From 2ebe834823ef6e01f3ac73fb2a2d55259820270b Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Sun, 24 Jul 2005 21:20:46 +0000 Subject: [PATCH] Make out of the box build on x86_64 system with complete 32 bit userland possible * include/cln/config.h.in: Don't #define __x86_64__ when __i386__ is defined. * src/base/digitseq/cl_asm_x86_64_.cc: New file. * doc/cln.tex: Revert workaround description introduced 2005-05-02. --- ChangeLog | 9 +++++++++ doc/cln.tex | 12 ------------ include/cln/config.h.in | 25 ++++++++++++++++++++++--- src/base/digitseq/cl_asm_x86_64_.cc | 6 ++++++ 4 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 src/base/digitseq/cl_asm_x86_64_.cc diff --git a/ChangeLog b/ChangeLog index f190248..c1344da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-08-24 Richard B. Kreckel + + Make out of the box build on x86_64 system with complete 32 bit + userland possible + * include/cln/config.h.in: Don't #define __x86_64__ when + __i386__ is defined. + * src/base/digitseq/cl_asm_x86_64_.cc: New file. + * doc/cln.tex: Revert workaround description introduced 2005-05-02. + 2005-06-10 Ralf Wildenhues * Makefile.in: Don't enter nonexisting directories. diff --git a/doc/cln.tex b/doc/cln.tex index 019eeee..146f81b 100644 --- a/doc/cln.tex +++ b/doc/cln.tex @@ -438,18 +438,6 @@ on all architectures. Try disabling them if you run into linker problems. Also, they are generally somewhat slower than static libraries so runtime-critical applications should be linked statically. -If you are compiling on a 64-bit machine with 32-bit userland, you -might have to specify that explicitly while configuring the library. -For instance, the popular x86_64 architecture can host a 32-bit x86 -operating system and toolchain on top of a 64-bit kernel. In such a -situation, you must explicitly tell configure @emph{not} to assume a -64-bit OS: -@example -$ ./configure --build=i686-pc-linux-gnu -@end example -If you forget about this, the build will fail because @code{uname -m} -will set x86_64 which conflicts with what the compiler knows. - If you use @code{g++} from gcc-3.1 with option @samp{-g}, you will need some disk space: 335 MB for building as both a shared and a static library, or 130 MB when building as a shared library only. diff --git a/include/cln/config.h.in b/include/cln/config.h.in index cc06b50..f591336 100644 --- a/include/cln/config.h.in +++ b/include/cln/config.h.in @@ -18,49 +18,68 @@ #ifndef __i386__ #undef __i386__ #endif + +// Take care not to define both __i386__ and __x86_64__ on those systems with +// 64 bit kernel and 32 bit userland: +#ifndef __x86_64__ +#ifndef __i386__ +#undef __x86_64__ +#endif +#endif + #ifndef __m68k__ #undef __m68k__ #endif + // NB: GCC def's __mips__ both on big-endian and little-endian systems. #ifndef __mips__ #undef __mips__ #endif + #ifndef __mipsel__ #undef __mipsel__ #endif + #ifndef __mips64__ #undef __mips64__ #endif + #ifndef __sparc__ #undef __sparc__ #endif + #ifndef __sparc64__ #undef __sparc64__ #endif + #ifndef __alpha__ #undef __alpha__ #endif + #ifndef __hppa__ #undef __hppa__ #endif + #ifndef __arm__ #undef __arm__ #endif + #ifndef __rs6000__ #undef __rs6000__ #endif + #ifndef __m88k__ #undef __m88k__ #endif + #ifndef __convex__ #undef __convex__ #endif + #ifndef __ia64__ #undef __ia64__ #endif -#ifndef __x86_64__ -#undef __x86_64__ -#endif + #ifndef __s390__ #undef __s390__ #endif diff --git a/src/base/digitseq/cl_asm_x86_64_.cc b/src/base/digitseq/cl_asm_x86_64_.cc new file mode 100644 index 0000000..665eacf --- /dev/null +++ b/src/base/digitseq/cl_asm_x86_64_.cc @@ -0,0 +1,6 @@ +#ifdef __i386__ +// This is most probably a x86_64 system with 32 bit userland. +#include "cl_asm_i386_.cc" +#else +// Nothing here yet. +#endif