Date: Wed, 07 Aug 2024 16:52:30 +0000 From: bugzilla-noreply@freebsd.org To: java@FreeBSD.org Subject: [Bug 280559] java/openjdk8: fix build with clang 19 Message-ID: <bug-280559-8522-mK166tkMHZ@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-280559-8522@https.bugs.freebsd.org/bugzilla/> References: <bug-280559-8522@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280559 --- Comment #4 from commit-hook@FreeBSD.org --- A commit in branch 2024Q3 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3D81c40ab2f6ae458d0bcb01d25385c86= b6c52fcb3 commit 81c40ab2f6ae458d0bcb01d25385c86b6c52fcb3 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-08-01 10:34:13 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-08-07 16:51:45 +0000 java/openjdk8: fix build with clang 19 Clang 19 is now more strict about undefined integral expressions used as constants in enum, which results in errors compiling java/openjdk8, similar to: =20=20=20=20=20=20=20 /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u422-b05.1/hotspot/src/shar= e/vm/oops/cpCache.hpp:195:34: error: expression is not an integral constant expression 195 | option_bits_mask =3D ~(((-1) << tos_state_shi= ft) | (field_index_mask | parameter_size_mask)) |=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20=20=20=20=20=20=20 /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u422-b05.1/hotspot/src/shar= e/vm/oops/cpCache.hpp:195:42: note: left shift of negative value -1 195 | option_bits_mask =3D ~(((-1) << tos_state_shi= ft) | (field_index_mask | parameter_size_mask)) | ^ =20=20=20=20=20=20=20 /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u422-b05.1/hotspot/src/shar= e/vm/code/dependencies.hpp:173:27: error: expression is not an integral constant expression 173 | all_types =3D ((1 << TYPE_LIMIT) - 1) & ((-1)= << FIRST_TYPE), |=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20=20=20=20=20=20=20 /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u422-b05.1/hotspot/src/shar= e/vm/code/dependencies.hpp:173:59: note: left shift of negative value -1 173 | all_types =3D ((1 << TYPE_LIMIT) - 1) & ((-1)= << FIRST_TYPE), | ^ In file included from /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u422-b05.1/jdk/src/share/na= tive/com/sun/java/util/jar/pack/bands.cpp:43: =20=20=20=20=20=20=20 /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u422-b05.1/jdk/src/share/na= tive/com/sun/java/util/jar/pack/constants.h:226:33: error: expression is not an integral constant expression 226 | AO_UNUSED_MBZ =3D (-1)<<13, // options bits reserved for future use. | ^~~~~~~~ =20=20=20=20=20=20=20 /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u422-b05.1/jdk/src/share/na= tive/com/sun/java/util/jar/pack/constants.h:226:37: note: left shift of negative value -1 226 | AO_UNUSED_MBZ =3D (-1)<<13, // options bits reserved for future use. | ^ In openjdk11 and later, the (-1) constants have been replaced by the unsigned variant (~0u), which fixes these errors. PR: 280559 Approved by: glewis (maintainer) MFH: 2024Q3 (cherry picked from commit 55925767376bb8d4ffe1a0304555988464c25599) .../patch-hotspot_src_share_vm_code_dependencies.hpp (new) | 11 +++++++= ++++ .../files/patch-hotspot_src_share_vm_oops_cpCache.hpp (new) | 11 +++++++= ++++ ..._share_native_com_sun_java_util_jar_pack_constants.h (new) | 11 +++++++= ++++ 3 files changed, 33 insertions(+) --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-280559-8522-mK166tkMHZ>