[8u] RFR: JDK-8269468: JDK-8269388 breaks the build on older GCCs
Andrew Hughes
gnu.andrew at redhat.com
Mon Jun 28 15:11:53 UTC 2021
On 16:19 Mon 28 Jun , Severin Gehwolf wrote:
> On Mon, 2021-06-28 at 14:36 +0100, Andrew Hughes wrote:
> > Bug: https://bugs.openjdk.java.net/browse/JDK-8269468
> > Webrev: https://cr.openjdk.java.net/~andrew/openjdk8/8269468/webrev.01/
>
> This looks fine.
>
> > 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.
>
> OK.
>
Thanks. I'll flag as jdk8u-critical-request.
> Aside:
>
> GCC 11, which I have here, prints this for -dumpversion: '11'. That is,
> CC_VER_MINOR is incorrect. As this patch isn't using that variable,
> it's fine. However a bug nevertheless.
>
> $ gcc -dumpfullversion
> 11.1.1
> $ gcc -dumpversion
> 11
> $ CC_VER_MINOR=$(gcc -dumpversion | sed 's/egcs-//' | cut -d'.' -f2); CC_VER_MAJOR=$(gcc -dumpversion | sed 's/egcs-//' | cut -d'.' -f1); echo $CC_VER_MAJOR.$CC_VER_MINOR
> 11.11
>
Same here with 8.
>From the other tests, I would guess the logic dates back to when GCC
made more use of the minor version numbers.
It seems like gcc -dumpfullversion would fix it, but that doesn't
exist on older GCCs:
$ cat /etc/redhat-release
Red Hat Enterprise Linux Workstation release 6.10 (Santiago)
$ cc -dumpversion
4.4.7
$ echo $?
4
$ cc -dumpfullversion
cc: no input files
$ echo $?
1
$ cat /etc/redhat-release
Red Hat Enterprise Linux Client release 7.9 (Maipo)
$ cc -dumpversion
4.8.5
$ echo $?
0
$ cc -dumpfullversion
cc: fatal error: no input files
compilation terminated.
$ echo $?
4
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.3 (Ootpa)
$ gcc -dumpversion
8
$ echo $?
0
$ gcc -dumpfullversion
8.3.1
$ echo $?
0
so it would need to be fallback on gcc -dumpversion.
> Thanks,
> Severin
>
--
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