From ebb1e5959552cd88f1098565970eb3e490de2441 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 26 Sep 2025 18:26:49 +0200 Subject: [PATCH] jdk8: fix build w/ glibc-2.42 Failing Hydra build: https://hydra.nixos.org/build/308320851 Upstream bug report: https://bugs.openjdk.org/browse/JDK-8354941 Only patching JDK8, newer versions received backports. --- pkgs/development/compilers/openjdk/generic.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/compilers/openjdk/generic.nix b/pkgs/development/compilers/openjdk/generic.nix index 1deaf765d57c..f4dac2209f92 100644 --- a/pkgs/development/compilers/openjdk/generic.nix +++ b/pkgs/development/compilers/openjdk/generic.nix @@ -481,6 +481,18 @@ stdenv.mkDerivation (finalAttrs: { + lib.optionalString atLeast25 '' chmod +x make/scripts/*.{template,sh,pl} patchShebangs --build make/scripts + '' + + lib.optionalString (!atLeast11) '' + # Fix build w/ glibc-2.42. Oldest backport target of this fix was + # JDK 11. + # See https://bugs.openjdk.org/browse/JDK-8354941 + substituteInPlace \ + hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp \ + hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp \ + hotspot/src/cpu/aarch64/vm/assembler_aarch64.cpp \ + hotspot/src/share/vm/opto/mulnode.cpp \ + hotspot/src/share/vm/utilities/globalDefinitions.hpp \ + --replace-fail "uabs" "g_uabs" ''; installPhase = ''