-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8314488: Compile the JDK as C++17 #14988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back jwaters! A progress list of the required criteria for merging this PR into |
@TheShermanTanker The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
/label hotspot |
@TheShermanTanker |
The minimum compiler requirements have not been implemented yet, as I wanted to leave their discretion to any reviewers before setting a fixed value in the build system |
Webrevs
|
/reviewers 3 reviewer |
@TheShermanTanker |
I disagree with this change. This should be discussed more broadly before trying to get a PR in. The associated JEP has been closed by Mark. Just a "oh well, then I'm doing it without JEP" is not the right way. Before agreeing to this, I would like to know what actual changes have been planned, and see them weighted against the cost. The cost, as I have stated before, are reviewer churn, implementation risk, and increased cost of downporting patches to older JDK versions. |
Mailing list message from Mario Torre on hotspot-dev: I agree with Thomas and Mark, I too don't see this change favourably. This change would affect current build environments and setups, The right place for this sort of changes is a JEP and it needs to be Eventually there will be a time where we can and maybe should consider Cheers, On Thu, Aug 17, 2023 at 8:04?AM Thomas Stuefe <stuefe at openjdk.org> wrote: -- Red Hat GmbH, Registered seat: Werner von Siemens Ring 12, D-85630 Commercial register: Amtsgericht Muenchen/Munich, HRB 153243, |
Mailing list message from Andrew Haley on build-dev: On 8/17/23 10:27, Mario Torre wrote:
Well, maybe. It depends on how much work is involved. But, to begin with, it'd be interesting to know if the JDK could be compiled -- |
Hi Andrew, majority of the work to remove C++17 breaking code from the JDK is actually already complete, this PR cleans out the last 2 places that cannot pass C++17 (a mismatched throw specifier and a register storage class qualifier), after which the JDK is fully compilable as C++17. I had taken Mark's rejection to mean that going to C++17 is not worth a JEP, unlike JEP-347. Is this still too soon? |
Hi Julian, Given the JEP was closed/rejected as being unnecessary it didn't really make sense to present this as an Implementation of the JEP. This is simply the last couple of fixes to make code C++17 clean and to switch to requiring C++17. The former seems quite reasonable to me. The latter does require further discussion and buy-in. Thanks |
@@ -574,11 +574,11 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], | |||
|
|||
# CXXFLAGS C++ language level for all of JDK, including Hotspot. | |||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xxlc; then | |||
LANGSTD_CXXFLAGS="-std=c++14" | |||
LANGSTD_CXXFLAGS="-std=c++17" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this change cannot be made yet. As noted in the prior JEP discussion, we need to wait for the aix-ppc
port maintainers to upgrade the compiler they are using. I happened to check last with them about their
progress. While progress has been made, they are not yet ready to throw that switch. Hoping to finish that
work sometime this fall.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is resolved. JDK23 doesn't support the old compiler any more. The only supported AIX compiler is C++17 capable.
There may be other changes needed either in preparation or as part of making
There may be others that I've forgotten or haven't noticed. |
This change needs to be motivated. One way to do that would be to file CRs to |
Is it impractical to drop the obsolete features of C++11, working in the common subset of C++11 and C++17? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully tested on AIX with xlc 17.1.1. Works for us (SAP). Please check with others who might still use an older compiler (IBM).
@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Seems we use already a little bit of C++17 coding in the Linux codebase . jdk/src/hotspot/os/linux/os_linux.cpp:2975:65: error: 'static_assert' with no message is a C++17 extension [-Werror,-Wc++17-extensions] So switching to C++17 would make our codebase compile :-) (at least in this case) ! |
@TheShermanTanker I suggest you close this PR. If we are going to switch to C++17, it should start by a discussion in the mailing list, not with a PR (the change itself is trivial). |
@TheShermanTanker This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@TheShermanTanker This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
/open |
@TheShermanTanker This pull request is now open |
There are build warnings on Windows (see GHA). |
I recently noticed that problem too, and am working on what to do about it. I guess I should file a bug. I think it wasn't previously noticed because there was a different bug that adlc wasn't being compiled with the |
https://bugs.openjdk.org/browse/JDK-8342639 |
@TheShermanTanker This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@TheShermanTanker This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
Reopening since #25992 has been created for discussion on C++17 features. This Pull Request will be useful in helping to see what will need to change to actually enable C++17 |
/open |
@TheShermanTanker This pull request is now open |
Compile the JDK as C++17, enabling the use of all C++17 language features
Progress
Integration blocker
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14988/head:pull/14988
$ git checkout pull/14988
Update a local copy of the PR:
$ git checkout pull/14988
$ git pull https://git.openjdk.org/jdk.git pull/14988/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14988
View PR using the GUI difftool:
$ git pr show -t 14988
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14988.diff
Using Webrev
Link to Webrev Comment