RFR: 8087156: SetupNativeCompilation ignores CFLAGS_release for cpp files

Omair Majid omajid at redhat.com
Wed Jun 10 22:36:09 UTC 2015


I discovered a bug in SetupNativeCompilation that results in some C++
code being built with wrong CXXFLAGS.

Bug: https://bugs.openjdk.java.net/browse/JDK-8087156
Webrev: http://cr.openjdk.java.net/~omajid/webrevs/8087156-setupnativecompilation/00/

It turns out that debugging flags are automatically added to the
CXXFLAGS which makes the code that copies over CFLAGS to CXXFLAGS if
CXXFLAGS is empty fail. This causes the desired CXXFLAGS to not be set
at all.

Depending on the code, these CXXFLAGS can include -DPRODUCT. In other
words, some JDK code is currently being built as if in non-product mode.
An example of this is libunpack:


$(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \
    ... snip ...
    CFLAGS_release := -DPRODUCT, \
    ... snip ...

The same issue exists in OpenJDK 8.


PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95  0056 F286 F14F 6648 4681

More information about the build-dev mailing list