about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm/12
diff options
context:
space:
mode:
authorTristan Ross <tristan.ross@midstall.com>2024-03-28 11:28:13 -0700
committerTristan Ross <tristan.ross@midstall.com>2024-04-12 07:22:03 -0700
commit8c71431f1414fcddcbf6b41c4d8d76b4f01853fb (patch)
tree512c6500fc3f18b215d70667922aa6381ab01293 /pkgs/development/compilers/llvm/12
parent8a9bde698902d452fa06d0d0c737951316bccb84 (diff)
llvmPackages_{12,13,14,15,16,17,18,git}: use common openmp
Diffstat (limited to 'pkgs/development/compilers/llvm/12')
-rw-r--r--pkgs/development/compilers/llvm/12/default.nix11
-rw-r--r--pkgs/development/compilers/llvm/12/openmp/default.nix48
2 files changed, 10 insertions, 49 deletions
diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix
index bd87dc5f34f03..d9b1b7bb83f50 100644
--- a/pkgs/development/compilers/llvm/12/default.nix
+++ b/pkgs/development/compilers/llvm/12/default.nix
@@ -1,5 +1,6 @@
 { lowPrio, newScope, pkgs, lib, stdenv, cmake
 , preLibcCrossHeaders
+, fetchpatch
 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildLlvmTools # tools, but from the previous stage, for cross
 , targetLlvmLibraries # libraries, but from the next stage, for cross
@@ -264,7 +265,15 @@ let
       stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx;
     };
 
-    openmp = callPackage ./openmp {
+    openmp = callPackage ../common/openmp {
+      src = fetch "openmp" "14dh0r6h2xh747ffgnsl4z08h0ri04azi9vf79cbz7ma1r27kzk0";
+      patches = [
+        # Fix cross.
+        (fetchpatch {
+          url = "https://github.com/llvm/llvm-project/commit/5e2358c781b85a18d1463fd924d2741d4ae5e42e.patch";
+          hash = "sha256-UxIlAifXnexF/MaraPW0Ut6q+sf3e7y1fMdEv1q103A=";
+        })
+      ];
       inherit llvm_meta targetLlvm;
     };
   });
diff --git a/pkgs/development/compilers/llvm/12/openmp/default.nix b/pkgs/development/compilers/llvm/12/openmp/default.nix
deleted file mode 100644
index 6040f3d1621a9..0000000000000
--- a/pkgs/development/compilers/llvm/12/openmp/default.nix
+++ /dev/null
@@ -1,48 +0,0 @@
-{ lib
-, stdenv
-, llvm_meta
-, fetch
-, fetchpatch
-, cmake
-, llvm
-, targetLlvm
-, perl
-, version
-}:
-
-stdenv.mkDerivation rec {
-  pname = "openmp";
-  inherit version;
-
-  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)
-  ];
-
-  meta = llvm_meta // {
-    homepage = "https://openmp.llvm.org/";
-    description = "Support for the OpenMP language";
-    longDescription = ''
-      The OpenMP subproject of LLVM contains the components required to build an
-      executable OpenMP program that are outside the compiler itself.
-      Contains the code for the runtime library against which code compiled by
-      "clang -fopenmp" must be linked before it can run and the library that
-      supports offload to target devices.
-    '';
-    # "All of the code is dual licensed under the MIT license and the UIUC
-    # License (a BSD-like license)":
-    license = with lib.licenses; [ mit ncsa ];
-  };
-}