about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/llvm/11/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/11/libcxx/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/11/libcxxabi/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/11/llvm/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/12/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/12/libcxx/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/12/libcxxabi/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/12/llvm/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/13/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/13/libcxx/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/13/llvm/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/14/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/14/libcxx/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/14/llvm/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/15/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/15/libcxx/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/15/llvm/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/16/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/16/llvm/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/17/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/17/llvm/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/9/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/9/libcxx/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/9/libcxxabi/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/9/llvm/default.nix6
-rw-r--r--pkgs/development/compilers/llvm/9/llvm/exegesis-force-bdver2.patch (renamed from pkgs/development/compilers/llvm/exegesis-force-bdver2.patch)0
-rw-r--r--pkgs/development/compilers/llvm/common/clang/clang-11-15-LLVMgold-path.patch (renamed from pkgs/development/compilers/llvm/clang-11-15-LLVMgold-path.patch)0
-rw-r--r--pkgs/development/compilers/llvm/common/clang/clang-6-10-LLVMgold-path.patch (renamed from pkgs/development/compilers/llvm/clang-6-10-LLVMgold-path.patch)0
-rw-r--r--pkgs/development/compilers/llvm/common/clang/clang-at-least-16-LLVMgold-path.patch (renamed from pkgs/development/compilers/llvm/clang-at-least-16-LLVMgold-path.patch)0
-rw-r--r--pkgs/development/compilers/llvm/common/libcxx/libcxx-0001-musl-hacks.patch (renamed from pkgs/development/compilers/llvm/libcxx-0001-musl-hacks.patch)0
-rw-r--r--pkgs/development/compilers/llvm/common/llvm/TLI-musl.patch (renamed from pkgs/development/compilers/llvm/TLI-musl.patch)0
-rw-r--r--pkgs/development/compilers/llvm/common/llvm/llvm-config-link-static.patch (renamed from pkgs/development/compilers/llvm/llvm-config-link-static.patch)0
-rw-r--r--pkgs/development/compilers/llvm/git/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/git/llvm/default.nix2
34 files changed, 32 insertions, 32 deletions
diff --git a/pkgs/development/compilers/llvm/11/clang/default.nix b/pkgs/development/compilers/llvm/11/clang/default.nix
index 5ddecd1f47e9..a31d0422f52b 100644
--- a/pkgs/development/compilers/llvm/11/clang/default.nix
+++ b/pkgs/development/compilers/llvm/11/clang/default.nix
@@ -50,7 +50,7 @@ let
       # https://reviews.llvm.org/D51899
       ./gnu-install-dirs.patch
       (substituteAll {
-        src = ../../clang-11-15-LLVMgold-path.patch;
+        src = ../../common/clang/clang-11-15-LLVMgold-path.patch;
         libllvmLibdir = "${libllvm.lib}/lib";
       })
     ];
diff --git a/pkgs/development/compilers/llvm/11/libcxx/default.nix b/pkgs/development/compilers/llvm/11/libcxx/default.nix
index 3e77e03b124b..10b8c00dd16a 100644
--- a/pkgs/development/compilers/llvm/11/libcxx/default.nix
+++ b/pkgs/development/compilers/llvm/11/libcxx/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
     })
     ./gnu-install-dirs.patch
   ] ++ lib.optionals stdenv.hostPlatform.isMusl [
-    ../../libcxx-0001-musl-hacks.patch
+    ../../common/libcxx/libcxx-0001-musl-hacks.patch
   ];
 
   # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz"
diff --git a/pkgs/development/compilers/llvm/11/libcxxabi/default.nix b/pkgs/development/compilers/llvm/11/libcxxabi/default.nix
index 8a0a18f67822..6c8487a2eb99 100644
--- a/pkgs/development/compilers/llvm/11/libcxxabi/default.nix
+++ b/pkgs/development/compilers/llvm/11/libcxxabi/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
   '' + lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
   '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -d libcxx -i ${../../libcxx-0001-musl-hacks.patch}
+    patch -p1 -d libcxx -i ${../../common/libcxx/libcxx-0001-musl-hacks.patch}
   '' + lib.optionalString stdenv.hostPlatform.isWasm ''
     patch -p1 -d llvm -i ${../../common/libcxxabi/wasm.patch}
   '';
diff --git a/pkgs/development/compilers/llvm/11/llvm/default.nix b/pkgs/development/compilers/llvm/11/llvm/default.nix
index 423b08396666..e71d63859a06 100644
--- a/pkgs/development/compilers/llvm/11/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/11/llvm/default.nix
@@ -86,7 +86,7 @@ in stdenv.mkDerivation (rec {
     # of the flags used for the normal LLVM build. To avoid the need for building
     # a native libLLVM.so (which would fail) we force llvm-config to be linked
     # statically against the necessary LLVM components always.
-    ../../llvm-config-link-static.patch
+    ../../common/llvm/llvm-config-link-static.patch
 
     ./gnu-install-dirs.patch
     # On older CPUs (e.g. Hydra/wendy) we'd be getting an error in this test.
@@ -149,7 +149,7 @@ in stdenv.mkDerivation (rec {
       --replace "Path.cpp" ""
     rm unittests/Support/Path.cpp
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../../TLI-musl.patch}
+    patch -p1 -i ${../../common/llvm/TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/12/clang/default.nix b/pkgs/development/compilers/llvm/12/clang/default.nix
index 28f976a26bdb..c482a8ee6875 100644
--- a/pkgs/development/compilers/llvm/12/clang/default.nix
+++ b/pkgs/development/compilers/llvm/12/clang/default.nix
@@ -47,7 +47,7 @@ let
       # https://reviews.llvm.org/D51899
       ./gnu-install-dirs.patch
       (substituteAll {
-        src = ../../clang-11-15-LLVMgold-path.patch;
+        src = ../../common/clang/clang-11-15-LLVMgold-path.patch;
         libllvmLibdir = "${libllvm.lib}/lib";
       })
     ];
diff --git a/pkgs/development/compilers/llvm/12/libcxx/default.nix b/pkgs/development/compilers/llvm/12/libcxx/default.nix
index 40bff3c1168b..67e2aed35cb6 100644
--- a/pkgs/development/compilers/llvm/12/libcxx/default.nix
+++ b/pkgs/development/compilers/llvm/12/libcxx/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   patches = [
     ./gnu-install-dirs.patch
   ] ++ lib.optionals stdenv.hostPlatform.isMusl [
-    ../../libcxx-0001-musl-hacks.patch
+    ../../common/libcxx/libcxx-0001-musl-hacks.patch
   ];
 
   preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
diff --git a/pkgs/development/compilers/llvm/12/libcxxabi/default.nix b/pkgs/development/compilers/llvm/12/libcxxabi/default.nix
index 78a4a68d6a16..5ebb77ad3880 100644
--- a/pkgs/development/compilers/llvm/12/libcxxabi/default.nix
+++ b/pkgs/development/compilers/llvm/12/libcxxabi/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
   '' + lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
   '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -d libcxx -i ${../../libcxx-0001-musl-hacks.patch}
+    patch -p1 -d libcxx -i ${../../common/libcxx/libcxx-0001-musl-hacks.patch}
   '' + lib.optionalString stdenv.hostPlatform.isWasm ''
     patch -p1 -d llvm -i ${../../common/libcxxabi/wasm.patch}
   '';
diff --git a/pkgs/development/compilers/llvm/12/llvm/default.nix b/pkgs/development/compilers/llvm/12/llvm/default.nix
index 3263c4ddaf35..3ac3ee24aec4 100644
--- a/pkgs/development/compilers/llvm/12/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/12/llvm/default.nix
@@ -87,7 +87,7 @@ in stdenv.mkDerivation (rec {
     # of the flags used for the normal LLVM build. To avoid the need for building
     # a native libLLVM.so (which would fail) we force llvm-config to be linked
     # statically against the necessary LLVM components always.
-    ../../llvm-config-link-static.patch
+    ../../common/llvm/llvm-config-link-static.patch
     # Fix llvm being miscompiled by some gccs. See llvm/llvm-project#49955
     # Fix llvm being miscompiled by some gccs. See https://github.com/llvm/llvm-project/issues/49955
     ./fix-llvm-issue-49955.patch
@@ -138,7 +138,7 @@ in stdenv.mkDerivation (rec {
     # TODO: Fix failing tests:
     rm test/DebugInfo/X86/vla-multi.ll
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../../TLI-musl.patch}
+    patch -p1 -i ${../../common/llvm/TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/13/clang/default.nix b/pkgs/development/compilers/llvm/13/clang/default.nix
index 7673c903e71c..2d02ffb60b36 100644
--- a/pkgs/development/compilers/llvm/13/clang/default.nix
+++ b/pkgs/development/compilers/llvm/13/clang/default.nix
@@ -43,7 +43,7 @@ let
       ./revert-malloc-alignment-assumption.patch
       ../../common/clang/add-nostdlibinc-flag.patch
       (substituteAll {
-        src = ../../clang-11-15-LLVMgold-path.patch;
+        src = ../../common/clang/clang-11-15-LLVMgold-path.patch;
         libllvmLibdir = "${libllvm.lib}/lib";
       })
     ];
diff --git a/pkgs/development/compilers/llvm/13/libcxx/default.nix b/pkgs/development/compilers/llvm/13/libcxx/default.nix
index 994ec7dd5a56..2974fc80e191 100644
--- a/pkgs/development/compilers/llvm/13/libcxx/default.nix
+++ b/pkgs/development/compilers/llvm/13/libcxx/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   patches = [
     ./gnu-install-dirs.patch
   ] ++ lib.optionals stdenv.hostPlatform.isMusl [
-    ../../libcxx-0001-musl-hacks.patch
+    ../../common/libcxx/libcxx-0001-musl-hacks.patch
   ];
 
   preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
diff --git a/pkgs/development/compilers/llvm/13/llvm/default.nix b/pkgs/development/compilers/llvm/13/llvm/default.nix
index 1e71cdd89c6c..faebfb6e2bfd 100644
--- a/pkgs/development/compilers/llvm/13/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/13/llvm/default.nix
@@ -81,7 +81,7 @@ in stdenv.mkDerivation (rec {
     # of the flags used for the normal LLVM build. To avoid the need for building
     # a native libLLVM.so (which would fail) we force llvm-config to be linked
     # statically against the necessary LLVM components always.
-    ../../llvm-config-link-static.patch
+    ../../common/llvm/llvm-config-link-static.patch
 
     ./gnu-install-dirs.patch
 
@@ -128,7 +128,7 @@ in stdenv.mkDerivation (rec {
     rm unittests/IR/PassBuilderCallbacksTest.cpp
     rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../../TLI-musl.patch}
+    patch -p1 -i ${../../common/llvm/TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/14/clang/default.nix b/pkgs/development/compilers/llvm/14/clang/default.nix
index f63f55cfa546..829edb15d600 100644
--- a/pkgs/development/compilers/llvm/14/clang/default.nix
+++ b/pkgs/development/compilers/llvm/14/clang/default.nix
@@ -46,7 +46,7 @@ let
       ./gnu-install-dirs.patch
       ../../common/clang/add-nostdlibinc-flag.patch
       (substituteAll {
-        src = ../../clang-11-15-LLVMgold-path.patch;
+        src = ../../common/clang/clang-11-15-LLVMgold-path.patch;
         libllvmLibdir = "${libllvm.lib}/lib";
       })
     ];
diff --git a/pkgs/development/compilers/llvm/14/libcxx/default.nix b/pkgs/development/compilers/llvm/14/libcxx/default.nix
index 3e42a8b1e43c..ad9e82291cde 100644
--- a/pkgs/development/compilers/llvm/14/libcxx/default.nix
+++ b/pkgs/development/compilers/llvm/14/libcxx/default.nix
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
   patches = [
     ./gnu-install-dirs.patch
   ] ++ lib.optionals stdenv.hostPlatform.isMusl [
-    ../../libcxx-0001-musl-hacks.patch
+    ../../common/libcxx/libcxx-0001-musl-hacks.patch
   ];
 
   preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
diff --git a/pkgs/development/compilers/llvm/14/llvm/default.nix b/pkgs/development/compilers/llvm/14/llvm/default.nix
index eab49d326ad4..caef58615fce 100644
--- a/pkgs/development/compilers/llvm/14/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/14/llvm/default.nix
@@ -110,7 +110,7 @@ in stdenv.mkDerivation (rec {
     rm unittests/IR/PassBuilderCallbacksTest.cpp
     rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../../TLI-musl.patch}
+    patch -p1 -i ${../../common/llvm/TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/15/clang/default.nix b/pkgs/development/compilers/llvm/15/clang/default.nix
index 9ec15a393004..de789edaa9ff 100644
--- a/pkgs/development/compilers/llvm/15/clang/default.nix
+++ b/pkgs/development/compilers/llvm/15/clang/default.nix
@@ -52,7 +52,7 @@ let
       ./gnu-install-dirs.patch
       ../../common/clang/add-nostdlibinc-flag.patch
       (substituteAll {
-        src = ../../clang-11-15-LLVMgold-path.patch;
+        src = ../../common/clang/clang-11-15-LLVMgold-path.patch;
         libllvmLibdir = "${libllvm.lib}/lib";
       })
     ];
diff --git a/pkgs/development/compilers/llvm/15/libcxx/default.nix b/pkgs/development/compilers/llvm/15/libcxx/default.nix
index be56770039d8..6a055581fffd 100644
--- a/pkgs/development/compilers/llvm/15/libcxx/default.nix
+++ b/pkgs/development/compilers/llvm/15/libcxx/default.nix
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
       relative = "libcxx";
     })
   ] ++ lib.optionals stdenv.hostPlatform.isMusl [
-    ../../libcxx-0001-musl-hacks.patch
+    ../../common/libcxx/libcxx-0001-musl-hacks.patch
   ];
 
   postPatch = ''
diff --git a/pkgs/development/compilers/llvm/15/llvm/default.nix b/pkgs/development/compilers/llvm/15/llvm/default.nix
index 4f17678ba14f..7f1232d57a18 100644
--- a/pkgs/development/compilers/llvm/15/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/15/llvm/default.nix
@@ -230,7 +230,7 @@ in stdenv.mkDerivation (rec {
     # timing-based tests are trouble
     rm utils/lit/tests/googletest-timeout.py
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../../TLI-musl.patch}
+    patch -p1 -i ${../../common/llvm/TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/16/clang/default.nix b/pkgs/development/compilers/llvm/16/clang/default.nix
index 43c497b92761..c5d9af356d9e 100644
--- a/pkgs/development/compilers/llvm/16/clang/default.nix
+++ b/pkgs/development/compilers/llvm/16/clang/default.nix
@@ -52,7 +52,7 @@ let
       ./gnu-install-dirs.patch
       ../../common/clang/add-nostdlibinc-flag.patch
       (substituteAll {
-        src = ../../clang-at-least-16-LLVMgold-path.patch;
+        src = ../../common/clang/clang-at-least-16-LLVMgold-path.patch;
        libllvmLibdir = "${libllvm.lib}/lib";
       })
     ];
diff --git a/pkgs/development/compilers/llvm/16/llvm/default.nix b/pkgs/development/compilers/llvm/16/llvm/default.nix
index 73fb6a785413..661866c1890b 100644
--- a/pkgs/development/compilers/llvm/16/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/16/llvm/default.nix
@@ -223,7 +223,7 @@ in
     # timing-based tests are trouble
     rm utils/lit/tests/googletest-timeout.py
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../../TLI-musl.patch}
+    patch -p1 -i ${../../common/llvm/TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/17/clang/default.nix b/pkgs/development/compilers/llvm/17/clang/default.nix
index f2f114233c28..f7922f3d9951 100644
--- a/pkgs/development/compilers/llvm/17/clang/default.nix
+++ b/pkgs/development/compilers/llvm/17/clang/default.nix
@@ -53,7 +53,7 @@ let
       ./gnu-install-dirs.patch
       ../../common/clang/add-nostdlibinc-flag.patch
       (substituteAll {
-        src = ../../clang-at-least-16-LLVMgold-path.patch;
+        src = ../../common/clang/clang-at-least-16-LLVMgold-path.patch;
        libllvmLibdir = "${libllvm.lib}/lib";
       })
     ];
diff --git a/pkgs/development/compilers/llvm/17/llvm/default.nix b/pkgs/development/compilers/llvm/17/llvm/default.nix
index 627679ce812f..2c5d6aeb5cec 100644
--- a/pkgs/development/compilers/llvm/17/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/17/llvm/default.nix
@@ -220,7 +220,7 @@ stdenv.mkDerivation (rec {
     rm unittests/IR/PassBuilderCallbacksTest.cpp
     rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../../TLI-musl.patch}
+    patch -p1 -i ${../../common/llvm/TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/9/clang/default.nix b/pkgs/development/compilers/llvm/9/clang/default.nix
index e8a2a4bd0db1..37138b13bd4c 100644
--- a/pkgs/development/compilers/llvm/9/clang/default.nix
+++ b/pkgs/development/compilers/llvm/9/clang/default.nix
@@ -52,7 +52,7 @@ let
       ./HIP-use-PATH-9.patch
       ./gnu-install-dirs.patch
       (substituteAll {
-        src = ../../clang-6-10-LLVMgold-path.patch;
+        src = ../../common/clang/clang-6-10-LLVMgold-path.patch;
         libllvmLibdir = "${libllvm.lib}/lib";
       })
     ];
diff --git a/pkgs/development/compilers/llvm/9/libcxx/default.nix b/pkgs/development/compilers/llvm/9/libcxx/default.nix
index ec09998ed37d..65f0e19225a5 100644
--- a/pkgs/development/compilers/llvm/9/libcxx/default.nix
+++ b/pkgs/development/compilers/llvm/9/libcxx/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
   patches = [
     ./gnu-install-dirs.patch
   ] ++ lib.optionals stdenv.hostPlatform.isMusl [
-    ../../libcxx-0001-musl-hacks.patch
+    ../../common/libcxx/libcxx-0001-musl-hacks.patch
   ];
 
   # Prevent errors like "error: 'foo' is unavailable: introduced in macOS yy.zz"
diff --git a/pkgs/development/compilers/llvm/9/libcxxabi/default.nix b/pkgs/development/compilers/llvm/9/libcxxabi/default.nix
index 24d89b1a2da5..7d4a83db390b 100644
--- a/pkgs/development/compilers/llvm/9/libcxxabi/default.nix
+++ b/pkgs/development/compilers/llvm/9/libcxxabi/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   '' + lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
   '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch}
+    patch -p1 -d $(ls -d libcxx-*) -i ${../../common/libcxx/libcxx-0001-musl-hacks.patch}
   '' + lib.optionalString stdenv.hostPlatform.isWasm ''
     patch -p1 -d $(ls -d llvm-*) -i ${../../common/libcxxabi/wasm.patch}
   '';
diff --git a/pkgs/development/compilers/llvm/9/llvm/default.nix b/pkgs/development/compilers/llvm/9/llvm/default.nix
index c0ef7801c348..7d5e8389eba9 100644
--- a/pkgs/development/compilers/llvm/9/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/9/llvm/default.nix
@@ -86,12 +86,12 @@ in stdenv.mkDerivation (rec {
     # of the flags used for the normal LLVM build. To avoid the need for building
     # a native libLLVM.so (which would fail) we force llvm-config to be linked
     # statically against the necessary LLVM components always.
-    ../../llvm-config-link-static.patch
+    ../../common/llvm/llvm-config-link-static.patch
 
     ./gnu-install-dirs.patch
     # Force a test to evaluate the saved benchmark for a CPU for which LLVM has
     # an execution model. See NixOS/nixpkgs#119673.
-    ../../exegesis-force-bdver2.patch
+    ./exegesis-force-bdver2.patch
 
     # Fix missing includes for GCC 11
     (fetchpatch {
@@ -137,7 +137,7 @@ in stdenv.mkDerivation (rec {
       --replace "Path.cpp" ""
     rm unittests/Support/Path.cpp
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../../TLI-musl.patch}
+    patch -p1 -i ${../../common/llvm/TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/exegesis-force-bdver2.patch b/pkgs/development/compilers/llvm/9/llvm/exegesis-force-bdver2.patch
index c2654153ed5a..c2654153ed5a 100644
--- a/pkgs/development/compilers/llvm/exegesis-force-bdver2.patch
+++ b/pkgs/development/compilers/llvm/9/llvm/exegesis-force-bdver2.patch
diff --git a/pkgs/development/compilers/llvm/clang-11-15-LLVMgold-path.patch b/pkgs/development/compilers/llvm/common/clang/clang-11-15-LLVMgold-path.patch
index 8f8991976f33..8f8991976f33 100644
--- a/pkgs/development/compilers/llvm/clang-11-15-LLVMgold-path.patch
+++ b/pkgs/development/compilers/llvm/common/clang/clang-11-15-LLVMgold-path.patch
diff --git a/pkgs/development/compilers/llvm/clang-6-10-LLVMgold-path.patch b/pkgs/development/compilers/llvm/common/clang/clang-6-10-LLVMgold-path.patch
index 93504316edf3..93504316edf3 100644
--- a/pkgs/development/compilers/llvm/clang-6-10-LLVMgold-path.patch
+++ b/pkgs/development/compilers/llvm/common/clang/clang-6-10-LLVMgold-path.patch
diff --git a/pkgs/development/compilers/llvm/clang-at-least-16-LLVMgold-path.patch b/pkgs/development/compilers/llvm/common/clang/clang-at-least-16-LLVMgold-path.patch
index 74cdbacc8a71..74cdbacc8a71 100644
--- a/pkgs/development/compilers/llvm/clang-at-least-16-LLVMgold-path.patch
+++ b/pkgs/development/compilers/llvm/common/clang/clang-at-least-16-LLVMgold-path.patch
diff --git a/pkgs/development/compilers/llvm/libcxx-0001-musl-hacks.patch b/pkgs/development/compilers/llvm/common/libcxx/libcxx-0001-musl-hacks.patch
index bcb5ad8cfb87..bcb5ad8cfb87 100644
--- a/pkgs/development/compilers/llvm/libcxx-0001-musl-hacks.patch
+++ b/pkgs/development/compilers/llvm/common/libcxx/libcxx-0001-musl-hacks.patch
diff --git a/pkgs/development/compilers/llvm/TLI-musl.patch b/pkgs/development/compilers/llvm/common/llvm/TLI-musl.patch
index 1a6908086637..1a6908086637 100644
--- a/pkgs/development/compilers/llvm/TLI-musl.patch
+++ b/pkgs/development/compilers/llvm/common/llvm/TLI-musl.patch
diff --git a/pkgs/development/compilers/llvm/llvm-config-link-static.patch b/pkgs/development/compilers/llvm/common/llvm/llvm-config-link-static.patch
index 3881cc5206e2..3881cc5206e2 100644
--- a/pkgs/development/compilers/llvm/llvm-config-link-static.patch
+++ b/pkgs/development/compilers/llvm/common/llvm/llvm-config-link-static.patch
diff --git a/pkgs/development/compilers/llvm/git/clang/default.nix b/pkgs/development/compilers/llvm/git/clang/default.nix
index eea346ef22ef..01b33c540ca2 100644
--- a/pkgs/development/compilers/llvm/git/clang/default.nix
+++ b/pkgs/development/compilers/llvm/git/clang/default.nix
@@ -54,7 +54,7 @@ let
       ./gnu-install-dirs.patch
       ../../common/clang/add-nostdlibinc-flag.patch
       (substituteAll {
-        src = ../../clang-at-least-16-LLVMgold-path.patch;
+        src = ../../common/clang/clang-at-least-16-LLVMgold-path.patch;
        libllvmLibdir = "${libllvm.lib}/lib";
       })
     ];
diff --git a/pkgs/development/compilers/llvm/git/llvm/default.nix b/pkgs/development/compilers/llvm/git/llvm/default.nix
index 3c52b7a9bb0b..b8cef2287806 100644
--- a/pkgs/development/compilers/llvm/git/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/git/llvm/default.nix
@@ -224,7 +224,7 @@ stdenv.mkDerivation (rec {
     rm unittests/IR/PassBuilderCallbacksTest.cpp
     rm test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../../TLI-musl.patch}
+    patch -p1 -i ${../../common/llvm/TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp