Kelly.Ohair at Sun.COM
Tue Jun 23 20:27:01 UTC 2009
Mario Torre wrote:
> Hello all!
> I have a problem with a block of code that checks if _LITTLE_ENDIAN is
> defined, the code is in little cms and looks like:
> #ifndef _LITTLE_ENDIAN
> #define USE_BIG_ENDIAN 1
> The issue that I have is that on VxWorks, the target I'm working on,
> there is always a definition of _LITTLE_ENDIAN, just the value change in
> case of big/little endiannes, and this in my case ends up conflicting
> with the code in the JDK.
So let me get this straight, _LITTLE_ENDIAN is "always" defined, even
when it is not "little endian"? That sure seems problematic to me.
I suspect this issue will continue to be trouble because it is so
easy to just #ifdef _LITTLE_ENDIAN.
Can we just have the makefiles define _BIG_ENDIAN on the appropriate
machines, and have big consume little if both are set?
> I started to replace all the _LITTLE_ENDIAN to be OPENJDK_LITTLE_ENDIAN,
> and as I think this is nice to have in OpenJDK and will improve
> portability, I would like to discuss the issue with whoever is
> interested (cc some mailing list here, sorry for cross posting).
> Other occurrences of the _LITTLE_ENDIAN define are:
> plus some other little places.
> I need to prepare a patch for that, but before I would like to have some
> suggestion or if you are not interested at all, I'll just fix the
> specific code that we use and not care about all the references.
Since VxWorks seems to be the problematic platform, I would rather see
the code that made _BIG_ENDIAN explicit, and it's definition take priority,
For better or worse, there seems to be
./common/Defs-linux.gmk:CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
./common/Defs-linux.gmk:CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
./common/Defs-linux.gmk:CFLAGS_REQUIRED_ia64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
./common/Defs-solaris.gmk: # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the
./common/Defs-solaris.gmk: # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
./common/Defs-solaris.gmk: CPPFLAGS_COMMON += -DcpuIntel -D_LITTLE_ENDIAN= -D$(LIBARCH)
./common/Defs-windows.gmk:CPPFLAGS_COMMON = -DWIN32 -DIAL -D_LITTLE_ENDIAN
./netbeans/awt2d/README: D3D_OVERLOADS; UNICODE; _UNICODE; WIN32; IAL; _LITTLE_ENDIAN; WIN32; _X86_;
That documents the issue
More information about the build-dev