RFR (s) 8141570: Fix Zero interpreter build for --disable-precompiled-headers

Kim Barrett kim.barrett at oracle.com
Tue Nov 17 03:14:03 UTC 2015

On Nov 16, 2015, at 9:47 PM, Coleen Phillimore <coleen.phillimore at oracle.com> wrote:
> On 11/16/15 9:11 PM, David Holmes wrote:
>> Hi Coleen,
>> On 17/11/2015 11:36 AM, Coleen Phillimore wrote:
>>> Sorry that was the wrong webrev:
>>> open webrev at http://cr.openjdk.java.net/~coleenp/8141570.02/
>>> bug link https://bugs.openjdk.java.net/browse/JDK-8141570
>> I may be missing something but in:
>> make/linux/makefiles/zeroshark.make
>> isn't the whole point of the original:
>> ! # override this from the main file because some version of llvm do not like -Wundef
>> ! WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wunused-function -Wunused-value
>> to avoid using the value set in gcc.make:
>> WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual
>> because the latter included -Wundef. Your new code simply adds new warnings to the existing value of WARNING_FLAGS
> I don't think the code wants to ignore the warning flags passed in from gcc.make.  I think -Wformat=2 was the one that caused my build to fail (or maybe others).   For zero we just want to add more warning flags or disable them after the gcc flags.   Kim might be able to provide more detail because he found this.  In general I don't see why Zero would ever want to ignore the warnings we enable/disable for the rest of the jvm.

As Coleen said, it was me who suggested that change.

I took the comment at its word, that the purpose of the replacement
was (just) to avoid -Wundef.  The better way to accomplish that is to
append -Wno-undef later.  And make it conditional on clang/llvm, since
that's where the trouble seems to be.  (It would be better to limit
the version if possible, but I don't have the information to do so.)

Then we needed to *disable* some other warnings, because Hotspot
builds ignore the configuration option --disable-warnings-as-error
(JDK-8141543), and the zero-specific code trips some warnings that the
rest of the Hotspot code doesn't (anymore).

Just using the replacement doesn't work for building on Ubuntu 14.04,
which is what both Coleen and I were using.  I re-did the experiment,
and it looks like adding just the following

WARNING_FLAGS += -Wno-format-zero-length
WARNING_FLAGS += -Wno-format-security

to the origninal code that bashes the WARNING_FLAGS value will
successfully build on that platform.  I don't know if these would be
needed for Oracle Linux; I know Ubuntu configures their gcc with some
non-standard defaults.

But I agree with Coleen that it would be better if the zero-specific
code conformed to the same warning requirements as the rest of
Hotspot, with the proposed extra warning suppression being a temporary
measure until the zero community has addressed those issues.

More information about the hotspot-dev mailing list