Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Sep 1998 18:54:47 +0200 (CEST)
From:      Joachim Kuebart <joki@kuebart.stuttgart.netsurf.de>
To:        galatalt@stuy.edu (Tugrul Galatali)
Cc:        dfr@nlsystems.com, freebsd-current@FreeBSD.ORG
Subject:   Re: XFree86 and ELF
Message-ID:  <199809011654.SAA14810@yacht.domestic.de>
In-Reply-To: <Pine.BSF.4.02.9808311915090.27868-100000@europa.novastar.com> from Tugrul Galatali at "Aug 31, 98 07:23:11 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Tugrul Galatali wrote:
> 
> 
> On Mon, 31 Aug 1998, Doug Rabson wrote:
> > 
> > I have a set of patches for the port.  I think that we need to fix the
> > weak definition of inet_addr in libc though.
> > 
> 
> 	The patches do fix one of the two parts of the problems I had.
> Most of the programs in xc/programs now actually link and have binaries,
> and all the libraries in xc/lib seem ok. But it completely barfs when
> linking XF86_SVGA. I'll send several pages of undefined symbols if anyone
> wants.

Indeed, this will probably be the leading '_' problem. The following
patches built my ELF XFree86 in an ELF world not quite cutting edge:
Just put them into the patches/ directory of the port and make.
Note that they include the arpa/inet.h patches from another recent
mail on -current.

--- config/cf/bsdLib.rules.orig	Mon Aug 31 18:03:14 1998
+++ config/cf/bsdLib.rules	Tue Sep  1 01:15:44 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;
--- programs/Xserver/hw/xfree86/os-support/assyntax.h.orig	Mon Aug 31 18:06:07 1998
+++ programs/Xserver/hw/xfree86/os-support/assyntax.h	Tue Sep  1 00:35:28 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)
--- programs/Xserver/os/connection.c.orig	Mon Aug 31 18:06:22 1998
+++ programs/Xserver/os/connection.c	Tue Sep  1 00:26:07 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
--- programs/xauth/gethost.c.orig	Tue Sep  1 00:11:48 1998
+++ programs/xauth/gethost.c	Tue Sep  1 00:26:26 1998
@@ -58,6 +58,7 @@
 #endif
 #include <netdb.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
 #ifdef SYSV
 #ifdef i386
 #ifndef sco
--- programs/xdm/chooser.c.orig	Tue Sep  1 00:14:41 1998
+++ programs/xdm/chooser.c	Tue Sep  1 00:26:47 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>
--- programs/xhost/xhost.c.orig	Tue Sep  1 00:27:05 1998
+++ programs/xhost/xhost.c	Tue Sep  1 00:34:39 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();
--- lib/SM/sm_genid.c.orig	Mon Aug 31 18:06:53 1998
+++ lib/SM/sm_genid.c	Tue Sep  1 00:27:29 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>
--- lib/xtrans/Xtransint.h.orig	Mon Aug 31 18:07:41 1998
+++ lib/xtrans/Xtransint.h	Tue Sep  1 00:27:56 1998
@@ -102,6 +102,7 @@
 #else
 #include <socket.h>
 #endif
+#include <arpa/inet.h>
 #endif
 #ifdef __EMX__
 #include <sys/ioctl.h>
--- config/cf/FreeBSD.cf.orig	Tue Sep  1 08:09:14 1998
+++ config/cf/FreeBSD.cf	Tue Sep  1 11:09:13 1998
@@ -222,10 +222,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
--- programs/Xserver/hw/xfree86/vga256/drivers/s3_svga/s3accel.c.orig	Tue Sep  1 16:35:24 1998
+++ programs/Xserver/hw/xfree86/vga256/drivers/s3_svga/s3accel.c	Tue Sep  1 16:35:12 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"
--- programs/Xserver/hw/xfree86/xaa/xf86expblt.c.orig	Tue Sep  1 16:46:41 1998
+++ programs/Xserver/hw/xfree86/xaa/xf86expblt.c	Tue Sep  1 16:44:23 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"


cu Jo

---------------------------------------------------------------------
FreeBSD: The Power to Serve                  <http://www.freebsd.org>;
Joachim Kuebart
Tel: +49 711 653706            Oh god, god... My tongue is asleep and
Germany                        my teeth itch.

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?199809011654.SAA14810>