RFR: 8151841: Build needs additional flags to compile with GCC 6

Andrew Hughes gnu.andrew at redhat.com
Fri Mar 18 04:42:55 UTC 2016

----- Original Message -----
> On 2016-03-16 05:25, Andrew Hughes wrote:
> > ----- Original Message -----
> >> Hello,
> >>
> >> As representative for the build-infra group creating the new Hotspot
> >> build, I appreciate that the changes are made in configure. That will at
> >> least automatically force me to merge them correctly when they hit the
> >> build-infra forest and will make the merge easier. The idea is to start
> >> getting the new Hotspot build in soon after Jigsaw M3 is integrated. If
> >> the GCC 6 changes get in soon enough in jdk9/dev I will be able to merge
> >> and convert in time.
> >>
> > When is M3 due to happen? I couldn't see anything regarding the milestones
> > on http://openjdk.java.net/projects/jdk9/. Hopefully we can get this change
> > in this week.
> See http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-March/003877.html

Ah ok, I think I did see this mail.

> If you get in this week, it should be fine.
> >> I like the refactoring of the FLAGS_COMPILER_CHECK_ARGUMENTS. Disabling
> >> optimizations that have obviously worked fine for a long time doesn't
> >> seem like a good idea though. I would prefer putting a conditional on
> >> the GCC version in those cases, but still keep the proposed flag check
> >> as well. There should be a toolchain version variable to compare
> >> against.
> > I agree that will lower the potential impact of this change. I've
> > added:
> >
> >
> > and moved the -fno-lifetime-dse and -fno-delete-null-pointer-checks
> > into this new macro, FLAGS_SETUP_GCC6_COMPILER_FLAGS. I'll post the
> > revised version once I've done more testing with GCC 6. With GCC 5.3,
> > I can confirm the tests and additions are gone with this change.
> Nice, I haven't kept up to date with the recent improvements Magnus made
> to configure here. That macro made the change very simple.

Yes, I was glad to find this. It will mean that chunks of these
earlier changesets will also need to be backported for 8u though.

> /Erik

Here's the revised webrev:



1. GCC 6 check added as mentioned earlier. The two optimisation flags
are now handled in a GCC 6 macro, FLAGS_SETUP_GCC6_COMPILER_FLAGS.
2. Copyright updated in hotspot-spec.gmk.in
3. Line break added in hotspot-spec.gmk.in
4. Typos fixed in toolchain.m4
5. Version number regular expression updated in toolchain.m4. The
previous version expected the version number to always be followed
by a space i.e. "x.y.z " which is not true for some pre-release
versions (e.g. Gentoo's GCC 6 reports 6.0.0-alpha20160306) so instead
it now matches the first character that is not a number or a '.'.
It works as before with released versions.

This should fix all concerns raised so far. Tested on both
GCC 5.3.0 and 6.0.0 successfully.

Incidentally, it may be worth sanity-checking COMPILER_VERSION_NUMBER
as, when it was mis-parsed, configure still carried on, with it set
to the entire first line of the version output, thus causing the later
version tests to return incorrect results.

Andrew :)

Senior Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222

More information about the hotspot-dev mailing list