Hello scifi, > I'd like to see how close we can get to having full 32- & 64-bit > universal binaries
That's currently something that does not work, because autoconf tests can yield different results in the 32-bit and in the 64-bit case - and some actually do, see below. > (0) I'm building coreutils-7.0 and other GNU projects seemingly > just fine (regular 'make'), after I learned that we had to pass > '--disable-dependency-tracking' to configure when building > so-called 'fat' binaries. Interesting... We document in INSTALL how to create fat binaries: On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" I didn't see problems with dependency tracking when using this recipe. It uses depmode=gcc, and this works fine. > (1) Regular 'make' finishes okay, then I'll do 'make check'. > The first real problem I had here was linking > coreutils-7.0/gnulib-tests/test-getdate failed because the > makefiles did not include the libiconv libs determined by > configure -- missing symbol '_libintl_gettext'. You mean libintl, not libiconv? This was fixed in gnulib on 2008-10-08. > (2) The next problem I had with coreutils-7.0 'make check', and > I'm _still_ stuck here: > The compiler bombs when it gets to building > coreutils-7.0/gnulib-tests/test-stdint: > […] > llvm-gcc-4.2 -std=gnu99 -I. -I../lib -I. -I. -I.. -I./.. -I../lib > -I./../lib -I/usr/local/include -Os -mtune=core2 -march=core2 > -force_cpusubtype_ALL -arch i386 -arch x86_64 -c test-stdint.c > test-stdint.c:263: error: negative width in bit-field > ‘verify_error_if_negative_size__’ > test-stdint.c:264: error: negative width in bit-field > ‘verify_error_if_negative_size__’ > test-stdint.c:263: error: negative width in bit-field > ‘verify_error_if_negative_size__’ > test-stdint.c:264: error: negative width in bit-field > ‘verify_error_if_negative_size__’ > […] > > The doubled-up error lines are because the module is > automatically being compiled twice: once for each -arch. Now this is a symptom of an autoconf test that produced no result that would be good for both 32-bit and 64-bit builds. Here's the complete list, that I got by running ./configure CC="gcc -arch i386" CPP="gcc -E" and ./configure CC="gcc -arch x86_64" CPP="gcc -E" and comparing the results. Bruno > The gnulib git snapshot is suffering other problems trying to > analyze these two problems. For ex. after using ./gnulib-tool to > create a tempdir and pull getdate with tests into it, the > configure & make steps left @LIBINTL@ empty ... which means that on your system, libintl was either not needed or not available. If in doubt, you can always consult config.log. > Could we get all the projects at the alpha FTP site that use > gnulib to be refreshed please so they'll get caught-up to the > fixes? The fixes that you want are not yet done. Bruno Differences between build32 and build64 on MacOS X: --- build32/config.h 2008-11-18 10:48:48.000000000 +0100 +++ build64/config.h 2008-11-18 10:53:09.000000000 +0100 @@ -5,13 +5,13 @@ #define AC_APPLE_UNIVERSAL_BUILD 1 /* Define to the number of bits in type 'ptrdiff_t'. */ -#define BITSIZEOF_PTRDIFF_T 32 +#define BITSIZEOF_PTRDIFF_T 64 /* Define to the number of bits in type 'sig_atomic_t'. */ #define BITSIZEOF_SIG_ATOMIC_T 32 /* Define to the number of bits in type 'size_t'. */ -#define BITSIZEOF_SIZE_T 32 +#define BITSIZEOF_SIZE_T 64 /* Define to the number of bits in type 'wchar_t'. */ #define BITSIZEOF_WCHAR_T 32 @@ -388,7 +388,7 @@ #define HAVE_BTOWC 1 /* Define to 1 if nanosleep mishandles large arguments. */ -/* #undef HAVE_BUG_BIG_NANOSLEEP */ +#define HAVE_BUG_BIG_NANOSLEEP 1 /* Define to 1 if you have the <byteswap.h> header file. */ /* #undef HAVE_BYTESWAP_H */ @@ -745,7 +745,7 @@ /* Define to 1 if you have the declaration of `timegm', and to 0 if you don't. */ -#define HAVE_DECL_TIMEGM 1 +/* #undef HAVE_DECL_TIMEGM */ /* Define to 1 if you have the declaration of `trunc', and to 0 if you don't. */ @@ -1725,7 +1725,7 @@ #define HAVE_TERMIOS_H 1 /* Define to 1 if you have the `timegm' function. */ -#define HAVE_TIMEGM 1 +/* #undef HAVE_TIMEGM */ /* Define to 1 if you have the `times' function. */ #define HAVE_TIMES 1 @@ -1993,11 +1993,11 @@ /* Define if the vasnprintf implementation needs special code for 'double' arguments. */ -#define NEED_PRINTF_DOUBLE 1 +/* #undef NEED_PRINTF_DOUBLE */ /* Define if the vasnprintf implementation needs special code for surviving out-of-memory conditions. */ -#define NEED_PRINTF_ENOMEM 1 +/* #undef NEED_PRINTF_ENOMEM */ /* Define if the vasnprintf implementation needs special code for the ' flag. */ @@ -2021,7 +2021,7 @@ /* Define if the vasnprintf implementation needs special code for 'long double' arguments. */ -#define NEED_PRINTF_LONG_DOUBLE 1 +/* #undef NEED_PRINTF_LONG_DOUBLE */ /* Define if the vasnprintf implementation needs special code for supporting large precisions without arbitrary bounds. */ @@ -2069,7 +2069,7 @@ /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'ptrdiff_t'. */ -#define PTRDIFF_T_SUFFIX +#define PTRDIFF_T_SUFFIX l /* If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this to 0. */ @@ -2392,7 +2392,7 @@ /* #undef memcmp */ /* Define to rpl_mktime if the replacement function should be used. */ -/* #undef mktime */ +#define mktime rpl_mktime /* Define to `int' if <sys/types.h> does not define. */ /* #undef mode_t */ --- build32/config.status 2008-11-18 10:48:47.000000000 +0100 +++ build64/config.status 2008-11-18 10:53:08.000000000 +0100 @@ -732,9 +734,9 @@ S["HAVE_NETINET_IN_H"]="" S["NEXT_NETINET_IN_H"]="" S["LIB_NANOSLEEP"]="" -S["REPLACE_TIMEGM"]="0" +S["REPLACE_TIMEGM"]="1" S["REPLACE_STRPTIME"]="0" -S["REPLACE_NANOSLEEP"]="0" +S["REPLACE_NANOSLEEP"]="1" S["REPLACE_LOCALTIME_R"]="0" S["REPLACE_STRSIGNAL"]="0" S["REPLACE_STRERROR"]="0" @@ -813,9 +815,9 @@ S["ISINF_LIBM"]="" S["ISFINITE_LIBM"]="" S["INTTYPES_H"]="inttypes.h" -S["UINT64_MAX_EQ_ULONG_MAX"]="0" +S["UINT64_MAX_EQ_ULONG_MAX"]="1" S["UINT32_MAX_LT_UINTMAX_MAX"]="1" -S["INT64_MAX_EQ_LONG_MAX"]="0" +S["INT64_MAX_EQ_LONG_MAX"]="1" S["INT32_MAX_LT_INTMAX_MAX"]="1" S["PRIPTR_PREFIX"]="\"l\"" S["NEXT_INTTYPES_H"]="<inttypes.h>" @@ -833,15 +835,15 @@ S["WCHAR_T_SUFFIX"]="" S["SIZE_T_SUFFIX"]="ul" S["SIG_ATOMIC_T_SUFFIX"]="" -S["PTRDIFF_T_SUFFIX"]="" +S["PTRDIFF_T_SUFFIX"]="l" S["HAVE_SIGNED_WINT_T"]="1" S["HAVE_SIGNED_WCHAR_T"]="1" S["HAVE_SIGNED_SIG_ATOMIC_T"]="1" S["BITSIZEOF_WINT_T"]="32" S["BITSIZEOF_WCHAR_T"]="32" -S["BITSIZEOF_SIZE_T"]="32" +S["BITSIZEOF_SIZE_T"]="64" S["BITSIZEOF_SIG_ATOMIC_T"]="32" -S["BITSIZEOF_PTRDIFF_T"]="32" +S["BITSIZEOF_PTRDIFF_T"]="64" S["HAVE_SYS_BITYPES_H"]="0" S["HAVE_SYS_INTTYPES_H"]="0" S["HAVE_STDINT_H"]="1"