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

Andrew John Hughes andrew at openjdk.org
Wed May 22 15:58:12 UTC 2024


On Sat, 17 Feb 2024 20:29:09 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)
>
> Andrew John Hughes has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Print spec files in right workflow and use path to build directory

> _Mailing list message from [Thorsten Glaser](mailto:t.glaser at qvest-digital.com) on [jdk8u-dev](mailto:jdk8u-dev at mail.openjdk.org):_
> 
> On Mon, 19 Feb 2024, Andrew John Hughes wrote:
> 
> > I think I know what's wrong here now with the cross-compilation builds.
> > The `EXTRA_CFLAGS` that HotSpot gets end up including the `--sysroot`
> > options on cross-compile builds, which are really destined for the
> > target compiler, not a build compiler which is compiling a build tool
> > that is going to be run during the build.
> 
> Ouch. So no clean distinction between CFLAGS and HOSTCFLAGS?

Yes, this is the conclusion I've come to as well.

> 
> > I can fix this, but it's going to make this fix a bit more involved
> > than I initially thought.
> 
> Yocto has an ugly workaround: https://github.com/ostroproject/ostro-os/blob/master/meta-java/recipes-core/openjdk/patches-openjdk-8/openjdk8-fix-adlc-flags.patch

Ah good to see someone else has encountered this. I think we can resolve it in a similar way, but by defining a new flag in configure rather than trying to filter things apart later.

> 
> bye, //mirabilos -- Infrastrukturexperte ? Qvest Digital AG Am Dickobskreuz 10, D-53121 Bonn ? https://www.qvest-digital.com/ Telephon +49 228 54881-393 ? Fax: +49 228 54881-235 HRB AG Bonn 18196 ? USt-ID (VAT): DE274355441 Vorstand: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg Vorsitzender Aufsichtsrat: Peter N?then

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

PR Comment: https://git.openjdk.org/jdk8u-dev/pull/357#issuecomment-2125144283


More information about the jdk8u-dev mailing list