llvmPackages: move patches to proper folders (#287092)

* llvmPackages: move clang-*-LLVMgold-path.patch to common/clang

* llvmPackages: move exegesis-force-bdver2.patch to 9/llvm

* llvmPackages: move llvm-config-link-static.patch to common/llvm

* llvmPackages: move TLI-musl.patch to common/llvm

* llvmPackages: move libcxx-0001-musl-hacks.patch to common/llvm

+1 -1
pkgs/development/compilers/llvm/11/clang/default.nix
···
# 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";
})
];
+1 -1
pkgs/development/compilers/llvm/11/libcxx/default.nix
···
})
./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"
+1 -1
pkgs/development/compilers/llvm/11/libcxxabi/default.nix
···
'' + 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}
'';
+2 -2
pkgs/development/compilers/llvm/11/llvm/default.nix
···
# 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.
···
--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
+1 -1
pkgs/development/compilers/llvm/12/clang/default.nix
···
# 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";
})
];
+1 -1
pkgs/development/compilers/llvm/12/libcxx/default.nix
···
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 ''
+1 -1
pkgs/development/compilers/llvm/12/libcxxabi/default.nix
···
'' + 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}
'';
+2 -2
pkgs/development/compilers/llvm/12/llvm/default.nix
···
# 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
···
# 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
+1 -1
pkgs/development/compilers/llvm/13/clang/default.nix
···
./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";
})
];
+1 -1
pkgs/development/compilers/llvm/13/libcxx/default.nix
···
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 ''
+2 -2
pkgs/development/compilers/llvm/13/llvm/default.nix
···
# 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
···
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
+1 -1
pkgs/development/compilers/llvm/14/clang/default.nix
···
./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";
})
];
+1 -1
pkgs/development/compilers/llvm/14/libcxx/default.nix
···
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 ''
+1 -1
pkgs/development/compilers/llvm/14/llvm/default.nix
···
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
+1 -1
pkgs/development/compilers/llvm/15/clang/default.nix
···
./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";
})
];
+1 -1
pkgs/development/compilers/llvm/15/libcxx/default.nix
···
relative = "libcxx";
})
] ++ lib.optionals stdenv.hostPlatform.isMusl [
-
../../libcxx-0001-musl-hacks.patch
+
../../common/libcxx/libcxx-0001-musl-hacks.patch
];
postPatch = ''
+1 -1
pkgs/development/compilers/llvm/15/llvm/default.nix
···
# 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
+1 -1
pkgs/development/compilers/llvm/16/clang/default.nix
···
./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";
})
];
+1 -1
pkgs/development/compilers/llvm/16/llvm/default.nix
···
# 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
+1 -1
pkgs/development/compilers/llvm/17/clang/default.nix
···
./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";
})
];
+1 -1
pkgs/development/compilers/llvm/17/llvm/default.nix
···
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
+1 -1
pkgs/development/compilers/llvm/9/clang/default.nix
···
./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";
})
];
+1 -1
pkgs/development/compilers/llvm/9/libcxx/default.nix
···
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"
+1 -1
pkgs/development/compilers/llvm/9/libcxxabi/default.nix
···
'' + 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}
'';
+3 -3
pkgs/development/compilers/llvm/9/llvm/default.nix
···
# 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 {
···
--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
pkgs/development/compilers/llvm/TLI-musl.patch pkgs/development/compilers/llvm/common/llvm/TLI-musl.patch
pkgs/development/compilers/llvm/clang-11-15-LLVMgold-path.patch pkgs/development/compilers/llvm/common/clang/clang-11-15-LLVMgold-path.patch
pkgs/development/compilers/llvm/clang-6-10-LLVMgold-path.patch pkgs/development/compilers/llvm/common/clang/clang-6-10-LLVMgold-path.patch
pkgs/development/compilers/llvm/clang-at-least-16-LLVMgold-path.patch pkgs/development/compilers/llvm/common/clang/clang-at-least-16-LLVMgold-path.patch
pkgs/development/compilers/llvm/exegesis-force-bdver2.patch pkgs/development/compilers/llvm/9/llvm/exegesis-force-bdver2.patch
+1 -1
pkgs/development/compilers/llvm/git/clang/default.nix
···
./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";
})
];
+1 -1
pkgs/development/compilers/llvm/git/llvm/default.nix
···
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
pkgs/development/compilers/llvm/libcxx-0001-musl-hacks.patch pkgs/development/compilers/llvm/common/libcxx/libcxx-0001-musl-hacks.patch