identifier name clash between hotspot and glibc

Omair Majid omajid at redhat.com
Thu Oct 20 08:36:57 PDT 2011


Hi,

I recently ran into a build failure when building hotspot with a recent 
glibc:
In file included from 
/builddir/build/BUILD/icedtea6-1.10.4/openjdk/hotspot/src/share/vm/prims/methodHandles.hpp:32:0,
                  from 
/builddir/build/BUILD/icedtea6-1.10.4/openjdk/hotspot/src/share/vm/ci/ciMethod.hpp:33,
                  from 
/builddir/build/BUILD/icedtea6-1.10.4/openjdk/hotspot/src/share/vm/code/debugInfoRec.hpp:30,
                  from 
/builddir/build/BUILD/icedtea6-1.10.4/openjdk/hotspot/src/share/vm/ci/ciEnv.hpp:31,
                  from 
/builddir/build/BUILD/icedtea6-1.10.4/openjdk/hotspot/src/share/vm/ci/ciUtilities.hpp:28,
                  from 
/builddir/build/BUILD/icedtea6-1.10.4/openjdk/hotspot/src/share/vm/ci/ciNullObject.hpp:30,
                  from 
/builddir/build/BUILD/icedtea6-1.10.4/openjdk/hotspot/src/share/vm/ci/ciConstant.hpp:29,
                  from 
/builddir/build/BUILD/icedtea6-1.10.4/openjdk/hotspot/src/share/vm/precompiled.hpp:36:
/builddir/build/BUILD/icedtea6-1.10.4/openjdk/hotspot/src/share/vm/runtime/interfaceSupport.hpp:426:0: 
error: "__LEAF" redefined [-Werror]
/usr/include/sys/cdefs.h:43:0: note: this is the location of the 
previous definition
cc1plus: all warnings being treated as errors

(Complete build logs are available at [1])

As you can guess, glibc has added a macro __LEAF to 
/usr/include/sys/cdefs.h, which conflicts with the definition of the 
macro in hotspot [2].

ISO/IEC 9899:TC3 Section 7.1.3 ("Reserved Identifiers") says:
All identifiers that begin with an underscore and either an uppercase
letter or another underscore are always reserved for any use

 From this, it sounds like hotspot should not be using these 
identifiers. A search for '#define __' shows about 81 matches [3], but 
only __LEAF is causing a problem right now.

Does anyone have any thoughts on how I should go about fixing it? Does 
renaming __LEAF to something like VM_LEAF or even LEAF__ make sense?

Thanks,
Omair

[1] http://koji.fedoraproject.org/koji/getfile?taskID=3442873&name=build.log
[2] 
http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=aa78043a4aafe5db1a1a76d544a833b63b4c5f5c
[3] http://icedtea.classpath.org/~omajid/name-clash-log.01


More information about the hotspot-dev mailing list