From de7fa9c41ec64be7f82b1241e35a550461771db0 Mon Sep 17 00:00:00 2001 From: "Liguros - Gitlab CI/CD [develop]" Date: Wed, 13 Aug 2025 19:01:40 +0000 Subject: Adding metadata --- dev-java/bsh/bsh-2.1.1-r1.ebuild | 116 ------------- dev-java/bsh/bsh-2.1.1-r2.ebuild | 123 +++++++++++++ ....0.28_p6-fixBuild_failure_with_glibc-2.42.patch | 130 ++++++++++++++ ....0.16_p8-fixBuild_failure_with_glibc-2.42.patch | 170 ++++++++++++++++++ ...1.0.8_p9-fixBuild_failure_with_glibc-2.42.patch | 191 +++++++++++++++++++++ dev-java/openjdk/openjdk-11.0.28_p6.ebuild | 2 + dev-java/openjdk/openjdk-17.0.16_p8.ebuild | 2 + dev-java/openjdk/openjdk-21.0.8_p9.ebuild | 2 + dev-java/rhino/rhino-1.8.0.ebuild | 14 +- dev-java/xalan/xalan-2.7.3-r2.ebuild | 78 --------- dev-java/xalan/xalan-2.7.3-r3.ebuild | 80 +++++++++ 11 files changed, 710 insertions(+), 198 deletions(-) delete mode 100644 dev-java/bsh/bsh-2.1.1-r1.ebuild create mode 100644 dev-java/bsh/bsh-2.1.1-r2.ebuild create mode 100644 dev-java/openjdk/files/openjdk-11.0.28_p6-fixBuild_failure_with_glibc-2.42.patch create mode 100644 dev-java/openjdk/files/openjdk-17.0.16_p8-fixBuild_failure_with_glibc-2.42.patch create mode 100644 dev-java/openjdk/files/openjdk-21.0.8_p9-fixBuild_failure_with_glibc-2.42.patch delete mode 100644 dev-java/xalan/xalan-2.7.3-r2.ebuild create mode 100644 dev-java/xalan/xalan-2.7.3-r3.ebuild (limited to 'dev-java') diff --git a/dev-java/bsh/bsh-2.1.1-r1.ebuild b/dev-java/bsh/bsh-2.1.1-r1.ebuild deleted file mode 100644 index ad59a52c5953..000000000000 --- a/dev-java/bsh/bsh-2.1.1-r1.ebuild +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -JAVA_PKG_IUSE="doc source test" -MAVEN_ID="org.apache-extras.beanshell:bsh:2.1.1" -JAVA_TESTING_FRAMEWORKS="junit-4" - -inherit java-pkg-2 java-pkg-simple - -DESCRIPTION="A small embeddable Java source interpreter" -HOMEPAGE="https://github.com/beanshell/beanshell" -SRC_URI="https://github.com/beanshell/beanshell/archive/${PV}.tar.gz -> ${P}.tar.gz" -S="${WORKDIR}/beanshell-${PV}" - -LICENSE="LGPL-2.1" -SLOT="0" -KEYWORDS="amd64 arm64 ppc64 ~amd64-linux ~x86-linux" - -# There was 1 failure: -# 1) do_not_access_non_open_methods(bsh.Java_9_Test) -# bsh.TargetError: Sourced file: inline evaluation of: ``import java.net.URL; -PROPERTIES="test_network" -RESTRICT="test" - -CP_DEPEND=" - dev-java/bsf:2.3 - dev-java/jakarta-servlet-api:4" - -RDEPEND="${CP_DEPEND} - >=virtual/jre-1.8:*" - -DEPEND="${CP_DEPEND} - >=virtual/jdk-1.8:*" - -DOCS=( - CHANGES.md - NOTICE - README.md -) - -PATCHES=( "${FILESDIR}/bsh-2.1.1-skip-tests.patch" ) - -JAVA_LAUNCHER_FILENAME="bsh-console" -JAVA_MAIN_CLASS="bsh.Console" -JAVA_RESOURCE_DIRS="resources/src" -JAVA_SRC_DIR=( src bsf/src engine/src ) -JAVA_TEST_GENTOO_CLASSPATH="junit-4" -JAVA_TEST_SRC_DIR="tests" - -src_prepare() { - default #780585 - java-pkg-2_src_prepare - java-pkg_clean ! -path "./tests/test-scripts/*" - - # These classes are not in upstream jar file - mkdir -p tests/src/bsh/engine || die - mv {engine,tests}/src/bsh/TestBshScriptEngine.java || die - mv {,tests/}src/bsh/JThis.java || die - - # java-pkg-simple.eclass wants resources in JAVA_RESOURCE_DIRS - mkdir resources || die - find src -type f \ - ! -name '*.java' \ - ! -name 'bsh.jj*' \ - ! -name '*.scripted' \ - ! -name '*.txt' \ - ! -name '*.xml' \ - ! -name '.errLog' \ - ! -name 'index.html' \ - ! -name 'Changes.html' \ - ! -name 'CodeMap.html' \ - ! -name 'Manifest.*' \ - | xargs cp --parent -t resources || die -} - -src_test() { - # tests/junitTests/src/bsh/Issue_55_Test.java:47: error: cannot find symbol - # final Object scriptEngineResult = new BshScriptEngineFactory().getScriptEngine().eval(script); - # ^ - # symbol: class BshScriptEngineFactory - # location: class Issue_55_Test - rm tests/junitTests/src/bsh/Issue_55_Test.java || die - - # We add 3 test classes which are not covered by the default test selection of java-pkg-simple - # We skip "OldScriptsTest" and 4 failing test classes. - # Test failures are documeted in bug #903519. - local JAVA_TEST_RUN_ONLY=$(find tests/junitTests/src \ - -type f \ - ! -name 'OldScriptsTest.java' \ - ! -name 'Class3_Test.java' \ - ! -name 'Class13Test.java' \ - ! -name 'Issue_7_Test.java' \ - ! -name 'Issue_8_Test.java' \ - \( \ - -name "*Test.java" \ - -o -name "AnnotationsParsing.java" \ - -o -name "GoogleReports.java" \ - -o -name "Namespace_chaining.java" \ - \) -printf '%P\n') - JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}" - JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}" - - local vm_version="$(java-config -g PROVIDES_VERSION)" - if ver_test "${vm_version}" -ge 17; then - JAVA_TEST_EXTRA_ARGS+=( --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED) - fi - java-pkg-simple_src_test -} - -src_install() { - java-pkg-simple_src_install - # The eclass installs only then main launcher. - java-pkg_dolauncher "${PN}-interpreter" --main bsh.Interpreter -} diff --git a/dev-java/bsh/bsh-2.1.1-r2.ebuild b/dev-java/bsh/bsh-2.1.1-r2.ebuild new file mode 100644 index 000000000000..a4b22492e299 --- /dev/null +++ b/dev-java/bsh/bsh-2.1.1-r2.ebuild @@ -0,0 +1,123 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="org.apache-extras.beanshell:bsh:2.1.1" +JAVA_TESTING_FRAMEWORKS="junit-4" + +inherit java-pkg-2 java-pkg-simple + +DESCRIPTION="A small embeddable Java source interpreter" +HOMEPAGE="https://github.com/beanshell/beanshell" +SRC_URI="https://github.com/beanshell/beanshell/archive/${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/beanshell-${PV}" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="amd64 arm64 ppc64 ~amd64-linux ~x86-linux" + +# There was 1 failure: +# 1) do_not_access_non_open_methods(bsh.Java_9_Test) +# bsh.TargetError: Sourced file: inline evaluation of: ``import java.net.URL; +PROPERTIES="test_network" +RESTRICT="test" + +CP_DEPEND=" + dev-java/bsf:2.3 + dev-java/jakarta-servlet-api:4 +" + +# restrict to max Java 25 +# https://bugs.openjdk.org/browse/JDK-8359053 +DEPEND=" + ${CP_DEPEND} + +Date: Mon, 4 Aug 2025 09:42:56 +0000 +Subject: [PATCH] Backport 38bb8adf4f632b08af15f2d8530b35f05f86a020 + +--- + src/hotspot/cpu/aarch64/assembler_aarch64.cpp | 2 +- + src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 2 +- + src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp | 2 +- + src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp | 4 ++-- + src/hotspot/share/opto/mulnode.cpp | 4 ++-- + src/hotspot/share/utilities/globalDefinitions.hpp | 8 ++++---- + 6 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +index 8047ed8fd2a..aece16763a6 100644 +--- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +@@ -1702,7 +1702,7 @@ void Assembler::add_sub_immediate(Register Rd, Register Rn, unsigned uimm, int o + } + + bool Assembler::operand_valid_for_add_sub_immediate(int64_t imm) { +- uint64_t uimm = (uint64_t)uabs((jlong)imm); ++ uint64_t uimm = (uint64_t)g_uabs((jlong)imm); + if (uimm < (1 << 12)) + return true; + if (uimm < (1 << 24) +diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +index e07bbba3f6e..be13d560345 100644 +--- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp ++++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +@@ -854,7 +854,7 @@ class Assembler : public AbstractAssembler { + static const uint64_t branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); + + static bool reachable_from_branch_at(address branch, address target) { +- return uabs(target - branch) < branch_range; ++ return g_uabs(target - branch) < branch_range; + } + + // Unconditional branch (immediate) +diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +index 7f329a45d30..c280df9f726 100644 +--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +@@ -2206,7 +2206,7 @@ void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned im + if (operand_valid_for_add_sub_immediate((int)imm)) { + (this->*insn1)(Rd, Rn, imm); + } else { +- if (uabs(imm) < (1 << 24)) { ++ if (g_uabs(imm) < (1 << 24)) { + (this->*insn1)(Rd, Rn, imm & -(1 << 12)); + (this->*insn1)(Rd, Rd, imm & ((1 << 12)-1)); + } else { +diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +index 598a25969d8..31817702b6b 100644 +--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +@@ -1009,7 +1009,7 @@ class StubGenerator: public StubCodeGenerator { + + void copy_memory_small(Register s, Register d, Register count, Register tmp, int step) { + bool is_backwards = step < 0; +- size_t granularity = uabs(step); ++ size_t granularity = g_uabs(step); + int direction = is_backwards ? -1 : 1; + int unit = wordSize * direction; + +@@ -1065,7 +1065,7 @@ class StubGenerator: public StubCodeGenerator { + Register count, Register tmp, int step) { + copy_direction direction = step < 0 ? copy_backwards : copy_forwards; + bool is_backwards = step < 0; +- unsigned int granularity = uabs(step); ++ unsigned int granularity = g_uabs(step); + const Register t0 = r3, t1 = r4; + + // <= 80 (or 96 for SIMD) bytes do inline. Direction doesn't matter because we always +diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp +index 6616fa0ad01..78cd34490da 100644 +--- a/src/hotspot/share/opto/mulnode.cpp ++++ b/src/hotspot/share/opto/mulnode.cpp +@@ -194,7 +194,7 @@ Node *MulINode::Ideal(PhaseGVN *phase, bool can_reshape) { + // Check for negative constant; if so negate the final result + bool sign_flip = false; + +- unsigned int abs_con = uabs(con); ++ unsigned int abs_con = g_uabs(con); + if (abs_con != (unsigned int)con) { + sign_flip = true; + } +@@ -290,7 +290,7 @@ Node *MulLNode::Ideal(PhaseGVN *phase, bool can_reshape) { + + // Check for negative constant; if so negate the final result + bool sign_flip = false; +- julong abs_con = uabs(con); ++ julong abs_con = g_uabs(con); + if (abs_con != (julong)con) { + sign_flip = true; + } +diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp +index c758fc57432..581753769d7 100644 +--- a/src/hotspot/share/utilities/globalDefinitions.hpp ++++ b/src/hotspot/share/utilities/globalDefinitions.hpp +@@ -1166,7 +1166,7 @@ inline bool is_even(intx x) { return !is_odd(x); } + + // abs methods which cannot overflow and so are well-defined across + // the entire domain of integer types. +-static inline unsigned int uabs(unsigned int n) { ++static inline unsigned int g_uabs(unsigned int n) { + union { + unsigned int result; + int value; +@@ -1175,7 +1175,7 @@ static inline unsigned int uabs(unsigned int n) { + if (value < 0) result = 0-result; + return result; + } +-static inline julong uabs(julong n) { ++static inline julong g_uabs(julong n) { + union { + julong result; + jlong value; +@@ -1184,8 +1184,8 @@ static inline julong uabs(julong n) { + if (value < 0) result = 0-result; + return result; + } +-static inline julong uabs(jlong n) { return uabs((julong)n); } +-static inline unsigned int uabs(int n) { return uabs((unsigned int)n); } ++static inline julong g_uabs(jlong n) { return g_uabs((julong)n); } ++static inline unsigned int g_uabs(int n) { return g_uabs((unsigned int)n); } + + // "to" should be greater than "from." + inline intx byte_size(void* from, void* to) { diff --git a/dev-java/openjdk/files/openjdk-17.0.16_p8-fixBuild_failure_with_glibc-2.42.patch b/dev-java/openjdk/files/openjdk-17.0.16_p8-fixBuild_failure_with_glibc-2.42.patch new file mode 100644 index 000000000000..040b257d144f --- /dev/null +++ b/dev-java/openjdk/files/openjdk-17.0.16_p8-fixBuild_failure_with_glibc-2.42.patch @@ -0,0 +1,170 @@ +From 4241313127be05704eeebcc6454120742cc93753 Mon Sep 17 00:00:00 2001 +From: Francesco Andreuzzi +Date: Thu, 12 Jun 2025 16:21:01 +0000 +Subject: [PATCH] 8354941: Build failure with glibc 2.42 due to uabs() name + collision + +Reviewed-by: phh +Backport-of: 38bb8adf4f632b08af15f2d8530b35f05f86a020 +--- + src/hotspot/cpu/aarch64/assembler_aarch64.cpp | 2 +- + src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 2 +- + src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp | 2 +- + src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp | 4 ++-- + src/hotspot/cpu/riscv/assembler_riscv.hpp | 2 +- + src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 4 ++-- + src/hotspot/share/opto/mulnode.cpp | 4 ++-- + src/hotspot/share/utilities/globalDefinitions.hpp | 8 ++++---- + 8 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +index 0c503e0b7fd..70a750f0043 100644 +--- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +@@ -318,7 +318,7 @@ void Assembler::wrap_label(Label &L, prfop op, prefetch_insn insn) { + + bool Assembler::operand_valid_for_add_sub_immediate(int64_t imm) { + bool shift = false; +- uint64_t uimm = (uint64_t)uabs((jlong)imm); ++ uint64_t uimm = (uint64_t)g_uabs((jlong)imm); + if (uimm < (1 << 12)) + return true; + if (uimm < (1 << 24) +diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +index 5a8047bc2af..12fff1972bd 100644 +--- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp ++++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +@@ -858,7 +858,7 @@ class Assembler : public AbstractAssembler { + static const uint64_t branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); + + static bool reachable_from_branch_at(address branch, address target) { +- return uabs(target - branch) < branch_range; ++ return g_uabs(target - branch) < branch_range; + } + + // Unconditional branch (immediate) +diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +index 7abb2205414..c9a8db901e4 100644 +--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +@@ -2410,7 +2410,7 @@ void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t im + if (fits) { + (this->*insn1)(Rd, Rn, imm); + } else { +- if (uabs(imm) < (1 << 24)) { ++ if (g_uabs(imm) < (1 << 24)) { + (this->*insn1)(Rd, Rn, imm & -(1 << 12)); + (this->*insn1)(Rd, Rd, imm & ((1 << 12)-1)); + } else { +diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +index c92f0cf05bd..4920b7cb47c 100644 +--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +@@ -1042,7 +1042,7 @@ class StubGenerator: public StubCodeGenerator { + + void copy_memory_small(Register s, Register d, Register count, Register tmp, int step) { + bool is_backwards = step < 0; +- size_t granularity = uabs(step); ++ size_t granularity = g_uabs(step); + int direction = is_backwards ? -1 : 1; + int unit = wordSize * direction; + +@@ -1098,7 +1098,7 @@ class StubGenerator: public StubCodeGenerator { + Register count, Register tmp, int step) { + copy_direction direction = step < 0 ? copy_backwards : copy_forwards; + bool is_backwards = step < 0; +- unsigned int granularity = uabs(step); ++ unsigned int granularity = g_uabs(step); + const Register t0 = r3, t1 = r4; + + // <= 80 (or 96 for SIMD) bytes do inline. Direction doesn't matter because we always +diff --git a/src/hotspot/cpu/riscv/assembler_riscv.hpp b/src/hotspot/cpu/riscv/assembler_riscv.hpp +index 98c51e9883d..31a8f59f802 100644 +--- a/src/hotspot/cpu/riscv/assembler_riscv.hpp ++++ b/src/hotspot/cpu/riscv/assembler_riscv.hpp +@@ -2779,7 +2779,7 @@ enum Nf { + static const unsigned long branch_range = 1 * M; + + static bool reachable_from_branch_at(address branch, address target) { +- return uabs(target - branch) < branch_range; ++ return g_uabs(target - branch) < branch_range; + } + + // Decode the given instruction, checking if it's a 16-bit compressed +diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +index 7fe0392ea5c..a0ebb34a548 100644 +--- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp ++++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +@@ -925,7 +925,7 @@ class StubGenerator: public StubCodeGenerator { + + void copy_memory_v(Register s, Register d, Register count, Register tmp, int step) { + bool is_backward = step < 0; +- int granularity = uabs(step); ++ int granularity = g_uabs(step); + + const Register src = x30, dst = x31, vl = x14, cnt = x15, tmp1 = x16, tmp2 = x17; + assert_different_registers(s, d, cnt, vl, tmp, tmp1, tmp2); +@@ -974,7 +974,7 @@ class StubGenerator: public StubCodeGenerator { + } + + bool is_backwards = step < 0; +- int granularity = uabs(step); ++ int granularity = g_uabs(step); + + const Register src = x30, dst = x31, cnt = x15, tmp3 = x16, tmp4 = x17, tmp5 = x14, tmp6 = x13; + +diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp +index 6d35fd8bf7b..6eb47eb38bb 100644 +--- a/src/hotspot/share/opto/mulnode.cpp ++++ b/src/hotspot/share/opto/mulnode.cpp +@@ -242,7 +242,7 @@ Node *MulINode::Ideal(PhaseGVN *phase, bool can_reshape) { + // Check for negative constant; if so negate the final result + bool sign_flip = false; + +- unsigned int abs_con = uabs(con); ++ unsigned int abs_con = g_uabs(con); + if (abs_con != (unsigned int)con) { + sign_flip = true; + } +@@ -336,7 +336,7 @@ Node *MulLNode::Ideal(PhaseGVN *phase, bool can_reshape) { + + // Check for negative constant; if so negate the final result + bool sign_flip = false; +- julong abs_con = uabs(con); ++ julong abs_con = g_uabs(con); + if (abs_con != (julong)con) { + sign_flip = true; + } +diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp +index 98d7fbc674c..d5840b0c001 100644 +--- a/src/hotspot/share/utilities/globalDefinitions.hpp ++++ b/src/hotspot/share/utilities/globalDefinitions.hpp +@@ -1064,7 +1064,7 @@ inline bool is_even(intx x) { return !is_odd(x); } + + // abs methods which cannot overflow and so are well-defined across + // the entire domain of integer types. +-static inline unsigned int uabs(unsigned int n) { ++static inline unsigned int g_uabs(unsigned int n) { + union { + unsigned int result; + int value; +@@ -1073,7 +1073,7 @@ static inline unsigned int uabs(unsigned int n) { + if (value < 0) result = 0-result; + return result; + } +-static inline julong uabs(julong n) { ++static inline julong g_uabs(julong n) { + union { + julong result; + jlong value; +@@ -1082,8 +1082,8 @@ static inline julong uabs(julong n) { + if (value < 0) result = 0-result; + return result; + } +-static inline julong uabs(jlong n) { return uabs((julong)n); } +-static inline unsigned int uabs(int n) { return uabs((unsigned int)n); } ++static inline julong g_uabs(jlong n) { return g_uabs((julong)n); } ++static inline unsigned int g_uabs(int n) { return g_uabs((unsigned int)n); } + + // "to" should be greater than "from." + inline intx byte_size(void* from, void* to) { diff --git a/dev-java/openjdk/files/openjdk-21.0.8_p9-fixBuild_failure_with_glibc-2.42.patch b/dev-java/openjdk/files/openjdk-21.0.8_p9-fixBuild_failure_with_glibc-2.42.patch new file mode 100644 index 000000000000..b5ffdf580067 --- /dev/null +++ b/dev-java/openjdk/files/openjdk-21.0.8_p9-fixBuild_failure_with_glibc-2.42.patch @@ -0,0 +1,191 @@ +From 3445b99bedfba659da49d72a39979703969cfc91 Mon Sep 17 00:00:00 2001 +From: Francesco Andreuzzi +Date: Fri, 6 Jun 2025 14:29:04 +0000 +Subject: [PATCH] 8354941: Build failure with glibc 2.42 due to uabs() name + collision + +Backport-of: 38bb8adf4f632b08af15f2d8530b35f05f86a020 +--- + src/hotspot/cpu/aarch64/assembler_aarch64.cpp | 2 +- + src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 2 +- + src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp | 2 +- + src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp | 4 ++-- + src/hotspot/cpu/riscv/assembler_riscv.hpp | 2 +- + src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 4 ++-- + src/hotspot/share/opto/mulnode.cpp | 4 ++-- + src/hotspot/share/opto/subnode.cpp | 4 ++-- + src/hotspot/share/utilities/globalDefinitions.hpp | 8 ++++---- + 9 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +index c7b867a4207..fab224847f4 100644 +--- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +@@ -461,7 +461,7 @@ void Assembler::bang_stack_with_offset(int offset) { Unimplemented(); } + + bool asm_util::operand_valid_for_immediate_bits(int64_t imm, unsigned nbits) { + guarantee(nbits == 8 || nbits == 12, "invalid nbits value"); +- uint64_t uimm = (uint64_t)uabs((jlong)imm); ++ uint64_t uimm = (uint64_t)g_uabs((jlong)imm); + if (uimm < (UCONST64(1) << nbits)) + return true; + if (uimm < (UCONST64(1) << (2 * nbits)) +diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +index dafb4f5229b..5d3ca441b41 100644 +--- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp ++++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +@@ -930,7 +930,7 @@ class Assembler : public AbstractAssembler { + static const uint64_t branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M); + + static bool reachable_from_branch_at(address branch, address target) { +- return uabs(target - branch) < branch_range; ++ return g_uabs(target - branch) < branch_range; + } + + // Unconditional branch (immediate) +diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +index 0a2dd0dce97..8ec1af1bd7a 100644 +--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +@@ -2894,7 +2894,7 @@ void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t im + if (fits) { + (this->*insn1)(Rd, Rn, imm); + } else { +- if (uabs(imm) < (1 << 24)) { ++ if (g_uabs(imm) < (1 << 24)) { + (this->*insn1)(Rd, Rn, imm & -(1 << 12)); + (this->*insn1)(Rd, Rd, imm & ((1 << 12)-1)); + } else { +diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +index b2cc462ff8e..2bfc49d05dd 100644 +--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp ++++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +@@ -1130,7 +1130,7 @@ class StubGenerator: public StubCodeGenerator { + + void copy_memory_small(DecoratorSet decorators, BasicType type, Register s, Register d, Register count, int step) { + bool is_backwards = step < 0; +- size_t granularity = uabs(step); ++ size_t granularity = g_uabs(step); + int direction = is_backwards ? -1 : 1; + + Label Lword, Lint, Lshort, Lbyte; +@@ -1189,7 +1189,7 @@ class StubGenerator: public StubCodeGenerator { + Register s, Register d, Register count, int step) { + copy_direction direction = step < 0 ? copy_backwards : copy_forwards; + bool is_backwards = step < 0; +- unsigned int granularity = uabs(step); ++ unsigned int granularity = g_uabs(step); + const Register t0 = r3, t1 = r4; + + // <= 80 (or 96 for SIMD) bytes do inline. Direction doesn't matter because we always +diff --git a/src/hotspot/cpu/riscv/assembler_riscv.hpp b/src/hotspot/cpu/riscv/assembler_riscv.hpp +index 24de7c15fe3..afb661e180d 100644 +--- a/src/hotspot/cpu/riscv/assembler_riscv.hpp ++++ b/src/hotspot/cpu/riscv/assembler_riscv.hpp +@@ -2913,7 +2913,7 @@ enum Nf { + static const unsigned long branch_range = 1 * M; + + static bool reachable_from_branch_at(address branch, address target) { +- return uabs(target - branch) < branch_range; ++ return g_uabs(target - branch) < branch_range; + } + + // Decode the given instruction, checking if it's a 16-bit compressed +diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +index 8c5e1c097ef..bc4d2e94414 100644 +--- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp ++++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +@@ -917,7 +917,7 @@ class StubGenerator: public StubCodeGenerator { + + void copy_memory_v(Register s, Register d, Register count, int step) { + bool is_backward = step < 0; +- int granularity = uabs(step); ++ int granularity = g_uabs(step); + + const Register src = x30, dst = x31, vl = x14, cnt = x15, tmp1 = x16, tmp2 = x17; + assert_different_registers(s, d, cnt, vl, tmp1, tmp2); +@@ -973,7 +973,7 @@ class StubGenerator: public StubCodeGenerator { + } + + bool is_backwards = step < 0; +- int granularity = uabs(step); ++ int granularity = g_uabs(step); + + const Register src = x30, dst = x31, cnt = x15, tmp3 = x16, tmp4 = x17, tmp5 = x14, tmp6 = x13; + const Register gct1 = x28, gct2 = x29, gct3 = t2; +diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp +index f42d06a3650..43d842173dd 100644 +--- a/src/hotspot/share/opto/mulnode.cpp ++++ b/src/hotspot/share/opto/mulnode.cpp +@@ -245,7 +245,7 @@ Node *MulINode::Ideal(PhaseGVN *phase, bool can_reshape) { + // Check for negative constant; if so negate the final result + bool sign_flip = false; + +- unsigned int abs_con = uabs(con); ++ unsigned int abs_con = g_uabs(con); + if (abs_con != (unsigned int)con) { + sign_flip = true; + } +@@ -480,7 +480,7 @@ Node *MulLNode::Ideal(PhaseGVN *phase, bool can_reshape) { + + // Check for negative constant; if so negate the final result + bool sign_flip = false; +- julong abs_con = uabs(con); ++ julong abs_con = g_uabs(con); + if (abs_con != (julong)con) { + sign_flip = true; + } +diff --git a/src/hotspot/share/opto/subnode.cpp b/src/hotspot/share/opto/subnode.cpp +index 8b2538f8ab5..c4a86d76506 100644 +--- a/src/hotspot/share/opto/subnode.cpp ++++ b/src/hotspot/share/opto/subnode.cpp +@@ -1899,14 +1899,14 @@ const Type* AbsNode::Value(PhaseGVN* phase) const { + case Type::Int: { + const TypeInt* ti = t1->is_int(); + if (ti->is_con()) { +- return TypeInt::make(uabs(ti->get_con())); ++ return TypeInt::make(g_uabs(ti->get_con())); + } + break; + } + case Type::Long: { + const TypeLong* tl = t1->is_long(); + if (tl->is_con()) { +- return TypeLong::make(uabs(tl->get_con())); ++ return TypeLong::make(g_uabs(tl->get_con())); + } + break; + } +diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp +index 0083442be6c..625fdcc414f 100644 +--- a/src/hotspot/share/utilities/globalDefinitions.hpp ++++ b/src/hotspot/share/utilities/globalDefinitions.hpp +@@ -1164,7 +1164,7 @@ inline bool is_even(intx x) { return !is_odd(x); } + + // abs methods which cannot overflow and so are well-defined across + // the entire domain of integer types. +-static inline unsigned int uabs(unsigned int n) { ++static inline unsigned int g_uabs(unsigned int n) { + union { + unsigned int result; + int value; +@@ -1173,7 +1173,7 @@ static inline unsigned int uabs(unsigned int n) { + if (value < 0) result = 0-result; + return result; + } +-static inline julong uabs(julong n) { ++static inline julong g_uabs(julong n) { + union { + julong result; + jlong value; +@@ -1182,8 +1182,8 @@ static inline julong uabs(julong n) { + if (value < 0) result = 0-result; + return result; + } +-static inline julong uabs(jlong n) { return uabs((julong)n); } +-static inline unsigned int uabs(int n) { return uabs((unsigned int)n); } ++static inline julong g_uabs(jlong n) { return g_uabs((julong)n); } ++static inline unsigned int g_uabs(int n) { return g_uabs((unsigned int)n); } + + // "to" should be greater than "from." + inline intx byte_size(void* from, void* to) { diff --git a/dev-java/openjdk/openjdk-11.0.28_p6.ebuild b/dev-java/openjdk/openjdk-11.0.28_p6.ebuild index e9031e5c1cf7..0690ffbd75ea 100644 --- a/dev-java/openjdk/openjdk-11.0.28_p6.ebuild +++ b/dev-java/openjdk/openjdk-11.0.28_p6.ebuild @@ -114,6 +114,8 @@ DEPEND=" ) " +PATCHES=( "${FILESDIR}/openjdk-11.0.28_p6-fixBuild_failure_with_glibc-2.42.patch" ) + # The space required to build varies wildly depending on USE flags, # ranging from 2GB to 16GB. This function is certainly not exact but # should be close enough to be useful. diff --git a/dev-java/openjdk/openjdk-17.0.16_p8.ebuild b/dev-java/openjdk/openjdk-17.0.16_p8.ebuild index 84ba59294f3b..13ebf1b1239d 100644 --- a/dev-java/openjdk/openjdk-17.0.16_p8.ebuild +++ b/dev-java/openjdk/openjdk-17.0.16_p8.ebuild @@ -114,6 +114,8 @@ DEPEND=" ) " +PATCHES=( "${FILESDIR}/openjdk-17.0.16_p8-fixBuild_failure_with_glibc-2.42.patch" ) + # The space required to build varies wildly depending on USE flags, # ranging from 2GB to 16GB. This function is certainly not exact but # should be close enough to be useful. diff --git a/dev-java/openjdk/openjdk-21.0.8_p9.ebuild b/dev-java/openjdk/openjdk-21.0.8_p9.ebuild index a27284c76795..ec15ef13a305 100644 --- a/dev-java/openjdk/openjdk-21.0.8_p9.ebuild +++ b/dev-java/openjdk/openjdk-21.0.8_p9.ebuild @@ -111,6 +111,8 @@ DEPEND=" ) " +PATCHES=( "${FILESDIR}/openjdk-21.0.8_p9-fixBuild_failure_with_glibc-2.42.patch" ) + # The space required to build varies wildly depending on USE flags, # ranging from 2GB to 16GB. This function is certainly not exact but # should be close enough to be useful. diff --git a/dev-java/rhino/rhino-1.8.0.ebuild b/dev-java/rhino/rhino-1.8.0.ebuild index 536c6c6b0984..4a73ddfc2659 100644 --- a/dev-java/rhino/rhino-1.8.0.ebuild +++ b/dev-java/rhino/rhino-1.8.0.ebuild @@ -3,11 +3,11 @@ EAPI=8 -# No tests, #839681 -JAVA_PKG_IUSE="doc source" MAVEN_ID="org.mozilla:rhino:${PV}" +JAVA_PKG_IUSE="doc source test" +JAVA_TESTING_FRAMEWORKS="junit-jupiter" -inherit java-pkg-2 java-pkg-simple +inherit java-pkg-2 java-pkg-simple junit5 DESCRIPTION="Rhino JavaScript runtime jar, excludes XML, tools, and ScriptEngine wrapper" HOMEPAGE="https://github.com/mozilla/rhino" @@ -21,7 +21,10 @@ KEYWORDS="amd64 arm64 ppc64" # error: package jdk.dynalink does not exist # error: package jdk.dynalink.linker does not exist # error: package jdk.dynalink.linker.support does not exist -DEPEND=">=virtual/jdk-11" +DEPEND=" + >=virtual/jdk-11 + test? ( dev-java/junit:4 ) +" # rhino/src/main/java/org/mozilla/javascript/Slot.java:29: error: cannot find symbol # var newSlot = new Slot(this); @@ -33,3 +36,6 @@ DOCS=( {CODE_OF_CONDUCT,README,RELEASE-NOTES,RELEASE-STEPS}.md {NOTICE-tools,NOT JAVA_RESOURCE_DIRS="rhino/src/main/resources" JAVA_SRC_DIR="rhino/src/main/java" +JAVA_TEST_GENTOO_CLASSPATH="junit-4 junit-5" +JAVA_TEST_RESOURCE_DIRS="rhino/src/test/resources" +JAVA_TEST_SRC_DIR=( {rhino/src/test,testutils/src/main}/java ) diff --git a/dev-java/xalan/xalan-2.7.3-r2.ebuild b/dev-java/xalan/xalan-2.7.3-r2.ebuild deleted file mode 100644 index 06f57ca47290..000000000000 --- a/dev-java/xalan/xalan-2.7.3-r2.ebuild +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -JAVA_PKG_IUSE="doc source" -MAVEN_ID="xalan:xalan:2.7.3" - -inherit java-pkg-2 java-pkg-simple verify-sig - -DESCRIPTION="Transforming XML documents into HTML, text, or other XML document types" -HOMEPAGE="https://xalan.apache.org/" -SRC_URI="mirror://apache/xalan/xalan-j/source/xalan-j_${PV//./_}-src.tar.gz - verify-sig? ( https://downloads.apache.org/xalan/xalan-j/source/xalan-j_${PV//./_}-src.tar.gz.asc ) - x86? ( https://www2.cs.tum.edu/projects/cup/releases/java-cup-bin-11b-20160615.tar.gz )" - -S="${WORKDIR}/xalan-j_${PV//./_}" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="amd64 arm64 ppc64 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" - -# https://bugs.gentoo.org/936274 - for x86 we provide the precompiled java-cup -COMMON_DEPEND=" - !x86? ( dev-java/javacup:0 ) -" - -CP_DEPEND=" - dev-java/bcel:0 - ~dev-java/xalan-serializer-${PV}:${SLOT} - dev-java/xerces:2 -" - -DEPEND=" - ${COMMON_DEPEND} - ${CP_DEPEND} - >=virtual/jdk-1.8:* -" - -RDEPEND=" - ${COMMON_DEPEND} - ${CP_DEPEND} - >=virtual/jre-1.8:* -" - -BDEPEND="verify-sig? ( sec-keys/openpgp-keys-apache-xalan-j )" -VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/xalan-j.apache.org.asc" - -JAVA_MAIN_CLASS="org.apache.xalan.xslt.Process" -JAVA_SRC_DIR="src" - -src_unpack() { - if use verify-sig; then - verify-sig_verify_detached \ - "${DISTDIR}/xalan-j_${PV//./_}-src.tar.gz" \ - "${DISTDIR}/xalan-j_${PV//./_}-src.tar.gz.asc" - fi - unpack "xalan-j_${PV//./_}-src.tar.gz" - use x86 && unpack java-cup-bin-11b-20160615.tar.gz -} - -src_prepare() { - java-pkg-2_src_prepare - # serializer is packaged separately - rm -r src/org/apache/xml/serializer || die "cannot remove serializer" - use !x86 && JAVA_GENTOO_CLASSPATH="javacup" - use x86 && JAVA_GENTOO_CLASSPATH_EXTRA="${WORKDIR}/java-cup-11b-runtime.jar:${WORKDIR}/java-cup-11b.jar" -} - -src_install() { - java-pkg-simple_src_install - if use x86; then - java-pkg_newjar "${WORKDIR}/java-cup-11b-runtime.jar" java-cup-runtime.jar - java-pkg_newjar "${WORKDIR}/java-cup-11b.jar" java-cup.jar - java-pkg_regjar "${ED}/usr/share/${PN}/lib/java-cup-runtime.jar" - java-pkg_regjar "${ED}/usr/share/${PN}/lib/java-cup.jar" - fi -} diff --git a/dev-java/xalan/xalan-2.7.3-r3.ebuild b/dev-java/xalan/xalan-2.7.3-r3.ebuild new file mode 100644 index 000000000000..2bf375f55979 --- /dev/null +++ b/dev-java/xalan/xalan-2.7.3-r3.ebuild @@ -0,0 +1,80 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source" +MAVEN_ID="xalan:xalan:2.7.3" + +inherit java-pkg-2 java-pkg-simple verify-sig + +DESCRIPTION="Transforming XML documents into HTML, text, or other XML document types" +HOMEPAGE="https://xalan.apache.org/" +SRC_URI="mirror://apache/xalan/xalan-j/source/xalan-j_${PV//./_}-src.tar.gz + verify-sig? ( https://downloads.apache.org/xalan/xalan-j/source/xalan-j_${PV//./_}-src.tar.gz.asc ) + x86? ( https://www2.cs.tum.edu/projects/cup/releases/java-cup-bin-11b-20160615.tar.gz )" + +S="${WORKDIR}/xalan-j_${PV//./_}" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="amd64 arm64 ppc64 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" + +# https://bugs.gentoo.org/936274 - for x86 we provide the precompiled java-cup +COMMON_DEPEND=" + !x86? ( dev-java/javacup:0 ) +" + +CP_DEPEND=" + dev-java/bcel:0 + ~dev-java/xalan-serializer-${PV}:${SLOT} + dev-java/xerces:2 +" + +# restrict to max Java 25 +# https://bugs.openjdk.org/browse/JDK-8359053 +DEPEND=" + ${COMMON_DEPEND} + ${CP_DEPEND} +