llvmPackages: Multuple outputs for everythting

Also begin to start work on cross compilation, though that will have to
be finished later.

The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.

Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.

----

Other misc notes, highly incomplete

- lvm-config-native and llvm-config are put in `dev` because they are
  tools just for build time.

- Clang no longer has an lld dep. That was introduced in
  db29857eb3, but if clang needs help
  finding lld when it is used we should just pass it flags / put in the
  resource dir. Providing it at build time increases critical path
  length for no good reason.

----

A note on `nativeCC`:

`stdenv` takes tools from the previous stage, so:

1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`

while:

1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
This commit is contained in:
Andrew Childs
2021-04-30 05:41:00 +00:00
committed by John Ericson
parent 17a8c9c4bf
commit 7869d16545
210 changed files with 10414 additions and 660 deletions
+8 -6
View File
@@ -73,7 +73,7 @@ in rec {
mkExtraBuildCommands = cc: ''
rsrc="$out/resource-root"
mkdir "$rsrc"
ln -s "${cc}/lib/clang/${cc.version}/include" "$rsrc"
ln -s "${cc.lib or cc}/lib/clang/${cc.version}/include" "$rsrc"
ln -s "${last.pkgs.llvmPackages_7.compiler-rt.out}/lib" "$rsrc/lib"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'';
@@ -407,7 +407,7 @@ in rec {
allowedRequisites =
[ bootstrapTools ] ++
(with pkgs; [
xz.bin xz.out bash libcxx libcxxabi llvmPackages_7.compiler-rt
xz.bin xz.out bash libcxx libcxx.dev libcxxabi libcxxabi.dev llvmPackages_7.compiler-rt
llvmPackages_7.clang-unwrapped zlib libxml2.out curl.out brotli.lib openssl.out
libssh2.out nghttp2.lib libkrb5 coreutils gnugrep pcre.out gmp libiconv
]) ++
@@ -434,8 +434,8 @@ in rec {
llvmPackages_7 = super.llvmPackages_7 // (let
tools = super.llvmPackages_7.tools.extend (llvmSelf: _: {
clang-unwrapped = llvmPackages_7.clang-unwrapped.override { llvm = llvmSelf.llvm; };
llvm = llvmPackages_7.llvm.override { inherit libxml2; };
clang-unwrapped-all-outputs = llvmPackages_7.clang-unwrapped-all-outputs.override { llvm = llvmSelf.llvm; };
libllvm = llvmPackages_7.libllvm.override { inherit libxml2; };
});
libraries = super.llvmPackages_7.libraries.extend (llvmSelf: _: {
inherit (llvmPackages_7) libcxx libcxxabi compiler-rt;
@@ -524,11 +524,13 @@ in rec {
};
allowedRequisites = (with pkgs; [
xz.out xz.bin libcxx libcxxabi gmp.out gnumake findutils bzip2.out
xz.out xz.bin libcxx libcxx.dev libcxxabi libcxxabi.dev gmp.out gnumake findutils bzip2.out
bzip2.bin llvmPackages.llvm llvmPackages.llvm.lib llvmPackages.compiler-rt llvmPackages.compiler-rt.dev
zlib.out zlib.dev libffi.out coreutils ed diffutils gnutar
gzip ncurses.out ncurses.dev ncurses.man gnused bash gawk
gnugrep llvmPackages.clang-unwrapped llvmPackages.clang-unwrapped.lib patch pcre.out gettext
gnugrep llvmPackages.clang-unwrapped
llvmPackages.libclang.dev llvmPackages.libclang.lib
patch pcre.out gettext
binutils.bintools darwin.binutils darwin.binutils.bintools
curl.out brotli.lib openssl.out libssh2.out nghttp2.lib libkrb5
cc.expand-response-params libxml2.out
+2 -2
View File
@@ -77,7 +77,7 @@ in rec {
# Copy what we need of clang
cp -d ${llvmPackages.clang-unwrapped}/bin/clang* $out/bin
cp -rL ${llvmPackages.clang-unwrapped}/lib/clang $out/lib
cp -rL ${llvmPackages.clang-unwrapped.lib}/lib/clang $out/lib
cp -d ${llvmPackages.libcxx}/lib/libc++*.dylib $out/lib
cp -d ${llvmPackages.libcxxabi}/lib/libc++abi*.dylib $out/lib
@@ -85,7 +85,7 @@ in rec {
cp -d ${libffi}/lib/libffi*.dylib $out/lib
mkdir $out/include
cp -rd ${llvmPackages.libcxx}/include/c++ $out/include
cp -rd ${llvmPackages.libcxx.dev}/include/c++ $out/include
cp -d ${darwin.ICU}/lib/libicu*.dylib $out/lib
cp -d ${zlib.out}/lib/libz.* $out/lib