From 53adcfb79813bebeb1ab2be85432367ec281ce39 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Mon, 26 Apr 2021 21:47:02 +0200 Subject: [PATCH 1/7] llvmPackages_7.libunwind: simplify expressions * Use LLVM_PATH instead of llvm-config * Pass less unnecessary options to cmake --- .../development/compilers/llvm/7/libunwind/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/llvm/7/libunwind/default.nix b/pkgs/development/compilers/llvm/7/libunwind/default.nix index 14c0abc5153..e8e96cf11cd 100644 --- a/pkgs/development/compilers/llvm/7/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/7/libunwind/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, fetchpatch, cmake, llvm, libcxx +{ lib, stdenv, version, fetch, fetchpatch, cmake, llvm , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -8,6 +8,11 @@ stdenv.mkDerivation { src = fetch "libunwind" "035dsxs10nyiqd00q07yycvmkjl01yz4jdlrjvmch8klxg4pyjhp"; + postUnpack = '' + unpackFile ${llvm.src} + cmakeFlagsArray=($cmakeFlagsArray -DLLVM_PATH=$PWD/$(ls -d llvm-*)) + ''; + patches = [ ./gnu-install-dirs.patch ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ @@ -24,12 +29,11 @@ stdenv.mkDerivation { }) ]; - nativeBuildInputs = [ cmake llvm.dev ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optionals (!enableShared) [ "-DLIBUNWIND_ENABLE_SHARED=OFF" ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ - "-DLIBUNWIND_HAS_NOSTDINCXX_FLAG=ON" "-DLLVM_ENABLE_LIBCXX=ON" ]; } From 894a09dfd215916f7fe61c273b29108d47d4f125 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Mon, 26 Apr 2021 21:46:44 +0200 Subject: [PATCH 2/7] llvmPackages_7.lldClang: add libunwind to extraLibraries --- pkgs/development/compilers/llvm/7/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 7aa3f9099cc..937bdb644a7 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -106,6 +106,8 @@ let extraPackages = [ targetLlvmLibraries.libcxxabi targetLlvmLibraries.compiler-rt + ] ++ lib.optionals (!stdenv.targetPlatform.isWasm) [ + targetLlvmLibraries.libunwind ]; extraBuildCommands = '' echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags From 4caedc060f7a664413373a92287f31c9bd90bed4 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Mon, 26 Apr 2021 21:46:44 +0200 Subject: [PATCH 3/7] llvmPackages_12.libunwind: Make sure we get right llvm version --- pkgs/development/compilers/llvm/12/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix index e5d6b316cd1..9a2bfb3fb40 100644 --- a/pkgs/development/compilers/llvm/12/default.nix +++ b/pkgs/development/compilers/llvm/12/default.nix @@ -229,12 +229,13 @@ let libunwind = libraries.libunwind; })); - openmp = callPackage ./openmp { inherit llvm_meta; }; + libunwind = callPackage ./libunwind ({ + inherit (buildLlvmTools) llvm; + } // lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { + stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; + }); - libunwind = callPackage ./libunwind ({ inherit llvm_meta; } // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + openmp = callPackage ./openmp { inherit llvm_meta; }; }); From 894f0c6ec8952f5074d48a373506524f75700012 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 11 May 2021 23:57:07 +0000 Subject: [PATCH 4/7] llvmPackages: Always put `libunwind` before `openmp` This keeps the "main bootstrap" together. --- pkgs/development/compilers/llvm/10/default.nix | 3 +-- pkgs/development/compilers/llvm/11/default.nix | 3 +-- pkgs/development/compilers/llvm/12/default.nix | 1 - pkgs/development/compilers/llvm/8/default.nix | 3 +-- pkgs/development/compilers/llvm/9/default.nix | 3 +-- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index e2e78e16d79..b63caf151f3 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -188,13 +188,12 @@ let libunwind = libraries.libunwind; })); - openmp = callPackage ./openmp.nix {}; - libunwind = callPackage ./libunwind ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); + openmp = callPackage ./openmp.nix {}; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix index 69c6564babe..d119460736c 100644 --- a/pkgs/development/compilers/llvm/11/default.nix +++ b/pkgs/development/compilers/llvm/11/default.nix @@ -189,13 +189,12 @@ let libunwind = libraries.libunwind; })); - openmp = callPackage ./openmp.nix {}; - libunwind = callPackage ./libunwind ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); + openmp = callPackage ./openmp.nix {}; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix index 9a2bfb3fb40..73a8b7a90a0 100644 --- a/pkgs/development/compilers/llvm/12/default.nix +++ b/pkgs/development/compilers/llvm/12/default.nix @@ -236,7 +236,6 @@ let }); openmp = callPackage ./openmp { inherit llvm_meta; }; - }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index bcbbd155e36..2ff579d071d 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -191,13 +191,12 @@ let libunwind = libraries.libunwind; })); - openmp = callPackage ./openmp.nix {}; - libunwind = callPackage ./libunwind ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); + openmp = callPackage ./openmp.nix {}; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index 0660bac137f..8a1400dfd37 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -191,13 +191,12 @@ let libunwind = libraries.libunwind; })); - openmp = callPackage ./openmp.nix {}; - libunwind = callPackage ./libunwind ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); + openmp = callPackage ./openmp.nix {}; }); in { inherit tools libraries; } // libraries // tools From e0d3c9d0317edf7fd8d99e78066a7cdaf1c5da21 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 11 May 2021 19:43:21 +0000 Subject: [PATCH 5/7] llvmPackages*.libcxx*: Always use the attribute name for pname This decision was made in a902d99422c6a522ffae7b8ad7711e23c7490d42 but just for LLVM 12. Now we apply it consitently. --- pkgs/development/compilers/llvm/10/default.nix | 4 ++-- .../compilers/llvm/10/{libc++ => libcxx}/default.nix | 2 +- .../llvm/10/{libc++ => libcxx}/gnu-install-dirs.patch | 0 .../compilers/llvm/10/{libc++abi => libcxxabi}/default.nix | 2 +- .../llvm/10/{libc++abi => libcxxabi}/gnu-install-dirs.patch | 0 .../llvm/10/{libc++abi => libcxxabi}/no-threads.patch | 0 .../compilers/llvm/10/{libc++abi => libcxxabi}/wasm.patch | 0 pkgs/development/compilers/llvm/11/default.nix | 4 ++-- .../compilers/llvm/11/{libc++ => libcxx}/default.nix | 2 +- .../llvm/11/{libc++ => libcxx}/gnu-install-dirs.patch | 0 .../compilers/llvm/11/{libc++abi => libcxxabi}/default.nix | 2 +- .../llvm/11/{libc++abi => libcxxabi}/gnu-install-dirs.patch | 0 .../llvm/11/{libc++abi => libcxxabi}/no-threads.patch | 0 .../compilers/llvm/11/{libc++abi => libcxxabi}/wasm.patch | 0 pkgs/development/compilers/llvm/5/default.nix | 4 ++-- .../compilers/llvm/5/{libc++ => libcxx}/default.nix | 2 +- .../llvm/5/{libc++ => libcxx}/gnu-install-dirs.patch | 0 .../compilers/llvm/5/{libc++abi => libcxxabi}/default.nix | 2 +- .../llvm/5/{libc++abi => libcxxabi}/gnu-install-dirs.patch | 0 pkgs/development/compilers/llvm/6/default.nix | 4 ++-- .../compilers/llvm/6/{libc++ => libcxx}/default.nix | 2 +- .../llvm/6/{libc++ => libcxx}/gnu-install-dirs.patch | 0 .../compilers/llvm/6/{libc++abi => libcxxabi}/default.nix | 2 +- .../llvm/6/{libc++abi => libcxxabi}/gnu-install-dirs.patch | 0 pkgs/development/compilers/llvm/7/default.nix | 4 ++-- .../compilers/llvm/7/{libc++ => libcxx}/default.nix | 2 +- .../llvm/7/{libc++ => libcxx}/gnu-install-dirs.patch | 0 .../compilers/llvm/7/{libc++abi => libcxxabi}/default.nix | 2 +- .../llvm/7/{libc++abi => libcxxabi}/gnu-install-dirs.patch | 0 pkgs/development/compilers/llvm/8/default.nix | 4 ++-- .../compilers/llvm/8/{libc++ => libcxx}/default.nix | 2 +- .../llvm/8/{libc++ => libcxx}/gnu-install-dirs.patch | 0 .../compilers/llvm/8/{libc++abi => libcxxabi}/default.nix | 2 +- .../llvm/8/{libc++abi => libcxxabi}/gnu-install-dirs.patch | 0 .../llvm/8/{libc++abi => libcxxabi}/no-threads.patch | 0 .../compilers/llvm/8/{libc++abi => libcxxabi}/wasm.patch | 0 pkgs/development/compilers/llvm/9/default.nix | 4 ++-- .../compilers/llvm/9/{libc++ => libcxx}/default.nix | 2 +- .../llvm/9/{libc++ => libcxx}/gnu-install-dirs.patch | 0 .../compilers/llvm/9/{libc++abi => libcxxabi}/default.nix | 2 +- .../llvm/9/{libc++abi => libcxxabi}/gnu-install-dirs.patch | 0 .../llvm/9/{libc++abi => libcxxabi}/no-threads.patch | 0 .../compilers/llvm/9/{libc++abi => libcxxabi}/wasm.patch | 0 43 files changed, 28 insertions(+), 28 deletions(-) rename pkgs/development/compilers/llvm/10/{libc++ => libcxx}/default.nix (98%) rename pkgs/development/compilers/llvm/10/{libc++ => libcxx}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/10/{libc++abi => libcxxabi}/default.nix (99%) rename pkgs/development/compilers/llvm/10/{libc++abi => libcxxabi}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/10/{libc++abi => libcxxabi}/no-threads.patch (100%) rename pkgs/development/compilers/llvm/10/{libc++abi => libcxxabi}/wasm.patch (100%) rename pkgs/development/compilers/llvm/11/{libc++ => libcxx}/default.nix (98%) rename pkgs/development/compilers/llvm/11/{libc++ => libcxx}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/11/{libc++abi => libcxxabi}/default.nix (99%) rename pkgs/development/compilers/llvm/11/{libc++abi => libcxxabi}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/11/{libc++abi => libcxxabi}/no-threads.patch (100%) rename pkgs/development/compilers/llvm/11/{libc++abi => libcxxabi}/wasm.patch (100%) rename pkgs/development/compilers/llvm/5/{libc++ => libcxx}/default.nix (98%) rename pkgs/development/compilers/llvm/5/{libc++ => libcxx}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/5/{libc++abi => libcxxabi}/default.nix (98%) rename pkgs/development/compilers/llvm/5/{libc++abi => libcxxabi}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/6/{libc++ => libcxx}/default.nix (98%) rename pkgs/development/compilers/llvm/6/{libc++ => libcxx}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/6/{libc++abi => libcxxabi}/default.nix (98%) rename pkgs/development/compilers/llvm/6/{libc++abi => libcxxabi}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/7/{libc++ => libcxx}/default.nix (98%) rename pkgs/development/compilers/llvm/7/{libc++ => libcxx}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/7/{libc++abi => libcxxabi}/default.nix (99%) rename pkgs/development/compilers/llvm/7/{libc++abi => libcxxabi}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/8/{libc++ => libcxx}/default.nix (99%) rename pkgs/development/compilers/llvm/8/{libc++ => libcxx}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/8/{libc++abi => libcxxabi}/default.nix (99%) rename pkgs/development/compilers/llvm/8/{libc++abi => libcxxabi}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/8/{libc++abi => libcxxabi}/no-threads.patch (100%) rename pkgs/development/compilers/llvm/8/{libc++abi => libcxxabi}/wasm.patch (100%) rename pkgs/development/compilers/llvm/9/{libc++ => libcxx}/default.nix (98%) rename pkgs/development/compilers/llvm/9/{libc++ => libcxx}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/9/{libc++abi => libcxxabi}/default.nix (99%) rename pkgs/development/compilers/llvm/9/{libc++abi => libcxxabi}/gnu-install-dirs.patch (100%) rename pkgs/development/compilers/llvm/9/{libc++abi => libcxxabi}/no-threads.patch (100%) rename pkgs/development/compilers/llvm/9/{libc++abi => libcxxabi}/wasm.patch (100%) diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index b63caf151f3..754c8cdc778 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -177,12 +177,12 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libc++ ({} // + libcxx = callPackage ./libcxx ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); - libcxxabi = callPackage ./libc++abi ({} // + libcxxabi = callPackage ./libcxxabi ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; libunwind = libraries.libunwind; diff --git a/pkgs/development/compilers/llvm/10/libc++/default.nix b/pkgs/development/compilers/llvm/10/libcxx/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/10/libc++/default.nix rename to pkgs/development/compilers/llvm/10/libcxx/default.nix index 1e5dc5b2dac..10616642f74 100644 --- a/pkgs/development/compilers/llvm/10/libc++/default.nix +++ b/pkgs/development/compilers/llvm/10/libcxx/default.nix @@ -3,7 +3,7 @@ }: stdenv.mkDerivation { - pname = "libc++"; + pname = "libcxx"; inherit version; src = fetch "libcxx" "0v78bfr6h2zifvdqnj2wlfk4pvxzrqn3hg1v6lqk3y12bx9p9xny"; diff --git a/pkgs/development/compilers/llvm/10/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/libcxx/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/libc++/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/10/libcxx/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/10/libc++abi/default.nix b/pkgs/development/compilers/llvm/10/libcxxabi/default.nix similarity index 99% rename from pkgs/development/compilers/llvm/10/libc++abi/default.nix rename to pkgs/development/compilers/llvm/10/libcxxabi/default.nix index bc5e77b739d..aa34af37c62 100644 --- a/pkgs/development/compilers/llvm/10/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/10/libcxxabi/default.nix @@ -3,7 +3,7 @@ }: stdenv.mkDerivation { - pname = "libc++abi"; + pname = "libcxxabi"; inherit version; src = fetch "libcxxabi" "0yqs722y76cwvmfsq0lb917r9m3fci7bf5z3yzl71yz9n88ghzm9"; diff --git a/pkgs/development/compilers/llvm/10/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/libcxxabi/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/libc++abi/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/10/libcxxabi/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/10/libc++abi/no-threads.patch b/pkgs/development/compilers/llvm/10/libcxxabi/no-threads.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/libc++abi/no-threads.patch rename to pkgs/development/compilers/llvm/10/libcxxabi/no-threads.patch diff --git a/pkgs/development/compilers/llvm/10/libc++abi/wasm.patch b/pkgs/development/compilers/llvm/10/libcxxabi/wasm.patch similarity index 100% rename from pkgs/development/compilers/llvm/10/libc++abi/wasm.patch rename to pkgs/development/compilers/llvm/10/libcxxabi/wasm.patch diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix index d119460736c..a8f6523dd90 100644 --- a/pkgs/development/compilers/llvm/11/default.nix +++ b/pkgs/development/compilers/llvm/11/default.nix @@ -178,12 +178,12 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libc++ ({} // + libcxx = callPackage ./libcxx ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); - libcxxabi = callPackage ./libc++abi ({} // + libcxxabi = callPackage ./libcxxabi ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; libunwind = libraries.libunwind; diff --git a/pkgs/development/compilers/llvm/11/libc++/default.nix b/pkgs/development/compilers/llvm/11/libcxx/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/11/libc++/default.nix rename to pkgs/development/compilers/llvm/11/libcxx/default.nix index e095350cea7..08150dc2f22 100644 --- a/pkgs/development/compilers/llvm/11/libc++/default.nix +++ b/pkgs/development/compilers/llvm/11/libcxx/default.nix @@ -3,7 +3,7 @@ }: stdenv.mkDerivation { - pname = "libc++"; + pname = "libcxx"; inherit version; src = fetch "libcxx" "1rgqsqpgi0vkga5d7hy0iyfsqgzfz7q1xy7afdfa1snp1qjks8xv"; diff --git a/pkgs/development/compilers/llvm/11/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/libcxx/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/libc++/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/11/libcxx/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/11/libc++abi/default.nix b/pkgs/development/compilers/llvm/11/libcxxabi/default.nix similarity index 99% rename from pkgs/development/compilers/llvm/11/libc++abi/default.nix rename to pkgs/development/compilers/llvm/11/libcxxabi/default.nix index a79a0d2f07a..209d34ba92a 100644 --- a/pkgs/development/compilers/llvm/11/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/11/libcxxabi/default.nix @@ -3,7 +3,7 @@ }: stdenv.mkDerivation { - pname = "libc++abi"; + pname = "libcxxabi"; inherit version; src = fetch "libcxxabi" "1azcf31mxw59hb1x17xncnm3dyw90ylh8rqx462lvypqh3nr6c8l"; diff --git a/pkgs/development/compilers/llvm/11/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/libcxxabi/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/libc++abi/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/11/libcxxabi/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/11/libc++abi/no-threads.patch b/pkgs/development/compilers/llvm/11/libcxxabi/no-threads.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/libc++abi/no-threads.patch rename to pkgs/development/compilers/llvm/11/libcxxabi/no-threads.patch diff --git a/pkgs/development/compilers/llvm/11/libc++abi/wasm.patch b/pkgs/development/compilers/llvm/11/libcxxabi/wasm.patch similarity index 100% rename from pkgs/development/compilers/llvm/11/libc++abi/wasm.patch rename to pkgs/development/compilers/llvm/11/libcxxabi/wasm.patch diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix index c416964b22a..67743cb8c97 100644 --- a/pkgs/development/compilers/llvm/5/default.nix +++ b/pkgs/development/compilers/llvm/5/default.nix @@ -91,9 +91,9 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libc++ {}; + libcxx = callPackage ./libcxx {}; - libcxxabi = callPackage ./libc++abi {}; + libcxxabi = callPackage ./libcxxabi {}; openmp = callPackage ./openmp.nix {}; }); diff --git a/pkgs/development/compilers/llvm/5/libc++/default.nix b/pkgs/development/compilers/llvm/5/libcxx/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/5/libc++/default.nix rename to pkgs/development/compilers/llvm/5/libcxx/default.nix index 77421b4e6d8..f7e973be3d4 100644 --- a/pkgs/development/compilers/llvm/5/libc++/default.nix +++ b/pkgs/development/compilers/llvm/5/libcxx/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version }: stdenv.mkDerivation { - pname = "libc++"; + pname = "libcxx"; inherit version; src = fetch "libcxx" "1672aaf95fgy4xsfra8pw24f6r93zwzpan1033hkcm8p2glqipvf"; diff --git a/pkgs/development/compilers/llvm/5/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/libcxx/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/5/libc++/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/5/libcxx/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/5/libc++abi/default.nix b/pkgs/development/compilers/llvm/5/libcxxabi/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/5/libc++abi/default.nix rename to pkgs/development/compilers/llvm/5/libcxxabi/default.nix index 8bc3b9e2977..85323c4371c 100644 --- a/pkgs/development/compilers/llvm/5/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/5/libcxxabi/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version }: stdenv.mkDerivation { - pname = "libc++abi"; + pname = "libcxxabi"; inherit version; src = fetch "libcxxabi" "12lp799rskr4fc2xr64qn4jfkjnfd8b1aymvsxyn4k9ar7r9pgqv"; diff --git a/pkgs/development/compilers/llvm/5/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/libcxxabi/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/5/libc++abi/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/5/libcxxabi/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/6/default.nix b/pkgs/development/compilers/llvm/6/default.nix index b78f7a62506..b4fd0a3bf71 100644 --- a/pkgs/development/compilers/llvm/6/default.nix +++ b/pkgs/development/compilers/llvm/6/default.nix @@ -92,9 +92,9 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libc++ {}; + libcxx = callPackage ./libcxx {}; - libcxxabi = callPackage ./libc++abi {}; + libcxxabi = callPackage ./libcxxabi {}; openmp = callPackage ./openmp.nix {}; }); diff --git a/pkgs/development/compilers/llvm/6/libc++/default.nix b/pkgs/development/compilers/llvm/6/libcxx/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/6/libc++/default.nix rename to pkgs/development/compilers/llvm/6/libcxx/default.nix index 69314fbe2ba..001fa3ed683 100644 --- a/pkgs/development/compilers/llvm/6/libc++/default.nix +++ b/pkgs/development/compilers/llvm/6/libcxx/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version }: stdenv.mkDerivation { - pname = "libc++"; + pname = "libcxx"; inherit version; src = fetch "libcxx" "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"; diff --git a/pkgs/development/compilers/llvm/6/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/6/libcxx/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/6/libc++/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/6/libcxx/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/6/libc++abi/default.nix b/pkgs/development/compilers/llvm/6/libcxxabi/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/6/libc++abi/default.nix rename to pkgs/development/compilers/llvm/6/libcxxabi/default.nix index 04054f0ba0e..109b5ef51bc 100644 --- a/pkgs/development/compilers/llvm/6/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/6/libcxxabi/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version }: stdenv.mkDerivation { - pname = "libc++abi"; + pname = "libcxxabi"; inherit version; src = fetch "libcxxabi" "0prqvdj317qrc8nddaq1hh2ag9algkd9wbkj3y4mr5588k12x7r0"; diff --git a/pkgs/development/compilers/llvm/6/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/6/libcxxabi/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/6/libc++abi/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/6/libcxxabi/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 937bdb644a7..fbae9840b24 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -180,12 +180,12 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libc++ ({} // + libcxx = callPackage ./libcxx ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); - libcxxabi = callPackage ./libc++abi ({} // + libcxxabi = callPackage ./libcxxabi ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; libunwind = libraries.libunwind; diff --git a/pkgs/development/compilers/llvm/7/libc++/default.nix b/pkgs/development/compilers/llvm/7/libcxx/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/7/libc++/default.nix rename to pkgs/development/compilers/llvm/7/libcxx/default.nix index afc59d91179..954ac50658b 100644 --- a/pkgs/development/compilers/llvm/7/libc++/default.nix +++ b/pkgs/development/compilers/llvm/7/libcxx/default.nix @@ -3,7 +3,7 @@ }: stdenv.mkDerivation { - pname = "libc++"; + pname = "libcxx"; inherit version; src = fetch "libcxx" "0kmhcapm2cjwalyiqasj9dmqbw59mcwdl8fgl951wg7ax84b8hj4"; diff --git a/pkgs/development/compilers/llvm/7/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/libcxx/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/7/libc++/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/7/libcxx/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/7/libc++abi/default.nix b/pkgs/development/compilers/llvm/7/libcxxabi/default.nix similarity index 99% rename from pkgs/development/compilers/llvm/7/libc++abi/default.nix rename to pkgs/development/compilers/llvm/7/libcxxabi/default.nix index 31ead6eb421..bb9fb684bc0 100644 --- a/pkgs/development/compilers/llvm/7/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/7/libcxxabi/default.nix @@ -6,7 +6,7 @@ }: stdenv.mkDerivation { - pname = "libc++abi"; + pname = "libcxxabi"; inherit version; src = fetch "libcxxabi" "1zcqxsdjhawgz1cvpk07y3jl6fg9p3ay4nl69zsirqb2ghgyhhb2"; diff --git a/pkgs/development/compilers/llvm/7/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/libcxxabi/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/7/libc++abi/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/7/libcxxabi/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index 2ff579d071d..ccf80f3df2a 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -180,12 +180,12 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libc++ ({} // + libcxx = callPackage ./libcxx ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); - libcxxabi = callPackage ./libc++abi ({} // + libcxxabi = callPackage ./libcxxabi ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; libunwind = libraries.libunwind; diff --git a/pkgs/development/compilers/llvm/8/libc++/default.nix b/pkgs/development/compilers/llvm/8/libcxx/default.nix similarity index 99% rename from pkgs/development/compilers/llvm/8/libc++/default.nix rename to pkgs/development/compilers/llvm/8/libcxx/default.nix index d73600b441d..5589cb7180a 100644 --- a/pkgs/development/compilers/llvm/8/libc++/default.nix +++ b/pkgs/development/compilers/llvm/8/libcxx/default.nix @@ -3,7 +3,7 @@ }: stdenv.mkDerivation { - pname = "libc++"; + pname = "libcxx"; inherit version; src = fetch "libcxx" "0y4vc9z36c1zlq15cnibdzxnc1xi5glbc6klnm8a41q3db4541kz"; diff --git a/pkgs/development/compilers/llvm/8/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/libcxx/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/libc++/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/8/libcxx/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/8/libc++abi/default.nix b/pkgs/development/compilers/llvm/8/libcxxabi/default.nix similarity index 99% rename from pkgs/development/compilers/llvm/8/libc++abi/default.nix rename to pkgs/development/compilers/llvm/8/libcxxabi/default.nix index 5659bb4f14a..ccc43d7cb21 100644 --- a/pkgs/development/compilers/llvm/8/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/8/libcxxabi/default.nix @@ -3,7 +3,7 @@ }: stdenv.mkDerivation { - pname = "libc++abi"; + pname = "libcxxabi"; inherit version; src = fetch "libcxxabi" "1vznz8n1z1h8af0ga451m98lc2hjnv4fyzl71napsvjhvk4g6nxp"; diff --git a/pkgs/development/compilers/llvm/8/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/libcxxabi/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/libc++abi/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/8/libcxxabi/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/8/libc++abi/no-threads.patch b/pkgs/development/compilers/llvm/8/libcxxabi/no-threads.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/libc++abi/no-threads.patch rename to pkgs/development/compilers/llvm/8/libcxxabi/no-threads.patch diff --git a/pkgs/development/compilers/llvm/8/libc++abi/wasm.patch b/pkgs/development/compilers/llvm/8/libcxxabi/wasm.patch similarity index 100% rename from pkgs/development/compilers/llvm/8/libc++abi/wasm.patch rename to pkgs/development/compilers/llvm/8/libcxxabi/wasm.patch diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index 8a1400dfd37..ff9a2462630 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -180,12 +180,12 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libc++ ({} // + libcxx = callPackage ./libcxx ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; })); - libcxxabi = callPackage ./libc++abi ({} // + libcxxabi = callPackage ./libcxxabi ({} // (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; libunwind = libraries.libunwind; diff --git a/pkgs/development/compilers/llvm/9/libc++/default.nix b/pkgs/development/compilers/llvm/9/libcxx/default.nix similarity index 98% rename from pkgs/development/compilers/llvm/9/libc++/default.nix rename to pkgs/development/compilers/llvm/9/libcxx/default.nix index 3cdb4f32a05..bfcd18a6e43 100644 --- a/pkgs/development/compilers/llvm/9/libc++/default.nix +++ b/pkgs/development/compilers/llvm/9/libcxx/default.nix @@ -3,7 +3,7 @@ }: stdenv.mkDerivation { - pname = "libc++"; + pname = "libcxx"; inherit version; src = fetch "libcxx" "0d2bj5i6mk4caq7skd5nsdmz8c2m5w5anximl5wz3x32p08zz089"; diff --git a/pkgs/development/compilers/llvm/9/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/libcxx/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/libc++/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/9/libcxx/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/9/libc++abi/default.nix b/pkgs/development/compilers/llvm/9/libcxxabi/default.nix similarity index 99% rename from pkgs/development/compilers/llvm/9/libc++abi/default.nix rename to pkgs/development/compilers/llvm/9/libcxxabi/default.nix index 5358985f448..1f0d7af25e4 100644 --- a/pkgs/development/compilers/llvm/9/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/9/libcxxabi/default.nix @@ -3,7 +3,7 @@ }: stdenv.mkDerivation { - pname = "libc++abi"; + pname = "libcxxabi"; inherit version; src = fetch "libcxxabi" "1b4aiaa8cirx52vk2p5kfk57qmbqf1ipb4nqnjhdgqps9jm7iyg8"; diff --git a/pkgs/development/compilers/llvm/9/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/libcxxabi/gnu-install-dirs.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/libc++abi/gnu-install-dirs.patch rename to pkgs/development/compilers/llvm/9/libcxxabi/gnu-install-dirs.patch diff --git a/pkgs/development/compilers/llvm/9/libc++abi/no-threads.patch b/pkgs/development/compilers/llvm/9/libcxxabi/no-threads.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/libc++abi/no-threads.patch rename to pkgs/development/compilers/llvm/9/libcxxabi/no-threads.patch diff --git a/pkgs/development/compilers/llvm/9/libc++abi/wasm.patch b/pkgs/development/compilers/llvm/9/libcxxabi/wasm.patch similarity index 100% rename from pkgs/development/compilers/llvm/9/libc++abi/wasm.patch rename to pkgs/development/compilers/llvm/9/libcxxabi/wasm.patch From 37194a325de090747ce5f97a38de4329708c1912 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 11 May 2021 19:20:15 +0000 Subject: [PATCH 6/7] treewide: Try to make a few bootstrapping things more consistent - Introduce `preLibcCrossHeaders` to bootstrap libgcc and compiler-rt the same way. - Organize LLVM bintools as `bintools{-unwrapped,,NoLibc}` for consistency with GNU Binutils and Apple's cctools. - Do Android changes for all `llvmPackages` for consistency. - Improve the way the default GCC and LLVM versions are selected. --- .../10/{bintools.nix => bintools/default.nix} | 0 .../compilers/llvm/10/compiler-rt/default.nix | 14 ++--- .../development/compilers/llvm/10/default.nix | 58 ++++++++++++----- .../11/{bintools.nix => bintools/default.nix} | 0 .../compilers/llvm/11/compiler-rt/default.nix | 14 ++--- .../development/compilers/llvm/11/default.nix | 58 ++++++++++++----- .../compilers/llvm/12/compiler-rt/default.nix | 3 +- .../development/compilers/llvm/12/default.nix | 52 ++++++++------- .../7/{bintools.nix => bintools/default.nix} | 0 .../compilers/llvm/7/compiler-rt/default.nix | 17 ++--- pkgs/development/compilers/llvm/7/default.nix | 51 ++++++++++----- .../8/{bintools.nix => bintools/default.nix} | 0 .../compilers/llvm/8/compiler-rt/default.nix | 9 +-- pkgs/development/compilers/llvm/8/default.nix | 58 ++++++++++++----- .../9/{bintools.nix => bintools/default.nix} | 0 .../compilers/llvm/9/compiler-rt/default.nix | 12 ++-- pkgs/development/compilers/llvm/9/default.nix | 58 ++++++++++++----- pkgs/top-level/all-packages.nix | 63 ++++++++++--------- pkgs/top-level/darwin-packages.nix | 3 +- 19 files changed, 301 insertions(+), 169 deletions(-) rename pkgs/development/compilers/llvm/10/{bintools.nix => bintools/default.nix} (100%) rename pkgs/development/compilers/llvm/11/{bintools.nix => bintools/default.nix} (100%) rename pkgs/development/compilers/llvm/7/{bintools.nix => bintools/default.nix} (100%) rename pkgs/development/compilers/llvm/8/{bintools.nix => bintools/default.nix} (100%) rename pkgs/development/compilers/llvm/9/{bintools.nix => bintools/default.nix} (100%) diff --git a/pkgs/development/compilers/llvm/10/bintools.nix b/pkgs/development/compilers/llvm/10/bintools/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/10/bintools.nix rename to pkgs/development/compilers/llvm/10/bintools/default.nix diff --git a/pkgs/development/compilers/llvm/10/compiler-rt/default.nix b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix index 1f990ac433d..85f2298f586 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix @@ -4,14 +4,15 @@ let useLLVM = stdenv.hostPlatform.useLLVM or false; bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; + haveLibc = stdenv.cc.libc != null; inherit (stdenv.hostPlatform) isMusl; in -stdenv.mkDerivation rec { - pname = "compiler-rt"; +stdenv.mkDerivation { + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; inherit version; - src = fetch pname "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr"; + src = fetch "compiler-rt" "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr"; nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; @@ -29,14 +30,15 @@ stdenv.mkDerivation rec { "-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" "-DCOMPILER_RT_BUILD_PROFILE=OFF" - ] ++ lib.optionals (useLLVM || bareMetal) [ + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ "-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON" "-DCOMPILER_RT_BAREMETAL_BUILD=ON" "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" + ] ++ lib.optionals (useLLVM && !haveLibc) [ + "-DCMAKE_C_FLAGS=-nodefaultlibs" ] ++ lib.optionals (useLLVM) [ "-DCOMPILER_RT_BUILD_BUILTINS=ON" - "-DCMAKE_C_FLAGS=-nodefaultlibs" #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" ] ++ lib.optionals (bareMetal) [ @@ -58,7 +60,6 @@ stdenv.mkDerivation rec { ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.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 # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd @@ -88,5 +89,4 @@ stdenv.mkDerivation rec { ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o ''; - } diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index 754c8cdc778..ead6c252651 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -1,4 +1,5 @@ -{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs +{ lowPrio, newScope, pkgs, lib, stdenv, cmake +, gccForLibs, preLibcCrossHeaders , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -93,7 +94,16 @@ let # doesn’t support like LLVM. Probably we should move to some other # file. - bintools = callPackage ./bintools.nix {}; + bintools-unwrapped = callPackage ./bintools {}; + + bintoolsNoLibc = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + libc = preLibcCrossHeaders; + }; + + bintools = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + }; lldClang = wrapCCWith rec { cc = tools.clang-unwrapped; @@ -112,6 +122,8 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + '' + lib.optionalString (stdenv.targetPlatform.isAndroid && stdenv.targetPlatform.useLLVM) '' + echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' echo "-fno-exceptions" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands cc; @@ -120,9 +132,7 @@ let lldClangNoLibcxx = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - }; + inherit (tools) bintools; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -136,10 +146,7 @@ let lldClangNoLibc = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -152,26 +159,43 @@ let lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands0 cc; }; + lldClangNoCompilerRtWithLibc = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = null; + inherit (tools) bintools; + extraPackages = [ ]; + extraBuildCommands = mkExtraBuildCommands0 cc; + }; + }); 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 ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; - })); + compiler-rt-libc = callPackage ./compiler-rt { + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc + else stdenv; + }; + + compiler-rt-no-libc = callPackage ./compiler-rt { + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt + else stdenv; + }; + + # N.B. condition is safe because without useLLVM both are the same. + compiler-rt = if stdenv.hostPlatform.isAndroid + then libraries.compiler-rt-libc + else libraries.compiler-rt-no-libc; stdenv = overrideCC stdenv buildLlvmTools.clang; diff --git a/pkgs/development/compilers/llvm/11/bintools.nix b/pkgs/development/compilers/llvm/11/bintools/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/11/bintools.nix rename to pkgs/development/compilers/llvm/11/bintools/default.nix diff --git a/pkgs/development/compilers/llvm/11/compiler-rt/default.nix b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix index 257bc34092f..61ff00cda6d 100644 --- a/pkgs/development/compilers/llvm/11/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix @@ -4,14 +4,15 @@ let useLLVM = stdenv.hostPlatform.useLLVM or false; bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; + haveLibc = stdenv.cc.libc != null; inherit (stdenv.hostPlatform) isMusl; in -stdenv.mkDerivation rec { - pname = "compiler-rt"; +stdenv.mkDerivation { + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; inherit version; - src = fetch pname "0x1j8ngf1zj63wlnns9vlibafq48qcm72p4jpaxkmkb4qw0grwfy"; + src = fetch "compiler-rt" "0x1j8ngf1zj63wlnns9vlibafq48qcm72p4jpaxkmkb4qw0grwfy"; nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; @@ -29,14 +30,15 @@ stdenv.mkDerivation rec { "-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" "-DCOMPILER_RT_BUILD_PROFILE=OFF" - ] ++ lib.optionals (useLLVM || bareMetal) [ + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ "-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON" "-DCOMPILER_RT_BAREMETAL_BUILD=ON" "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" + ] ++ lib.optionals (useLLVM && !haveLibc) [ + "-DCMAKE_C_FLAGS=-nodefaultlibs" ] ++ lib.optionals (useLLVM) [ "-DCOMPILER_RT_BUILD_BUILTINS=ON" - "-DCMAKE_C_FLAGS=-nodefaultlibs" #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" ] ++ lib.optionals (bareMetal) [ @@ -59,7 +61,6 @@ stdenv.mkDerivation rec { ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.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 # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd @@ -91,5 +92,4 @@ stdenv.mkDerivation rec { ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o ''; - } diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix index a8f6523dd90..bab5831e17c 100644 --- a/pkgs/development/compilers/llvm/11/default.nix +++ b/pkgs/development/compilers/llvm/11/default.nix @@ -1,4 +1,5 @@ -{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs +{ lowPrio, newScope, pkgs, lib, stdenv, cmake +, gccForLibs, preLibcCrossHeaders , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -94,7 +95,16 @@ let # doesn’t support like LLVM. Probably we should move to some other # file. - bintools = callPackage ./bintools.nix {}; + bintools-unwrapped = callPackage ./bintools {}; + + bintoolsNoLibc = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + libc = preLibcCrossHeaders; + }; + + bintools = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + }; lldClang = wrapCCWith rec { cc = tools.clang-unwrapped; @@ -113,6 +123,8 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + '' + lib.optionalString (stdenv.targetPlatform.isAndroid && stdenv.targetPlatform.useLLVM) '' + echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' echo "-fno-exceptions" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands cc; @@ -121,9 +133,7 @@ let lldClangNoLibcxx = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - }; + inherit (tools) bintools; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -137,10 +147,7 @@ let lldClangNoLibc = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -153,26 +160,43 @@ let lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands0 cc; }; + lldClangNoCompilerRtWithLibc = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = null; + inherit (tools) bintools; + extraPackages = [ ]; + extraBuildCommands = mkExtraBuildCommands0 cc; + }; + }); 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 ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; - })); + compiler-rt-libc = callPackage ./compiler-rt { + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc + else stdenv; + }; + + compiler-rt-no-libc = callPackage ./compiler-rt { + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt + else stdenv; + }; + + # N.B. condition is safe because without useLLVM both are the same. + compiler-rt = if stdenv.hostPlatform.isAndroid + then libraries.compiler-rt-libc + else libraries.compiler-rt-no-libc; stdenv = overrideCC stdenv buildLlvmTools.clang; diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix index 8ca01e44a54..895af8f2f02 100644 --- a/pkgs/development/compilers/llvm/12/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/12/compiler-rt/default.nix @@ -9,7 +9,7 @@ let in -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; inherit version; src = fetch "compiler-rt" "0d444qihq9jhqnfv003cr704v363va72zl6qaw2algj1c85cva45"; @@ -61,7 +61,6 @@ stdenv.mkDerivation rec { ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.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 # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix index 73a8b7a90a0..2d3c1795bd2 100644 --- a/pkgs/development/compilers/llvm/12/default.nix +++ b/pkgs/development/compilers/llvm/12/default.nix @@ -1,4 +1,5 @@ -{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs +{ lowPrio, newScope, pkgs, lib, stdenv, cmake +, gccForLibs, preLibcCrossHeaders , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -112,7 +113,16 @@ let # doesn’t support like LLVM. Probably we should move to some other # file. - bintools = callPackage ./bintools {}; + bintools-unwrapped = callPackage ./bintools {}; + + bintoolsNoLibc = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + libc = preLibcCrossHeaders; + }; + + bintools = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + }; lldClang = wrapCCWith rec { cc = tools.clang-unwrapped; @@ -141,9 +151,7 @@ let lldClangNoLibcxx = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - }; + inherit (tools) bintools; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -157,10 +165,7 @@ let lldClangNoLibc = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -173,10 +178,7 @@ let lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags @@ -186,9 +188,7 @@ let lldClangNoCompilerRtWithLibc = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - }; + inherit (tools) bintools; extraPackages = [ ]; extraBuildCommands = mkExtraBuildCommands0 cc; }; @@ -199,15 +199,19 @@ let callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); in { - compiler-rt-libc = callPackage ./compiler-rt ({ inherit llvm_meta; } // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc; - })); + compiler-rt-libc = callPackage ./compiler-rt { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc + else stdenv; + }; - compiler-rt-no-libc = callPackage ./compiler-rt ({ inherit llvm_meta; } // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; - })); + compiler-rt-no-libc = callPackage ./compiler-rt { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt + else stdenv; + }; # N.B. condition is safe because without useLLVM both are the same. compiler-rt = if stdenv.hostPlatform.isAndroid diff --git a/pkgs/development/compilers/llvm/7/bintools.nix b/pkgs/development/compilers/llvm/7/bintools/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/7/bintools.nix rename to pkgs/development/compilers/llvm/7/bintools/default.nix diff --git a/pkgs/development/compilers/llvm/7/compiler-rt/default.nix b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix index 75d61a51e60..d97e54d8f49 100644 --- a/pkgs/development/compilers/llvm/7/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix @@ -4,12 +4,13 @@ let useLLVM = stdenv.hostPlatform.useLLVM or false; bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; + haveLibc = stdenv.cc.libc != null; inherit (stdenv.hostPlatform) isMusl; in stdenv.mkDerivation { - pname = "compiler-rt"; + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; inherit version; src = fetch "compiler-rt" "1n48p8gjarihkws0i2bay5w9bdwyxyxxbpwyng7ba58jb30dlyq5"; @@ -29,14 +30,15 @@ stdenv.mkDerivation { "-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" "-DCOMPILER_RT_BUILD_PROFILE=OFF" - ] ++ lib.optionals (useLLVM || bareMetal) [ + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ "-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON" "-DCOMPILER_RT_BAREMETAL_BUILD=ON" "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" + ] ++ lib.optionals (useLLVM && !haveLibc) [ + "-DCMAKE_C_FLAGS=-nodefaultlibs" ] ++ lib.optionals (useLLVM) [ "-DCOMPILER_RT_BUILD_BUILTINS=ON" - "-DCMAKE_C_FLAGS=-nodefaultlibs" #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" ] ++ lib.optionals (bareMetal) [ @@ -83,10 +85,9 @@ stdenv.mkDerivation { postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' ln -s "$out/lib"/*/* "$out/lib" '' + lib.optionalString (useLLVM) '' - ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o - ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o - ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o - ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/linux/crtendS.o + ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o + ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o + ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o + ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o ''; - } diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index fbae9840b24..5060777c64a 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -1,4 +1,5 @@ -{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs +{ lowPrio, newScope, pkgs, lib, stdenv, cmake +, gccForLibs, preLibcCrossHeaders , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -95,7 +96,16 @@ let # doesn’t support like LLVM. Probably we should move to some other # file. - bintools = callPackage ./bintools.nix {}; + bintools-unwrapped = callPackage ./bintools {}; + + bintoolsNoLibc = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + libc = preLibcCrossHeaders; + }; + + bintools = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + }; lldClang = wrapCCWith rec { cc = tools.clang-unwrapped; @@ -114,6 +124,8 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + '' + lib.optionalString (stdenv.targetPlatform.isAndroid && stdenv.targetPlatform.useLLVM) '' + echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' echo "-fno-exceptions" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands cc; @@ -122,9 +134,7 @@ let lldClangNoLibcxx = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - }; + inherit (tools) bintools; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -138,10 +148,7 @@ let lldClangNoLibc = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -154,28 +161,44 @@ let lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands0 cc; }; + lldClangNoCompilerRtWithLibc = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = null; + inherit (tools) bintools; + extraPackages = [ ]; + extraBuildCommands = mkExtraBuildCommands0 cc; + }; + }); 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 { + compiler-rt-libc = callPackage ./compiler-rt { + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc + else stdenv; + }; + + compiler-rt-no-libc = callPackage ./compiler-rt { stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt else stdenv; }; + # N.B. condition is safe because without useLLVM both are the same. + compiler-rt = if stdenv.hostPlatform.isAndroid + then libraries.compiler-rt-libc + else libraries.compiler-rt-no-libc; + stdenv = overrideCC stdenv buildLlvmTools.clang; libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; diff --git a/pkgs/development/compilers/llvm/8/bintools.nix b/pkgs/development/compilers/llvm/8/bintools/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/8/bintools.nix rename to pkgs/development/compilers/llvm/8/bintools/default.nix diff --git a/pkgs/development/compilers/llvm/8/compiler-rt/default.nix b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix index d370de031bb..d7d5e36e79d 100644 --- a/pkgs/development/compilers/llvm/8/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix @@ -4,12 +4,13 @@ let useLLVM = stdenv.hostPlatform.useLLVM or false; bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; + haveLibc = stdenv.cc.libc != null; inherit (stdenv.hostPlatform) isMusl; in stdenv.mkDerivation { - pname = "compiler-rt"; + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; inherit version; src = fetch "compiler-rt" "0dqqf8f930l8gag4d9qjgn1n0pj0nbv2anviqqhdi1rkhas8z0hi"; @@ -29,14 +30,15 @@ stdenv.mkDerivation { "-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" "-DCOMPILER_RT_BUILD_PROFILE=OFF" - ] ++ lib.optionals (useLLVM || bareMetal) [ + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ "-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON" "-DCOMPILER_RT_BAREMETAL_BUILD=ON" "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" + ] ++ lib.optionals (useLLVM && !haveLibc) [ + "-DCMAKE_C_FLAGS=-nodefaultlibs" ] ++ lib.optionals (useLLVM) [ "-DCOMPILER_RT_BUILD_BUILTINS=ON" - "-DCMAKE_C_FLAGS=-nodefaultlibs" #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" ] ++ lib.optionals (bareMetal) [ @@ -88,5 +90,4 @@ stdenv.mkDerivation { ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o ''; - } diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index ccf80f3df2a..78deb942c6e 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -1,4 +1,5 @@ -{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs +{ lowPrio, newScope, pkgs, lib, stdenv, cmake +, gccForLibs, preLibcCrossHeaders , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -96,7 +97,16 @@ let # doesn’t support like LLVM. Probably we should move to some other # file. - bintools = callPackage ./bintools.nix {}; + bintools-unwrapped = callPackage ./bintools {}; + + bintoolsNoLibc = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + libc = preLibcCrossHeaders; + }; + + bintools = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + }; lldClang = wrapCCWith rec { cc = tools.clang-unwrapped; @@ -115,6 +125,8 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + '' + lib.optionalString (stdenv.targetPlatform.isAndroid && stdenv.targetPlatform.useLLVM) '' + echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' echo "-fno-exceptions" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands cc; @@ -123,9 +135,7 @@ let lldClangNoLibcxx = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - }; + inherit (tools) bintools; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -139,10 +149,7 @@ let lldClangNoLibc = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -155,26 +162,43 @@ let lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands0 cc; }; + lldClangNoCompilerRtWithLibc = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = null; + inherit (tools) bintools; + extraPackages = [ ]; + extraBuildCommands = mkExtraBuildCommands0 cc; + }; + }); 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 ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; - })); + compiler-rt-libc = callPackage ./compiler-rt { + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc + else stdenv; + }; + + compiler-rt-no-libc = callPackage ./compiler-rt { + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt + else stdenv; + }; + + # N.B. condition is safe because without useLLVM both are the same. + compiler-rt = if stdenv.hostPlatform.isAndroid + then libraries.compiler-rt-libc + else libraries.compiler-rt-no-libc; stdenv = overrideCC stdenv buildLlvmTools.clang; diff --git a/pkgs/development/compilers/llvm/9/bintools.nix b/pkgs/development/compilers/llvm/9/bintools/default.nix similarity index 100% rename from pkgs/development/compilers/llvm/9/bintools.nix rename to pkgs/development/compilers/llvm/9/bintools/default.nix diff --git a/pkgs/development/compilers/llvm/9/compiler-rt/default.nix b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix index 285fe811514..def3473a050 100644 --- a/pkgs/development/compilers/llvm/9/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix @@ -4,14 +4,15 @@ let useLLVM = stdenv.hostPlatform.useLLVM or false; bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; + haveLibc = stdenv.cc.libc != null; inherit (stdenv.hostPlatform) isMusl; in -stdenv.mkDerivation rec { - pname = "compiler-rt"; +stdenv.mkDerivation { + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; inherit version; - src = fetch pname "0xwh79g3zggdabxgnd0bphry75asm1qz7mv3hcqihqwqr6aspgy2"; + src = fetch "compiler-rt" "0xwh79g3zggdabxgnd0bphry75asm1qz7mv3hcqihqwqr6aspgy2"; nativeBuildInputs = [ cmake python3 llvm.dev ]; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; @@ -29,14 +30,15 @@ stdenv.mkDerivation rec { "-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" "-DCOMPILER_RT_BUILD_PROFILE=OFF" - ] ++ lib.optionals (useLLVM || bareMetal) [ + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ "-DCMAKE_C_COMPILER_WORKS=ON" "-DCMAKE_CXX_COMPILER_WORKS=ON" "-DCOMPILER_RT_BAREMETAL_BUILD=ON" "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" + ] ++ lib.optionals (useLLVM && !haveLibc) [ + "-DCMAKE_C_FLAGS=-nodefaultlibs" ] ++ lib.optionals (useLLVM) [ "-DCOMPILER_RT_BUILD_BUILTINS=ON" - "-DCMAKE_C_FLAGS=-nodefaultlibs" #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" ] ++ lib.optionals (bareMetal) [ diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index ff9a2462630..39b285da262 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -1,4 +1,5 @@ -{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs +{ lowPrio, newScope, pkgs, lib, stdenv, cmake +, gccForLibs, preLibcCrossHeaders , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -96,7 +97,16 @@ let # doesn’t support like LLVM. Probably we should move to some other # file. - bintools = callPackage ./bintools.nix {}; + bintools-unwrapped = callPackage ./bintools {}; + + bintoolsNoLibc = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + libc = preLibcCrossHeaders; + }; + + bintools = wrapBintoolsWith { + bintools = tools.bintools-unwrapped; + }; lldClang = wrapCCWith rec { cc = tools.clang-unwrapped; @@ -115,6 +125,8 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + '' + lib.optionalString (stdenv.targetPlatform.isAndroid && stdenv.targetPlatform.useLLVM) '' + echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' echo "-fno-exceptions" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands cc; @@ -123,9 +135,7 @@ let lldClangNoLibcxx = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - }; + inherit (tools) bintools; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -139,10 +149,7 @@ let lldClangNoLibc = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ targetLlvmLibraries.compiler-rt ]; @@ -155,26 +162,43 @@ let lldClangNoCompilerRt = wrapCCWith rec { cc = tools.clang-unwrapped; libcxx = null; - bintools = wrapBintoolsWith { - inherit (tools) bintools; - libc = null; - }; + bintools = tools.bintoolsNoLibc; extraPackages = [ ]; extraBuildCommands = '' echo "-nostartfiles" >> $out/nix-support/cc-cflags '' + mkExtraBuildCommands0 cc; }; + lldClangNoCompilerRtWithLibc = wrapCCWith rec { + cc = tools.clang-unwrapped; + libcxx = null; + inherit (tools) bintools; + extraPackages = [ ]; + extraBuildCommands = mkExtraBuildCommands0 cc; + }; + }); 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 ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; - })); + compiler-rt-libc = callPackage ./compiler-rt { + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc + else stdenv; + }; + + compiler-rt-no-libc = callPackage ./compiler-rt { + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt + else stdenv; + }; + + # N.B. condition is safe because without useLLVM both are the same. + compiler-rt = if stdenv.hostPlatform.isAndroid + then libraries.compiler-rt-libc + else libraries.compiler-rt-no-libc; stdenv = overrideCC stdenv buildLlvmTools.clang; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ebedcb0e168..499dde10f4f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10345,14 +10345,17 @@ in gerbil-support = callPackage ../development/compilers/gerbil/gerbil-support.nix { }; gerbilPackages-unstable = gerbil-support.gerbilPackages-unstable; # NB: don't recurseIntoAttrs for (unstable!) libraries - gccFun = callPackage (if (with stdenv.targetPlatform; isVc4 || libc == "relibc") - then ../development/compilers/gcc/6 - else ../development/compilers/gcc/10); - gcc = if (with stdenv.targetPlatform; isVc4 || libc == "relibc") - then gcc6 else - # aarch64-darwin doesn't support earlier gcc - if (stdenv.targetPlatform.isAarch64 && stdenv.isDarwin) then gcc11 - else if stdenv.targetPlatform.isAarch64 then gcc9 else gcc10; + inherit (let + num = + if (with stdenv.targetPlatform; isVc4 || libc == "relibc") then 6 + else if (stdenv.targetPlatform.isAarch64 && stdenv.isDarwin) then 11 + else if stdenv.targetPlatform.isAarch64 then 9 + else 10; + numS = toString num; + in { + gcc = pkgs.${"gcc${numS}"}; + gccFun = callPackage (../development/compilers/gcc + "/${numS}"); + }) gcc gccFun; gcc-unwrapped = gcc.cc; wrapNonDeterministicGcc = stdenv: ccWrapper: @@ -10430,7 +10433,7 @@ in crossLibcStdenv = if stdenv.hostPlatform.useLLVM or false - then overrideCC stdenv buildPackages.llvmPackages_8.lldClangNoLibc + then overrideCC stdenv buildPackages.llvmPackages.lldClangNoLibc else gccCrossLibcStdenv; # The GCC used to build libc for the target platform. Normal gccs will be @@ -11175,19 +11178,16 @@ in llvm_6 = llvmPackages_6.llvm; llvm_5 = llvmPackages_5.llvm; - llvmPackages = with targetPlatform; - if isDarwin then - llvmPackages_7 - else if isFreeBSD then - llvmPackages_7 - else if isAndroid then - llvmPackages_12 - else if isLinux then - llvmPackages_7 - else if isWasm then - llvmPackages_8 - else - llvmPackages_latest; + llvmPackages = let + choose = platform: + /**/ if platform.isDarwin then "7" + else if platform.isFreeBSD then "7" + else if platform.isAndroid then "12" + else if platform.isLinux then "7" + else if platform.isWasm then "8" + else "latest"; + minSupported = lib.min (choose stdenv.hostPlatform) (choose stdenv.targetPlatform); + in pkgs.${"llvmPackages_${minSupported}"}; llvmPackages_5 = recurseIntoAttrs (callPackage ../development/compilers/llvm/5 { inherit (stdenvAdapters) overrideCC; @@ -12602,11 +12602,7 @@ in }); binutilsNoLibc = wrapBintoolsWith { bintools = binutils-unwrapped; - libc = - /**/ if stdenv.targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers - else if stdenv.targetPlatform.libc == "libSystem" then darwin.xcode - else if stdenv.targetPlatform.libc == "nblibc" then targetPackages.netbsdCross.headers - else null; + libc = preLibcCrossHeaders; }; bison = callPackage ../development/tools/parsing/bison { }; @@ -14741,6 +14737,13 @@ in stdenv = crossLibcStdenv; }; + # These are used when buiding compiler-rt / libgcc, prior to building libc. + preLibcCrossHeaders = let + inherit (stdenv.targetPlatform) libc; + in if libc == "msvcrt" then targetPackages.windows.mingw_w64_headers + else if libc == "nblibc" then targetPackages.netbsdCross.headers + else null; + # We can choose: libcCrossChooser = name: # libc is hackily often used from the previous stage. This `or` @@ -14755,8 +14758,10 @@ in else if name == "newlib" then targetPackages.newlibCross or newlibCross else if name == "musl" then targetPackages.muslCross or muslCross else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64 - else if stdenv.targetPlatform.useiOSPrebuilt then targetPackages.darwin.iosSdkPkgs.libraries or darwin.iosSdkPkgs.libraries - else if name == "libSystem" then targetPackages.darwin.xcode + else if name == "libSystem" then + if stdenv.targetPlatform.useiOSPrebuilt + then targetPackages.darwin.iosSdkPkgs.libraries or darwin.iosSdkPkgs.libraries + else throw "don't yet have a `targetPackages.darwin.LibsystemCross`" else if name == "nblibc" then targetPackages.netbsdCross.libc or netbsdCross.libc else if name == "wasilibc" then targetPackages.wasilibc or wasilibc else if name == "relibc" then targetPackages.relibc or relibc diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index 5275a6f3123..2af799e5646 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -2,6 +2,7 @@ , buildPackages, pkgs, targetPackages , pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget , stdenv, splicePackages, newScope +, preLibcCrossHeaders }: let @@ -52,7 +53,7 @@ impure-cmds // apple-source-releases // { }; binutilsNoLibc = pkgs.wrapBintoolsWith { - libc = null; + libc = preLibcCrossHeaders; bintools = self.binutils-unwrapped; }; From e830db4320ac3b38c648d492b3d04c71a0860a54 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 11 May 2021 21:12:04 +0000 Subject: [PATCH 7/7] llvmPackages: Fix more inconsistencies The main thing was using `llvm_meta` in all versions. Secondarily: - libunwindx7: Forgot to split outputs - libcxx{,abi} 12: Forgot to apply output-splitting patches. - simplify `useLLVM` stdenv-switching logic. - openmp always gets its own directory --- .../compilers/llvm/10/clang/default.nix | 25 +++-- .../compilers/llvm/10/compiler-rt/default.nix | 18 +++- .../development/compilers/llvm/10/default.nix | 57 ++++++---- .../compilers/llvm/10/libcxx/default.nix | 19 ++-- .../compilers/llvm/10/libcxxabi/default.nix | 16 +-- .../compilers/llvm/10/libunwind/default.nix | 14 ++- .../compilers/llvm/10/lld/default.nix | 18 ++-- .../compilers/llvm/10/lldb/default.nix | 18 ++-- .../compilers/llvm/10/llvm/default.nix | 29 +++-- pkgs/development/compilers/llvm/10/openmp.nix | 25 ----- .../compilers/llvm/10/openmp/default.nix | 34 ++++++ .../compilers/llvm/11/clang/default.nix | 25 +++-- .../compilers/llvm/11/compiler-rt/default.nix | 18 +++- .../development/compilers/llvm/11/default.nix | 57 ++++++---- .../compilers/llvm/11/libcxx/default.nix | 19 ++-- .../compilers/llvm/11/libcxxabi/default.nix | 16 +-- .../compilers/llvm/11/libunwind/default.nix | 14 ++- .../compilers/llvm/11/lld/default.nix | 18 ++-- .../compilers/llvm/11/lldb/default.nix | 18 ++-- .../compilers/llvm/11/llvm/default.nix | 29 +++-- pkgs/development/compilers/llvm/11/openmp.nix | 35 ------ .../compilers/llvm/11/openmp/default.nix | 44 ++++++++ .../development/compilers/llvm/12/default.nix | 36 ++++--- .../compilers/llvm/12/libcxx/default.nix | 8 +- .../llvm/12/libcxx/gnu-install-dirs.patch | 100 ++++++++++++++++++ .../compilers/llvm/12/libcxxabi/default.nix | 30 +++--- .../llvm/12/libcxxabi/gnu-install-dirs.patch | 34 ++++++ .../compilers/llvm/12/lld/default.nix | 16 +-- .../compilers/llvm/12/llvm/default.nix | 2 + .../compilers/llvm/5/clang/default.nix | 25 +++-- .../compilers/llvm/5/compiler-rt/default.nix | 17 ++- pkgs/development/compilers/llvm/5/default.nix | 43 ++++++-- .../compilers/llvm/5/libcxx/default.nix | 15 ++- .../compilers/llvm/5/libcxxabi/default.nix | 16 +-- .../compilers/llvm/5/lld/default.nix | 21 ++-- .../compilers/llvm/5/lldb/default.nix | 14 ++- .../compilers/llvm/5/llvm/default.nix | 29 +++-- pkgs/development/compilers/llvm/5/openmp.nix | 25 ----- .../compilers/llvm/5/openmp/default.nix | 34 ++++++ .../compilers/llvm/6/clang/default.nix | 25 +++-- .../compilers/llvm/6/compiler-rt/default.nix | 17 ++- pkgs/development/compilers/llvm/6/default.nix | 43 ++++++-- .../compilers/llvm/6/libcxx/default.nix | 15 ++- .../compilers/llvm/6/libcxxabi/default.nix | 16 +-- .../compilers/llvm/6/lld/default.nix | 22 ++-- .../compilers/llvm/6/lldb/default.nix | 14 ++- .../compilers/llvm/6/llvm/default.nix | 29 +++-- pkgs/development/compilers/llvm/6/openmp.nix | 25 ----- .../compilers/llvm/6/openmp/default.nix | 34 ++++++ .../compilers/llvm/7/clang/default.nix | 25 +++-- .../compilers/llvm/7/compiler-rt/default.nix | 18 +++- pkgs/development/compilers/llvm/7/default.nix | 63 +++++++---- .../compilers/llvm/7/libcxx/default.nix | 21 ++-- .../compilers/llvm/7/libcxxabi/default.nix | 16 +-- .../compilers/llvm/7/libunwind/default.nix | 20 +++- .../compilers/llvm/7/lld/default.nix | 22 ++-- .../compilers/llvm/7/lldb/default.nix | 14 ++- .../compilers/llvm/7/llvm/default.nix | 29 +++-- pkgs/development/compilers/llvm/7/openmp.nix | 25 ----- .../compilers/llvm/7/openmp/default.nix | 34 ++++++ .../compilers/llvm/8/clang/default.nix | 25 +++-- .../compilers/llvm/8/compiler-rt/default.nix | 18 +++- pkgs/development/compilers/llvm/8/default.nix | 63 +++++++---- .../compilers/llvm/8/libcxx/default.nix | 19 ++-- .../compilers/llvm/8/libcxxabi/default.nix | 16 +-- .../compilers/llvm/8/libunwind/default.nix | 14 ++- .../compilers/llvm/8/lld/default.nix | 22 ++-- .../compilers/llvm/8/lldb/default.nix | 14 ++- .../compilers/llvm/8/llvm/default.nix | 29 +++-- pkgs/development/compilers/llvm/8/openmp.nix | 25 ----- .../compilers/llvm/8/openmp/default.nix | 34 ++++++ .../compilers/llvm/9/clang/default.nix | 25 +++-- .../compilers/llvm/9/compiler-rt/default.nix | 18 +++- pkgs/development/compilers/llvm/9/default.nix | 63 +++++++---- .../compilers/llvm/9/libcxx/default.nix | 19 ++-- .../compilers/llvm/9/libcxxabi/default.nix | 16 +-- .../compilers/llvm/9/libunwind/default.nix | 14 ++- .../compilers/llvm/9/lld/default.nix | 18 ++-- .../compilers/llvm/9/lldb/default.nix | 14 ++- .../compilers/llvm/9/llvm/default.nix | 29 +++-- pkgs/development/compilers/llvm/9/openmp.nix | 25 ----- .../compilers/llvm/9/openmp/default.nix | 34 ++++++ 82 files changed, 1489 insertions(+), 623 deletions(-) delete mode 100644 pkgs/development/compilers/llvm/10/openmp.nix create mode 100644 pkgs/development/compilers/llvm/10/openmp/default.nix delete mode 100644 pkgs/development/compilers/llvm/11/openmp.nix create mode 100644 pkgs/development/compilers/llvm/11/openmp/default.nix create mode 100644 pkgs/development/compilers/llvm/12/libcxx/gnu-install-dirs.patch create mode 100644 pkgs/development/compilers/llvm/12/libcxxabi/gnu-install-dirs.patch delete mode 100644 pkgs/development/compilers/llvm/5/openmp.nix create mode 100644 pkgs/development/compilers/llvm/5/openmp/default.nix delete mode 100644 pkgs/development/compilers/llvm/6/openmp.nix create mode 100644 pkgs/development/compilers/llvm/6/openmp/default.nix delete mode 100644 pkgs/development/compilers/llvm/7/openmp.nix create mode 100644 pkgs/development/compilers/llvm/7/openmp/default.nix delete mode 100644 pkgs/development/compilers/llvm/8/openmp.nix create mode 100644 pkgs/development/compilers/llvm/8/openmp/default.nix delete mode 100644 pkgs/development/compilers/llvm/9/openmp.nix create mode 100644 pkgs/development/compilers/llvm/9/openmp/default.nix diff --git a/pkgs/development/compilers/llvm/10/clang/default.nix b/pkgs/development/compilers/llvm/10/clang/default.nix index d228c4261af..e0c52651cad 100644 --- a/pkgs/development/compilers/llvm/10/clang/default.nix +++ b/pkgs/development/compilers/llvm/10/clang/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -96,11 +96,20 @@ let inherit libllvm; }; - meta = { - description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://clang.llvm.org/"; + description = "A C language family frontend for LLVM"; + longDescription = '' + The Clang project provides a language front-end and tooling + infrastructure for languages in the C language family (C, C++, Objective + C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. + It aims to deliver amazingly fast compiles, extremely useful error and + warning messages and to provide a platform for building great source + level tools. The Clang Static Analyzer and clang-tidy are tools that + automatically find bugs in your code, and are great examples of the sort + of tools that can be built using the Clang frontend as a library to + parse C/C++ code. + ''; }; } // lib.optionalAttrs enableManpages { pname = "clang-manpages"; @@ -119,6 +128,8 @@ let doCheck = false; - meta.description = "man page for Clang ${version}"; + meta = llvm_meta // { + description = "man page for Clang ${version}"; + }; }); in self diff --git a/pkgs/development/compilers/llvm/10/compiler-rt/default.nix b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix index 85f2298f586..37c7e0599b5 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }: +{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, llvm, libcxxabi }: let @@ -89,4 +89,20 @@ stdenv.mkDerivation { ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o ''; + + meta = llvm_meta // { + homepage = "https://compiler-rt.llvm.org/"; + description = "Compiler runtime libraries"; + longDescription = '' + The compiler-rt project provides highly tuned implementations of the + low-level code generator support routines like "__fixunsdfdi" and other + calls generated when a target doesn't have a short sequence of native + instructions to implement a core IR operation. It also provides + implementations of run-time libraries for dynamic testing tools such as + AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. + ''; + # "All of the code in the compiler-rt project is dual licensed under the MIT + # license and the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; } diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index ead6c252651..ac982a0ba45 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -17,6 +17,12 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "06n1yp638rh24xdxv9v2df0qajxbjz4w59b7dd4ky36drwmpi4yh"; + llvm_meta = { + license = lib.licenses.ncsa; + maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; + platforms = lib.platforms.all; + }; + tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands0 = cc: '' @@ -32,14 +38,16 @@ let in { - libllvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { + inherit llvm_meta; + }; # `llvm` historically had the binaries. When choosing an output explicitly, # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm.out // { outputUnspecified = true; }; libclang = callPackage ./clang { - inherit clang-tools-extra_src; + inherit clang-tools-extra_src llvm_meta; }; clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; @@ -83,9 +91,13 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld {}; + lld = callPackage ./lld { + inherit llvm_meta; + }; - lldb = callPackage ./lldb {}; + lldb = callPackage ./lldb { + inherit llvm_meta; + }; # Below, is the LLVM bootstrapping logic. It handles building a # fully LLVM toolchain from scratch. No GCC toolchain should be @@ -181,12 +193,14 @@ let in { compiler-rt-libc = callPackage ./compiler-rt { + inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc else stdenv; }; compiler-rt-no-libc = callPackage ./compiler-rt { + inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt else stdenv; @@ -201,23 +215,30 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libcxx ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + libcxx = callPackage ./libcxx { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libcxxabi = callPackage ./libcxxabi ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - libunwind = libraries.libunwind; - })); + libcxxabi = callPackage ./libcxxabi { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libunwind = callPackage ./libunwind ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + libunwind = callPackage ./libunwind { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - openmp = callPackage ./openmp.nix {}; + openmp = callPackage ./openmp { + inherit llvm_meta; + }; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/10/libcxx/default.nix b/pkgs/development/compilers/llvm/10/libcxx/default.nix index 10616642f74..7c01e731711 100644 --- a/pkgs/development/compilers/llvm/10/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/10/libcxx/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version +{ lib, stdenv, llvm_meta, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -17,7 +17,9 @@ stdenv.mkDerivation { patches = [ ./gnu-install-dirs.patch - ] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ + ../../libcxx-0001-musl-hacks.patch + ]; preConfigure = '' # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package @@ -47,10 +49,15 @@ stdenv.mkDerivation { isLLVM = true; }; - meta = { + meta = llvm_meta // { homepage = "https://libcxx.llvm.org/"; - description = "A new implementation of the C++ standard library, targeting C++11"; - license = with lib.licenses; [ ncsa mit ]; - platforms = lib.platforms.all; + description = "C++ standard library"; + longDescription = '' + libc++ is an implementation of the C++ standard library, targeting C++11, + C++14 and above. + ''; + # "All of the code in libc++ is dual licensed under the MIT license and the + # UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; }; } diff --git a/pkgs/development/compilers/llvm/10/libcxxabi/default.nix b/pkgs/development/compilers/llvm/10/libcxxabi/default.nix index aa34af37c62..b427949a842 100644 --- a/pkgs/development/compilers/llvm/10/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/10/libcxxabi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version +{ lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -63,11 +63,15 @@ stdenv.mkDerivation { ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 ''; - meta = { + meta = llvm_meta // { homepage = "https://libcxxabi.llvm.org/"; - description = "A new implementation of low level support for a standard C++ library"; - license = with lib.licenses; [ ncsa mit ]; - maintainers = with lib.maintainers; [ vlstill ]; - platforms = lib.platforms.all; + description = "Provides C++ standard library support"; + longDescription = '' + libc++abi is a new implementation of low level support for a standard C++ library. + ''; + # "All of the code in libc++abi is dual licensed under the MIT license and + # the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; }; } diff --git a/pkgs/development/compilers/llvm/10/libunwind/default.nix b/pkgs/development/compilers/llvm/10/libunwind/default.nix index d010deb6618..8124cf0821e 100644 --- a/pkgs/development/compilers/llvm/10/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/10/libunwind/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, fetchpatch +{ lib, stdenv, llvm_meta, version, fetch, cmake, fetchpatch , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -17,4 +17,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; + + meta = llvm_meta // { + # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst + homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library"; + description = "LLVM's unwinder library"; + longDescription = '' + The unwind library provides a family of _Unwind_* functions implementing + the language-neutral stack unwinding portion of the Itanium C++ ABI (Level + I). It is a dependency of the C++ ABI library, and sometimes is a + dependency of other runtimes. + ''; + }; } diff --git a/pkgs/development/compilers/llvm/10/lld/default.nix b/pkgs/development/compilers/llvm/10/lld/default.nix index 03a48f02a0c..5d590aec35a 100644 --- a/pkgs/development/compilers/llvm/10/lld/default.nix +++ b/pkgs/development/compilers/llvm/10/lld/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , buildLlvmTools , fetch , cmake @@ -28,10 +28,16 @@ stdenv.mkDerivation rec { outputs = [ "out" "lib" "dev" ]; - meta = { - description = "The LLVM Linker"; - homepage = "https://lld.llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://lld.llvm.org/"; + description = "The LLVM linker"; + longDescription = '' + LLD is a linker from the LLVM project that is a drop-in replacement for + system linkers and runs much faster than them. It also provides features + that are useful for toolchain developers. + The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS), and + WebAssembly in descending order of completeness. Internally, LLD consists + of several different linkers. + ''; }; } diff --git a/pkgs/development/compilers/llvm/10/lldb/default.nix b/pkgs/development/compilers/llvm/10/lldb/default.nix index ccca340b3e2..04b9e06e77a 100644 --- a/pkgs/development/compilers/llvm/10/lldb/default.nix +++ b/pkgs/development/compilers/llvm/10/lldb/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , fetch , cmake , zlib @@ -76,11 +76,15 @@ stdenv.mkDerivation (rec { ln -s $out/bin/llvm-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin ''; - meta = with lib; { + meta = llvm_meta // { + homepage = "https://lldb.llvm.org/"; description = "A next-generation high-performance debugger"; - homepage = "https://lldb.llvm.org"; - license = licenses.ncsa; - platforms = platforms.all; + longDescription = '' + LLDB is a next generation, high-performance debugger. It is built as a set + of reusable components which highly leverage existing libraries in the + larger LLVM Project, such as the Clang expression parser and LLVM + disassembler. + ''; }; } // lib.optionalAttrs enableManpages { pname = "lldb-manpages"; @@ -104,5 +108,7 @@ stdenv.mkDerivation (rec { doCheck = false; - meta.description = "man pages for LLDB ${version}"; + meta = llvm_meta // { + description = "man pages for LLDB ${version}"; + }; }) diff --git a/pkgs/development/compilers/llvm/10/llvm/default.nix b/pkgs/development/compilers/llvm/10/llvm/default.nix index 22ed308486d..8a7b84c4eb1 100644 --- a/pkgs/development/compilers/llvm/10/llvm/default.nix +++ b/pkgs/development/compilers/llvm/10/llvm/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , pkgsBuildBuild , fetch , cmake @@ -172,12 +172,23 @@ in stdenv.mkDerivation (rec { checkTarget = "check-all"; requiredSystemFeatures = [ "big-parallel" ]; - meta = { - description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ]; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://llvm.org/"; + description = "A collection of modular and reusable compiler and toolchain technologies"; + longDescription = '' + The LLVM Project is a collection of modular and reusable compiler and + toolchain technologies. Despite its name, LLVM has little to do with + traditional virtual machines. The name "LLVM" itself is not an acronym; it + is the full name of the project. + LLVM began as a research project at the University of Illinois, with the + goal of providing a modern, SSA-based compilation strategy capable of + supporting both static and dynamic compilation of arbitrary programming + languages. Since then, LLVM has grown to be an umbrella project consisting + of a number of subprojects, many of which are being used in production by + a wide variety of commercial and open source projects as well as being + widely used in academic research. Code in the LLVM project is licensed + under the "Apache 2.0 License with LLVM exceptions". + ''; }; } // lib.optionalAttrs enableManpages { pname = "llvm-manpages"; @@ -199,5 +210,7 @@ in stdenv.mkDerivation (rec { doCheck = false; - meta.description = "man pages for LLVM ${version}"; + meta = llvm_meta // { + description = "man pages for LLVM ${version}"; + }; }) diff --git a/pkgs/development/compilers/llvm/10/openmp.nix b/pkgs/development/compilers/llvm/10/openmp.nix deleted file mode 100644 index 2946c51fafe..00000000000 --- a/pkgs/development/compilers/llvm/10/openmp.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib -, stdenv -, fetch -, cmake -, llvm -, perl -, version -}: - -stdenv.mkDerivation rec { - pname = "openmp"; - inherit version; - - src = fetch pname "0i4bn84lkpm5w3qkpvwm5z6jdj8fynp7d3bcasa1xyq4is6757yi"; - - nativeBuildInputs = [ cmake perl ]; - buildInputs = [ llvm ]; - - meta = { - description = "Components required to build an executable OpenMP program"; - homepage = "https://openmp.llvm.org/"; - license = lib.licenses.mit; - platforms = lib.platforms.all; - }; -} diff --git a/pkgs/development/compilers/llvm/10/openmp/default.nix b/pkgs/development/compilers/llvm/10/openmp/default.nix new file mode 100644 index 00000000000..a1b04c7c66b --- /dev/null +++ b/pkgs/development/compilers/llvm/10/openmp/default.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, llvm_meta +, fetch +, cmake +, llvm +, perl +, version +}: + +stdenv.mkDerivation rec { + pname = "openmp"; + inherit version; + + src = fetch pname "0i4bn84lkpm5w3qkpvwm5z6jdj8fynp7d3bcasa1xyq4is6757yi"; + + nativeBuildInputs = [ cmake perl ]; + buildInputs = [ llvm ]; + + meta = llvm_meta // { + homepage = "https://openmp.llvm.org/"; + description = "Support for the OpenMP language"; + longDescription = '' + The OpenMP subproject of LLVM contains the components required to build an + executable OpenMP program that are outside the compiler itself. + Contains the code for the runtime library against which code compiled by + "clang -fopenmp" must be linked before it can run and the library that + supports offload to target devices. + ''; + # "All of the code is dual licensed under the MIT license and the UIUC + # License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; +} diff --git a/pkgs/development/compilers/llvm/11/clang/default.nix b/pkgs/development/compilers/llvm/11/clang/default.nix index 3b7accffbca..67b5e0c17fe 100644 --- a/pkgs/development/compilers/llvm/11/clang/default.nix +++ b/pkgs/development/compilers/llvm/11/clang/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -95,11 +95,20 @@ let inherit libllvm; }; - meta = { - description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://clang.llvm.org/"; + description = "A C language family frontend for LLVM"; + longDescription = '' + The Clang project provides a language front-end and tooling + infrastructure for languages in the C language family (C, C++, Objective + C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. + It aims to deliver amazingly fast compiles, extremely useful error and + warning messages and to provide a platform for building great source + level tools. The Clang Static Analyzer and clang-tidy are tools that + automatically find bugs in your code, and are great examples of the sort + of tools that can be built using the Clang frontend as a library to + parse C/C++ code. + ''; }; } // lib.optionalAttrs enableManpages { pname = "clang-manpages"; @@ -118,6 +127,8 @@ let doCheck = false; - meta.description = "man page for Clang ${version}"; + meta = llvm_meta // { + description = "man page for Clang ${version}"; + }; }); in self diff --git a/pkgs/development/compilers/llvm/11/compiler-rt/default.nix b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix index 61ff00cda6d..c9f97bacb3e 100644 --- a/pkgs/development/compilers/llvm/11/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }: +{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, llvm, libcxxabi }: let @@ -92,4 +92,20 @@ stdenv.mkDerivation { ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o ''; + + meta = llvm_meta // { + homepage = "https://compiler-rt.llvm.org/"; + description = "Compiler runtime libraries"; + longDescription = '' + The compiler-rt project provides highly tuned implementations of the + low-level code generator support routines like "__fixunsdfdi" and other + calls generated when a target doesn't have a short sequence of native + instructions to implement a core IR operation. It also provides + implementations of run-time libraries for dynamic testing tools such as + AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. + ''; + # "All of the code in the compiler-rt project is dual licensed under the MIT + # license and the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; } diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix index bab5831e17c..3babaa1961f 100644 --- a/pkgs/development/compilers/llvm/11/default.nix +++ b/pkgs/development/compilers/llvm/11/default.nix @@ -19,6 +19,12 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "18n1w1hkv931xzq02b34wglbv6zd6sd0r5kb8piwvag7klj7qw3n"; + llvm_meta = { + license = lib.licenses.ncsa; + maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; + platforms = lib.platforms.all; + }; + tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands0 = cc: '' @@ -34,14 +40,16 @@ let in { - libllvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { + inherit llvm_meta; + }; # `llvm` historically had the binaries. When choosing an output explicitly, # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm.out // { outputUnspecified = true; }; libclang = callPackage ./clang { - inherit clang-tools-extra_src; + inherit clang-tools-extra_src llvm_meta; }; clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; @@ -84,9 +92,13 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld {}; + lld = callPackage ./lld { + inherit llvm_meta; + }; - lldb = callPackage ./lldb {}; + lldb = callPackage ./lldb { + inherit llvm_meta; + }; # Below, is the LLVM bootstrapping logic. It handles building a # fully LLVM toolchain from scratch. No GCC toolchain should be @@ -182,12 +194,14 @@ let in { compiler-rt-libc = callPackage ./compiler-rt { + inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc else stdenv; }; compiler-rt-no-libc = callPackage ./compiler-rt { + inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt else stdenv; @@ -202,23 +216,30 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libcxx ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + libcxx = callPackage ./libcxx { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libcxxabi = callPackage ./libcxxabi ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - libunwind = libraries.libunwind; - })); + libcxxabi = callPackage ./libcxxabi { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libunwind = callPackage ./libunwind ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + libunwind = callPackage ./libunwind { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - openmp = callPackage ./openmp.nix {}; + openmp = callPackage ./openmp { + inherit llvm_meta; + }; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/11/libcxx/default.nix b/pkgs/development/compilers/llvm/11/libcxx/default.nix index 08150dc2f22..7bd4f7e26b7 100644 --- a/pkgs/development/compilers/llvm/11/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/11/libcxx/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, fetchpatch, cmake, python3, libcxxabi, llvm, fixDarwinDylibNames, version +{ lib, stdenv, llvm_meta, fetch, fetchpatch, cmake, python3, libcxxabi, llvm, fixDarwinDylibNames, version , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -25,7 +25,9 @@ stdenv.mkDerivation { stripLen = 1; }) ./gnu-install-dirs.patch - ] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ + ../../libcxx-0001-musl-hacks.patch + ]; preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' patchShebangs utils/cat_files.py @@ -50,10 +52,15 @@ stdenv.mkDerivation { isLLVM = true; }; - meta = { + meta = llvm_meta // { homepage = "https://libcxx.llvm.org/"; - description = "A new implementation of the C++ standard library, targeting C++11"; - license = with lib.licenses; [ ncsa mit ]; - platforms = lib.platforms.all; + description = "C++ standard library"; + longDescription = '' + libc++ is an implementation of the C++ standard library, targeting C++11, + C++14 and above. + ''; + # "All of the code in libc++ is dual licensed under the MIT license and the + # UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; }; } diff --git a/pkgs/development/compilers/llvm/11/libcxxabi/default.nix b/pkgs/development/compilers/llvm/11/libcxxabi/default.nix index 209d34ba92a..f555abd8acb 100644 --- a/pkgs/development/compilers/llvm/11/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/11/libcxxabi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version +{ lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -64,11 +64,15 @@ stdenv.mkDerivation { ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 ''; - meta = { + meta = llvm_meta // { homepage = "https://libcxxabi.llvm.org/"; - description = "A new implementation of low level support for a standard C++ library"; - license = with lib.licenses; [ ncsa mit ]; - maintainers = with lib.maintainers; [ vlstill ]; - platforms = lib.platforms.all; + description = "Provides C++ standard library support"; + longDescription = '' + libc++abi is a new implementation of low level support for a standard C++ library. + ''; + # "All of the code in libc++abi is dual licensed under the MIT license and + # the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; }; } diff --git a/pkgs/development/compilers/llvm/11/libunwind/default.nix b/pkgs/development/compilers/llvm/11/libunwind/default.nix index 6b095f4feae..462d63283ba 100644 --- a/pkgs/development/compilers/llvm/11/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/11/libunwind/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, fetchpatch +{ lib, stdenv, llvm_meta, version, fetch, cmake, fetchpatch , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -17,4 +17,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; + + meta = llvm_meta // { + # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst + homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library"; + description = "LLVM's unwinder library"; + longDescription = '' + The unwind library provides a family of _Unwind_* functions implementing + the language-neutral stack unwinding portion of the Itanium C++ ABI (Level + I). It is a dependency of the C++ ABI library, and sometimes is a + dependency of other runtimes. + ''; + }; } diff --git a/pkgs/development/compilers/llvm/11/lld/default.nix b/pkgs/development/compilers/llvm/11/lld/default.nix index 3ee5ba6e5a6..d344d3d3c11 100644 --- a/pkgs/development/compilers/llvm/11/lld/default.nix +++ b/pkgs/development/compilers/llvm/11/lld/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , buildLlvmTools , fetch , cmake @@ -28,10 +28,16 @@ stdenv.mkDerivation rec { outputs = [ "out" "lib" "dev" ]; - meta = { - description = "The LLVM Linker"; - homepage = "https://lld.llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://lld.llvm.org/"; + description = "The LLVM linker"; + longDescription = '' + LLD is a linker from the LLVM project that is a drop-in replacement for + system linkers and runs much faster than them. It also provides features + that are useful for toolchain developers. + The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS), and + WebAssembly in descending order of completeness. Internally, LLD consists + of several different linkers. + ''; }; } diff --git a/pkgs/development/compilers/llvm/11/lldb/default.nix b/pkgs/development/compilers/llvm/11/lldb/default.nix index 2979a46a6cc..785ac4671ef 100644 --- a/pkgs/development/compilers/llvm/11/lldb/default.nix +++ b/pkgs/development/compilers/llvm/11/lldb/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , fetch , cmake , zlib @@ -76,11 +76,15 @@ stdenv.mkDerivation (rec { ln -s $out/bin/llvm-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin ''; - meta = with lib; { + meta = llvm_meta // { + homepage = "https://lldb.llvm.org/"; description = "A next-generation high-performance debugger"; - homepage = "https://lldb.llvm.org"; - license = licenses.ncsa; - platforms = platforms.all; + longDescription = '' + LLDB is a next generation, high-performance debugger. It is built as a set + of reusable components which highly leverage existing libraries in the + larger LLVM Project, such as the Clang expression parser and LLVM + disassembler. + ''; }; } // lib.optionalAttrs enableManpages { pname = "lldb-manpages"; @@ -104,5 +108,7 @@ stdenv.mkDerivation (rec { doCheck = false; - meta.description = "man pages for LLDB ${version}"; + meta = llvm_meta // { + description = "man pages for LLDB ${version}"; + }; }) diff --git a/pkgs/development/compilers/llvm/11/llvm/default.nix b/pkgs/development/compilers/llvm/11/llvm/default.nix index c8033b585cb..3ade1ac4817 100644 --- a/pkgs/development/compilers/llvm/11/llvm/default.nix +++ b/pkgs/development/compilers/llvm/11/llvm/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , pkgsBuildBuild , fetch , cmake @@ -174,12 +174,23 @@ in stdenv.mkDerivation (rec { checkTarget = "check-all"; requiredSystemFeatures = [ "big-parallel" ]; - meta = { - description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://llvm.org/"; + description = "A collection of modular and reusable compiler and toolchain technologies"; + longDescription = '' + The LLVM Project is a collection of modular and reusable compiler and + toolchain technologies. Despite its name, LLVM has little to do with + traditional virtual machines. The name "LLVM" itself is not an acronym; it + is the full name of the project. + LLVM began as a research project at the University of Illinois, with the + goal of providing a modern, SSA-based compilation strategy capable of + supporting both static and dynamic compilation of arbitrary programming + languages. Since then, LLVM has grown to be an umbrella project consisting + of a number of subprojects, many of which are being used in production by + a wide variety of commercial and open source projects as well as being + widely used in academic research. Code in the LLVM project is licensed + under the "Apache 2.0 License with LLVM exceptions". + ''; }; } // lib.optionalAttrs enableManpages { pname = "llvm-manpages"; @@ -201,5 +212,7 @@ in stdenv.mkDerivation (rec { doCheck = false; - meta.description = "man pages for LLVM ${version}"; + meta = llvm_meta // { + description = "man pages for LLVM ${version}"; + }; }) diff --git a/pkgs/development/compilers/llvm/11/openmp.nix b/pkgs/development/compilers/llvm/11/openmp.nix deleted file mode 100644 index c99358cd287..00000000000 --- a/pkgs/development/compilers/llvm/11/openmp.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ lib -, stdenv -, fetch -, fetchpatch -, cmake -, llvm -, perl -, version -}: - -stdenv.mkDerivation rec { - pname = "openmp"; - inherit version; - - src = fetch pname "0bh5cswgpc79awlq8j5i7hp355adaac7s6zaz0zwp6mkflxli1yi"; - - patches = [ - # Fix compilation on aarch64-darwin, remove after the next release. - (fetchpatch { - url = "https://github.com/llvm/llvm-project/commit/7b5254223acbf2ef9cd278070c5a84ab278d7e5f.patch"; - sha256 = "sha256-A+9/IVIoazu68FK5H5CiXcOEYe1Hpp4xTx2mIw7m8Es="; - stripLen = 1; - }) - ]; - - nativeBuildInputs = [ cmake perl ]; - buildInputs = [ llvm ]; - - meta = { - description = "Components required to build an executable OpenMP program"; - homepage = "https://openmp.llvm.org/"; - license = lib.licenses.mit; - platforms = lib.platforms.all; - }; -} diff --git a/pkgs/development/compilers/llvm/11/openmp/default.nix b/pkgs/development/compilers/llvm/11/openmp/default.nix new file mode 100644 index 00000000000..330560a677d --- /dev/null +++ b/pkgs/development/compilers/llvm/11/openmp/default.nix @@ -0,0 +1,44 @@ +{ lib +, stdenv +, llvm_meta +, fetch +, fetchpatch +, cmake +, llvm +, perl +, version +}: + +stdenv.mkDerivation rec { + pname = "openmp"; + inherit version; + + src = fetch pname "0bh5cswgpc79awlq8j5i7hp355adaac7s6zaz0zwp6mkflxli1yi"; + + patches = [ + # Fix compilation on aarch64-darwin, remove after the next release. + (fetchpatch { + url = "https://github.com/llvm/llvm-project/commit/7b5254223acbf2ef9cd278070c5a84ab278d7e5f.patch"; + sha256 = "sha256-A+9/IVIoazu68FK5H5CiXcOEYe1Hpp4xTx2mIw7m8Es="; + stripLen = 1; + }) + ]; + + nativeBuildInputs = [ cmake perl ]; + buildInputs = [ llvm ]; + + meta = llvm_meta // { + homepage = "https://openmp.llvm.org/"; + description = "Support for the OpenMP language"; + longDescription = '' + The OpenMP subproject of LLVM contains the components required to build an + executable OpenMP program that are outside the compiler itself. + Contains the code for the runtime library against which code compiled by + "clang -fopenmp" must be linked before it can run and the library that + supports offload to target devices. + ''; + # "All of the code is dual licensed under the MIT license and the UIUC + # License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; +} diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix index 2d3c1795bd2..db43c5bd00b 100644 --- a/pkgs/development/compilers/llvm/12/default.nix +++ b/pkgs/development/compilers/llvm/12/default.nix @@ -96,7 +96,6 @@ let lld = callPackage ./lld { inherit llvm_meta; - libunwind = libraries.libunwind; }; lldb = callPackage ./lldb { @@ -222,24 +221,31 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libcxx ({ inherit llvm_meta; } // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + libcxx = callPackage ./libcxx { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libcxxabi = callPackage ./libcxxabi ({ inherit llvm_meta; } // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - libunwind = libraries.libunwind; - })); + libcxxabi = callPackage ./libcxxabi { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libunwind = callPackage ./libunwind ({ + libunwind = callPackage ./libunwind { + inherit llvm_meta; inherit (buildLlvmTools) llvm; - } // lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - }); + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - openmp = callPackage ./openmp { inherit llvm_meta; }; + openmp = callPackage ./openmp { + inherit llvm_meta; + }; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/12/libcxx/default.nix b/pkgs/development/compilers/llvm/12/libcxx/default.nix index 7b3b26b959e..1c9a7dd3c53 100644 --- a/pkgs/development/compilers/llvm/12/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/12/libcxx/default.nix @@ -15,7 +15,13 @@ stdenv.mkDerivation { mv llvm-* llvm ''; - patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; + outputs = [ "out" "dev" ]; + + patches = [ + ./gnu-install-dirs.patch + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ + ../../libcxx-0001-musl-hacks.patch + ]; preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' patchShebangs utils/cat_files.py diff --git a/pkgs/development/compilers/llvm/12/libcxx/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/libcxx/gnu-install-dirs.patch new file mode 100644 index 00000000000..1f9de00a9d5 --- /dev/null +++ b/pkgs/development/compilers/llvm/12/libcxx/gnu-install-dirs.patch @@ -0,0 +1,100 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9bf1a02f0908..612cd4aab76c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,6 +28,8 @@ set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build") + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUILD) + project(libcxx CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxx) + set(PACKAGE_VERSION 12.0.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +@@ -402,7 +404,7 @@ endif () + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) + string(APPEND LIBCXX_INSTALL_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) +@@ -410,11 +412,11 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}) + else() + set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) + set(LIBCXX_HEADER_DIR ${CMAKE_BINARY_DIR}) +- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) ++ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}) + endif() + + file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}") +diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake +index 5d2764e870e9..bb1ec5de6ca2 100644 +--- a/cmake/Modules/HandleLibCXXABI.cmake ++++ b/cmake/Modules/HandleLibCXXABI.cmake +@@ -63,7 +63,7 @@ macro(setup_abi_lib abidefines abishared abistatic abifiles abidirs) + + if (LIBCXX_INSTALL_HEADERS) + install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}" +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dstdir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir} + COMPONENT cxx-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index 29a317b8ae9a..4747263cfd1b 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -252,7 +252,7 @@ if (LIBCXX_INSTALL_HEADERS) + foreach(file ${files}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${file} +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir} ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dir} + COMPONENT cxx-headers + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + ) +@@ -260,7 +260,7 @@ if (LIBCXX_INSTALL_HEADERS) + + # Install the generated header as __config. + install(FILES ${LIBCXX_BINARY_DIR}/__generated_config +- DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1 ++ DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1 + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + RENAME __config + COMPONENT cxx-headers) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9965104cb5b2..9b55dbb1d822 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -352,21 +352,21 @@ if (LIBCXX_INSTALL_SHARED_LIBRARY) + install(TARGETS cxx_shared + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + if (LIBCXX_INSTALL_STATIC_LIBRARY) + install(TARGETS cxx_static + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY) + install(TARGETS cxx_experimental + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx +- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) ++ RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_BINDIR} COMPONENT cxx) + endif() + + # NOTE: This install command must go after the cxx install command otherwise diff --git a/pkgs/development/compilers/llvm/12/libcxxabi/default.nix b/pkgs/development/compilers/llvm/12/libcxxabi/default.nix index 7c974262438..e360cf8d0b2 100644 --- a/pkgs/development/compilers/llvm/12/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/12/libcxxabi/default.nix @@ -8,18 +8,7 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "1cbmzspwjlr8f6sp73pw6ivf4dpg6rpc61by0q1m2zca2k6yif3a"; - nativeBuildInputs = [ cmake python3 ]; - buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; - - cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [ - "-DLLVM_ENABLE_LIBCXX=ON" - "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" - ] ++ lib.optionals stdenv.hostPlatform.isWasm [ - "-DLIBCXXABI_ENABLE_THREADS=OFF" - "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" - ] ++ lib.optionals (!enableShared) [ - "-DLIBCXXABI_ENABLE_SHARED=OFF" - ]; + outputs = [ "out" "dev" ]; postUnpack = '' unpackFile ${libcxx.src} @@ -34,6 +23,23 @@ stdenv.mkDerivation { patch -p1 -d llvm -i ${./wasm.patch} ''; + patches = [ + ./gnu-install-dirs.patch + ]; + + nativeBuildInputs = [ cmake python3 ]; + buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; + + cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [ + "-DLLVM_ENABLE_LIBCXX=ON" + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ + "-DLIBCXXABI_ENABLE_THREADS=OFF" + "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" + ] ++ lib.optionals (!enableShared) [ + "-DLIBCXXABI_ENABLE_SHARED=OFF" + ]; + installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do diff --git a/pkgs/development/compilers/llvm/12/libcxxabi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/libcxxabi/gnu-install-dirs.patch new file mode 100644 index 00000000000..b49b1685940 --- /dev/null +++ b/pkgs/development/compilers/llvm/12/libcxxabi/gnu-install-dirs.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 426c855288fc..a9812a994f53 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,6 +27,8 @@ set(LIBCXXABI_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXXABI_STANDALONE_BUILD) + project(libcxxabi CXX C) + ++ include(GNUInstallDirs) ++ + set(PACKAGE_NAME libcxxabi) + set(PACKAGE_VERSION 11.0.0) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +@@ -180,17 +182,17 @@ set(CMAKE_MODULE_PATH + + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBCXXABI_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) + string(APPEND LIBCXXABI_INSTALL_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) + endif() + elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX}) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX}) + else() + set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX}) +- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX}) ++ set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX}) + endif() + + set(LIBCXXABI_INSTALL_PREFIX "" CACHE STRING "Define libc++abi destination prefix.") diff --git a/pkgs/development/compilers/llvm/12/lld/default.nix b/pkgs/development/compilers/llvm/12/lld/default.nix index d46f25b68b3..e2c7470d2fc 100644 --- a/pkgs/development/compilers/llvm/12/lld/default.nix +++ b/pkgs/development/compilers/llvm/12/lld/default.nix @@ -18,6 +18,13 @@ stdenv.mkDerivation rec { ./gnu-install-dirs.patch ]; + postPatch = '' + substituteInPlace MachO/CMakeLists.txt --replace \ + '(''${LLVM_MAIN_SRC_DIR}/' '(' + mkdir -p libunwind/include + tar -xf "${libunwind.src}" --wildcards -C libunwind/include --strip-components=2 "libunwind-*/include/" + ''; + nativeBuildInputs = [ cmake ]; buildInputs = [ libllvm libxml2 ]; @@ -29,13 +36,6 @@ stdenv.mkDerivation rec { outputs = [ "out" "lib" "dev" ]; - postPatch = '' - substituteInPlace MachO/CMakeLists.txt --replace \ - '(''${LLVM_MAIN_SRC_DIR}/' '(' - mkdir -p libunwind/include - tar -xf "${libunwind.src}" --wildcards -C libunwind/include --strip-components=2 "libunwind-*/include/" - ''; - meta = llvm_meta // { homepage = "https://lld.llvm.org/"; description = "The LLVM linker"; @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { LLD is a linker from the LLVM project that is a drop-in replacement for system linkers and runs much faster than them. It also provides features that are useful for toolchain developers. - The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS) and + The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS), and WebAssembly in descending order of completeness. Internally, LLD consists of several different linkers. ''; diff --git a/pkgs/development/compilers/llvm/12/llvm/default.nix b/pkgs/development/compilers/llvm/12/llvm/default.nix index 0bc704a8155..2e5afc0d5e2 100644 --- a/pkgs/development/compilers/llvm/12/llvm/default.nix +++ b/pkgs/development/compilers/llvm/12/llvm/default.nix @@ -205,6 +205,8 @@ in stdenv.mkDerivation (rec { make docs-llvm-man ''; + propagatedBuildInputs = []; + installPhase = '' make -C docs install ''; diff --git a/pkgs/development/compilers/llvm/5/clang/default.nix b/pkgs/development/compilers/llvm/5/clang/default.nix index bbeb9277683..b5887a23c65 100644 --- a/pkgs/development/compilers/llvm/5/clang/default.nix +++ b/pkgs/development/compilers/llvm/5/clang/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -88,11 +88,20 @@ let inherit libllvm; }; - meta = { - description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://clang.llvm.org/"; + description = "A C language family frontend for LLVM"; + longDescription = '' + The Clang project provides a language front-end and tooling + infrastructure for languages in the C language family (C, C++, Objective + C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. + It aims to deliver amazingly fast compiles, extremely useful error and + warning messages and to provide a platform for building great source + level tools. The Clang Static Analyzer and clang-tidy are tools that + automatically find bugs in your code, and are great examples of the sort + of tools that can be built using the Clang frontend as a library to + parse C/C++ code. + ''; }; } // lib.optionalAttrs enableManpages { pname = "clang-manpages"; @@ -111,6 +120,8 @@ let doCheck = false; - meta.description = "man page for Clang ${version}"; + meta = llvm_meta // { + description = "man page for Clang ${version}"; + }; }); in self diff --git a/pkgs/development/compilers/llvm/5/compiler-rt/default.nix b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix index 7e85c420da0..a14823571e1 100644 --- a/pkgs/development/compilers/llvm/5/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }: +{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, llvm, libcxxabi }: let @@ -86,4 +86,19 @@ stdenv.mkDerivation { ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/linux/crtendS.o ''; + meta = llvm_meta // { + homepage = "https://compiler-rt.llvm.org/"; + description = "Compiler runtime libraries"; + longDescription = '' + The compiler-rt project provides highly tuned implementations of the + low-level code generator support routines like "__fixunsdfdi" and other + calls generated when a target doesn't have a short sequence of native + instructions to implement a core IR operation. It also provides + implementations of run-time libraries for dynamic testing tools such as + AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. + ''; + # "All of the code in the compiler-rt project is dual licensed under the MIT + # license and the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; } diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix index 67743cb8c97..d11c08329d5 100644 --- a/pkgs/development/compilers/llvm/5/default.nix +++ b/pkgs/development/compilers/llvm/5/default.nix @@ -16,30 +16,41 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "018b3fiwah8f8br5i26qmzh6sjvzchpn358sn8v079m49f2jldm3"; + llvm_meta = { + license = lib.licenses.ncsa; + maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; + platforms = lib.platforms.all; + }; + tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" - ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" ''; in { - libllvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { + inherit llvm_meta; + }; # `llvm` historically had the binaries. When choosing an output explicitly, # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm.out // { outputUnspecified = true; }; - libllvm-polly = callPackage ./llvm { enablePolly = true; }; + libllvm-polly = callPackage ./llvm { + inherit llvm_meta; + enablePolly = true; + }; llvm-polly = tools.libllvm-polly.lib // { outputUnspecified = true; }; libclang = callPackage ./clang { - inherit clang-tools-extra_src; + inherit clang-tools-extra_src llvm_meta; }; clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; @@ -76,26 +87,38 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld {}; + lld = callPackage ./lld { + inherit llvm_meta; + }; - lldb = callPackage ./lldb {}; + lldb = callPackage ./lldb { + inherit llvm_meta; + }; }); 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 {}; + compiler-rt = callPackage ./compiler-rt { + inherit llvm_meta; + }; stdenv = overrideCC stdenv buildLlvmTools.clang; libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libcxx {}; + libcxx = callPackage ./libcxx { + inherit llvm_meta; + }; - libcxxabi = callPackage ./libcxxabi {}; + libcxxabi = callPackage ./libcxxabi { + inherit llvm_meta; + }; - openmp = callPackage ./openmp.nix {}; + openmp = callPackage ./openmp { + inherit llvm_meta; + }; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/5/libcxx/default.nix b/pkgs/development/compilers/llvm/5/libcxx/default.nix index f7e973be3d4..44026fba187 100644 --- a/pkgs/development/compilers/llvm/5/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/5/libcxx/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version }: +{ lib, stdenv, llvm_meta, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version }: stdenv.mkDerivation { pname = "libcxx"; @@ -45,10 +45,15 @@ stdenv.mkDerivation { isLLVM = true; }; - meta = { + meta = llvm_meta // { homepage = "https://libcxx.llvm.org/"; - description = "A new implementation of the C++ standard library, targeting C++11"; - license = with lib.licenses; [ ncsa mit ]; - platforms = lib.platforms.unix; + description = "C++ standard library"; + longDescription = '' + libc++ is an implementation of the C++ standard library, targeting C++11, + C++14 and above. + ''; + # "All of the code in libc++ is dual licensed under the MIT license and the + # UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; }; } diff --git a/pkgs/development/compilers/llvm/5/libcxxabi/default.nix b/pkgs/development/compilers/llvm/5/libcxxabi/default.nix index 85323c4371c..5146e20089b 100644 --- a/pkgs/development/compilers/llvm/5/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/5/libcxxabi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version }: +{ lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version }: stdenv.mkDerivation { pname = "libcxxabi"; @@ -47,11 +47,15 @@ stdenv.mkDerivation { ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 ''; - meta = { + meta = llvm_meta // { homepage = "https://libcxxabi.llvm.org/"; - description = "A new implementation of low level support for a standard C++ library"; - license = with lib.licenses; [ ncsa mit ]; - maintainers = with lib.maintainers; [ vlstill ]; - platforms = lib.platforms.unix; + description = "Provides C++ standard library support"; + longDescription = '' + libc++abi is a new implementation of low level support for a standard C++ library. + ''; + # "All of the code in libc++abi is dual licensed under the MIT license and + # the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; }; } diff --git a/pkgs/development/compilers/llvm/5/lld/default.nix b/pkgs/development/compilers/llvm/5/lld/default.nix index 73762e2d2e5..7e74e79a15c 100644 --- a/pkgs/development/compilers/llvm/5/lld/default.nix +++ b/pkgs/development/compilers/llvm/5/lld/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , buildLlvmTools , fetch , cmake @@ -6,7 +6,7 @@ , version }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "lld"; inherit version; @@ -27,11 +27,16 @@ stdenv.mkDerivation { outputs = [ "out" "lib" "dev" ]; - meta = { - description = "The LLVM Linker"; - homepage = "https://lld.llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; - badPlatforms = [ "x86_64-darwin" ]; + meta = llvm_meta // { + homepage = "https://lld.llvm.org/"; + description = "The LLVM linker"; + longDescription = '' + LLD is a linker from the LLVM project that is a drop-in replacement for + system linkers and runs much faster than them. It also provides features + that are useful for toolchain developers. + The linker supports ELF (Unix), PE/COFF (Windows), and Mach-O (macOS) + in descending order of completeness. Internally, LLD consists + of several different linkers. + ''; }; } diff --git a/pkgs/development/compilers/llvm/5/lldb/default.nix b/pkgs/development/compilers/llvm/5/lldb/default.nix index 723792d1341..951e9c8e1ac 100644 --- a/pkgs/development/compilers/llvm/5/lldb/default.nix +++ b/pkgs/development/compilers/llvm/5/lldb/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , fetch , fetchpatch , cmake @@ -73,10 +73,14 @@ stdenv.mkDerivation rec { cp ../docs/lldb.1 $out/share/man/man1/ ''; - meta = with lib; { + meta = llvm_meta // { + homepage = "https://lldb.llvm.org/"; description = "A next-generation high-performance debugger"; - homepage = "https://llvm.org/"; - license = licenses.ncsa; - platforms = platforms.all; + longDescription = '' + LLDB is a next generation, high-performance debugger. It is built as a set + of reusable components which highly leverage existing libraries in the + larger LLVM Project, such as the Clang expression parser and LLVM + disassembler. + ''; }; } diff --git a/pkgs/development/compilers/llvm/5/llvm/default.nix b/pkgs/development/compilers/llvm/5/llvm/default.nix index 0cbd30c783c..54fd783a7c2 100644 --- a/pkgs/development/compilers/llvm/5/llvm/default.nix +++ b/pkgs/development/compilers/llvm/5/llvm/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , pkgsBuildBuild , fetch , fetchpatch @@ -173,12 +173,23 @@ stdenv.mkDerivation ({ checkTarget = "check-all"; requiredSystemFeatures = [ "big-parallel" ]; - meta = { - description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ]; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://llvm.org/"; + description = "A collection of modular and reusable compiler and toolchain technologies"; + longDescription = '' + The LLVM Project is a collection of modular and reusable compiler and + toolchain technologies. Despite its name, LLVM has little to do with + traditional virtual machines. The name "LLVM" itself is not an acronym; it + is the full name of the project. + LLVM began as a research project at the University of Illinois, with the + goal of providing a modern, SSA-based compilation strategy capable of + supporting both static and dynamic compilation of arbitrary programming + languages. Since then, LLVM has grown to be an umbrella project consisting + of a number of subprojects, many of which are being used in production by + a wide variety of commercial and open source projects as well as being + widely used in academic research. Code in the LLVM project is licensed + under the "Apache 2.0 License with LLVM exceptions". + ''; }; } // lib.optionalAttrs enableManpages { pname = "llvm-manpages"; @@ -197,5 +208,7 @@ stdenv.mkDerivation ({ doCheck = false; - meta.description = "man pages for LLVM ${version}"; + meta = llvm_meta // { + description = "man pages for LLVM ${version}"; + }; }) diff --git a/pkgs/development/compilers/llvm/5/openmp.nix b/pkgs/development/compilers/llvm/5/openmp.nix deleted file mode 100644 index 169c9c50324..00000000000 --- a/pkgs/development/compilers/llvm/5/openmp.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib -, stdenv -, fetch -, cmake -, llvm -, perl -, version -}: - -stdenv.mkDerivation { - pname = "openmp"; - inherit version; - - src = fetch "openmp" "0p2n52676wlq6y9q99n5pivq6pvvda1p994r69fxj206ahn59jir"; - - nativeBuildInputs = [ cmake perl ]; - buildInputs = [ llvm ]; - - meta = { - description = "Components required to build an executable OpenMP program"; - homepage = "https://openmp.llvm.org/"; - license = lib.licenses.mit; - platforms = lib.platforms.all; - }; -} diff --git a/pkgs/development/compilers/llvm/5/openmp/default.nix b/pkgs/development/compilers/llvm/5/openmp/default.nix new file mode 100644 index 00000000000..3a1f97919dc --- /dev/null +++ b/pkgs/development/compilers/llvm/5/openmp/default.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, llvm_meta +, fetch +, cmake +, llvm +, perl +, version +}: + +stdenv.mkDerivation { + pname = "openmp"; + inherit version; + + src = fetch "openmp" "0p2n52676wlq6y9q99n5pivq6pvvda1p994r69fxj206ahn59jir"; + + nativeBuildInputs = [ cmake perl ]; + buildInputs = [ llvm ]; + + meta = llvm_meta // { + homepage = "https://openmp.llvm.org/"; + description = "Support for the OpenMP language"; + longDescription = '' + The OpenMP subproject of LLVM contains the components required to build an + executable OpenMP program that are outside the compiler itself. + Contains the code for the runtime library against which code compiled by + "clang -fopenmp" must be linked before it can run and the library that + supports offload to target devices. + ''; + # "All of the code is dual licensed under the MIT license and the UIUC + # License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; +} diff --git a/pkgs/development/compilers/llvm/6/clang/default.nix b/pkgs/development/compilers/llvm/6/clang/default.nix index 5c4894af9da..eba9111d9d3 100644 --- a/pkgs/development/compilers/llvm/6/clang/default.nix +++ b/pkgs/development/compilers/llvm/6/clang/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -88,11 +88,20 @@ let inherit libllvm; }; - meta = { - description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://clang.llvm.org/"; + description = "A C language family frontend for LLVM"; + longDescription = '' + The Clang project provides a language front-end and tooling + infrastructure for languages in the C language family (C, C++, Objective + C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. + It aims to deliver amazingly fast compiles, extremely useful error and + warning messages and to provide a platform for building great source + level tools. The Clang Static Analyzer and clang-tidy are tools that + automatically find bugs in your code, and are great examples of the sort + of tools that can be built using the Clang frontend as a library to + parse C/C++ code. + ''; }; } // lib.optionalAttrs enableManpages { pname = "clang-manpages"; @@ -111,6 +120,8 @@ let doCheck = false; - meta.description = "man page for Clang ${version}"; + meta = llvm_meta // { + description = "man page for Clang ${version}"; + }; }); in self diff --git a/pkgs/development/compilers/llvm/6/compiler-rt/default.nix b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix index 384305f5cf2..0ba96e5375b 100644 --- a/pkgs/development/compilers/llvm/6/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }: +{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, llvm, libcxxabi }: let @@ -88,4 +88,19 @@ stdenv.mkDerivation { ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/linux/crtendS.o ''; + meta = llvm_meta // { + homepage = "https://compiler-rt.llvm.org/"; + description = "Compiler runtime libraries"; + longDescription = '' + The compiler-rt project provides highly tuned implementations of the + low-level code generator support routines like "__fixunsdfdi" and other + calls generated when a target doesn't have a short sequence of native + instructions to implement a core IR operation. It also provides + implementations of run-time libraries for dynamic testing tools such as + AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. + ''; + # "All of the code in the compiler-rt project is dual licensed under the MIT + # license and the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; } diff --git a/pkgs/development/compilers/llvm/6/default.nix b/pkgs/development/compilers/llvm/6/default.nix index b4fd0a3bf71..a0cc84d8d73 100644 --- a/pkgs/development/compilers/llvm/6/default.nix +++ b/pkgs/development/compilers/llvm/6/default.nix @@ -16,30 +16,41 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "1w8ml7fyn4vyxmy59n2qm4r1k1kgwgwkaldp6m45fdv4g0kkfbhd"; + llvm_meta = { + license = lib.licenses.ncsa; + maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; + platforms = lib.platforms.all; + }; + tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc" - ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" ''; in { - libllvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { + inherit llvm_meta; + }; # `llvm` historically had the binaries. When choosing an output explicitly, # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm.out // { outputUnspecified = true; }; - libllvm-polly = callPackage ./llvm { enablePolly = true; }; + libllvm-polly = callPackage ./llvm { + inherit llvm_meta; + enablePolly = true; + }; llvm-polly = tools.libllvm-polly.lib // { outputUnspecified = true; }; libclang = callPackage ./clang { - inherit clang-tools-extra_src; + inherit clang-tools-extra_src llvm_meta; }; clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; @@ -77,26 +88,38 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld {}; + lld = callPackage ./lld { + inherit llvm_meta; + }; - lldb = callPackage ./lldb {}; + lldb = callPackage ./lldb { + inherit llvm_meta; + }; }); 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 {}; + compiler-rt = callPackage ./compiler-rt { + inherit llvm_meta; + }; stdenv = overrideCC stdenv buildLlvmTools.clang; libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libcxx {}; + libcxx = callPackage ./libcxx { + inherit llvm_meta; + }; - libcxxabi = callPackage ./libcxxabi {}; + libcxxabi = callPackage ./libcxxabi { + inherit llvm_meta; + }; - openmp = callPackage ./openmp.nix {}; + openmp = callPackage ./openmp { + inherit llvm_meta; + }; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/6/libcxx/default.nix b/pkgs/development/compilers/llvm/6/libcxx/default.nix index 001fa3ed683..3e39dd84042 100644 --- a/pkgs/development/compilers/llvm/6/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/6/libcxx/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version }: +{ lib, stdenv, llvm_meta, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version }: stdenv.mkDerivation { pname = "libcxx"; @@ -45,10 +45,15 @@ stdenv.mkDerivation { isLLVM = true; }; - meta = { + meta = llvm_meta // { homepage = "https://libcxx.llvm.org/"; - description = "A new implementation of the C++ standard library, targeting C++11"; - license = with lib.licenses; [ ncsa mit ]; - platforms = lib.platforms.unix; + description = "C++ standard library"; + longDescription = '' + libc++ is an implementation of the C++ standard library, targeting C++11, + C++14 and above. + ''; + # "All of the code in libc++ is dual licensed under the MIT license and the + # UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; }; } diff --git a/pkgs/development/compilers/llvm/6/libcxxabi/default.nix b/pkgs/development/compilers/llvm/6/libcxxabi/default.nix index 109b5ef51bc..6a03d8a1835 100644 --- a/pkgs/development/compilers/llvm/6/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/6/libcxxabi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version }: +{ lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version }: stdenv.mkDerivation { pname = "libcxxabi"; @@ -47,11 +47,15 @@ stdenv.mkDerivation { ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 ''; - meta = { + meta = llvm_meta // { homepage = "https://libcxxabi.llvm.org/"; - description = "A new implementation of low level support for a standard C++ library"; - license = with lib.licenses; [ ncsa mit ]; - maintainers = with lib.maintainers; [ vlstill ]; - platforms = lib.platforms.unix; + description = "Provides C++ standard library support"; + longDescription = '' + libc++abi is a new implementation of low level support for a standard C++ library. + ''; + # "All of the code in libc++abi is dual licensed under the MIT license and + # the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; }; } diff --git a/pkgs/development/compilers/llvm/6/lld/default.nix b/pkgs/development/compilers/llvm/6/lld/default.nix index 5bfd5f60e92..83b1991f453 100644 --- a/pkgs/development/compilers/llvm/6/lld/default.nix +++ b/pkgs/development/compilers/llvm/6/lld/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , buildLlvmTools , fetch , cmake @@ -7,11 +7,11 @@ , version }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "lld"; inherit version; - src = fetch "lld" "04afcfq2h7ysyqxxhyhb7ig4p0vdw7mi63kh8mffl74j0rc781p7"; + src = fetch pname "04afcfq2h7ysyqxxhyhb7ig4p0vdw7mi63kh8mffl74j0rc781p7"; patches = [ ./gnu-install-dirs.patch @@ -28,10 +28,16 @@ stdenv.mkDerivation { outputs = [ "out" "lib" "dev" ]; - meta = { - description = "The LLVM Linker"; - homepage = "https://lld.llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://lld.llvm.org/"; + description = "The LLVM linker"; + longDescription = '' + LLD is a linker from the LLVM project that is a drop-in replacement for + system linkers and runs much faster than them. It also provides features + that are useful for toolchain developers. + The linker supports ELF (Unix), PE/COFF (Windows), and Mach-O (macOS) + in descending order of completeness. Internally, LLD consists + of several different linkers. + ''; }; } diff --git a/pkgs/development/compilers/llvm/6/lldb/default.nix b/pkgs/development/compilers/llvm/6/lldb/default.nix index 31cc0ca68d7..da3c4a73a59 100644 --- a/pkgs/development/compilers/llvm/6/lldb/default.nix +++ b/pkgs/development/compilers/llvm/6/lldb/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , fetch , fetchpatch , cmake @@ -73,10 +73,14 @@ stdenv.mkDerivation rec { cp ../docs/lldb.1 $out/share/man/man1/ ''; - meta = with lib; { + meta = llvm_meta // { + homepage = "https://lldb.llvm.org/"; description = "A next-generation high-performance debugger"; - homepage = "https://llvm.org/"; - license = licenses.ncsa; - platforms = platforms.all; + longDescription = '' + LLDB is a next generation, high-performance debugger. It is built as a set + of reusable components which highly leverage existing libraries in the + larger LLVM Project, such as the Clang expression parser and LLVM + disassembler. + ''; }; } diff --git a/pkgs/development/compilers/llvm/6/llvm/default.nix b/pkgs/development/compilers/llvm/6/llvm/default.nix index 1c04a62c4d5..0907c895617 100644 --- a/pkgs/development/compilers/llvm/6/llvm/default.nix +++ b/pkgs/development/compilers/llvm/6/llvm/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , pkgsBuildBuild , fetch , cmake @@ -167,12 +167,23 @@ stdenv.mkDerivation ({ checkTarget = "check-all"; requiredSystemFeatures = [ "big-parallel" ]; - meta = { - description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ]; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://llvm.org/"; + description = "A collection of modular and reusable compiler and toolchain technologies"; + longDescription = '' + The LLVM Project is a collection of modular and reusable compiler and + toolchain technologies. Despite its name, LLVM has little to do with + traditional virtual machines. The name "LLVM" itself is not an acronym; it + is the full name of the project. + LLVM began as a research project at the University of Illinois, with the + goal of providing a modern, SSA-based compilation strategy capable of + supporting both static and dynamic compilation of arbitrary programming + languages. Since then, LLVM has grown to be an umbrella project consisting + of a number of subprojects, many of which are being used in production by + a wide variety of commercial and open source projects as well as being + widely used in academic research. Code in the LLVM project is licensed + under the "Apache 2.0 License with LLVM exceptions". + ''; }; } // lib.optionalAttrs enableManpages { pname = "llvm-manpages"; @@ -191,5 +202,7 @@ stdenv.mkDerivation ({ doCheck = false; - meta.description = "man pages for LLVM ${version}"; + meta = llvm_meta // { + description = "man pages for LLVM ${version}"; + }; }) diff --git a/pkgs/development/compilers/llvm/6/openmp.nix b/pkgs/development/compilers/llvm/6/openmp.nix deleted file mode 100644 index 9de18065918..00000000000 --- a/pkgs/development/compilers/llvm/6/openmp.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib -, stdenv -, fetch -, cmake -, llvm -, perl -, version -}: - -stdenv.mkDerivation { - pname = "openmp"; - inherit version; - - src = fetch "openmp" "0nhwfba9c351r16zgyjyfwdayr98nairky3c2f0b2lc360mwmbv6"; - - nativeBuildInputs = [ cmake perl ]; - buildInputs = [ llvm ]; - - meta = { - description = "Components required to build an executable OpenMP program"; - homepage = "https://openmp.llvm.org/"; - license = lib.licenses.mit; - platforms = lib.platforms.all; - }; -} diff --git a/pkgs/development/compilers/llvm/6/openmp/default.nix b/pkgs/development/compilers/llvm/6/openmp/default.nix new file mode 100644 index 00000000000..bc21220af7c --- /dev/null +++ b/pkgs/development/compilers/llvm/6/openmp/default.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, llvm_meta +, fetch +, cmake +, llvm +, perl +, version +}: + +stdenv.mkDerivation { + pname = "openmp"; + inherit version; + + src = fetch "openmp" "0nhwfba9c351r16zgyjyfwdayr98nairky3c2f0b2lc360mwmbv6"; + + nativeBuildInputs = [ cmake perl ]; + buildInputs = [ llvm ]; + + meta = llvm_meta // { + homepage = "https://openmp.llvm.org/"; + description = "Support for the OpenMP language"; + longDescription = '' + The OpenMP subproject of LLVM contains the components required to build an + executable OpenMP program that are outside the compiler itself. + Contains the code for the runtime library against which code compiled by + "clang -fopenmp" must be linked before it can run and the library that + supports offload to target devices. + ''; + # "All of the code is dual licensed under the MIT license and the UIUC + # License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; +} diff --git a/pkgs/development/compilers/llvm/7/clang/default.nix b/pkgs/development/compilers/llvm/7/clang/default.nix index 187602ef361..e1b031ad352 100644 --- a/pkgs/development/compilers/llvm/7/clang/default.nix +++ b/pkgs/development/compilers/llvm/7/clang/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -100,11 +100,20 @@ let inherit libllvm; }; - meta = { - description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://clang.llvm.org/"; + description = "A C language family frontend for LLVM"; + longDescription = '' + The Clang project provides a language front-end and tooling + infrastructure for languages in the C language family (C, C++, Objective + C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. + It aims to deliver amazingly fast compiles, extremely useful error and + warning messages and to provide a platform for building great source + level tools. The Clang Static Analyzer and clang-tidy are tools that + automatically find bugs in your code, and are great examples of the sort + of tools that can be built using the Clang frontend as a library to + parse C/C++ code. + ''; }; } // lib.optionalAttrs enableManpages { pname = "clang-manpages"; @@ -123,6 +132,8 @@ let doCheck = false; - meta.description = "man page for Clang ${version}"; + meta = llvm_meta // { + description = "man page for Clang ${version}"; + }; }); in self diff --git a/pkgs/development/compilers/llvm/7/compiler-rt/default.nix b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix index d97e54d8f49..5f64e2f2a27 100644 --- a/pkgs/development/compilers/llvm/7/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }: +{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, llvm, libcxxabi }: let @@ -90,4 +90,20 @@ stdenv.mkDerivation { ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o ''; + + meta = llvm_meta // { + homepage = "https://compiler-rt.llvm.org/"; + description = "Compiler runtime libraries"; + longDescription = '' + The compiler-rt project provides highly tuned implementations of the + low-level code generator support routines like "__fixunsdfdi" and other + calls generated when a target doesn't have a short sequence of native + instructions to implement a core IR operation. It also provides + implementations of run-time libraries for dynamic testing tools such as + AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. + ''; + # "All of the code in the compiler-rt project is dual licensed under the MIT + # license and the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; } diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 5060777c64a..43a397a1cf8 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -17,6 +17,12 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "0lb4kdh7j2fhfz8kd6iv5df7m3pikiryk1vvwsf87spc90n09q0w"; + llvm_meta = { + license = lib.licenses.ncsa; + maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; + platforms = lib.platforms.all; + }; + tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands0 = cc: '' @@ -31,23 +37,29 @@ let in { - libllvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { + inherit llvm_meta; + }; # `llvm` historically had the binaries. When choosing an output explicitly, # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm.out // { outputUnspecified = true; }; - libllvm-polly = callPackage ./llvm { enablePolly = true; }; + libllvm-polly = callPackage ./llvm { + inherit llvm_meta; + enablePolly = true; + }; llvm-polly = tools.libllvm-polly.lib // { outputUnspecified = true; }; libclang = callPackage ./clang { - inherit clang-tools-extra_src; + inherit clang-tools-extra_src llvm_meta; }; clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; clang-polly-unwrapped = callPackage ./clang { + inherit llvm_meta; inherit clang-tools-extra_src; libllvm = tools.libllvm-polly; enablePolly = true; @@ -85,9 +97,13 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld {}; + lld = callPackage ./lld { + inherit llvm_meta; + }; - lldb = callPackage ./lldb {}; + lldb = callPackage ./lldb { + inherit llvm_meta; + }; # Below, is the LLVM bootstrapping logic. It handles building a # fully LLVM toolchain from scratch. No GCC toolchain should be @@ -183,12 +199,14 @@ let in { compiler-rt-libc = callPackage ./compiler-rt { + inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc else stdenv; }; compiler-rt-no-libc = callPackage ./compiler-rt { + inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt else stdenv; @@ -203,24 +221,31 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libcxx ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + libcxx = callPackage ./libcxx { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libcxxabi = callPackage ./libcxxabi ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - libunwind = libraries.libunwind; - })); + libcxxabi = callPackage ./libcxxabi { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libunwind = callPackage ./libunwind ({ + libunwind = callPackage ./libunwind { + inherit llvm_meta; inherit (buildLlvmTools) llvm; - } // lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - }); + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - openmp = callPackage ./openmp.nix {}; + openmp = callPackage ./openmp { + inherit llvm_meta; + }; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/7/libcxx/default.nix b/pkgs/development/compilers/llvm/7/libcxx/default.nix index 954ac50658b..ac10e8eb77e 100644 --- a/pkgs/development/compilers/llvm/7/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/7/libcxx/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version +{ lib, stdenv, llvm_meta, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -17,7 +17,9 @@ stdenv.mkDerivation { patches = [ ./gnu-install-dirs.patch - ] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ + ../../libcxx-0001-musl-hacks.patch + ]; prePatch = '' substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" @@ -34,7 +36,7 @@ stdenv.mkDerivation { ++ lib.optional stdenv.hostPlatform.isMusl python3 ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = [ libcxxabi ] ; + buildInputs = [ libcxxabi ]; cmakeFlags = [ "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib" @@ -48,10 +50,15 @@ stdenv.mkDerivation { isLLVM = true; }; - meta = { + meta = llvm_meta // { homepage = "https://libcxx.llvm.org/"; - description = "A new implementation of the C++ standard library, targeting C++11"; - license = with lib.licenses; [ ncsa mit ]; - platforms = lib.platforms.unix; + description = "C++ standard library"; + longDescription = '' + libc++ is an implementation of the C++ standard library, targeting C++11, + C++14 and above. + ''; + # "All of the code in libc++ is dual licensed under the MIT license and the + # UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; }; } diff --git a/pkgs/development/compilers/llvm/7/libcxxabi/default.nix b/pkgs/development/compilers/llvm/7/libcxxabi/default.nix index bb9fb684bc0..1663b8c7291 100644 --- a/pkgs/development/compilers/llvm/7/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/7/libcxxabi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version +{ lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version , standalone ? stdenv.hostPlatform.useLLVM or false , withLibunwind ? !stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm # on musl the shared objects don't build @@ -58,11 +58,15 @@ stdenv.mkDerivation { ${lib.optionalString enableShared "ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1"} ''; - meta = { + meta = llvm_meta // { homepage = "https://libcxxabi.llvm.org/"; - description = "A new implementation of low level support for a standard C++ library"; - license = with lib.licenses; [ ncsa mit ]; - maintainers = with lib.maintainers; [ vlstill ]; - platforms = lib.platforms.unix; + description = "Provides C++ standard library support"; + longDescription = '' + libc++abi is a new implementation of low level support for a standard C++ library. + ''; + # "All of the code in libc++abi is dual licensed under the MIT license and + # the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; }; } diff --git a/pkgs/development/compilers/llvm/7/libunwind/default.nix b/pkgs/development/compilers/llvm/7/libunwind/default.nix index e8e96cf11cd..426895029b3 100644 --- a/pkgs/development/compilers/llvm/7/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/7/libunwind/default.nix @@ -1,12 +1,12 @@ -{ lib, stdenv, version, fetch, fetchpatch, cmake, llvm +{ lib, stdenv, llvm_meta, version, fetch, fetchpatch, cmake, llvm , enableShared ? !stdenv.hostPlatform.isStatic }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "libunwind"; inherit version; - src = fetch "libunwind" "035dsxs10nyiqd00q07yycvmkjl01yz4jdlrjvmch8klxg4pyjhp"; + src = fetch pname "035dsxs10nyiqd00q07yycvmkjl01yz4jdlrjvmch8klxg4pyjhp"; postUnpack = '' unpackFile ${llvm.src} @@ -29,6 +29,8 @@ stdenv.mkDerivation { }) ]; + outputs = [ "out" "dev" ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optionals (!enableShared) [ @@ -36,4 +38,16 @@ stdenv.mkDerivation { ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ "-DLLVM_ENABLE_LIBCXX=ON" ]; + + meta = llvm_meta // { + # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst + homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library"; + description = "LLVM's unwinder library"; + longDescription = '' + The unwind library provides a family of _Unwind_* functions implementing + the language-neutral stack unwinding portion of the Itanium C++ ABI (Level + I). It is a dependency of the C++ ABI library, and sometimes is a + dependency of other runtimes. + ''; + }; } diff --git a/pkgs/development/compilers/llvm/7/lld/default.nix b/pkgs/development/compilers/llvm/7/lld/default.nix index da863d5ad4a..09a0a68e257 100644 --- a/pkgs/development/compilers/llvm/7/lld/default.nix +++ b/pkgs/development/compilers/llvm/7/lld/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , buildLlvmTools , fetch , cmake @@ -7,11 +7,11 @@ , version }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "lld"; inherit version; - src = fetch "lld" "0rsqb7zcnij5r5ipfhr129j7skr5n9pyr388kjpqwh091952f3x1"; + src = fetch pname "0rsqb7zcnij5r5ipfhr129j7skr5n9pyr388kjpqwh091952f3x1"; patches = [ ./gnu-install-dirs.patch @@ -28,10 +28,16 @@ stdenv.mkDerivation { outputs = [ "out" "lib" "dev" ]; - meta = { - description = "The LLVM Linker"; - homepage = "https://lld.llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://lld.llvm.org/"; + description = "The LLVM linker"; + longDescription = '' + LLD is a linker from the LLVM project that is a drop-in replacement for + system linkers and runs much faster than them. It also provides features + that are useful for toolchain developers. + The linker supports ELF (Unix), PE/COFF (Windows), and Mach-O (macOS) + in descending order of completeness. Internally, LLD consists + of several different linkers. + ''; }; } diff --git a/pkgs/development/compilers/llvm/7/lldb/default.nix b/pkgs/development/compilers/llvm/7/lldb/default.nix index 97888492879..e2eab31697d 100644 --- a/pkgs/development/compilers/llvm/7/lldb/default.nix +++ b/pkgs/development/compilers/llvm/7/lldb/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , fetch , cmake , zlib @@ -76,10 +76,14 @@ stdenv.mkDerivation rec { cp ../docs/lldb.1 $out/share/man/man1/ ''; - meta = with lib; { + meta = llvm_meta // { + homepage = "https://lldb.llvm.org/"; description = "A next-generation high-performance debugger"; - homepage = "https://llvm.org/"; - license = licenses.ncsa; - platforms = platforms.all; + longDescription = '' + LLDB is a next generation, high-performance debugger. It is built as a set + of reusable components which highly leverage existing libraries in the + larger LLVM Project, such as the Clang expression parser and LLVM + disassembler. + ''; }; } diff --git a/pkgs/development/compilers/llvm/7/llvm/default.nix b/pkgs/development/compilers/llvm/7/llvm/default.nix index 6f189779f84..4a9b4f51820 100644 --- a/pkgs/development/compilers/llvm/7/llvm/default.nix +++ b/pkgs/development/compilers/llvm/7/llvm/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , pkgsBuildBuild , fetch , fetchpatch @@ -184,12 +184,23 @@ in stdenv.mkDerivation ({ checkTarget = "check-all"; requiredSystemFeatures = [ "big-parallel" ]; - meta = { - description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ]; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://llvm.org/"; + description = "A collection of modular and reusable compiler and toolchain technologies"; + longDescription = '' + The LLVM Project is a collection of modular and reusable compiler and + toolchain technologies. Despite its name, LLVM has little to do with + traditional virtual machines. The name "LLVM" itself is not an acronym; it + is the full name of the project. + LLVM began as a research project at the University of Illinois, with the + goal of providing a modern, SSA-based compilation strategy capable of + supporting both static and dynamic compilation of arbitrary programming + languages. Since then, LLVM has grown to be an umbrella project consisting + of a number of subprojects, many of which are being used in production by + a wide variety of commercial and open source projects as well as being + widely used in academic research. Code in the LLVM project is licensed + under the "Apache 2.0 License with LLVM exceptions". + ''; }; } // lib.optionalAttrs enableManpages { pname = "llvm-manpages"; @@ -211,5 +222,7 @@ in stdenv.mkDerivation ({ doCheck = false; - meta.description = "man pages for LLVM ${version}"; + meta = llvm_meta // { + description = "man pages for LLVM ${version}"; + }; }) diff --git a/pkgs/development/compilers/llvm/7/openmp.nix b/pkgs/development/compilers/llvm/7/openmp.nix deleted file mode 100644 index 53f52c326c5..00000000000 --- a/pkgs/development/compilers/llvm/7/openmp.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib -, stdenv -, fetch -, cmake -, llvm -, perl -, version -}: - -stdenv.mkDerivation { - pname = "openmp"; - inherit version; - - src = fetch "openmp" "1dg53wzsci2kra8lh1y0chh60h2l8h1by93br5spzvzlxshkmrqy"; - - nativeBuildInputs = [ cmake perl ]; - buildInputs = [ llvm ]; - - meta = { - description = "Components required to build an executable OpenMP program"; - homepage = "https://openmp.llvm.org/"; - license = lib.licenses.mit; - platforms = lib.platforms.all; - }; -} diff --git a/pkgs/development/compilers/llvm/7/openmp/default.nix b/pkgs/development/compilers/llvm/7/openmp/default.nix new file mode 100644 index 00000000000..c331762712f --- /dev/null +++ b/pkgs/development/compilers/llvm/7/openmp/default.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, llvm_meta +, fetch +, cmake +, llvm +, perl +, version +}: + +stdenv.mkDerivation { + pname = "openmp"; + inherit version; + + src = fetch "openmp" "1dg53wzsci2kra8lh1y0chh60h2l8h1by93br5spzvzlxshkmrqy"; + + nativeBuildInputs = [ cmake perl ]; + buildInputs = [ llvm ]; + + meta = llvm_meta // { + homepage = "https://openmp.llvm.org/"; + description = "Support for the OpenMP language"; + longDescription = '' + The OpenMP subproject of LLVM contains the components required to build an + executable OpenMP program that are outside the compiler itself. + Contains the code for the runtime library against which code compiled by + "clang -fopenmp" must be linked before it can run and the library that + supports offload to target devices. + ''; + # "All of the code is dual licensed under the MIT license and the UIUC + # License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; +} diff --git a/pkgs/development/compilers/llvm/8/clang/default.nix b/pkgs/development/compilers/llvm/8/clang/default.nix index c82b3e873e8..c3399dccd1d 100644 --- a/pkgs/development/compilers/llvm/8/clang/default.nix +++ b/pkgs/development/compilers/llvm/8/clang/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -107,11 +107,20 @@ let inherit libllvm; }; - meta = { - description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://clang.llvm.org/"; + description = "A C language family frontend for LLVM"; + longDescription = '' + The Clang project provides a language front-end and tooling + infrastructure for languages in the C language family (C, C++, Objective + C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. + It aims to deliver amazingly fast compiles, extremely useful error and + warning messages and to provide a platform for building great source + level tools. The Clang Static Analyzer and clang-tidy are tools that + automatically find bugs in your code, and are great examples of the sort + of tools that can be built using the Clang frontend as a library to + parse C/C++ code. + ''; }; } // lib.optionalAttrs enableManpages { pname = "clang-manpages"; @@ -130,6 +139,8 @@ let doCheck = false; - meta.description = "man page for Clang ${version}"; + meta = llvm_meta // { + description = "man page for Clang ${version}"; + }; }); in self diff --git a/pkgs/development/compilers/llvm/8/compiler-rt/default.nix b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix index d7d5e36e79d..d6d60b24150 100644 --- a/pkgs/development/compilers/llvm/8/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }: +{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, llvm, libcxxabi }: let @@ -90,4 +90,20 @@ stdenv.mkDerivation { ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o ''; + + meta = llvm_meta // { + homepage = "https://compiler-rt.llvm.org/"; + description = "Compiler runtime libraries"; + longDescription = '' + The compiler-rt project provides highly tuned implementations of the + low-level code generator support routines like "__fixunsdfdi" and other + calls generated when a target doesn't have a short sequence of native + instructions to implement a core IR operation. It also provides + implementations of run-time libraries for dynamic testing tools such as + AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. + ''; + # "All of the code in the compiler-rt project is dual licensed under the MIT + # license and the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; } diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index 78deb942c6e..f946d991f59 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -17,6 +17,12 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "1qf3097bc5ia8p6cpmbx985rjr3yaah5s8fc0nv7pw742yv7jw8q"; + llvm_meta = { + license = lib.licenses.ncsa; + maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; + platforms = lib.platforms.all; + }; + tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands0 = cc: '' @@ -31,23 +37,29 @@ let in { - libllvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { + inherit llvm_meta; + }; # `llvm` historically had the binaries. When choosing an output explicitly, # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm.out // { outputUnspecified = true; }; - libllvm-polly = callPackage ./llvm { enablePolly = true; }; + libllvm-polly = callPackage ./llvm { + inherit llvm_meta; + enablePolly = true; + }; llvm-polly = tools.libllvm-polly.lib // { outputUnspecified = true; }; libclang = callPackage ./clang { - inherit clang-tools-extra_src; + inherit clang-tools-extra_src llvm_meta; }; clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; clang-polly-unwrapped = callPackage ./clang { + inherit llvm_meta; inherit clang-tools-extra_src; libllvm = tools.libllvm-polly; enablePolly = true; @@ -86,9 +98,13 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld {}; + lld = callPackage ./lld { + inherit llvm_meta; + }; - lldb = callPackage ./lldb {}; + lldb = callPackage ./lldb { + inherit llvm_meta; + }; # Below, is the LLVM bootstrapping logic. It handles building a # fully LLVM toolchain from scratch. No GCC toolchain should be @@ -184,12 +200,14 @@ let in { compiler-rt-libc = callPackage ./compiler-rt { + inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc else stdenv; }; compiler-rt-no-libc = callPackage ./compiler-rt { + inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt else stdenv; @@ -204,23 +222,30 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libcxx ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + libcxx = callPackage ./libcxx { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libcxxabi = callPackage ./libcxxabi ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - libunwind = libraries.libunwind; - })); + libcxxabi = callPackage ./libcxxabi { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libunwind = callPackage ./libunwind ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + libunwind = callPackage ./libunwind { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - openmp = callPackage ./openmp.nix {}; + openmp = callPackage ./openmp { + inherit llvm_meta; + }; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/8/libcxx/default.nix b/pkgs/development/compilers/llvm/8/libcxx/default.nix index 5589cb7180a..804b9a53c24 100644 --- a/pkgs/development/compilers/llvm/8/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/8/libcxx/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version +{ lib, stdenv, llvm_meta, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -17,7 +17,9 @@ stdenv.mkDerivation { patches = [ ./gnu-install-dirs.patch - ] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ + ../../libcxx-0001-musl-hacks.patch + ]; prePatch = '' substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" @@ -51,10 +53,15 @@ stdenv.mkDerivation { isLLVM = true; }; - meta = { + meta = llvm_meta // { homepage = "https://libcxx.llvm.org/"; - description = "A new implementation of the C++ standard library, targeting C++11"; - license = with lib.licenses; [ ncsa mit ]; - platforms = lib.platforms.all; + description = "C++ standard library"; + longDescription = '' + libc++ is an implementation of the C++ standard library, targeting C++11, + C++14 and above. + ''; + # "All of the code in libc++ is dual licensed under the MIT license and the + # UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; }; } diff --git a/pkgs/development/compilers/llvm/8/libcxxabi/default.nix b/pkgs/development/compilers/llvm/8/libcxxabi/default.nix index ccc43d7cb21..593b1df9b7a 100644 --- a/pkgs/development/compilers/llvm/8/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/8/libcxxabi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version +{ lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -63,11 +63,15 @@ stdenv.mkDerivation { ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 ''; - meta = { + meta = llvm_meta // { homepage = "https://libcxxabi.llvm.org/"; - description = "A new implementation of low level support for a standard C++ library"; - license = with lib.licenses; [ ncsa mit ]; - maintainers = with lib.maintainers; [ vlstill ]; - platforms = lib.platforms.all; + description = "Provides C++ standard library support"; + longDescription = '' + libc++abi is a new implementation of low level support for a standard C++ library. + ''; + # "All of the code in libc++abi is dual licensed under the MIT license and + # the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; }; } diff --git a/pkgs/development/compilers/llvm/8/libunwind/default.nix b/pkgs/development/compilers/llvm/8/libunwind/default.nix index e38f2072ced..244b5775bdc 100644 --- a/pkgs/development/compilers/llvm/8/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/8/libunwind/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, fetchpatch +{ lib, stdenv, llvm_meta, version, fetch, cmake, fetchpatch , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -25,4 +25,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; + + meta = llvm_meta // { + # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst + homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library"; + description = "LLVM's unwinder library"; + longDescription = '' + The unwind library provides a family of _Unwind_* functions implementing + the language-neutral stack unwinding portion of the Itanium C++ ABI (Level + I). It is a dependency of the C++ ABI library, and sometimes is a + dependency of other runtimes. + ''; + }; } diff --git a/pkgs/development/compilers/llvm/8/lld/default.nix b/pkgs/development/compilers/llvm/8/lld/default.nix index 696403d1bf6..66b59937e5f 100644 --- a/pkgs/development/compilers/llvm/8/lld/default.nix +++ b/pkgs/development/compilers/llvm/8/lld/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , buildLlvmTools , fetch , cmake @@ -7,11 +7,11 @@ , version }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "lld"; inherit version; - src = fetch "lld" "121xhxrlvwy3k5nf6p1wv31whxlb635ssfkci8z93mwv4ja1xflz"; + src = fetch pname "121xhxrlvwy3k5nf6p1wv31whxlb635ssfkci8z93mwv4ja1xflz"; patches = [ ./gnu-install-dirs.patch @@ -28,10 +28,16 @@ stdenv.mkDerivation { outputs = [ "out" "lib" "dev" ]; - meta = { - description = "The LLVM Linker"; - homepage = "https://lld.llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://lld.llvm.org/"; + description = "The LLVM linker"; + longDescription = '' + LLD is a linker from the LLVM project that is a drop-in replacement for + system linkers and runs much faster than them. It also provides features + that are useful for toolchain developers. + The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS), and + WebAssembly in descending order of completeness. Internally, LLD consists + of several different linkers. + ''; }; } diff --git a/pkgs/development/compilers/llvm/8/lldb/default.nix b/pkgs/development/compilers/llvm/8/lldb/default.nix index 95bf4aae054..ee1f678996a 100644 --- a/pkgs/development/compilers/llvm/8/lldb/default.nix +++ b/pkgs/development/compilers/llvm/8/lldb/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , fetch , cmake , zlib @@ -70,10 +70,14 @@ stdenv.mkDerivation rec { ln -s $out/bin/llvm-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin ''; - meta = with lib; { + meta = llvm_meta // { + homepage = "https://lldb.llvm.org/"; description = "A next-generation high-performance debugger"; - homepage = "https://llvm.org/"; - license = licenses.ncsa; - platforms = platforms.all; + longDescription = '' + LLDB is a next generation, high-performance debugger. It is built as a set + of reusable components which highly leverage existing libraries in the + larger LLVM Project, such as the Clang expression parser and LLVM + disassembler. + ''; }; } diff --git a/pkgs/development/compilers/llvm/8/llvm/default.nix b/pkgs/development/compilers/llvm/8/llvm/default.nix index 8ea9b287c7c..6f14b375c62 100644 --- a/pkgs/development/compilers/llvm/8/llvm/default.nix +++ b/pkgs/development/compilers/llvm/8/llvm/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , pkgsBuildBuild , fetch , fetchpatch @@ -168,12 +168,23 @@ in stdenv.mkDerivation ({ checkTarget = "check-all"; requiredSystemFeatures = [ "big-parallel" ]; - meta = { - description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ]; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://llvm.org/"; + description = "A collection of modular and reusable compiler and toolchain technologies"; + longDescription = '' + The LLVM Project is a collection of modular and reusable compiler and + toolchain technologies. Despite its name, LLVM has little to do with + traditional virtual machines. The name "LLVM" itself is not an acronym; it + is the full name of the project. + LLVM began as a research project at the University of Illinois, with the + goal of providing a modern, SSA-based compilation strategy capable of + supporting both static and dynamic compilation of arbitrary programming + languages. Since then, LLVM has grown to be an umbrella project consisting + of a number of subprojects, many of which are being used in production by + a wide variety of commercial and open source projects as well as being + widely used in academic research. Code in the LLVM project is licensed + under the "Apache 2.0 License with LLVM exceptions". + ''; }; } // lib.optionalAttrs enableManpages { pname = "llvm-manpages"; @@ -195,5 +206,7 @@ in stdenv.mkDerivation ({ doCheck = false; - meta.description = "man pages for LLVM ${version}"; + meta = llvm_meta // { + description = "man pages for LLVM ${version}"; + }; }) diff --git a/pkgs/development/compilers/llvm/8/openmp.nix b/pkgs/development/compilers/llvm/8/openmp.nix deleted file mode 100644 index b5d75d9c872..00000000000 --- a/pkgs/development/compilers/llvm/8/openmp.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib -, stdenv -, fetch -, cmake -, llvm -, perl -, version -}: - -stdenv.mkDerivation { - pname = "openmp"; - inherit version; - - src = fetch "openmp" "0b3jlxhqbpyd1nqkpxjfggm5d9va5qpyf7d4i5y7n4a1mlydv19y"; - - nativeBuildInputs = [ cmake perl ]; - buildInputs = [ llvm ]; - - meta = { - description = "Components required to build an executable OpenMP program"; - homepage = "https://openmp.llvm.org/"; - license = lib.licenses.mit; - platforms = lib.platforms.all; - }; -} diff --git a/pkgs/development/compilers/llvm/8/openmp/default.nix b/pkgs/development/compilers/llvm/8/openmp/default.nix new file mode 100644 index 00000000000..e8459d27982 --- /dev/null +++ b/pkgs/development/compilers/llvm/8/openmp/default.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, llvm_meta +, fetch +, cmake +, llvm +, perl +, version +}: + +stdenv.mkDerivation { + pname = "openmp"; + inherit version; + + src = fetch "openmp" "0b3jlxhqbpyd1nqkpxjfggm5d9va5qpyf7d4i5y7n4a1mlydv19y"; + + nativeBuildInputs = [ cmake perl ]; + buildInputs = [ llvm ]; + + meta = llvm_meta // { + homepage = "https://openmp.llvm.org/"; + description = "Support for the OpenMP language"; + longDescription = '' + The OpenMP subproject of LLVM contains the components required to build an + executable OpenMP program that are outside the compiler itself. + Contains the code for the runtime library against which code compiled by + "clang -fopenmp" must be linked before it can run and the library that + supports offload to target devices. + ''; + # "All of the code is dual licensed under the MIT license and the UIUC + # License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; +} diff --git a/pkgs/development/compilers/llvm/9/clang/default.nix b/pkgs/development/compilers/llvm/9/clang/default.nix index f1c21083bb6..700fcb414fc 100644 --- a/pkgs/development/compilers/llvm/9/clang/default.nix +++ b/pkgs/development/compilers/llvm/9/clang/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 +{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -102,11 +102,20 @@ let inherit libllvm; }; - meta = { - description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://clang.llvm.org/"; + description = "A C language family frontend for LLVM"; + longDescription = '' + The Clang project provides a language front-end and tooling + infrastructure for languages in the C language family (C, C++, Objective + C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. + It aims to deliver amazingly fast compiles, extremely useful error and + warning messages and to provide a platform for building great source + level tools. The Clang Static Analyzer and clang-tidy are tools that + automatically find bugs in your code, and are great examples of the sort + of tools that can be built using the Clang frontend as a library to + parse C/C++ code. + ''; }; } // lib.optionalAttrs enableManpages { pname = "clang-manpages"; @@ -125,6 +134,8 @@ let doCheck = false; - meta.description = "man page for Clang ${version}"; + meta = llvm_meta // { + description = "man page for Clang ${version}"; + }; }); in self diff --git a/pkgs/development/compilers/llvm/9/compiler-rt/default.nix b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix index def3473a050..c31ce78ea0f 100644 --- a/pkgs/development/compilers/llvm/9/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }: +{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, llvm, libcxxabi }: let @@ -89,4 +89,20 @@ stdenv.mkDerivation { ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o ''; + + meta = llvm_meta // { + homepage = "https://compiler-rt.llvm.org/"; + description = "Compiler runtime libraries"; + longDescription = '' + The compiler-rt project provides highly tuned implementations of the + low-level code generator support routines like "__fixunsdfdi" and other + calls generated when a target doesn't have a short sequence of native + instructions to implement a core IR operation. It also provides + implementations of run-time libraries for dynamic testing tools such as + AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer. + ''; + # "All of the code in the compiler-rt project is dual licensed under the MIT + # license and the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; } diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index 39b285da262..b93e05d614b 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -17,6 +17,12 @@ let clang-tools-extra_src = fetch "clang-tools-extra" "01vgzd4k1q93nfs8gyl83mjlc4x0qsgfqw32lacbjzdxg0mdfvxj"; + llvm_meta = { + license = lib.licenses.ncsa; + maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; + platforms = lib.platforms.all; + }; + tools = lib.makeExtensible (tools: let callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; }); mkExtraBuildCommands0 = cc: '' @@ -31,23 +37,29 @@ let in { - libllvm = callPackage ./llvm { }; + libllvm = callPackage ./llvm { + inherit llvm_meta; + }; # `llvm` historically had the binaries. When choosing an output explicitly, # we need to reintroduce `outputUnspecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm.out // { outputUnspecified = true; }; - libllvm-polly = callPackage ./llvm { enablePolly = true; }; + libllvm-polly = callPackage ./llvm { + inherit llvm_meta; + enablePolly = true; + }; llvm-polly = tools.libllvm-polly.lib // { outputUnspecified = true; }; libclang = callPackage ./clang { - inherit clang-tools-extra_src; + inherit clang-tools-extra_src llvm_meta; }; clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; clang-polly-unwrapped = callPackage ./clang { + inherit llvm_meta; inherit clang-tools-extra_src; libllvm = tools.libllvm-polly; enablePolly = true; @@ -86,9 +98,13 @@ let extraBuildCommands = mkExtraBuildCommands cc; }; - lld = callPackage ./lld {}; + lld = callPackage ./lld { + inherit llvm_meta; + }; - lldb = callPackage ./lldb {}; + lldb = callPackage ./lldb { + inherit llvm_meta; + }; # Below, is the LLVM bootstrapping logic. It handles building a # fully LLVM toolchain from scratch. No GCC toolchain should be @@ -184,12 +200,14 @@ let in { compiler-rt-libc = callPackage ./compiler-rt { + inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc else stdenv; }; compiler-rt-no-libc = callPackage ./compiler-rt { + inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt else stdenv; @@ -204,23 +222,30 @@ let libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; - libcxx = callPackage ./libcxx ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + libcxx = callPackage ./libcxx { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libcxxabi = callPackage ./libcxxabi ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - libunwind = libraries.libunwind; - })); + libcxxabi = callPackage ./libcxxabi { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - libunwind = callPackage ./libunwind ({} // - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx; - })); + libunwind = callPackage ./libunwind { + inherit llvm_meta; + stdenv = if stdenv.hostPlatform.useLLVM or false + then overrideCC stdenv buildLlvmTools.lldClangNoLibcxx + else stdenv; + }; - openmp = callPackage ./openmp.nix {}; + openmp = callPackage ./openmp { + inherit llvm_meta; + }; }); in { inherit tools libraries; } // libraries // tools diff --git a/pkgs/development/compilers/llvm/9/libcxx/default.nix b/pkgs/development/compilers/llvm/9/libcxx/default.nix index bfcd18a6e43..b2022f23e51 100644 --- a/pkgs/development/compilers/llvm/9/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/9/libcxx/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version +{ lib, stdenv, llvm_meta, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -17,7 +17,9 @@ stdenv.mkDerivation { patches = [ ./gnu-install-dirs.patch - ] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch; + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ + ../../libcxx-0001-musl-hacks.patch + ]; preConfigure = '' # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package @@ -47,10 +49,15 @@ stdenv.mkDerivation { isLLVM = true; }; - meta = { + meta = llvm_meta // { homepage = "https://libcxx.llvm.org/"; - description = "A new implementation of the C++ standard library, targeting C++11"; - license = with lib.licenses; [ ncsa mit ]; - platforms = lib.platforms.all; + description = "C++ standard library"; + longDescription = '' + libc++ is an implementation of the C++ standard library, targeting C++11, + C++14 and above. + ''; + # "All of the code in libc++ is dual licensed under the MIT license and the + # UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; }; } diff --git a/pkgs/development/compilers/llvm/9/libcxxabi/default.nix b/pkgs/development/compilers/llvm/9/libcxxabi/default.nix index 1f0d7af25e4..2af3322fd68 100644 --- a/pkgs/development/compilers/llvm/9/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/9/libcxxabi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version +{ lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -63,11 +63,15 @@ stdenv.mkDerivation { ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 ''; - meta = { + meta = llvm_meta // { homepage = "https://libcxxabi.llvm.org/"; - description = "A new implementation of low level support for a standard C++ library"; - license = with lib.licenses; [ ncsa mit ]; - maintainers = with lib.maintainers; [ vlstill ]; - platforms = lib.platforms.all; + description = "Provides C++ standard library support"; + longDescription = '' + libc++abi is a new implementation of low level support for a standard C++ library. + ''; + # "All of the code in libc++abi is dual licensed under the MIT license and + # the UIUC License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ]; }; } diff --git a/pkgs/development/compilers/llvm/9/libunwind/default.nix b/pkgs/development/compilers/llvm/9/libunwind/default.nix index fdb362dcd2e..65b89c6bb18 100644 --- a/pkgs/development/compilers/llvm/9/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/9/libunwind/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, version, fetch, cmake, fetchpatch +{ lib, stdenv, llvm_meta, version, fetch, cmake, fetchpatch , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -17,4 +17,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"; + + meta = llvm_meta // { + # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst + homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library"; + description = "LLVM's unwinder library"; + longDescription = '' + The unwind library provides a family of _Unwind_* functions implementing + the language-neutral stack unwinding portion of the Itanium C++ ABI (Level + I). It is a dependency of the C++ ABI library, and sometimes is a + dependency of other runtimes. + ''; + }; } diff --git a/pkgs/development/compilers/llvm/9/lld/default.nix b/pkgs/development/compilers/llvm/9/lld/default.nix index cd84afe70e4..d13e6a107dd 100644 --- a/pkgs/development/compilers/llvm/9/lld/default.nix +++ b/pkgs/development/compilers/llvm/9/lld/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , buildLlvmTools , fetch , cmake @@ -28,10 +28,16 @@ stdenv.mkDerivation rec { outputs = [ "out" "lib" "dev" ]; - meta = { - description = "The LLVM Linker"; - homepage = "https://lld.llvm.org/"; - license = lib.licenses.ncsa; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://lld.llvm.org/"; + description = "The LLVM linker"; + longDescription = '' + LLD is a linker from the LLVM project that is a drop-in replacement for + system linkers and runs much faster than them. It also provides features + that are useful for toolchain developers. + The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS), and + WebAssembly in descending order of completeness. Internally, LLD consists + of several different linkers. + ''; }; } diff --git a/pkgs/development/compilers/llvm/9/lldb/default.nix b/pkgs/development/compilers/llvm/9/lldb/default.nix index 6d753ce1a86..9957a0218da 100644 --- a/pkgs/development/compilers/llvm/9/lldb/default.nix +++ b/pkgs/development/compilers/llvm/9/lldb/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , fetch , cmake , zlib @@ -70,10 +70,14 @@ stdenv.mkDerivation rec { ln -s $out/bin/llvm-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin ''; - meta = with lib; { + meta = llvm_meta // { + homepage = "https://lldb.llvm.org/"; description = "A next-generation high-performance debugger"; - homepage = "https://llvm.org/"; - license = licenses.ncsa; - platforms = platforms.all; + longDescription = '' + LLDB is a next generation, high-performance debugger. It is built as a set + of reusable components which highly leverage existing libraries in the + larger LLVM Project, such as the Clang expression parser and LLVM + disassembler. + ''; }; } diff --git a/pkgs/development/compilers/llvm/9/llvm/default.nix b/pkgs/development/compilers/llvm/9/llvm/default.nix index 78d8d7b30ef..6b37460b8ab 100644 --- a/pkgs/development/compilers/llvm/9/llvm/default.nix +++ b/pkgs/development/compilers/llvm/9/llvm/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv +{ lib, stdenv, llvm_meta , pkgsBuildBuild , fetch , cmake @@ -179,12 +179,23 @@ in stdenv.mkDerivation (rec { checkTarget = "check-all"; requiredSystemFeatures = [ "big-parallel" ]; - meta = { - description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "https://llvm.org/"; - license = lib.licenses.ncsa; - maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ]; - platforms = lib.platforms.all; + meta = llvm_meta // { + homepage = "https://llvm.org/"; + description = "A collection of modular and reusable compiler and toolchain technologies"; + longDescription = '' + The LLVM Project is a collection of modular and reusable compiler and + toolchain technologies. Despite its name, LLVM has little to do with + traditional virtual machines. The name "LLVM" itself is not an acronym; it + is the full name of the project. + LLVM began as a research project at the University of Illinois, with the + goal of providing a modern, SSA-based compilation strategy capable of + supporting both static and dynamic compilation of arbitrary programming + languages. Since then, LLVM has grown to be an umbrella project consisting + of a number of subprojects, many of which are being used in production by + a wide variety of commercial and open source projects as well as being + widely used in academic research. Code in the LLVM project is licensed + under the "Apache 2.0 License with LLVM exceptions". + ''; }; } // lib.optionalAttrs enableManpages { pname = "llvm-manpages"; @@ -206,5 +217,7 @@ in stdenv.mkDerivation (rec { doCheck = false; - meta.description = "man pages for LLVM ${version}"; + meta = llvm_meta // { + description = "man pages for LLVM ${version}"; + }; }) diff --git a/pkgs/development/compilers/llvm/9/openmp.nix b/pkgs/development/compilers/llvm/9/openmp.nix deleted file mode 100644 index 416916f57ff..00000000000 --- a/pkgs/development/compilers/llvm/9/openmp.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib -, stdenv -, fetch -, cmake -, llvm -, perl -, version -}: - -stdenv.mkDerivation rec { - pname = "openmp"; - inherit version; - - src = fetch pname "1knafnpp0f7hylx8q20lkd6g1sf0flly572dayc5d5kghh7hd52w"; - - nativeBuildInputs = [ cmake perl ]; - buildInputs = [ llvm ]; - - meta = { - description = "Components required to build an executable OpenMP program"; - homepage = "https://openmp.llvm.org/"; - license = lib.licenses.mit; - platforms = lib.platforms.all; - }; -} diff --git a/pkgs/development/compilers/llvm/9/openmp/default.nix b/pkgs/development/compilers/llvm/9/openmp/default.nix new file mode 100644 index 00000000000..bedd191d513 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/openmp/default.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, llvm_meta +, fetch +, cmake +, llvm +, perl +, version +}: + +stdenv.mkDerivation rec { + pname = "openmp"; + inherit version; + + src = fetch pname "1knafnpp0f7hylx8q20lkd6g1sf0flly572dayc5d5kghh7hd52w"; + + nativeBuildInputs = [ cmake perl ]; + buildInputs = [ llvm ]; + + meta = llvm_meta // { + homepage = "https://openmp.llvm.org/"; + description = "Support for the OpenMP language"; + longDescription = '' + The OpenMP subproject of LLVM contains the components required to build an + executable OpenMP program that are outside the compiler itself. + Contains the code for the runtime library against which code compiled by + "clang -fopenmp" must be linked before it can run and the library that + supports offload to target devices. + ''; + # "All of the code is dual licensed under the MIT license and the UIUC + # License (a BSD-like license)": + license = with lib.licenses; [ mit ncsa ]; + }; +}