about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm/10
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/llvm/10')
-rw-r--r--pkgs/development/compilers/llvm/10/bintools/default.nix (renamed from pkgs/development/compilers/llvm/10/bintools.nix)0
-rw-r--r--pkgs/development/compilers/llvm/10/clang/default.nix25
-rw-r--r--pkgs/development/compilers/llvm/10/compiler-rt/default.nix30
-rw-r--r--pkgs/development/compilers/llvm/10/default.nix148
-rw-r--r--pkgs/development/compilers/llvm/10/libcxx/default.nix (renamed from pkgs/development/compilers/llvm/10/libc++/default.nix)21
-rw-r--r--pkgs/development/compilers/llvm/10/libcxx/gnu-install-dirs.patch (renamed from pkgs/development/compilers/llvm/10/libc++/gnu-install-dirs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/libcxxabi/default.nix (renamed from pkgs/development/compilers/llvm/10/libc++abi/default.nix)18
-rw-r--r--pkgs/development/compilers/llvm/10/libcxxabi/gnu-install-dirs.patch (renamed from pkgs/development/compilers/llvm/10/libc++abi/gnu-install-dirs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/libcxxabi/no-threads.patch (renamed from pkgs/development/compilers/llvm/10/libc++abi/no-threads.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/libcxxabi/wasm.patch (renamed from pkgs/development/compilers/llvm/10/libc++abi/wasm.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/libunwind/default.nix14
-rw-r--r--pkgs/development/compilers/llvm/10/lld/default.nix18
-rw-r--r--pkgs/development/compilers/llvm/10/lldb/default.nix18
-rw-r--r--pkgs/development/compilers/llvm/10/llvm/default.nix37
-rw-r--r--pkgs/development/compilers/llvm/10/openmp.nix25
-rw-r--r--pkgs/development/compilers/llvm/10/openmp/default.nix34
16 files changed, 271 insertions, 117 deletions
diff --git a/pkgs/development/compilers/llvm/10/bintools.nix b/pkgs/development/compilers/llvm/10/bintools/default.nix
index 53f7941e33699..53f7941e33699 100644
--- a/pkgs/development/compilers/llvm/10/bintools.nix
+++ b/pkgs/development/compilers/llvm/10/bintools/default.nix
diff --git a/pkgs/development/compilers/llvm/10/clang/default.nix b/pkgs/development/compilers/llvm/10/clang/default.nix
index d228c4261afe9..e0c52651cadc5 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 1f990ac433d2f..37c7e0599b5f0 100644
--- a/pkgs/development/compilers/llvm/10/compiler-rt/default.nix
+++ b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix
@@ -1,17 +1,18 @@
-{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
+{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, llvm, libcxxabi }:
 
 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
@@ -89,4 +90,19 @@ stdenv.mkDerivation rec {
     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 e2e78e16d7979..11367d453cde5 100644
--- a/pkgs/development/compilers/llvm/10/default.nix
+++ b/pkgs/development/compilers/llvm/10/default.nix
@@ -1,7 +1,19 @@
-{ 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
+# This is the default binutils, but with *this* version of LLD rather
+# than the default LLVM verion's, if LLD is the choice. We use these for
+# the `useLLVM` bootstrapping below.
+, bootBintoolsNoLibc ?
+    if stdenv.targetPlatform.linker == "lld"
+    then null
+    else pkgs.bintoolsNoLibc
+, bootBintools ?
+    if stdenv.targetPlatform.linker == "lld"
+    then null
+    else pkgs.bintools
 }:
 
 let
@@ -16,6 +28,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: ''
@@ -29,16 +47,27 @@ let
       ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
     '';
 
+  bintoolsNoLibc' =
+    if bootBintoolsNoLibc == null
+    then tools.bintoolsNoLibc
+    else bootBintoolsNoLibc;
+  bintools' =
+    if bootBintools == null
+    then tools.bintools
+    else bootBintools;
+
   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; };
@@ -82,9 +111,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
@@ -93,14 +126,21 @@ let
     # doesn’t support like LLVM. Probably we should move to some other
     # file.
 
-    bintools = callPackage ./bintools.nix {};
+    bintools-unwrapped = callPackage ./bintools {};
 
-    lldClang = wrapCCWith rec {
+    bintoolsNoLibc = wrapBintoolsWith {
+      bintools = tools.bintools-unwrapped;
+      libc = preLibcCrossHeaders;
+    };
+
+    bintools = wrapBintoolsWith {
+      bintools = tools.bintools-unwrapped;
+    };
+
+    clangUseLLVM = wrapCCWith rec {
       cc = tools.clang-unwrapped;
       libcxx = targetLlvmLibraries.libcxx;
-      bintools = wrapBintoolsWith {
-        inherit (tools) bintools;
-      };
+      bintools = bintools';
       extraPackages = [
         targetLlvmLibraries.libcxxabi
         targetLlvmLibraries.compiler-rt
@@ -112,17 +152,17 @@ 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.isWasm && stdenv.targetPlatform.useLLVM or false) ''
+        echo "-lunwind" >> $out/nix-support/cc-ldflags
       '' + lib.optionalString stdenv.targetPlatform.isWasm ''
         echo "-fno-exceptions" >> $out/nix-support/cc-cflags
       '' + mkExtraBuildCommands cc;
     };
 
-    lldClangNoLibcxx = wrapCCWith rec {
+    clangNoLibcxx = wrapCCWith rec {
       cc = tools.clang-unwrapped;
       libcxx = null;
-      bintools = wrapBintoolsWith {
-        inherit (tools) bintools;
-      };
+      bintools = bintools';
       extraPackages = [
         targetLlvmLibraries.compiler-rt
       ];
@@ -133,13 +173,10 @@ let
       '' + mkExtraBuildCommands cc;
     };
 
-    lldClangNoLibc = wrapCCWith rec {
+    clangNoLibc = wrapCCWith rec {
       cc = tools.clang-unwrapped;
       libcxx = null;
-      bintools = wrapBintoolsWith {
-        inherit (tools) bintools;
-        libc = null;
-      };
+      bintools = bintoolsNoLibc';
       extraPackages = [
         targetLlvmLibraries.compiler-rt
       ];
@@ -149,52 +186,77 @@ let
       '' + mkExtraBuildCommands cc;
     };
 
-    lldClangNoCompilerRt = wrapCCWith rec {
+    clangNoCompilerRt = wrapCCWith rec {
       cc = tools.clang-unwrapped;
       libcxx = null;
-      bintools = wrapBintoolsWith {
-        inherit (tools) bintools;
-        libc = null;
-      };
+      bintools = bintoolsNoLibc';
       extraPackages = [ ];
       extraBuildCommands = ''
         echo "-nostartfiles" >> $out/nix-support/cc-cflags
       '' + mkExtraBuildCommands0 cc;
     };
 
+    clangNoCompilerRtWithLibc = wrapCCWith rec {
+      cc = tools.clang-unwrapped;
+      libcxx = null;
+      bintools = 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 {
+      inherit llvm_meta;
+      stdenv = if stdenv.hostPlatform.useLLVM or false
+               then overrideCC stdenv buildLlvmTools.clangNoCompilerRtWithLibc
+               else stdenv;
+    };
+
+    compiler-rt-no-libc = callPackage ./compiler-rt {
+      inherit llvm_meta;
+      stdenv = if stdenv.hostPlatform.useLLVM or false
+               then overrideCC stdenv buildLlvmTools.clangNoCompilerRt
+               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;
 
-    libcxx = callPackage ./libc++ ({} //
-      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
-        stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
-      }));
-
-    libcxxabi = callPackage ./libc++abi ({} //
-      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
-        stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
-        libunwind = libraries.libunwind;
-      }));
+    libcxx = callPackage ./libcxx {
+      inherit llvm_meta;
+      stdenv = if stdenv.hostPlatform.useLLVM or false
+               then overrideCC stdenv buildLlvmTools.clangNoLibcxx
+               else stdenv;
+    };
 
-    openmp = callPackage ./openmp.nix {};
+    libcxxabi = callPackage ./libcxxabi {
+      inherit llvm_meta;
+      stdenv = if stdenv.hostPlatform.useLLVM or false
+               then overrideCC stdenv buildLlvmTools.clangNoLibcxx
+               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.clangNoLibcxx
+               else stdenv;
+    };
 
+    openmp = callPackage ./openmp {
+      inherit llvm_meta;
+    };
   });
 
 in { inherit tools libraries; } // libraries // tools
diff --git a/pkgs/development/compilers/llvm/10/libc++/default.nix b/pkgs/development/compilers/llvm/10/libcxx/default.nix
index 1e5dc5b2dacc0..7c01e73171164 100644
--- a/pkgs/development/compilers/llvm/10/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/10/libcxx/default.nix
@@ -1,9 +1,9 @@
-{ lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version
+{ lib, stdenv, llvm_meta, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
 stdenv.mkDerivation {
-  pname = "libc++";
+  pname = "libcxx";
   inherit version;
 
   src = fetch "libcxx" "0v78bfr6h2zifvdqnj2wlfk4pvxzrqn3hg1v6lqk3y12bx9p9xny";
@@ -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/libc++/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/libcxx/gnu-install-dirs.patch
index 4b031e90bdd55..4b031e90bdd55 100644
--- a/pkgs/development/compilers/llvm/10/libc++/gnu-install-dirs.patch
+++ b/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
index bc5e77b739d7e..b427949a84267 100644
--- a/pkgs/development/compilers/llvm/10/libc++abi/default.nix
+++ b/pkgs/development/compilers/llvm/10/libcxxabi/default.nix
@@ -1,9 +1,9 @@
-{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version
+{ lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
 stdenv.mkDerivation {
-  pname = "libc++abi";
+  pname = "libcxxabi";
   inherit version;
 
   src = fetch "libcxxabi" "0yqs722y76cwvmfsq0lb917r9m3fci7bf5z3yzl71yz9n88ghzm9";
@@ -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/libc++abi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/libcxxabi/gnu-install-dirs.patch
index 0f80ade7c389d..0f80ade7c389d 100644
--- a/pkgs/development/compilers/llvm/10/libc++abi/gnu-install-dirs.patch
+++ b/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
index 787f3e16500e2..787f3e16500e2 100644
--- a/pkgs/development/compilers/llvm/10/libc++abi/no-threads.patch
+++ b/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
index 4ebfe46aa813d..4ebfe46aa813d 100644
--- a/pkgs/development/compilers/llvm/10/libc++abi/wasm.patch
+++ b/pkgs/development/compilers/llvm/10/libcxxabi/wasm.patch
diff --git a/pkgs/development/compilers/llvm/10/libunwind/default.nix b/pkgs/development/compilers/llvm/10/libunwind/default.nix
index d010deb661861..8124cf0821e03 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 03a48f02a0c1e..5d590aec35acb 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 ccca340b3e235..04b9e06e77a3d 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 22ed308486db0..93cdc7307daa6 100644
--- a/pkgs/development/compilers/llvm/10/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/10/llvm/default.nix
@@ -1,6 +1,7 @@
-{ lib, stdenv
+{ lib, stdenv, llvm_meta
 , pkgsBuildBuild
 , fetch
+, fetchpatch
 , cmake
 , python3
 , libffi
@@ -57,6 +58,13 @@ in stdenv.mkDerivation (rec {
 
   patches = [
     ./gnu-install-dirs.patch
+    # On older CPUs (e.g. Hydra/wendy) we'd be getting an error in this test.
+    (fetchpatch {
+      name = "uops-CMOV16rm-noreg.diff";
+      url = "https://github.com/llvm/llvm-project/commit/9e9f991ac033.diff";
+      sha256 = "sha256:12s8vr6ibri8b48h2z38f3afhwam10arfiqfy4yg37bmc054p5hi";
+      stripLen = 1;
+    })
   ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch;
 
   postPatch = optionalString stdenv.isDarwin ''
@@ -172,12 +180,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 +218,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 2946c51fafe21..0000000000000
--- 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 0000000000000..a1b04c7c66b25
--- /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 ];
+  };
+}