From 92f4286cd892b29b594c76193e76e8e3f3583da3 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 15 Sep 2024 12:48:06 +0200 Subject: [PATCH] llvm{17,18}: fix build w/ glibc-2.40 See https://github.com/llvm/llvm-project/pull/100804 for further context. Tests for LLVM 12 to 16 pass fine without this change (the entire section of the test doesn't exist there), our LLVM 19 already has the patch applied. --- pkgs/development/compilers/llvm/common/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/llvm/common/default.nix b/pkgs/development/compilers/llvm/common/default.nix index 1c56e0f6f4c1..0369b7186974 100644 --- a/pkgs/development/compilers/llvm/common/default.nix +++ b/pkgs/development/compilers/llvm/common/default.nix @@ -480,7 +480,18 @@ let stripLen = 1; hash = "sha256-fqw5gTSEOGs3kAguR4tINFG7Xja1RAje+q67HJt2nGg="; }) - ]; + ] + ++ + lib.optionals + (lib.versionAtLeast metadata.release_version "17" && lib.versionOlder metadata.release_version "19") + [ + # Fixes test-suite on glibc 2.40 (https://github.com/llvm/llvm-project/pull/100804) + (fetchpatch2 { + url = "https://github.com/llvm/llvm-project/commit/1e8df9e85a1ff213e5868bd822877695f27504ad.patch"; + hash = "sha256-EX+PYGicK73lsL/J0kSZ4S5y1/NHIclBddhsnV6NPPI="; + stripLen = 1; + }) + ]; pollyPatches = [ (metadata.getVersionFile "llvm/gnu-install-dirs-polly.patch") ] ++ lib.optional (lib.versionAtLeast metadata.release_version "15")