RFR: 8314488: Compile the JDK as C++17 [v2]
Kim Barrett
kbarrett at openjdk.org
Fri Dec 15 15:54:47 UTC 2023
On Fri, 15 Dec 2023 08:08:10 GMT, Julian Waters <jwaters at openjdk.org> wrote:
>> Implementation of [JEP draft: Compile the JDK as C++17](https://bugs.openjdk.org/browse/JDK-8310260)
>
> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>
> - Merge branch 'openjdk:master' into patch-7
> - Revert vm_version_linux_riscv.cpp
> - vm_version_linux_riscv.cpp
> - allocation.cpp
> - 8310260
In conjunction with changing to C++17, I suggest the following changes to the
minimum compiler versions, as indicated in make/autoconf/toolchain.m4
old:
make/autoconf/toolchain.m4
TOOLCHAIN_MINIMUM_VERSION_clang="3.5"
TOOLCHAIN_MINIMUM_VERSION_gcc="6.0"
TOOLCHAIN_MINIMUM_VERSION_microsoft="19.28.0.0" # VS2019 16.8, aka MSVC 14.28
TOOLCHAIN_MINIMUM_VERSION_xlc="16.1.0.0011"
proposed new:
TOOLCHAIN_MINIMUM_VERSION_clang="13.0"
TOOLCHAIN_MINIMUM_VERSION_gcc="9.0"
TOOLCHAIN_MINIMUM_VERSION_microsoft="19.28.0.0" # VS2019 16.8, aka MSVC 14.28
TOOLCHAIN_MINIMUM_VERSION_xlc="17.1.1.4"
Here's the rationale for each of these:
-----
gcc:
https://gcc.gnu.org/gcc-9/changes.html
"The C++17 implementation is no longer experimental."
-----
open xl c++ for aix
https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.1?topic=features-supported-language-levels
supports C17 and C++17, with experimental support for C++20
17.1.0 docs explicitly says __clang_version__ is 13.0.0, with the other
version macros set accordingly. 17.1.1 just describes the version macros, but
doesn't say what their values are. But the __VERSION__ macro description
includes "Clang 15.0.0" in the string.
Note that there is now a 17.1.2 version, but the aix-ppc porters haven't proposed
going that far.
-----
Visual Studio
https://learn.microsoft.com/en-gb/cpp/overview/visual-cpp-language-conformance?view=msvc-170
We already require VS2019 16.8, which covers all of C++17 features listed on
that page.
-----
clang
https://clang.llvm.org/cxx_status.html
c++17 - Clang 5
However, there is a critical bug for which we really want a fix. Using
[[noreturn]] seems to be buggy and leads to crashes. This has been seen with
clang 12. It appears to be fixed with clang 13.0.0 (Xcode 13.0).
There may also be a bug somewhere in the 13.x release series with the handling
of noexcept. See discussion in https://bugs.openjdk.org/browse/JDK-8255082.
Oracle is currently using Xcode 14.3.1 (clang 14.0.3), so I think we wouldn't
object to something between 13.0.0 and 14.0.3 as the minimum version.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14988#issuecomment-1858097523
More information about the build-dev
mailing list