summary refs log tree commit diff
path: root/pkgs/development/libraries/opencl-clang/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/opencl-clang/default.nix')
-rw-r--r--pkgs/development/libraries/opencl-clang/default.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkgs/development/libraries/opencl-clang/default.nix b/pkgs/development/libraries/opencl-clang/default.nix
index c40fb9c1203..48c681973d1 100644
--- a/pkgs/development/libraries/opencl-clang/default.nix
+++ b/pkgs/development/libraries/opencl-clang/default.nix
@@ -76,6 +76,13 @@ let
         ./opencl-headers-dir.patch
       ];
 
+      # Uses linker flags that are not supported on Darwin.
+      postPatch = lib.optionalString stdenv.isDarwin ''
+        sed -i -e '/SET_LINUX_EXPORTS_FILE/d' CMakeLists.txt
+        substituteInPlace CMakeLists.txt \
+          --replace '-Wl,--no-undefined' ""
+      '';
+
       nativeBuildInputs = [ cmake git llvm.dev ];
 
       buildInputs = [ libclang llvm spirv-llvm-translator ];