From fcc44e9aeae563b9beea171ef47d1a11dd117d12 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 30 Oct 2023 11:03:20 +0100 Subject: llvmPackages_12.openmp,llvmPackages_13.openmp: fix cross CMake commit faa950a155 ("try_compile: Run native build tool with verbose output") did not play well with these versions of openmp, which have a faulty failure regex that considers "unknown" in the build output to indicate a failure. When cross compiling, the string "unknown" is very likely to occur as part of triples. Fix by backporting a patch that improves the failure regex check to not be tripped up by triples. The same problem affects LLVM 11 and possibly earlier, but the patch doesn't apply that far back, so I didn't bother for now. Fixes: b8ac5b6cfbc7 ("cmake: 3.25.3 -> 3.26.4") --- pkgs/development/compilers/llvm/12/openmp/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pkgs/development/compilers/llvm/12') diff --git a/pkgs/development/compilers/llvm/12/openmp/default.nix b/pkgs/development/compilers/llvm/12/openmp/default.nix index e0bcf03e00e3a..6040f3d1621a9 100644 --- a/pkgs/development/compilers/llvm/12/openmp/default.nix +++ b/pkgs/development/compilers/llvm/12/openmp/default.nix @@ -2,6 +2,7 @@ , stdenv , llvm_meta , fetch +, fetchpatch , cmake , llvm , targetLlvm @@ -15,6 +16,16 @@ stdenv.mkDerivation rec { src = fetch pname "14dh0r6h2xh747ffgnsl4z08h0ri04azi9vf79cbz7ma1r27kzk0"; + patches = [ + # Fix cross. + (fetchpatch { + url = "https://github.com/llvm/llvm-project/commit/5e2358c781b85a18d1463fd924d2741d4ae5e42e.patch"; + hash = "sha256-UxIlAifXnexF/MaraPW0Ut6q+sf3e7y1fMdEv1q103A="; + }) + ]; + + patchFlags = [ "-p2" ]; + nativeBuildInputs = [ cmake perl ]; buildInputs = [ (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm) -- cgit 1.4.1