Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jun 1998 14:20:19 +0200
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        Vladimir Kushnir <kushn@mail.kar.net>
Cc:        "FreeBSD Current Users' list" <freebsd-current@FreeBSD.ORG>
Subject:   Patches for XFree86 ELF build
Message-ID:  <19980607142019.A22822@keltia.freenix.fr>
In-Reply-To: <19980528123617.46624@rf900.physics.usyd.edu.au>; from David Dawes on Thu, May 28, 1998 at 12:36:17PM %2B1000
References:  <199805270920.CAA01664@rah.star-gate.com> <199805270939.LAA17351@sos.freebsd.dk> <19980527230443.A23502@keltia.freenix.fr> <19980528123617.46624@rf900.physics.usyd.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Here are the patches to build an ELF version of XFree86, they're not that
big so I figured I could post them here. 

Caveats :

- they're against 3.3.1 and not 3.3.2 as I thought (that should not be a
  problem).
- I've cleaned them up somewhat...
- I'm using egcs/pgcc in ELF mode not the default compiler so "-elf" can't
  be used. The build should be done with an ELF /usr/bin/cc (which I don't
  have for now).
- I use "ELF=yes" from inside /etc/make.conf to enable ELF building. You
  may want to find another way...

diff -ur xc/config/cf/FreeBSD.cf xc.new/config/cf/FreeBSD.cf
--- xc/config/cf/FreeBSD.cf	Sun Jun 29 10:43:25 1997
+++ xc.new/config/cf/FreeBSD.cf	Thu Feb  5 20:03:08 1998
@@ -49,7 +49,11 @@
 
 #define MkdirHierCmd		mkdir -p
 
-#define CcCmd			cc
+#ifdef ELF
+#define CcCmd			gcc
+#else
+#define CcCmd           cc
+#endif
 #define CppCmd			/usr/libexec/cpp
 #define PreProcessCmd		CppCmd
 #define StandardCppDefines	-traditional
@@ -180,7 +184,11 @@
 
 #if GccUsesGas
 # define GccGasOption 		-DGCCUSESGAS
-# define AsmDefines		-DUSE_GAS
+# ifdef ELF
+#  define AsmDefines		-DUSE_GAS -D__ELF__
+# else
+#  define AsmDefines		-DUSE_GAS
+# endif
 #else
 # define GccGasOption /**/
 #endif
@@ -210,14 +218,14 @@
 /* The GCC strength-reduce bug is fixed for FreeBSD 2.1.5 and later */
 #ifndef DefaultGcc2i386Opt
 #if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion > 1) || (OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 5)
-#define DefaultGcc2i386Opt -O2
+#define DefaultGcc2i386Opt -O3 -pipe -fno-inline
 #endif
 #endif
 
 #ifdef i386Architecture
 # define OptimizedCDebugFlags DefaultGcc2i386Opt
 #else
-# define OptimizedCDebugFlags -O2
+# define OptimizedCDebugFlags -O3 -fno-inline
 #endif
 
 #ifndef PreIncDir
@@ -311,6 +319,12 @@
 #if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 1)
 #define HasBsdMake	YES
 #endif
+
+#define BuildDynamicLoading   YES
+#define HasSharedLibraries    YES
+#ifdef ELF
+#  define UseElfFormat          YES
+#endif /* ELF */
 
 #ifndef StaticLibrary
 #define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) Concat(-l,libname) -Wl,-Bdynamic
diff -ur xc/config/cf/bsdLib.rules xc.new/config/cf/bsdLib.rules
--- xc/config/cf/bsdLib.rules	Sun May 11 07:04:04 1997
+++ xc.new/config/cf/bsdLib.rules	Sat Jan 31 16:19:44 1998
@@ -228,6 +228,21 @@
 
 #endif /* SharedLibraryTarget */
 
+#ifndef SharedDepModuleTarget
+#define SharedDepModuleTarget(name,deps,solist)				@@\
+AllTarget(name)								@@\
+									@@\
+name: deps								@@\
+	$(RM) $@~							@@\
+	$(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
+	$(RM) $@							@@\
+	$(MV) $@~ $@							@@\
+									@@\
+clean::									@@\
+	$(RM) name
+
+#endif /* SharedDepModuleTarget */
+
 /*
  * SharedLibraryDataTarget - generate rules to create shlib data file;
  */
diff -ur xc/config/cf/xf86.rules xc.new/config/cf/xf86.rules
--- xc/config/cf/xf86.rules	Sun May 18 14:00:01 1997
+++ xc.new/config/cf/xf86.rules	Sat Jan 31 17:34:21 1998
@@ -162,6 +162,19 @@
 /*
  * DynamicModuleTarget - build a module to be dynamically loaded
  */
+#ifdef UseElfFormat
+#ifndef DynamicModuleTarget
+#define DynamicModuleTarget(module,modlist)				@@\
+AllTarget(module)							@@\
+									@@\
+module: modlist								@@\
+	RemoveFile($@)							@@\
+	$(CC) -o $@ $(SHLIBLDFLAGS) -Wl,-soname,$@ modlist				@@\
+									@@\
+clean::									@@\
+	RemoveFile(module)
+#endif /* DynamicModuleTarget */
+#else
 #ifndef DynamicModuleTarget
 #define DynamicModuleTarget(module,modlist)				@@\
 AllTarget(module)							@@\
@@ -173,7 +186,7 @@
 clean::									@@\
 	RemoveFile(module)
 #endif /* DynamicModuleTarget */
-
+#endif /* UseElfFormat */
 /*
  * InstallDynamicModule - install a dynamic module
  */
diff -ur xc/programs/Xserver/hw/xfree86/os-support/assyntax.h xc.new/programs/Xserver/hw/xfree86/os-support/assyntax.h
--- xc/programs/Xserver/hw/xfree86/os-support/assyntax.h	Sun May 11 04:56:22 1997
+++ xc.new/programs/Xserver/hw/xfree86/os-support/assyntax.h	Thu Feb  5 21:06:03 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(__FreeBSD__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__)
 #define GLNAME(a)       a
 #else
 #define GLNAME(a)       CONCAT(_,a)
Only in xc/programs/Xserver/hw/xfree86/vga256/drivers/mga/util: Makefile
diff -ur xc/programs/Xserver/hw/xfree86/xaa/xf86expblt.c xc.new/programs/Xserver/hw/xfree86/xaa/xf86expblt.c
--- xc/programs/Xserver/hw/xfree86/xaa/xf86expblt.c	Sat Jul 26 08:30:58 1997
+++ xc.new/programs/Xserver/hw/xfree86/xaa/xf86expblt.c	Fri Feb  6 00:18:17 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(__FreeBSD__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined (__OS2ELF__)) && defined(__ELF__)
 	__asm__(
 		"movl $0,%%ecx\n"
 		"movb %%al,%%cl\n"

-- 
Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr
FreeBSD keltia.freenix.fr 3.0-CURRENT #60: Fri May 15 21:04:22 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?19980607142019.A22822>