From 5afd15a2affe2229585109b1a5f039d604d30467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Tue, 18 May 2021 11:10:39 +0200 Subject: [PATCH] opencl-clang: fix darwin build --- pkgs/development/libraries/opencl-clang/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) 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 ];