From d32e0e6b1b6c308c28f954685cf63cf176db02af Mon Sep 17 00:00:00 2001 From: Divam Date: Thu, 23 Sep 2021 09:17:31 +0900 Subject: [PATCH] llvmPackages_13.lld: add postPatch to fix Darwin build --- pkgs/development/compilers/llvm/13/lld/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/compilers/llvm/13/lld/default.nix b/pkgs/development/compilers/llvm/13/lld/default.nix index 34ac265f4bfd..2b5e9e965d07 100644 --- a/pkgs/development/compilers/llvm/13/lld/default.nix +++ b/pkgs/development/compilers/llvm/13/lld/default.nix @@ -18,6 +18,14 @@ stdenv.mkDerivation rec { ./gnu-install-dirs.patch ]; + # On Darwin the llvm-config is perhaps not working fine as the + # LLVM_MAIN_SRC_DIR is not getting set correctly, and the build fails as the + # include path is not correct. + postPatch = lib.optionalString stdenv.isDarwin '' + substituteInPlace MachO/CMakeLists.txt --replace \ + '(''${LLVM_MAIN_SRC_DIR}/' '(../' + ''; + nativeBuildInputs = [ cmake ]; buildInputs = [ libllvm libxml2 ];