diff --git a/pkgs/development/compilers/llvm/10/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/10/compiler-rt/armv7l.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/compiler-rt-armv7l.patch rename to pkgs/development/compilers/llvm/10/compiler-rt/armv7l.patch diff --git a/pkgs/development/compilers/llvm/10/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/10/compiler-rt/codesign.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/compiler-rt-codesign.patch rename to pkgs/development/compilers/llvm/10/compiler-rt/codesign.patch diff --git a/pkgs/development/compilers/llvm/10/compiler-rt.nix b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix similarity index 95% rename from pkgs/development/compilers/llvm/10/compiler-rt.nix rename to pkgs/development/compilers/llvm/10/compiler-rt/default.nix index 64d57e3e811..1d759c903fc 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix @@ -52,10 +52,10 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; patches = [ - ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory + ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory ./find-darwin-sdk-version.patch # don't test for macOS being >= 10.15 ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch - ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; + ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks diff --git a/pkgs/development/compilers/llvm/10/find-darwin-sdk-version.patch b/pkgs/development/compilers/llvm/10/compiler-rt/find-darwin-sdk-version.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/find-darwin-sdk-version.patch rename to pkgs/development/compilers/llvm/10/compiler-rt/find-darwin-sdk-version.patch diff --git a/pkgs/development/compilers/llvm/10/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/10/compiler-rt/sanitizers-nongnu.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/sanitizers-nongnu.patch rename to pkgs/development/compilers/llvm/10/compiler-rt/sanitizers-nongnu.patch diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index 978f2895666..9663c512d86 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -29,7 +29,7 @@ let ''; in { - llvm = callPackage ./llvm.nix { }; + llvm = callPackage ./llvm { }; clang-unwrapped = callPackage ./clang { inherit (tools) lld; @@ -77,9 +77,9 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld.nix {}; + lld = callPackage ./lld {}; - lldb = callPackage ./lldb.nix {}; + lldb = callPackage ./lldb {}; # Below, is the LLVM bootstrapping logic. It handles building a # fully LLVM toolchain from scratch. No GCC toolchain should be @@ -163,7 +163,7 @@ let callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); in { - compiler-rt = callPackage ./compiler-rt.nix ({} // + compiler-rt = callPackage ./compiler-rt ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; })); @@ -177,7 +177,7 @@ let stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); - libcxxabi = callPackage ./libc++abi.nix ({} // + libcxxabi = callPackage ./libc++abi ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; libunwind = libraries.libunwind; diff --git a/pkgs/development/compilers/llvm/10/libc++abi.nix b/pkgs/development/compilers/llvm/10/libc++abi/default.nix similarity index 95% rename from pkgs/development/compilers/llvm/10/libc++abi.nix rename to pkgs/development/compilers/llvm/10/libc++abi/default.nix index 61f778fbc55..7541cee1a54 100644 --- a/pkgs/development/compilers/llvm/10/libc++abi.nix +++ b/pkgs/development/compilers/llvm/10/libc++abi/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation { "-DLIBCXXABI_ENABLE_SHARED=OFF" ]; - patches = [ ./libcxxabi-no-threads.patch ]; + patches = [ ./no-threads.patch ]; postUnpack = '' unpackFile ${libcxx.src} @@ -32,7 +32,7 @@ stdenv.mkDerivation { '' + lib.optionalString stdenv.hostPlatform.isMusl '' patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch} '' + lib.optionalString stdenv.hostPlatform.isWasm '' - patch -p1 -d $(ls -d llvm-*) -i ${./libcxxabi-wasm.patch} + patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch} ''; installPhase = if stdenv.isDarwin diff --git a/pkgs/development/compilers/llvm/10/libcxxabi-no-threads.patch b/pkgs/development/compilers/llvm/10/libc++abi/no-threads.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/libcxxabi-no-threads.patch rename to pkgs/development/compilers/llvm/10/libc++abi/no-threads.patch diff --git a/pkgs/development/compilers/llvm/10/libcxxabi-wasm.patch b/pkgs/development/compilers/llvm/10/libc++abi/wasm.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/libcxxabi-wasm.patch rename to pkgs/development/compilers/llvm/10/libc++abi/wasm.patch diff --git a/pkgs/development/compilers/llvm/10/lld.nix b/pkgs/development/compilers/llvm/10/lld/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/10/lld.nix rename to pkgs/development/compilers/llvm/10/lld/default.nix diff --git a/pkgs/development/compilers/llvm/10/lldb.nix b/pkgs/development/compilers/llvm/10/lldb/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/10/lldb.nix rename to pkgs/development/compilers/llvm/10/lldb/default.nix index e7dd48a23ce..7fb8ed57a01 100644 --- a/pkgs/development/compilers/llvm/10/lldb.nix +++ b/pkgs/development/compilers/llvm/10/lldb/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation (rec { src = fetch pname "051p5b04y6z3g730rmc2n2v71lipbw7k69riww3a6sl74myfiaq7"; - patches = [ ./lldb-procfs.patch ]; + patches = [ ./procfs.patch ]; nativeBuildInputs = [ cmake python3 which swig lit ] ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; diff --git a/pkgs/development/compilers/llvm/10/lldb-procfs.patch b/pkgs/development/compilers/llvm/10/lldb/procfs.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/lldb-procfs.patch rename to pkgs/development/compilers/llvm/10/lldb/procfs.patch diff --git a/pkgs/development/compilers/llvm/10/llvm.nix b/pkgs/development/compilers/llvm/10/llvm/default.nix similarity index 97% rename from pkgs/development/compilers/llvm/10/llvm.nix rename to pkgs/development/compilers/llvm/10/llvm/default.nix index e951375a833..3100eaf4db4 100644 --- a/pkgs/development/compilers/llvm/10/llvm.nix +++ b/pkgs/development/compilers/llvm/10/llvm/default.nix @@ -62,15 +62,15 @@ in stdenv.mkDerivation (rec { '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' - substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib - patch -p1 < ./llvm-outputs.patch + substitute '${./outputs.patch}' ./outputs.patch --subst-var lib + patch -p1 < ./outputs.patch '' + '' # FileSystem permissions tests fail with various special bits substituteInPlace unittests/Support/CMakeLists.txt \ --replace "Path.cpp" "" rm unittests/Support/Path.cpp '' + optionalString stdenv.hostPlatform.isMusl '' - patch -p1 -i ${../TLI-musl.patch} + patch -p1 -i ${../../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/10/llvm-outputs.patch b/pkgs/development/compilers/llvm/10/llvm/outputs.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/llvm-outputs.patch rename to pkgs/development/compilers/llvm/10/llvm/outputs.patch diff --git a/pkgs/development/compilers/llvm/11/compiler-rt-X86-support-extension.patch b/pkgs/development/compilers/llvm/11/compiler-rt/X86-support-extension.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/compiler-rt-X86-support-extension.patch rename to pkgs/development/compilers/llvm/11/compiler-rt/X86-support-extension.patch diff --git a/pkgs/development/compilers/llvm/11/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/11/compiler-rt/armv7l.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/compiler-rt-armv7l.patch rename to pkgs/development/compilers/llvm/11/compiler-rt/armv7l.patch diff --git a/pkgs/development/compilers/llvm/11/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/11/compiler-rt/codesign.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/compiler-rt-codesign.patch rename to pkgs/development/compilers/llvm/11/compiler-rt/codesign.patch diff --git a/pkgs/development/compilers/llvm/11/compiler-rt.nix b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix similarity index 93% rename from pkgs/development/compilers/llvm/11/compiler-rt.nix rename to pkgs/development/compilers/llvm/11/compiler-rt/default.nix index 88a412f6cb4..6ab36063077 100644 --- a/pkgs/development/compilers/llvm/11/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix @@ -50,10 +50,10 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; patches = [ - ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory - ./compiler-rt-X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config + ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory + ./X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch - ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; + ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks diff --git a/pkgs/development/compilers/llvm/11/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/11/compiler-rt/sanitizers-nongnu.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/sanitizers-nongnu.patch rename to pkgs/development/compilers/llvm/11/compiler-rt/sanitizers-nongnu.patch diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix index e4d9f45c955..88e1850059a 100644 --- a/pkgs/development/compilers/llvm/11/default.nix +++ b/pkgs/development/compilers/llvm/11/default.nix @@ -31,7 +31,7 @@ let ''; in { - llvm = callPackage ./llvm.nix { }; + llvm = callPackage ./llvm { }; clang-unwrapped = callPackage ./clang { inherit (tools) lld; @@ -79,9 +79,9 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld.nix {}; + lld = callPackage ./lld {}; - lldb = callPackage ./lldb.nix {}; + lldb = callPackage ./lldb {}; # Below, is the LLVM bootstrapping logic. It handles building a # fully LLVM toolchain from scratch. No GCC toolchain should be @@ -165,7 +165,7 @@ let callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); in { - compiler-rt = callPackage ./compiler-rt.nix ({} // + compiler-rt = callPackage ./compiler-rt ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; })); @@ -179,7 +179,7 @@ let stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); - libcxxabi = callPackage ./libc++abi.nix ({} // + libcxxabi = callPackage ./libc++abi ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; libunwind = libraries.libunwind; diff --git a/pkgs/development/compilers/llvm/11/libc++abi.nix b/pkgs/development/compilers/llvm/11/libc++abi/default.nix similarity index 95% rename from pkgs/development/compilers/llvm/11/libc++abi.nix rename to pkgs/development/compilers/llvm/11/libc++abi/default.nix index d941044ca60..a95a3051415 100644 --- a/pkgs/development/compilers/llvm/11/libc++abi.nix +++ b/pkgs/development/compilers/llvm/11/libc++abi/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation { "-DLIBCXXABI_ENABLE_SHARED=OFF" ]; - patches = [ ./libcxxabi-no-threads.patch ]; + patches = [ ./no-threads.patch ]; postUnpack = '' unpackFile ${libcxx.src} @@ -33,7 +33,7 @@ stdenv.mkDerivation { '' + lib.optionalString stdenv.hostPlatform.isMusl '' patch -p1 -d libcxx -i ${../libcxx-0001-musl-hacks.patch} '' + lib.optionalString stdenv.hostPlatform.isWasm '' - patch -p1 -d llvm -i ${./libcxxabi-wasm.patch} + patch -p1 -d llvm -i ${./wasm.patch} ''; installPhase = if stdenv.isDarwin diff --git a/pkgs/development/compilers/llvm/11/libcxxabi-no-threads.patch b/pkgs/development/compilers/llvm/11/libc++abi/no-threads.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/libcxxabi-no-threads.patch rename to pkgs/development/compilers/llvm/11/libc++abi/no-threads.patch diff --git a/pkgs/development/compilers/llvm/11/libcxxabi-wasm.patch b/pkgs/development/compilers/llvm/11/libc++abi/wasm.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/libcxxabi-wasm.patch rename to pkgs/development/compilers/llvm/11/libc++abi/wasm.patch diff --git a/pkgs/development/compilers/llvm/11/lld.nix b/pkgs/development/compilers/llvm/11/lld/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/11/lld.nix rename to pkgs/development/compilers/llvm/11/lld/default.nix diff --git a/pkgs/development/compilers/llvm/11/lldb.nix b/pkgs/development/compilers/llvm/11/lldb/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/11/lldb.nix rename to pkgs/development/compilers/llvm/11/lldb/default.nix index 2f54305736a..fc9b471ec9a 100644 --- a/pkgs/development/compilers/llvm/11/lldb.nix +++ b/pkgs/development/compilers/llvm/11/lldb/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation (rec { src = fetch pname "1vlyg015dyng43xqb8cg2l6r9ix8klibxsajazbfnckdnh54hwxj"; - patches = [ ./lldb-procfs.patch ]; + patches = [ ./procfs.patch ]; nativeBuildInputs = [ cmake python3 which swig lit ] ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; diff --git a/pkgs/development/compilers/llvm/11/lldb-procfs.patch b/pkgs/development/compilers/llvm/11/lldb/procfs.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/lldb-procfs.patch rename to pkgs/development/compilers/llvm/11/lldb/procfs.patch diff --git a/pkgs/development/compilers/llvm/11/llvm.nix b/pkgs/development/compilers/llvm/11/llvm/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/11/llvm.nix rename to pkgs/development/compilers/llvm/11/llvm/default.nix index cb44643ff78..fc64451e013 100644 --- a/pkgs/development/compilers/llvm/11/llvm.nix +++ b/pkgs/development/compilers/llvm/11/llvm/default.nix @@ -62,8 +62,8 @@ in stdenv.mkDerivation (rec { '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' - substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib - patch -p1 < ./llvm-outputs.patch + substitute '${./outputs.patch}' ./outputs.patch --subst-var lib + patch -p1 < ./outputs.patch '' + '' # FileSystem permissions tests fail with various special bits substituteInPlace unittests/Support/CMakeLists.txt \ diff --git a/pkgs/development/compilers/llvm/11/llvm-outputs.patch b/pkgs/development/compilers/llvm/11/llvm/outputs.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/llvm-outputs.patch rename to pkgs/development/compilers/llvm/11/llvm/outputs.patch diff --git a/pkgs/development/compilers/llvm/5/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/5/compiler-rt/armv7l.patch similarity index 100% rename from pkgs/development/compilers/llvm/5/compiler-rt-armv7l.patch rename to pkgs/development/compilers/llvm/5/compiler-rt/armv7l.patch diff --git a/pkgs/development/compilers/llvm/5/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/5/compiler-rt/codesign.patch similarity index 100% rename from pkgs/development/compilers/llvm/5/compiler-rt-codesign.patch rename to pkgs/development/compilers/llvm/5/compiler-rt/codesign.patch diff --git a/pkgs/development/compilers/llvm/5/compiler-rt.nix b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix similarity index 91% rename from pkgs/development/compilers/llvm/5/compiler-rt.nix rename to pkgs/development/compilers/llvm/5/compiler-rt/default.nix index 81dbe7048e6..705c5994bd1 100644 --- a/pkgs/development/compilers/llvm/5/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix @@ -51,11 +51,12 @@ stdenv.mkDerivation { outputs = [ "out" "dev" ]; patches = [ - ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory - ../7/compiler-rt-glibc.patch + ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory + # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce + ../../common/compiler-rt/glibc.patch ] ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch - ++ lib.optional (stdenv.hostPlatform.libc == "glibc") ./compiler-rt-sys-ustat.patch - ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; + ++ lib.optional (stdenv.hostPlatform.libc == "glibc") ./sys-ustat.patch + ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra diff --git a/pkgs/development/compilers/llvm/5/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/5/compiler-rt/sanitizers-nongnu.patch similarity index 100% rename from pkgs/development/compilers/llvm/5/sanitizers-nongnu.patch rename to pkgs/development/compilers/llvm/5/compiler-rt/sanitizers-nongnu.patch diff --git a/pkgs/development/compilers/llvm/5/compiler-rt-sys-ustat.patch b/pkgs/development/compilers/llvm/5/compiler-rt/sys-ustat.patch similarity index 100% rename from pkgs/development/compilers/llvm/5/compiler-rt-sys-ustat.patch rename to pkgs/development/compilers/llvm/5/compiler-rt/sys-ustat.patch diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix index f03325cd427..86bba415c01 100644 --- a/pkgs/development/compilers/llvm/5/default.nix +++ b/pkgs/development/compilers/llvm/5/default.nix @@ -28,7 +28,7 @@ let ''; in { - llvm = callPackage ./llvm.nix { }; + llvm = callPackage ./llvm { }; clang-unwrapped = callPackage ./clang { inherit clang-tools-extra_src; @@ -68,16 +68,16 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld.nix {}; + lld = callPackage ./lld {}; - lldb = callPackage ./lldb.nix {}; + lldb = callPackage ./lldb {}; }); libraries = lib.makeExtensible (libraries: let callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); in { - compiler-rt = callPackage ./compiler-rt.nix {}; + compiler-rt = callPackage ./compiler-rt {}; stdenv = overrideCC stdenv buildLlvmTools.clang; @@ -85,7 +85,7 @@ let libcxx = callPackage ./libc++ {}; - libcxxabi = callPackage ./libc++abi.nix {}; + libcxxabi = callPackage ./libc++abi {}; openmp = callPackage ./openmp.nix {}; }); diff --git a/pkgs/development/compilers/llvm/5/libc++abi.nix b/pkgs/development/compilers/llvm/5/libc++abi/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/5/libc++abi.nix rename to pkgs/development/compilers/llvm/5/libc++abi/default.nix diff --git a/pkgs/development/compilers/llvm/5/lld.nix b/pkgs/development/compilers/llvm/5/lld/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/5/lld.nix rename to pkgs/development/compilers/llvm/5/lld/default.nix diff --git a/pkgs/development/compilers/llvm/5/lldb.nix b/pkgs/development/compilers/llvm/5/lldb/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/5/lldb.nix rename to pkgs/development/compilers/llvm/5/lldb/default.nix diff --git a/pkgs/development/compilers/llvm/5/llvm.nix b/pkgs/development/compilers/llvm/5/llvm/default.nix similarity index 86% rename from pkgs/development/compilers/llvm/5/llvm.nix rename to pkgs/development/compilers/llvm/5/llvm/default.nix index c91e9420435..94d2a1e5863 100644 --- a/pkgs/development/compilers/llvm/5/llvm.nix +++ b/pkgs/development/compilers/llvm/5/llvm/default.nix @@ -16,6 +16,8 @@ }: let + inherit (lib) optional optionals optionalString; + # Used when creating a versioned symlinks of libLLVM.dylib versionSuffixes = with lib; let parts = splitVersion release_version; in @@ -35,10 +37,10 @@ stdenv.mkDerivation ({ ''; outputs = [ "out" "python" ] - ++ lib.optional enableSharedLibraries "lib"; + ++ optional enableSharedLibraries "lib"; nativeBuildInputs = [ cmake python3 ] - ++ lib.optional enableManpages python3.pkgs.sphinx; + ++ optional enableManpages python3.pkgs.sphinx; buildInputs = [ libxml2 libffi ]; @@ -58,24 +60,24 @@ stdenv.mkDerivation ({ # stripLen = 1; #}) ]; - postPatch = lib.optionalString stdenv.isDarwin '' + postPatch = optionalString stdenv.isDarwin '' substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \ --replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' "" '' # Patch llvm-config to return correct library path based on --link-{shared,static}. - + lib.optionalString (enableSharedLibraries) '' - substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib - patch -p1 < ./llvm-outputs.patch + + optionalString (enableSharedLibraries) '' + substitute '${./outputs.patch}' ./outputs.patch --subst-var lib + patch -p1 < ./outputs.patch '' + '' # FileSystem permissions tests fail with various special bits substituteInPlace unittests/Support/CMakeLists.txt \ --replace "Path.cpp" "" rm unittests/Support/Path.cpp - '' + lib.optionalString stdenv.isAarch64 '' - patch -p0 < ${../aarch64.patch} - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - patch -p1 -i ${../TLI-musl.patch} + '' + optionalString stdenv.isAarch64 '' + patch -p0 < ${../../aarch64.patch} + '' + optionalString stdenv.hostPlatform.isMusl '' + patch -p1 -i ${../../TLI-musl.patch} substituteInPlace unittests/Support/CMakeLists.txt \ --replace "add_subdirectory(DynamicLibrary)" "" rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp @@ -98,18 +100,18 @@ stdenv.mkDerivation ({ "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" "-DTARGET_TRIPLE=${stdenv.hostPlatform.config}" ] - ++ lib.optional enableSharedLibraries + ++ optional enableSharedLibraries "-DLLVM_LINK_LLVM_DYLIB=ON" - ++ lib.optionals enableManpages [ + ++ optionals enableManpages [ "-DLLVM_BUILD_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" ] - ++ lib.optional (!isDarwin) + ++ optional (!isDarwin) "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" - ++ lib.optionals (isDarwin) [ + ++ optionals (isDarwin) [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" ]; @@ -126,14 +128,14 @@ stdenv.mkDerivation ({ mkdir -p $python/share mv $out/share/opt-viewer $python/share/opt-viewer '' - + lib.optionalString enableSharedLibraries '' + + optionalString enableSharedLibraries '' moveToOutput "lib/libLLVM-*" "$lib" moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" moveToOutput "lib/libLTO${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" '' - + lib.optionalString (stdenv.isDarwin && enableSharedLibraries) '' + + optionalString (stdenv.isDarwin && enableSharedLibraries) '' substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" \ --replace "\''${_IMPORT_PREFIX}/lib/libLTO.dylib" "$lib/lib/libLTO.dylib" diff --git a/pkgs/development/compilers/llvm/5/fix-gcc9.patch b/pkgs/development/compilers/llvm/5/llvm/fix-gcc9.patch similarity index 100% rename from pkgs/development/compilers/llvm/5/fix-gcc9.patch rename to pkgs/development/compilers/llvm/5/llvm/fix-gcc9.patch diff --git a/pkgs/development/compilers/llvm/5/llvm-outputs.patch b/pkgs/development/compilers/llvm/5/llvm/outputs.patch similarity index 100% rename from pkgs/development/compilers/llvm/5/llvm-outputs.patch rename to pkgs/development/compilers/llvm/5/llvm/outputs.patch diff --git a/pkgs/development/compilers/llvm/6/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/6/compiler-rt/armv7l.patch similarity index 100% rename from pkgs/development/compilers/llvm/6/compiler-rt-armv7l.patch rename to pkgs/development/compilers/llvm/6/compiler-rt/armv7l.patch diff --git a/pkgs/development/compilers/llvm/6/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/6/compiler-rt/codesign.patch similarity index 100% rename from pkgs/development/compilers/llvm/6/compiler-rt-codesign.patch rename to pkgs/development/compilers/llvm/6/compiler-rt/codesign.patch diff --git a/pkgs/development/compilers/llvm/6/compiler-rt.nix b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix similarity index 93% rename from pkgs/development/compilers/llvm/6/compiler-rt.nix rename to pkgs/development/compilers/llvm/6/compiler-rt/default.nix index 11d46289afe..f0a1c7ecc34 100644 --- a/pkgs/development/compilers/llvm/6/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix @@ -51,10 +51,11 @@ stdenv.mkDerivation { outputs = [ "out" "dev" ]; patches = [ - ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory - ../7/compiler-rt-glibc.patch + ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory + # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce + ../../common/compiler-rt/glibc.patch ] ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch - ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; + ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra diff --git a/pkgs/development/compilers/llvm/6/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/6/compiler-rt/sanitizers-nongnu.patch similarity index 100% rename from pkgs/development/compilers/llvm/6/sanitizers-nongnu.patch rename to pkgs/development/compilers/llvm/6/compiler-rt/sanitizers-nongnu.patch diff --git a/pkgs/development/compilers/llvm/6/default.nix b/pkgs/development/compilers/llvm/6/default.nix index a98314d1181..823b922705e 100644 --- a/pkgs/development/compilers/llvm/6/default.nix +++ b/pkgs/development/compilers/llvm/6/default.nix @@ -28,7 +28,7 @@ let ''; in { - llvm = callPackage ./llvm.nix { }; + llvm = callPackage ./llvm { }; clang-unwrapped = callPackage ./clang { inherit clang-tools-extra_src; @@ -68,16 +68,16 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld.nix {}; + lld = callPackage ./lld {}; - lldb = callPackage ./lldb.nix {}; + lldb = callPackage ./lldb {}; }); libraries = lib.makeExtensible (libraries: let callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); in { - compiler-rt = callPackage ./compiler-rt.nix {}; + compiler-rt = callPackage ./compiler-rt {}; stdenv = overrideCC stdenv buildLlvmTools.clang; @@ -85,7 +85,7 @@ let libcxx = callPackage ./libc++ {}; - libcxxabi = callPackage ./libc++abi.nix {}; + libcxxabi = callPackage ./libc++abi {}; openmp = callPackage ./openmp.nix {}; }); diff --git a/pkgs/development/compilers/llvm/6/libc++abi.nix b/pkgs/development/compilers/llvm/6/libc++abi/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/6/libc++abi.nix rename to pkgs/development/compilers/llvm/6/libc++abi/default.nix diff --git a/pkgs/development/compilers/llvm/6/lld.nix b/pkgs/development/compilers/llvm/6/lld/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/6/lld.nix rename to pkgs/development/compilers/llvm/6/lld/default.nix diff --git a/pkgs/development/compilers/llvm/6/lldb.nix b/pkgs/development/compilers/llvm/6/lldb/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/6/lldb.nix rename to pkgs/development/compilers/llvm/6/lldb/default.nix diff --git a/pkgs/development/compilers/llvm/6/llvm.nix b/pkgs/development/compilers/llvm/6/llvm/default.nix similarity index 97% rename from pkgs/development/compilers/llvm/6/llvm.nix rename to pkgs/development/compilers/llvm/6/llvm/default.nix index 7d429e3ecf3..de99691094b 100644 --- a/pkgs/development/compilers/llvm/6/llvm.nix +++ b/pkgs/development/compilers/llvm/6/llvm/default.nix @@ -67,15 +67,15 @@ stdenv.mkDerivation ({ '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' - substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib - patch -p1 < ./llvm-outputs.patch + substitute '${./outputs.patch}' ./outputs.patch --subst-var lib + patch -p1 < ./outputs.patch '' + '' # FileSystem permissions tests fail with various special bits substituteInPlace unittests/Support/CMakeLists.txt \ --replace "Path.cpp" "" rm unittests/Support/Path.cpp '' + optionalString stdenv.hostPlatform.isMusl '' - patch -p1 -i ${../TLI-musl.patch} + patch -p1 -i ${../../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/6/llvm-outputs.patch b/pkgs/development/compilers/llvm/6/llvm/outputs.patch similarity index 100% rename from pkgs/development/compilers/llvm/6/llvm-outputs.patch rename to pkgs/development/compilers/llvm/6/llvm/outputs.patch diff --git a/pkgs/development/compilers/llvm/7/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/7/compiler-rt/armv7l.patch similarity index 100% rename from pkgs/development/compilers/llvm/7/compiler-rt-armv7l.patch rename to pkgs/development/compilers/llvm/7/compiler-rt/armv7l.patch diff --git a/pkgs/development/compilers/llvm/7/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/7/compiler-rt/codesign.patch similarity index 100% rename from pkgs/development/compilers/llvm/7/compiler-rt-codesign.patch rename to pkgs/development/compilers/llvm/7/compiler-rt/codesign.patch diff --git a/pkgs/development/compilers/llvm/7/crtbegin-and-end.patch b/pkgs/development/compilers/llvm/7/compiler-rt/crtbegin-and-end.patch similarity index 100% rename from pkgs/development/compilers/llvm/7/crtbegin-and-end.patch rename to pkgs/development/compilers/llvm/7/compiler-rt/crtbegin-and-end.patch diff --git a/pkgs/development/compilers/llvm/7/compiler-rt.nix b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix similarity index 95% rename from pkgs/development/compilers/llvm/7/compiler-rt.nix rename to pkgs/development/compilers/llvm/7/compiler-rt/default.nix index 0f91f3c5e6c..21842131599 100644 --- a/pkgs/development/compilers/llvm/7/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix @@ -52,12 +52,11 @@ stdenv.mkDerivation { patches = [ # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce - ./compiler-rt-glibc.patch - - ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory + ../../common/compiler-rt/glibc.patch + ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory ] ++ lib.optional (useLLVM) ./crtbegin-and-end.patch ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch - ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; + ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra diff --git a/pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/7/compiler-rt/sanitizers-nongnu.patch similarity index 100% rename from pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch rename to pkgs/development/compilers/llvm/7/compiler-rt/sanitizers-nongnu.patch diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 111ccbb9a38..2170177117e 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -28,8 +28,9 @@ let ''; in { - llvm = callPackage ./llvm.nix { }; - llvm-polly = callPackage ./llvm.nix { enablePolly = true; }; + llvm = callPackage ./llvm { }; + + llvm-polly = callPackage ./llvm { enablePolly = true; }; clang-unwrapped = callPackage ./clang { inherit (tools) lld; @@ -75,9 +76,9 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld.nix {}; + lld = callPackage ./lld {}; - lldb = callPackage ./lldb.nix {}; + lldb = callPackage ./lldb {}; # Below, is the LLVM bootstrapping logic. It handles building a # fully LLVM toolchain from scratch. No GCC toolchain should be @@ -159,7 +160,7 @@ let callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); in { - compiler-rt = callPackage ./compiler-rt.nix { + compiler-rt = callPackage ./compiler-rt { stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt else stdenv; @@ -174,7 +175,7 @@ let stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); - libcxxabi = callPackage ./libc++abi.nix ({} // + libcxxabi = callPackage ./libc++abi ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; libunwind = libraries.libunwind; diff --git a/pkgs/development/compilers/llvm/7/libc++abi.nix b/pkgs/development/compilers/llvm/7/libc++abi/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/7/libc++abi.nix rename to pkgs/development/compilers/llvm/7/libc++abi/default.nix diff --git a/pkgs/development/compilers/llvm/7/lld.nix b/pkgs/development/compilers/llvm/7/lld/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/7/lld.nix rename to pkgs/development/compilers/llvm/7/lld/default.nix diff --git a/pkgs/development/compilers/llvm/7/lldb.nix b/pkgs/development/compilers/llvm/7/lldb/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/7/lldb.nix rename to pkgs/development/compilers/llvm/7/lldb/default.nix diff --git a/pkgs/development/compilers/llvm/7/llvm.nix b/pkgs/development/compilers/llvm/7/llvm/default.nix similarity index 97% rename from pkgs/development/compilers/llvm/7/llvm.nix rename to pkgs/development/compilers/llvm/7/llvm/default.nix index 2d6f0d18722..53a7301b19b 100644 --- a/pkgs/development/compilers/llvm/7/llvm.nix +++ b/pkgs/development/compilers/llvm/7/llvm/default.nix @@ -76,15 +76,15 @@ in stdenv.mkDerivation ({ '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' - substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib - patch -p1 < ./llvm-outputs.patch + substitute '${./outputs.patch}' ./outputs.patch --subst-var lib + patch -p1 < ./outputs.patch '' + '' # FileSystem permissions tests fail with various special bits substituteInPlace unittests/Support/CMakeLists.txt \ --replace "Path.cpp" "" rm unittests/Support/Path.cpp '' + optionalString stdenv.hostPlatform.isMusl '' - patch -p1 -i ${../TLI-musl.patch} + patch -p1 -i ${../../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/7/llvm-outputs.patch b/pkgs/development/compilers/llvm/7/llvm/outputs.patch similarity index 100% rename from pkgs/development/compilers/llvm/7/llvm-outputs.patch rename to pkgs/development/compilers/llvm/7/llvm/outputs.patch diff --git a/pkgs/development/compilers/llvm/8/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/8/compiler-rt/armv7l.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/compiler-rt-armv7l.patch rename to pkgs/development/compilers/llvm/8/compiler-rt/armv7l.patch diff --git a/pkgs/development/compilers/llvm/8/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/8/compiler-rt/codesign.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/compiler-rt-codesign.patch rename to pkgs/development/compilers/llvm/8/compiler-rt/codesign.patch diff --git a/pkgs/development/compilers/llvm/8/crtbegin-and-end.patch b/pkgs/development/compilers/llvm/8/compiler-rt/crtbegin-and-end.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/crtbegin-and-end.patch rename to pkgs/development/compilers/llvm/8/compiler-rt/crtbegin-and-end.patch diff --git a/pkgs/development/compilers/llvm/8/compiler-rt.nix b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix similarity index 93% rename from pkgs/development/compilers/llvm/8/compiler-rt.nix rename to pkgs/development/compilers/llvm/8/compiler-rt/default.nix index a9dabebb59a..3da3d59d111 100644 --- a/pkgs/development/compilers/llvm/8/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix @@ -51,11 +51,12 @@ stdenv.mkDerivation { outputs = [ "out" "dev" ]; patches = [ - ../7/compiler-rt-glibc.patch - ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory + # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce + ../../common/compiler-rt/glibc.patch + ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch ++ lib.optional (useLLVM) ./crtbegin-and-end.patch - ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; + ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra diff --git a/pkgs/development/compilers/llvm/8/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/8/compiler-rt/sanitizers-nongnu.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/sanitizers-nongnu.patch rename to pkgs/development/compilers/llvm/8/compiler-rt/sanitizers-nongnu.patch diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index 313b97455e5..2e3bf61099d 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -28,8 +28,9 @@ let ''; in { - llvm = callPackage ./llvm.nix { }; - llvm-polly = callPackage ./llvm.nix { enablePolly = true; }; + llvm = callPackage ./llvm { }; + + llvm-polly = callPackage ./llvm { enablePolly = true; }; clang-unwrapped = callPackage ./clang { inherit (tools) lld; @@ -76,9 +77,9 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld.nix {}; + lld = callPackage ./lld {}; - lldb = callPackage ./lldb.nix {}; + lldb = callPackage ./lldb {}; # Below, is the LLVM bootstrapping logic. It handles building a # fully LLVM toolchain from scratch. No GCC toolchain should be @@ -162,7 +163,7 @@ let callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); in { - compiler-rt = callPackage ./compiler-rt.nix ({} // + compiler-rt = callPackage ./compiler-rt ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; })); @@ -176,7 +177,7 @@ let stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); - libcxxabi = callPackage ./libc++abi.nix ({} // + libcxxabi = callPackage ./libc++abi ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; libunwind = libraries.libunwind; diff --git a/pkgs/development/compilers/llvm/8/libc++abi.nix b/pkgs/development/compilers/llvm/8/libc++abi/default.nix similarity index 95% rename from pkgs/development/compilers/llvm/8/libc++abi.nix rename to pkgs/development/compilers/llvm/8/libc++abi/default.nix index 5a74981eba8..411b94e6275 100644 --- a/pkgs/development/compilers/llvm/8/libc++abi.nix +++ b/pkgs/development/compilers/llvm/8/libc++abi/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation { "-DLIBCXXABI_ENABLE_SHARED=OFF" ]; - patches = [ ./libcxxabi-no-threads.patch ]; + patches = [ ./no-threads.patch ]; postUnpack = '' unpackFile ${libcxx.src} @@ -32,7 +32,7 @@ stdenv.mkDerivation { '' + lib.optionalString stdenv.hostPlatform.isMusl '' patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch} '' + lib.optionalString stdenv.hostPlatform.isWasm '' - patch -p1 -d $(ls -d llvm-*) -i ${./libcxxabi-wasm.patch} + patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch} ''; installPhase = if stdenv.isDarwin diff --git a/pkgs/development/compilers/llvm/8/libcxxabi-no-threads.patch b/pkgs/development/compilers/llvm/8/libc++abi/no-threads.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/libcxxabi-no-threads.patch rename to pkgs/development/compilers/llvm/8/libc++abi/no-threads.patch diff --git a/pkgs/development/compilers/llvm/8/libcxxabi-wasm.patch b/pkgs/development/compilers/llvm/8/libc++abi/wasm.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/libcxxabi-wasm.patch rename to pkgs/development/compilers/llvm/8/libc++abi/wasm.patch diff --git a/pkgs/development/compilers/llvm/8/lld.nix b/pkgs/development/compilers/llvm/8/lld/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/8/lld.nix rename to pkgs/development/compilers/llvm/8/lld/default.nix diff --git a/pkgs/development/compilers/llvm/8/lldb.nix b/pkgs/development/compilers/llvm/8/lldb/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/8/lldb.nix rename to pkgs/development/compilers/llvm/8/lldb/default.nix diff --git a/pkgs/development/compilers/llvm/8/llvm.nix b/pkgs/development/compilers/llvm/8/llvm/default.nix similarity index 97% rename from pkgs/development/compilers/llvm/8/llvm.nix rename to pkgs/development/compilers/llvm/8/llvm/default.nix index 9c2c3416aea..c0b88e7ff3e 100644 --- a/pkgs/development/compilers/llvm/8/llvm.nix +++ b/pkgs/development/compilers/llvm/8/llvm/default.nix @@ -71,15 +71,15 @@ in stdenv.mkDerivation ({ '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' - substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib - patch -p1 < ./llvm-outputs.patch + substitute '${./outputs.patch}' ./outputs.patch --subst-var lib + patch -p1 < ./outputs.patch '' + '' # FileSystem permissions tests fail with various special bits substituteInPlace unittests/Support/CMakeLists.txt \ --replace "Path.cpp" "" rm unittests/Support/Path.cpp '' + optionalString stdenv.hostPlatform.isMusl '' - patch -p1 -i ${../TLI-musl.patch} + patch -p1 -i ${../../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/8/llvm-outputs.patch b/pkgs/development/compilers/llvm/8/llvm/outputs.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/llvm-outputs.patch rename to pkgs/development/compilers/llvm/8/llvm/outputs.patch diff --git a/pkgs/development/compilers/llvm/9/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/9/compiler-rt/armv7l.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/compiler-rt-armv7l.patch rename to pkgs/development/compilers/llvm/9/compiler-rt/armv7l.patch diff --git a/pkgs/development/compilers/llvm/9/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/9/compiler-rt/codesign.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/compiler-rt-codesign.patch rename to pkgs/development/compilers/llvm/9/compiler-rt/codesign.patch diff --git a/pkgs/development/compilers/llvm/9/compiler-rt.nix b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix similarity index 93% rename from pkgs/development/compilers/llvm/9/compiler-rt.nix rename to pkgs/development/compilers/llvm/9/compiler-rt/default.nix index 1e9aa1d5d1b..cfc8e0ea74a 100644 --- a/pkgs/development/compilers/llvm/9/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix @@ -51,10 +51,11 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; patches = [ - ../7/compiler-rt-glibc.patch - ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory + # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce + ../../common/compiler-rt/glibc.patch + ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch - ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; + ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra diff --git a/pkgs/development/compilers/llvm/9/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/9/compiler-rt/sanitizers-nongnu.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/sanitizers-nongnu.patch rename to pkgs/development/compilers/llvm/9/compiler-rt/sanitizers-nongnu.patch diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index dfb4981a5b7..4989c9bfad7 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -28,8 +28,9 @@ let ''; in { - llvm = callPackage ./llvm.nix { }; - llvm-polly = callPackage ./llvm.nix { enablePolly = true; }; + llvm = callPackage ./llvm { }; + + llvm-polly = callPackage ./llvm { enablePolly = true; }; clang-unwrapped = callPackage ./clang { inherit (tools) lld; @@ -76,9 +77,9 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld.nix {}; + lld = callPackage ./lld {}; - lldb = callPackage ./lldb.nix {}; + lldb = callPackage ./lldb {}; # Below, is the LLVM bootstrapping logic. It handles building a # fully LLVM toolchain from scratch. No GCC toolchain should be @@ -162,7 +163,7 @@ let callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); in { - compiler-rt = callPackage ./compiler-rt.nix ({} // + compiler-rt = callPackage ./compiler-rt ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; })); @@ -176,7 +177,7 @@ let stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); - libcxxabi = callPackage ./libc++abi.nix ({} // + libcxxabi = callPackage ./libc++abi ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; libunwind = libraries.libunwind; diff --git a/pkgs/development/compilers/llvm/9/libc++abi.nix b/pkgs/development/compilers/llvm/9/libc++abi/default.nix similarity index 95% rename from pkgs/development/compilers/llvm/9/libc++abi.nix rename to pkgs/development/compilers/llvm/9/libc++abi/default.nix index e8e08f84801..ceb83d252a8 100644 --- a/pkgs/development/compilers/llvm/9/libc++abi.nix +++ b/pkgs/development/compilers/llvm/9/libc++abi/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation { "-DLIBCXXABI_ENABLE_SHARED=OFF" ]; - patches = [ ./libcxxabi-no-threads.patch ]; + patches = [ ./no-threads.patch ]; postUnpack = '' unpackFile ${libcxx.src} @@ -32,7 +32,7 @@ stdenv.mkDerivation { '' + lib.optionalString stdenv.hostPlatform.isMusl '' patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch} '' + lib.optionalString stdenv.hostPlatform.isWasm '' - patch -p1 -d $(ls -d llvm-*) -i ${./libcxxabi-wasm.patch} + patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch} ''; installPhase = if stdenv.isDarwin diff --git a/pkgs/development/compilers/llvm/9/libcxxabi-no-threads.patch b/pkgs/development/compilers/llvm/9/libc++abi/no-threads.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/libcxxabi-no-threads.patch rename to pkgs/development/compilers/llvm/9/libc++abi/no-threads.patch diff --git a/pkgs/development/compilers/llvm/9/libcxxabi-wasm.patch b/pkgs/development/compilers/llvm/9/libc++abi/wasm.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/libcxxabi-wasm.patch rename to pkgs/development/compilers/llvm/9/libc++abi/wasm.patch diff --git a/pkgs/development/compilers/llvm/9/lld.nix b/pkgs/development/compilers/llvm/9/lld/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/9/lld.nix rename to pkgs/development/compilers/llvm/9/lld/default.nix diff --git a/pkgs/development/compilers/llvm/9/lldb.nix b/pkgs/development/compilers/llvm/9/lldb/default.nix similarity index 97% rename from pkgs/development/compilers/llvm/9/lldb.nix rename to pkgs/development/compilers/llvm/9/lldb/default.nix index 8da5c0bef68..d75acf135f3 100644 --- a/pkgs/development/compilers/llvm/9/lldb.nix +++ b/pkgs/development/compilers/llvm/9/lldb/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { src = fetch pname "02gb3fbz09kyw8n71218v5v77ip559x3gqbcp8y3w6n3jpbryywa"; - patches = [ ./lldb-procfs.patch ]; + patches = [ ./procfs.patch ]; nativeBuildInputs = [ cmake python3 which swig lit ]; buildInputs = [ diff --git a/pkgs/development/compilers/llvm/9/lldb-procfs.patch b/pkgs/development/compilers/llvm/9/lldb/procfs.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/lldb-procfs.patch rename to pkgs/development/compilers/llvm/9/lldb/procfs.patch diff --git a/pkgs/development/compilers/llvm/9/llvm.nix b/pkgs/development/compilers/llvm/9/llvm/default.nix similarity index 97% rename from pkgs/development/compilers/llvm/9/llvm.nix rename to pkgs/development/compilers/llvm/9/llvm/default.nix index 207dc242b91..b795f07d472 100644 --- a/pkgs/development/compilers/llvm/9/llvm.nix +++ b/pkgs/development/compilers/llvm/9/llvm/default.nix @@ -62,15 +62,15 @@ in stdenv.mkDerivation (rec { '' # Patch llvm-config to return correct library path based on --link-{shared,static}. + optionalString (enableSharedLibraries) '' - substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib - patch -p1 < ./llvm-outputs.patch + substitute '${./outputs.patch}' ./outputs.patch --subst-var lib + patch -p1 < ./outputs.patch '' + '' # FileSystem permissions tests fail with various special bits substituteInPlace unittests/Support/CMakeLists.txt \ --replace "Path.cpp" "" rm unittests/Support/Path.cpp '' + optionalString stdenv.hostPlatform.isMusl '' - patch -p1 -i ${../TLI-musl.patch} + patch -p1 -i ${../../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/fix-test-on-non-x86-like-others.patch b/pkgs/development/compilers/llvm/9/llvm/fix-test-on-non-x86-like-others.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/fix-test-on-non-x86-like-others.patch rename to pkgs/development/compilers/llvm/9/llvm/fix-test-on-non-x86-like-others.patch diff --git a/pkgs/development/compilers/llvm/9/llvm-outputs.patch b/pkgs/development/compilers/llvm/9/llvm/outputs.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/llvm-outputs.patch rename to pkgs/development/compilers/llvm/9/llvm/outputs.patch diff --git a/pkgs/development/compilers/llvm/7/compiler-rt-glibc.patch b/pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch similarity index 100% rename from pkgs/development/compilers/llvm/7/compiler-rt-glibc.patch rename to pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch diff --git a/pkgs/development/compilers/llvm/rocm/default.nix b/pkgs/development/compilers/llvm/rocm/default.nix index 5f9dba0fc3c..2b6d2a906f9 100644 --- a/pkgs/development/compilers/llvm/rocm/default.nix +++ b/pkgs/development/compilers/llvm/rocm/default.nix @@ -28,12 +28,12 @@ in rec { src = "${src}/clang"; }; - lld = callPackage ./lld.nix { + lld = callPackage ./lld { inherit llvm version; src = "${src}/lld"; }; - llvm = callPackage ./llvm.nix { + llvm = callPackage ./llvm { inherit version; src = "${src}/llvm"; }; diff --git a/pkgs/development/compilers/llvm/rocm/lld.nix b/pkgs/development/compilers/llvm/rocm/lld/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/rocm/lld.nix rename to pkgs/development/compilers/llvm/rocm/lld/default.nix diff --git a/pkgs/development/compilers/llvm/rocm/llvm.nix b/pkgs/development/compilers/llvm/rocm/llvm/default.nix similarity index 95% rename from pkgs/development/compilers/llvm/rocm/llvm.nix rename to pkgs/development/compilers/llvm/rocm/llvm/default.nix index d6fe211c475..62559bf1392 100644 --- a/pkgs/development/compilers/llvm/rocm/llvm.nix +++ b/pkgs/development/compilers/llvm/rocm/llvm/default.nix @@ -57,8 +57,8 @@ in stdenv.mkDerivation rec { ]; postPatch = '' - substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib - patch -p1 < ./llvm-outputs.patch + substitute '${./outputs.patch}' ./outputs.patch --subst-var lib + patch -p1 < ./outputs.patch ''; # hacky fix: created binaries need to be run before installation diff --git a/pkgs/development/compilers/llvm/rocm/llvm-outputs.patch b/pkgs/development/compilers/llvm/rocm/llvm/outputs.patch similarity index 100% rename from pkgs/development/compilers/llvm/rocm/llvm-outputs.patch rename to pkgs/development/compilers/llvm/rocm/llvm/outputs.patch