Date: Sat, 29 Apr 2023 08:46:56 GMT From: Dimitry Andric <dim@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 6c7525282e52 - main - java/openjdk8: fix build with clang 16 Message-ID: <202304290846.33T8kua6079405@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=6c7525282e522052f7416bf30223c7c56f3a5b63 commit 6c7525282e522052f7416bf30223c7c56f3a5b63 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2023-04-26 12:38:28 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2023-04-29 08:45:36 +0000 java/openjdk8: fix build with clang 16 Since clang 16 (and gcc 11) the default C++ standard is now gnu++17. Because java/openjdk8's build infrastructure does not explicitly set its C++ standard, this leads to several errors: /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u362-b09.1/hotspot/src/share/vm/adlc/arena.cpp:82:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register Chunk *k = _first; ^~~~~~~~~ /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u362-b09.1/hotspot/src/share/vm/adlc/arena.cpp:96:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register Chunk *k = _chunk; // Get filled-up chunk address ^~~~~~~~~ 2 errors generated. /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u362-b09.1/hotspot/src/share/vm/adlc/adlparse.cpp:4567:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register char c; ^~~~~~~~~ /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u362-b09.1/hotspot/src/share/vm/adlc/adlparse.cpp:4765:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register char c; ^~~~~~~~~ For newer versions of OpenJDK this has been fixed by removing the 'register' keyword, but upstream has not yet backported it to OpenJDK 8. To work around the errors, define the register keyword away using a command line flag. PR: 271080 Approved by: glewis (maintainer) MFH: 2023Q2 --- java/openjdk8/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/java/openjdk8/Makefile b/java/openjdk8/Makefile index 688035a60d89..6196947d8f30 100644 --- a/java/openjdk8/Makefile +++ b/java/openjdk8/Makefile @@ -1,5 +1,6 @@ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_UPDATE_VERSION}.${JDK_BUILD_NUMBER}.${BSD_JDK_VERSION} +PORTREVISION= 1 CATEGORIES= java devel MASTER_SITES= LOCAL/jkim:jtreg PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION} @@ -213,6 +214,13 @@ BUILD_DEPENDS+= clang${LLVM_VER}:devel/llvm${LLVM_VER} CC= ${LOCALBASE}/bin/clang${LLVM_VER} CXX= ${LOCALBASE}/bin/clang++${LLVM_VER} .endif +.if ${COMPILER_VERSION} >= 160 +# clang 16 defaults to C++17, which no longer allows the 'register' keyword. +# There is an upstream commit that removes all the individual 'register' +# keywords, but it has not yet been backported to OpenJDK 8. +# NOTE: passing this option via --with-extra-cflags does not work. +CFLAGS+= -Dregister= +.endif .endif # GCC is broken with PCH: https://lists.freebsd.org/pipermail/svn-src-all/2015-March/101722.html
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202304290846.33T8kua6079405>