[jdk11u-dev] RFR: 8229258: Backport patch from JDK 14 to allow building with Clang 13

Christoph Langer clanger at openjdk.org
Tue Aug 16 13:38:18 UTC 2022


On Thu, 28 Jul 2022 21:01:32 GMT, Salander <duke at openjdk.org> wrote:

> This patch backports changes from JDK14 commit ae5615c6142a4dc0d9033462f4880d7b3c127e26. It does not rename the class to markWord as the original patch does, but instead converts markOop to a markWord equivalent in-place. This patch allows the JDK to be built with Clang 13, as it avoids undefined behavior.
> 
> See the following for more information:
> 
>     https://bugs.openjdk.java.net/browse/JDK-8229258
>     https://bugs.gentoo.org/817995
>     https://mail.openjdk.java.net/pipermail/hotspot-dev/2019-July/038704.html
>     https://mail.openjdk.java.net/pipermail/hotspot-dev/2019-July/038712.html
>     https://reviews.llvm.org/D99790#2678384
> 
> This is a re-do of @Serebit's PR that erroneously targeted the jdk11u repository ([link](https://github.com/openjdk/jdk11u/pull/23)), the only difference is that some errors in the backport were corrected in the `shenandoahForwarding.inline.hpp` file to fix some compilation errors when compiling with `shenandoahgc` enabled.

Hi,

that's quite a big patch. Can this be made smaller - if the purpose is only to make clang13 work?

Furthermore, as this is no full backport of JDK-8229258, I suggest to change the title into just "Allow building with Clang 13" for the time being. I think, if this is ever going to be reviewed and accepted, we'll need to open a specific JBS bug for this, targeting  JDK 11.

I'm also not sure where support for clang13 is needed in the OpenJDK so far. Usually, linux versions are built with gcc. clang is only used on MacOS and AIX but for these OS versions we're not yet at clang version 13, I believe.

Anyway, if it fixes UB and XCode will go to clang13 soon, a fix for this issue might be needed sooner or later.

Another hint/requirement: Please enable GitHub Actions on your repository so as to have some basic tier1 acceptance testing for the PR.

Cheers
Christoph

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

PR: https://git.openjdk.org/jdk11u-dev/pull/1284


More information about the jdk-updates-dev mailing list