From: Omair Majid <###@###.###>
Subject: identifier name clash between hotspot and glibc
Date: October 20, 2011 8:36:57 AM PDT
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,
/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 )
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 .
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 , 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?