about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-12-12 18:09:57 +0100
committerGitHub <noreply@github.com>2023-12-12 18:09:57 +0100
commit8bdc624b2a85070de385eb8c6aa07be68c8d9e99 (patch)
tree63210c8a912fd3524701e14178ab4c17daaf4a1c /pkgs
parentfecc1aadc5f869127f45fe8121f5fcbba493cbc3 (diff)
parentf6da64f8dbd835774998ac336933d2a0147fa310 (diff)
downloadnixlib-8bdc624b2a85070de385eb8c6aa07be68c8d9e99.tar
nixlib-8bdc624b2a85070de385eb8c6aa07be68c8d9e99.tar.gz
nixlib-8bdc624b2a85070de385eb8c6aa07be68c8d9e99.tar.bz2
nixlib-8bdc624b2a85070de385eb8c6aa07be68c8d9e99.tar.lz
nixlib-8bdc624b2a85070de385eb8c6aa07be68c8d9e99.tar.xz
nixlib-8bdc624b2a85070de385eb8c6aa07be68c8d9e99.tar.zst
nixlib-8bdc624b2a85070de385eb8c6aa07be68c8d9e99.zip
Merge pull request #272924 from wegank/llvm-17-libclc
llvmPackages_17.libclc: init
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/llvm/16/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/17/default.nix6
-rw-r--r--pkgs/development/compilers/llvm/common/libclc.nix (renamed from pkgs/development/compilers/llvm/16/libclc/default.nix)5
-rw-r--r--pkgs/development/compilers/llvm/common/libclc/libclc-gnu-install-dirs.patch (renamed from pkgs/development/compilers/llvm/16/libclc/libclc-gnu-install-dirs.patch)0
4 files changed, 9 insertions, 4 deletions
diff --git a/pkgs/development/compilers/llvm/16/default.nix b/pkgs/development/compilers/llvm/16/default.nix
index 5ecb89a3a264..580821cc0d2c 100644
--- a/pkgs/development/compilers/llvm/16/default.nix
+++ b/pkgs/development/compilers/llvm/16/default.nix
@@ -281,7 +281,7 @@ in let
     # Has to be in tools despite mostly being a library,
     # because we use a native helper executable from a
     # non-cross build in cross builds.
-    libclc = callPackage ./libclc {
+    libclc = callPackage ../common/libclc.nix {
       inherit buildLlvmTools;
     };
   });
diff --git a/pkgs/development/compilers/llvm/17/default.nix b/pkgs/development/compilers/llvm/17/default.nix
index 8109f27586cb..2c422da8f9f8 100644
--- a/pkgs/development/compilers/llvm/17/default.nix
+++ b/pkgs/development/compilers/llvm/17/default.nix
@@ -269,6 +269,12 @@ in let
       nixSupport.cc-cflags = [ "-fno-exceptions" ];
     });
 
+    # Has to be in tools despite mostly being a library,
+    # because we use a native helper executable from a
+    # non-cross build in cross builds.
+    libclc = callPackage ../common/libclc.nix {
+      inherit buildLlvmTools;
+    };
   });
 
   libraries = lib.makeExtensible (libraries: let
diff --git a/pkgs/development/compilers/llvm/16/libclc/default.nix b/pkgs/development/compilers/llvm/common/libclc.nix
index 2ceca9aaf7fd..c91930963b20 100644
--- a/pkgs/development/compilers/llvm/16/libclc/default.nix
+++ b/pkgs/development/compilers/llvm/common/libclc.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   patches = [
-    ./libclc-gnu-install-dirs.patch
+    ./libclc/libclc-gnu-install-dirs.patch
   ];
 
   # cmake expects all required binaries to be in the same place, so it will not be able to find clang without the patch
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
       --replace 'find_program( LLVM_OPT opt PATHS ''${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )' \
                 'find_program( LLVM_OPT opt PATHS "${buildLlvmTools.llvm}/bin" NO_DEFAULT_PATH )' \
       --replace 'find_program( LLVM_SPIRV llvm-spirv PATHS ''${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )' \
-                'find_program( LLVM_SPIRV llvm-spirv PATHS "${buildPackages.spirv-llvm-translator}/bin" NO_DEFAULT_PATH )'
+                'find_program( LLVM_SPIRV llvm-spirv PATHS "${buildPackages.spirv-llvm-translator.override { inherit (buildLlvmTools) llvm; }}/bin" NO_DEFAULT_PATH )'
   '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     substituteInPlace CMakeLists.txt \
       --replace 'COMMAND prepare_builtins' 'COMMAND ${buildLlvmTools.libclc.dev}/bin/prepare_builtins'
@@ -45,7 +45,6 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
     homepage = "http://libclc.llvm.org/";
     description = "Implementation of the library requirements of the OpenCL C programming language";
     license = licenses.mit;
diff --git a/pkgs/development/compilers/llvm/16/libclc/libclc-gnu-install-dirs.patch b/pkgs/development/compilers/llvm/common/libclc/libclc-gnu-install-dirs.patch
index 1e5108a27c38..1e5108a27c38 100644
--- a/pkgs/development/compilers/llvm/16/libclc/libclc-gnu-install-dirs.patch
+++ b/pkgs/development/compilers/llvm/common/libclc/libclc-gnu-install-dirs.patch