Recently, from 1.16.2 to 1.17.1 include/platform.h changed its endianess detection and it broke compilation on Mac OS X. It seems this broke OpenBSD as well: http://lists.busybox.net/pipermail/busybox/2010-August/073031.html I would suspect it probably breaks NetBSD also. The patch provided in the mailing list does not work for Mac OS X. If __APPLE__ is treated like __FreeBSD__ everything compiles fine. For example, --- a/include/platform.h 2010-07-05 20:25:54.000000000 -0600 +++ b/include/platform.h 2010-08-15 18:21:44.000000000 -0600 @@ -154,14 +154,14 @@ # include <sex.h> # define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN) # define __BYTE_ORDER BYTE_ORDER -#elif defined __FreeBSD__ +#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) # include <sys/resource.h> /* rlimit */ # include <machine/endian.h> # define bswap_64 __bswap64 # define bswap_32 __bswap32 # define bswap_16 __bswap16 # define __BIG_ENDIAN__ (_BYTE_ORDER == _BIG_ENDIAN) -#elif !defined __APPLE__ +#else # include <byteswap.h> # include <endian.h> #endif This worked for me for Mac OS X and OpenBSD.. I'd suspect it fixes NetBSD also, but its untested.
Can you provide a patch, against 1.17.1, which has a standalone #elif __APPLE__ block, without merging it with other OSes?
Sure, no problem. I attached it as well. --- a/include/platform.h 2010-07-05 20:25:54.000000000 -0600 +++ b/include/platform.h 2010-08-15 19:17:00.000000000 -0600 @@ -161,7 +161,14 @@ # define bswap_32 __bswap32 # define bswap_16 __bswap16 # define __BIG_ENDIAN__ (_BYTE_ORDER == _BIG_ENDIAN) -#elif !defined __APPLE__ +#elif defined(__APPLE__) +# include <sys/resource.h> /* rlimit */ +# include <machine/endian.h> +# define bswap_64 __bswap64 +# define bswap_32 __bswap32 +# define bswap_16 __bswap16 +# define __BIG_ENDIAN__ (_BYTE_ORDER == _BIG_ENDIAN) +#else # include <byteswap.h> # include <endian.h> #endif
Created attachment 2347 [details] compilation fix for Mac OS X with endianess detection in platform.h
forgot to close this bug... fixed in git sometime ago, will be in 1.18.x