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

Coleen Phillimore coleen.phillimore at oracle.com
Tue Nov 17 03:23:43 UTC 2015

On 11/16/15 10:14 PM, Kim Barrett wrote:
> 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.

I was trying to find if -Wundef wasn't an option supported in CLANG but 
undef is a hard thing to google for.

The change came from this changeset:

changeset:   6090:81ccf2c854c7
user:        neugens
date:        Tue Mar 04 18:52:06 2014 -0800
summary:     8036619: Shark: add LLVM 3.4 support

But it could be that the Shark compiler based on LLVM had warnings with 
-Xundef ?  It's not that old of a change though.  I thought Shark hasn't 
compiled in years.


More information about the hotspot-dev mailing list