RFR (XS): Add necessary .inline.hpp files to fix non-PCH build

Volker Simonis volker.simonis at gmail.com
Fri Nov 30 10:51:39 PST 2012


Hi,

I'm currently working on "6889002 : CHECK macros in return constructs
lead to unreachable code" and just realized that the non-PCH build on
Linux is broken (once again).

The failure manifests itself with a "libjvm.so: undefined reference to
`CHeapObj<(unsigned short)1280>::operator new(unsigned long, unsigned
char*)'" which is caused by the recent "6995781: Native memory
Tracking" change. The problem is that "operator new" is called in the
files "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp"
and "gc_implementation/shared/gcStats.cpp"  for classes which have the
template class "CHeapObj" as their base class. CHeapObj defines its
own "new" operator in "memory/allocation.inline.hpp" but this
inline.hpp file is not included into
"gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp" and
"gc_implementation/shared/gcStats.cpp".

Funny enough, the problem doesn't seem to appear neither for older
version of GCC (e.g. 4.4.6 on SLES 10) nor in debug builds. I could
only reproduce it with a product build on Ubuntu 12.04 with GCC 4.6.3.
The reason is most probably the fact that newer versions of GCC create
template instantiations in a much more lazy way.

The fix is easy - just add the missing includes to the corresponding
files (see attached patch).
Could somebody please open a bug for this issue and review/commit the change.

Please notice that this actually not exactly the annoying "inline.hpp"
problem which will be addressed with "8003990: Clean up inline
#includes" but very similar because template definition and
instantiation have similar semantics. This only didn't caused any
problems until now because templates have been used very little in
HotSpot. However once this changes, special care has to be taken to
manage them in a way every compiler can cope with.

Thank you and best regards,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_nonPCH_build.patch
Type: application/octet-stream
Size: 1304 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20121130/cc267ca1/fix_nonPCH_build-0001.patch 


More information about the hotspot-runtime-dev mailing list