[8u] RFR: JDK-8269468: JDK-8269388 breaks the build on older GCCs

Andrew Hughes gnu.andrew at redhat.com
Mon Jun 28 16:58:39 UTC 2021


On 15:19 Mon 28 Jun     , Andrew Haley wrote:
> On 6/28/21 2:36 PM, Andrew Hughes wrote:
> > Bug: https://bugs.openjdk.java.net/browse/JDK-8269468
> > Webrev: https://cr.openjdk.java.net/~andrew/openjdk8/8269468/webrev.01/
> > 
> > In trying to promote 8u302-b07, I found the addition of -Werror=format-overflow
> > broke the build on older GCCs (specifically building on RHEL 7).
> > 
> > The option is fairly new, only introduced in GCC 7:
> > 
> > https://gcc.gnu.org/gcc-7/changes.html
> > 
> > Adding a version conditional similar to others in that file fixes the
> > build.
> > 
> > A quick review and critical-ack of this would be appreciated so we
> > can promote 8u302-b07.
> 
> I will do that if you like, but wouldn't this be better as an autoconf check
> FLAGS_CXX_COMPILER_CHECK_ARGUMENTS ?
> 
> -- 
> Andrew Haley  (he/him)
> Java Platform Lead Engineer
> Red Hat UK Ltd. <https://www.redhat.com>
> https://keybase.io/andrewhaley
> EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
> 

Good point. A compiler check rather than a version test would be better.
I'd forgotten we had both ways in 8u, as it still has the old HotSpot build
with lots of version tests.

This is my revised version:

https://cr.openjdk.java.net/~andrew/openjdk8/8269468/webrev.02/

It works fine locally with GCC 8:

checking if the C compiler supports "-Wformat-overflow -Werror"... yes
checking if the C++ compiler supports "-Wformat-overflow -Werror"... yes
checking if both compilers support "-Wformat-overflow -Werror"... yes

and on RHEL 7 with GCC 4:

checking if the C compiler supports "-Wformat-overflow -Werror"... no
checking if the C++ compiler supports "-Wformat-overflow -Werror"... no
checking if both compilers support "-Wformat-overflow -Werror"... no

with both compiling os_linux.o.

I also included a fix for this bad line which was introduced by JDK-8267545:

if test "x$TOOLCHAIN_TYPE" = xgcc -o test "x$TOOLCHAIN_TYPE" = xclang; then

The rogue second 'test' causes test to fail:

checking if the C compiler supports "-m64"... /builddir/build/BUILD/java-1.8.0-openjdk-1.8.0.302.b07-0.0.ea.el7_9.x86_64/jdk8u302-b07/common/autoconf/generated-configure.sh: line 42635: test: too many arguments
yes

I thought at first my changes had caused this, but couldn't see how any
of them would. Turns out it was already in the build from yesterday as well.

I can stick that under a separate bug if really necessary, but as it is also
local to 8u, we may as well just fix it here.

Thanks,
-- 
Andrew :)
Pronouns: he / him or they / them
Senior Free Java Software Engineer
OpenJDK Package Owner
Red Hat, Inc. (http://www.redhat.com)

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


More information about the jdk8u-dev mailing list