clang, cc-wrapper: Move --gcc-toolchain logic into CC wrapper

Take 2, after #94582 had to be reverted.

This reverts commit ac03cfa3c5.
This commit is contained in:
John Ericson
2021-01-24 15:49:32 -05:00
parent a7a61998e9
commit 0710308402
11 changed files with 21 additions and 23 deletions
+10 -6
View File
@@ -13,7 +13,12 @@ let
chmod u+rw -R $out/lib
cp -r ${basegcc.libc}/lib/* $(ls -d $out/lib/gcc/*/*)
'';
gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {} ''
gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {
passthru = {
inherit (gcc64) version;
lib = gcc_multi_sysroot;
};
} ''
mkdir -p $out/lib/gcc
ln -s ${combine gcc64}/lib/gcc/* $out/lib/gcc/
@@ -32,17 +37,16 @@ let
'';
clangMulti = clang.override {
# Only used for providing expected structure re:dynamic linkers, AFAIK
# Most of the magic is done by setting the --gcc-toolchain option below
# Only used for providing expected structure re:dynamic linkers, AFAIK Most
# of the magic is done by setting the --gcc-toolchain option via
# `gccForLibs`.
libc = gcc_multi_sysroot;
bintools = clang.bintools.override {
libc = gcc_multi_sysroot;
};
extraBuildCommands = ''
sed -e '$a --gcc-toolchain=${gcc_multi_sysroot}' -i $out/nix-support/libc-cflags
'';
gccForLibs = gcc_multi_sysroot;
};
in clangMulti