about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm/common/clang/default.nix
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2024-05-03 17:36:08 +0200
committerVladimír Čunát <v@cunat.cz>2024-05-03 17:36:08 +0200
commite96601ecf084d9d6a366a4f0da7f36479f67f81e (patch)
treedbfe3d477ed9bee7adb03c76ae5fecce043fb9bf /pkgs/development/compilers/llvm/common/clang/default.nix
parent1aae0909b02ffb4d0d4a45db322df7a8c9fdd34e (diff)
parent2544167a82ff99e00a8de68fa529701a30648128 (diff)
Merge #306080: staging-next 2024-04-22
Diffstat (limited to 'pkgs/development/compilers/llvm/common/clang/default.nix')
-rw-r--r--pkgs/development/compilers/llvm/common/clang/default.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/development/compilers/llvm/common/clang/default.nix b/pkgs/development/compilers/llvm/common/clang/default.nix
index 2373795b49fd8..58af0340a1399 100644
--- a/pkgs/development/compilers/llvm/common/clang/default.nix
+++ b/pkgs/development/compilers/llvm/common/clang/default.nix
@@ -71,7 +71,11 @@ let
       "-DCLANG_PSEUDO_GEN=${buildLlvmTools.libclang.dev}/bin/clang-pseudo-gen"
     ]);
 
-    postPatch = (if lib.versionOlder release_version "13" then ''
+    postPatch = ''
+      # Make sure clang passes the correct location of libLTO to ld64
+      substituteInPlace lib/Driver/ToolChains/Darwin.cpp \
+        --replace-fail 'StringRef P = llvm::sys::path::parent_path(D.Dir);' 'StringRef P = "${lib.getLib libllvm}";'
+    '' + (if lib.versionOlder release_version "13" then ''
       sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
              -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
              lib/Driver/ToolChains/*.cpp