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 ];