[jdk8u-dev] Integrated: 8281096: Flags introduced by configure script are not passed to ADLC build

Andrew John Hughes andrew at openjdk.org
Wed Aug 14 15:53:01 UTC 2024


On Wed, 23 Aug 2023 03:58:10 GMT, Andrew John Hughes <andrew at openjdk.org> wrote:

> The 8u configure script defines compiler flags in `EXTRA_CFLAGS`, `EXTRA_LDFLAGS` and `EXTRA_ASFLAGS`. Some are added by configure tests, while others are taken directly from corresponding options passed by the user.
> 
> 8u still use the legacy HotSpot build system which is not fully integrated with the autoconf system. Variables defined by configure thus have to be explicitly passed down to the separate HotSpot build.
> 
> ADLC is a tool used at build-time and so the flags it uses don't impact on the end product. So, for a long time, it has been ignoring these flags defined by configure and using just its own minimal set.
> 
> However, with newer compilers, this means that the code is compiled to a newer version of the C++ standard, as the default has changed in GCC 6 and later (see [JDK-8151841](https://bugs.openjdk.org/browse/JDK-8151841)). With the latest versions of GCC (11 and 12), this actually leads to build failures due to the use of 'register' (GCC 11) and the way comments are used (GCC 12) in the code.
> 
> We should fix the ADLC build to use the same flags as the rest of the build. The impact should be negligible, given the same flags are already used in the code that is actually shipped.
> 
> This does not affect 9+ where HotSpot's build system has been replaced with full integration in the autoconf system.
> 
> With this change, 8u can be built with GCC 11 on GNU/Linux. I'd appreciate testing on other platforms, particularly those not covered by GHA (Solaris, AIX - @adamfarley, @sxa & @deepa181 who have provided previous fixes for these platforms)
> 
> During testing, we found we could not use the `EXTRA_` prefixed variables as they include flags for the target compiler on cross-compilation builds. To fix this, we split out new `HOST_` prefixed variables which include all the flags of the `EXTRA_` prefixed variables, bar the `--sysroot` options.

This pull request has now been integrated.

Changeset: 4106121e
Author:    Andrew John Hughes <andrew at openjdk.org>
URL:       https://git.openjdk.org/jdk8u-dev/commit/4106121e0ae42d644e45c6eab9037874110ed670
Stats:     184 lines in 8 files changed: 63 ins; 14 del; 107 mod

8281096: Flags introduced by configure script are not passed to ADLC build

Reviewed-by: stuefe, zzambers, sgehwolf

-------------

PR: https://git.openjdk.org/jdk8u-dev/pull/357


More information about the jdk8u-dev mailing list