[tlbuild] sparc-linux (bigendian?) failure in icu

Peter Breitenlohner peb at mppmu.mpg.de
Tue Apr 17 15:51:09 CEST 2012


On Mon, 16 Apr 2012, Peter Breitenlohner wrote:

> the sparc-linux is correctly detected as BigEndian and 'icupkg -tb' tries to
> build a BigEndian data archive from the distributed LittleEndian one.
>
> With the latest ICU some architecture dependent decisions that used to be
> done by configure are now done via U_PLATFORM as determined by
> icu-49.1/common/unicode/platform.h, and I have the strong suspicion that 
> either
> sparc-linux is not properly detected or otherwise mishandled.

I just had another close look and found this:

configure correctly detects
   U_IS_BIG_ENDIAN=1  AC_SUBST'ed into Makefile fragments
   U_ENDIAN_CHAR="b"  try to build a BigEndian archive icudt49b.dat
but U_IS_BIG_ENDIAN is not propagated to the C/C++ files but rather
determined independently in common/unicode/platform.h line 344ff from
   #ifdef U_IS_BIG_ENDIAN
       /* Use the predefined value. */
   #elif defined(BYTE_ORDER) && defined(BIG_ENDIAN)
   #   define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
   #elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__)
       /* gcc */
   #   define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
   #elif defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN)
   #   define U_IS_BIG_ENDIAN 1
   #elif defined(__LITTLE_ENDIAN__) || defined(_LITTLE_ENDIAN)
   #   define U_IS_BIG_ENDIAN 0
   #elif U_PLATFORM == U_PF_OS390 || U_PLATFORM == U_PF_OS400
       /* These platforms do not appear to predefine any endianness macros. */
   #   define U_IS_BIG_ENDIAN 1
   #else
   #   define U_IS_BIG_ENDIAN 0
   #endif
Could it be that none of the above works for sparc-linux?

Once we know what is defined this should easily be fixed.

BTW: layout/LESwaps.h line 59ff and 83ff uses
   #if (defined(U_IS_BIG_ENDIAN) && U_IS_BIG_ENDIAN) || \
       (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)) || \
       defined(__BIG_ENDIAN__)
for the fast noop-swap and otherwise the slow universal method.

Regards
Peter


More information about the tlbuild mailing list