OpenJDK11 build on macOS with autoconf 2.72 / -std=gnu++11 option
Baesken, Matthias
matthias.baesken at sap.com
Wed Jan 3 07:48:01 UTC 2024
>Perhaps this is a clang vs gcc thing in the build system? With "-std=gnu++98"
>only being applied for gcc, not for clang?
Hi Kim, I saw this only with xcode/clang (after the update to autoconf 2.72) .
>BTW, I have no reason to expect "-std=gnu++11" to work with JDK 11. There were
>a number of changes needed to go from C++98 to C++14, and I don't know if all
>of them were done for JDK 11.
After disabling PCH, the openjdk11 build works (I did not expect it, but build + tests look good).
Best regards, Matthias
-----Original Message-----
From: Kim Barrett <kim.barrett at oracle.com>
Sent: Tuesday, 2 January 2024 22:35
To: Baesken, Matthias <matthias.baesken at sap.com>
Cc: build-dev at openjdk.org; Magnus Ihse Bursie <magnus.ihse.bursie at oracle.com>; Langer, Christoph <christoph.langer at sap.com>; Erik Joelsson <erik.joelsson at oracle.com>
Subject: Re: OpenJDK11 build on macOS with autoconf 2.72 / -std=gnu++11 option
* PGP Signed by an unknown key
> On Jan 2, 2024, at 4:19 AM, Baesken, Matthias <matthias.baesken at sap.com> wrote:
>
> Hi , was anyone seen the following issue ?
> After an update from autoconf 2.71 to 2.72 on macOS (x86_6$9 , the C++ flag detection changed in an unexpected way . It is an OpenJDK11 build .
> Previously with (autoconf 2.71) we had :
> checking for /jenkins/workspace/devkit-xcode-13.1/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ option to enable C++11 features... none needed
> now (2.72)
> checking for /jenkins/workspace/devkit-xcode-13.1/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ option to enable C++11 features... -std=gnu++11
> the new option -std=gnu++11 leads to :
> error: C++11 was disabled in PCH file but is currently enabled
> Should we simply disable PCH ?
> Or is there a good and reliable way to get rid of the unwanted option ?
> Thanks, Matthias
JDK-8151841 and JDK-8156980 (both from JDK 9) changed the build system to
explicitly use "-std=gnu++98". It remained that way until JDK 16, when it was
changed to "-std=c++14". So why is "-std=gnu++11" being used at all?
Perhaps this is a clang vs gcc thing in the build system? With "-std=gnu++98"
only being applied for gcc, not for clang?
BTW, I have no reason to expect "-std=gnu++11" to work with JDK 11. There were
a number of changes needed to go from C++98 to C++14, and I don't know if all
of them were done for JDK 11.
* Unknown Key
* 0x19B3C410
More information about the build-dev
mailing list