Date: Wed, 2 Sep 1998 00:41:40 +0200 From: Ollivier Robert <roberto@keltia.freenix.fr> To: freebsd-current@FreeBSD.ORG Subject: Re: XFree86 and ELF Message-ID: <19980902004140.A17784@keltia.freenix.fr> In-Reply-To: <199809011809.UAA16527@yacht.domestic.de>; from Joachim Kuebart on Tue, Sep 01, 1998 at 08:09:40PM %2B0200 References: <199809011809.UAA16527@yacht.domestic.de>
next in thread | previous in thread | raw e-mail | index | archive | help
According to Joachim Kuebart:
> The information to build XFree86 is incomplete:
>
> You need to separately "make configure" and then edit
> work/xc/config/cf/xf86site.def to include the line
>
> #define UseElfFormat YES
There is a better way I think. I've completed a "make World" of X11R6.3,
using a merge of all posted patches (Doug's & yours) and some mine. The
various X servers/lib/programs linked successfully and seems to run fine.
> This is due to the fact that I am unaware of a portable way to check
> if we're on an ELF system. Bear in mind it might be a prehistoric
> -stable version, so it isn't just a question of `objformat`.
XFree86 has only releases to consider and 3.0 will be ELF so it is safe IMO
to assume that "objformat" will return "elf". Anyway, when you run an ELF
FreeBSD, __ELF__ is defined by the preprocessor...
Supporting both 3.0/aout and 3.0/ELF may be too complicated.
-=-=-
Building Release 6.3 of the X Window System.
I hope you checked the configuration parameters in ./config/cf
to see if you need to pass BOOTSTRAPCFLAGS.
Tue Sep 1 22:51:36 CEST 1998
...
Wed Sep 2 00:17:50 CEST 1998
Full build of Release 6.3 of the X Window System complete.
-=-=-
ldd seems to display some libraries (the one in the path specified with
"-rpath" and "-rpath-link"). Is it expected ?
-=-=-
programs/xdpyinfo/xdpyinfo:
libXtst.so.6 => /usr/X11R6/lib/libXtst.so.6 (0x28056000)
libXIE.so.6 => /usr/X11R6/lib/libXIE.so.6 (0x2805b000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x28065000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x2806c000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x28076000)
libm.so.2 => /usr/lib/libm.so.2 (0x28109000)
libc.so.3 => /usr/lib/libc.so.3 (0x28123000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x2806c000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x28076000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x28076000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x2806c000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x28076000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x28076000)
-=-=-
the diffs.
-=-=-
diff -ur xc/config/cf/FreeBSD.cf elf-xc/config/cf/FreeBSD.cf
--- xc/config/cf/FreeBSD.cf Mon Mar 2 12:55:21 1998
+++ elf-xc/config/cf/FreeBSD.cf Tue Sep 1 22:44:33 1998
@@ -2,7 +2,7 @@
XCOMM platform: $XFree86: xc/config/cf/FreeBSD.cf,v 3.58.2.11 1998/03/01 01:08:59 dawes Exp $
#ifndef OSName
-#define OSName DefaultOSName
+#define OSName DefaultOSName OSBinaryType
#endif
#ifndef OSVendor
#define OSVendor /**/
@@ -76,6 +76,13 @@
#define HasSetUserContext YES
#endif
+/* 3.0 and up are ELF */
+#if OSMajorVersion > 2
+#ifndef UseElfFormat
+#define UseElfFormat YES
+#endif
+#endif
+
/*
* This doesn't work the way it does on every other system. On FreeBSD it's
* only a "hint, not a demand", whatever that means. Note that this is not
@@ -109,11 +116,14 @@
* and they can remove it from the list of directories they add to ld.so.cache
* in their /etc/rc file.
*/
+
+#if !UseElfFormat
#if OSMajorVersion > 2 || (OsMajorVersion == 2 && OSMinorVersion >= 2)
#ifndef ExtraLoadFlags
#define ExtraLoadFlags -Wl,-R,$(USRLIBDIRPATH)
#endif
#endif
+#endif
#ifndef GnuMallocLibrary
#define GnuMallocLibrary -lgnumalloc
@@ -217,10 +227,35 @@
#define InstallCmd /usr/bin/install
#if GccUsesGas
-# define GccGasOption -DGCCUSESGAS
-# define AsmDefines -DUSE_GAS
+# define GccGasOption -DGCCUSESGAS
+# define AsmDefines -DUSE_GAS AsmElfDefines
#else
# define GccGasOption /**/
+# define AsmDefines AsmElfDefines
+#endif
+
+/* UseElfFormat defaults to YES if __ELF__ set */
+#ifndef UseElfFormat
+# ifdef __ELF__
+# undef __ELF__ /* other imake files shouldn't care */
+# define UseElfFormat YES
+# else
+# define UseElfFormat NO
+# endif
+#endif
+
+#if UseElfFormat
+# define AsmElfDefines -D__ELF__
+#else
+# define AsmElfDefines /**/
+#endif
+
+#ifndef OSBinaryType
+# if UseElfFormat
+# define OSBinaryType [ELF]
+# else
+# define OSBinaryType /**/
+# endif
#endif
#define ServerExtraDefines GccGasOption XFree86ServerDefines
diff -ur xc/config/cf/bsdLib.rules elf-xc/config/cf/bsdLib.rules
--- xc/config/cf/bsdLib.rules Sun May 11 07:04:04 1997
+++ elf-xc/config/cf/bsdLib.rules Tue Sep 1 21:27:40 1998
@@ -153,7 +153,7 @@
#define ShLibIncludeFile <bsdLib.tmpl>
#endif
#ifndef SharedLibraryLoadFlags
-#define SharedLibraryLoadFlags -shared -Wl,-rpath,$(USRLIBDIR)
+#define SharedLibraryLoadFlags -shared -rpath $(USRLIBDIR)
#endif
#ifndef PositionIndependentCFlags
#define PositionIndependentCFlags -fPIC
@@ -213,7 +213,7 @@
Concat(lib,libname.so.rev): solist @@\
$(RM) $@~ @@\
SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; \ @@\
- (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
+ (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) -soname $$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
$(RM) $$SONAME; $(LN) $@ $$SONAME; \ @@\
LinkBuildSonameLibrary($$SONAME) @@\
$(RM) $@ @@\
@@ -227,6 +227,21 @@
$(RM) Concat(lib,libname.so.rev)
#endif /* SharedLibraryTarget */
+
+#ifndef SharedDepModuleTarget
+#define SharedDepModuleTarget(name,deps,solist) @@\
+AllTarget(name) @@\
+ @@\
+name: deps @@\
+ $(RM) $@~ @@\
+ $(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) @@\
+ $(RM) $@ @@\
+ $(MV) $@~ $@ @@\
+ @@\
+clean:: @@\
+ $(RM) name
+
+#endif /* SharedDepModuleTarget */
/*
* SharedLibraryDataTarget - generate rules to create shlib data file;
diff -ur xc/lib/SM/sm_genid.c elf-xc/lib/SM/sm_genid.c
--- xc/lib/SM/sm_genid.c Sat Jan 18 07:51:43 1997
+++ elf-xc/lib/SM/sm_genid.c Tue Sep 1 21:27:40 1998
@@ -60,6 +60,7 @@
#include <socket.h>
#endif
#include <netinet/in.h>
+#include <arpa/inet.h>
#define XOS_USE_NO_LOCKING
#define X_INCLUDE_NETDB_H
#include <X11/Xos_r.h>
diff -ur xc/lib/xtrans/Xtransint.h elf-xc/lib/xtrans/Xtransint.h
--- xc/lib/xtrans/Xtransint.h Sat Jul 19 06:59:16 1997
+++ elf-xc/lib/xtrans/Xtransint.h Tue Sep 1 21:27:40 1998
@@ -102,6 +102,7 @@
#else
#include <socket.h>
#endif
+#include <arpa/inet.h>
#endif
#ifdef __EMX__
#include <sys/ioctl.h>
diff -ur xc/programs/Xserver/hw/xfree86/os-support/assyntax.h elf-xc/programs/Xserver/hw/xfree86/os-support/assyntax.h
--- xc/programs/Xserver/hw/xfree86/os-support/assyntax.h Sun May 11 04:56:22 1997
+++ elf-xc/programs/Xserver/hw/xfree86/os-support/assyntax.h Tue Sep 1 21:27:40 1998
@@ -212,7 +212,7 @@
#endif /* ACK_ASSEMBLER */
-#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__)
+#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(__FreeBSD__) || defined(linux) || defined(__OS2ELF__)) && defined(__ELF__)
#define GLNAME(a) a
#else
#define GLNAME(a) CONCAT(_,a)
diff -ur xc/programs/Xserver/hw/xfree86/vga256/drivers/s3_svga/s3accel.c elf-xc/programs/Xserver/hw/xfree86/vga256/drivers/s3_svga/s3accel.c
--- xc/programs/Xserver/hw/xfree86/vga256/drivers/s3_svga/s3accel.c Mon Mar 2 12:56:24 1998
+++ elf-xc/programs/Xserver/hw/xfree86/vga256/drivers/s3_svga/s3accel.c Tue Sep 1 21:27:40 1998
@@ -798,7 +798,7 @@
#if defined(__GNUC__) && defined(__i386__)
static __inline__ CARD32 reverse_bitorder(CARD32 data) {
-#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined (__OS2ELF__)) && defined(__ELF__)
+#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(__FreeBSD__) || defined(linux) || defined (__OS2ELF__)) && defined(__ELF__)
__asm__(
"movl $0,%%ecx\n"
"movb %%al,%%cl\n"
diff -ur xc/programs/Xserver/hw/xfree86/xaa/xf86expblt.c elf-xc/programs/Xserver/hw/xfree86/xaa/xf86expblt.c
--- xc/programs/Xserver/hw/xfree86/xaa/xf86expblt.c Mon Mar 2 12:56:27 1998
+++ elf-xc/programs/Xserver/hw/xfree86/xaa/xf86expblt.c Tue Sep 1 21:27:40 1998
@@ -83,7 +83,7 @@
#if defined(__GNUC__) && defined(__i386__)
static __inline__ unsigned int reverse_bitorder(data) {
-#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined (__OS2ELF__)) && defined(__ELF__)
+#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(__FreeBSD__) || defined(linux) || defined (__OS2ELF__)) && defined(__ELF__)
__asm__(
"movl $0,%%ecx\n"
"movb %%al,%%cl\n"
diff -ur xc/programs/Xserver/os/connection.c elf-xc/programs/Xserver/os/connection.c
--- xc/programs/Xserver/os/connection.c Sat Jul 5 17:55:45 1997
+++ elf-xc/programs/Xserver/os/connection.c Tue Sep 1 21:27:40 1998
@@ -109,6 +109,7 @@
#if defined(TCPCONN) || defined(STREAMSCONN)
# include <netinet/in.h>
+# include <arpa/inet.h>
# ifndef hpux
# ifdef apollo
# ifndef NO_TCP_H
diff -ur xc/programs/xauth/gethost.c elf-xc/programs/xauth/gethost.c
--- xc/programs/xauth/gethost.c Sat Jan 18 08:02:10 1997
+++ elf-xc/programs/xauth/gethost.c Tue Sep 1 21:27:40 1998
@@ -58,6 +58,7 @@
#endif
#include <netdb.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#ifdef SYSV
#ifdef i386
#ifndef sco
diff -ur xc/programs/xdm/chooser.c elf-xc/programs/xdm/chooser.c
--- xc/programs/xdm/chooser.c Sat Jan 18 08:02:20 1997
+++ elf-xc/programs/xdm/chooser.c Tue Sep 1 21:27:40 1998
@@ -87,6 +87,7 @@
#include <socket.h>
#endif
#include <netinet/in.h>
+#include <arpa/inet.h>
#else /* MINIX */
#include <net/hton.h>
#include <net/netlib.h>
diff -ur xc/programs/xhost/xhost.c elf-xc/programs/xhost/xhost.c
--- xc/programs/xhost/xhost.c Sun Jul 6 09:28:20 1997
+++ elf-xc/programs/xhost/xhost.c Tue Sep 1 21:27:40 1998
@@ -85,9 +85,9 @@
#endif
#endif /* NEEDSOCKETS */
-#ifdef notdef
+#ifdef __FreeBSD__
#include <arpa/inet.h>
- bogus definition of inet_makeaddr() in BSD 4.2 and Ultrix
+ /* bogus definition of inet_makeaddr() in BSD 4.2 and Ultrix */
#else
#if !defined(hpux) && !defined(NCR) && !defined(__EMX__)
extern unsigned long inet_makeaddr();
-=-=-
--
Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr
FreeBSD keltia.freenix.fr 3.0-CURRENT #62: Mon Jul 27 20:47:08 CEST 1998
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980902004140.A17784>
