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 = ''