about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-10-30 11:03:20 +0100
committerAlyssa Ross <hi@alyssa.is>2023-10-30 13:04:51 +0100
commitfcc44e9aeae563b9beea171ef47d1a11dd117d12 (patch)
treec3593c9f84c81fb33a8fa07d2f56455f3f5a9a8d /pkgs/development/compilers/llvm
parent1d9a88ae853051fc765ce1e131c6dd60d6dd0395 (diff)
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")
Diffstat (limited to 'pkgs/development/compilers/llvm')
-rw-r--r--pkgs/development/compilers/llvm/12/openmp/default.nix11
-rw-r--r--pkgs/development/compilers/llvm/13/openmp/default.nix11
2 files changed, 22 insertions, 0 deletions
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)
diff --git a/pkgs/development/compilers/llvm/13/openmp/default.nix b/pkgs/development/compilers/llvm/13/openmp/default.nix
index 8eca980d601cc..7b461df438f9a 100644
--- a/pkgs/development/compilers/llvm/13/openmp/default.nix
+++ b/pkgs/development/compilers/llvm/13/openmp/default.nix
@@ -2,6 +2,7 @@
 , stdenv
 , llvm_meta
 , src
+, fetchpatch
 , cmake
 , llvm
 , targetLlvm
@@ -16,6 +17,16 @@ stdenv.mkDerivation rec {
   inherit src;
   sourceRoot = "${src.name}/${pname}";
 
+  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)