cc-wrapper: when merging gcc32 and gcc64, merge libgcc as well
Our gcc_multi and glibc_multi expressions merge together a 32-bit-targeted and 64-bit-targeted gcc. However they do not thread through the passthru.libgcc from these merged gccs. This commit corrects that. It also extends passthru.libgcc to allow a *list* rather than just a single outpath. Resolves part of #221891 (at least getting it back to the error message it gave before).
This commit is contained in:
parent
849e9aa221
commit
0e9ef0a07d
@ -364,9 +364,9 @@ stdenv.mkDerivation {
|
|||||||
''
|
''
|
||||||
# this ensures that when clang passes -lgcc_s to lld (as it does
|
# this ensures that when clang passes -lgcc_s to lld (as it does
|
||||||
# when building e.g. firefox), lld is able to find libgcc_s.so
|
# when building e.g. firefox), lld is able to find libgcc_s.so
|
||||||
+ lib.optionalString (gccForLibs?libgcc) ''
|
+ concatMapStrings (libgcc: ''
|
||||||
echo "-L${gccForLibs.libgcc}/lib" >> $out/nix-support/cc-ldflags
|
echo "-L${libgcc}/lib" >> $out/nix-support/cc-ldflags
|
||||||
'')
|
'') (lib.toList (gccForLibs.libgcc or [])))
|
||||||
|
|
||||||
##
|
##
|
||||||
## General libc support
|
## General libc support
|
||||||
|
@ -46,7 +46,7 @@ let
|
|||||||
libc = gcc_multi_sysroot;
|
libc = gcc_multi_sysroot;
|
||||||
};
|
};
|
||||||
|
|
||||||
gccForLibs = gcc_multi_sysroot;
|
gccForLibs = gcc_multi_sysroot // { inherit (glibc_multi) libgcc; };
|
||||||
};
|
};
|
||||||
|
|
||||||
in clangMulti
|
in clangMulti
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{ runCommand, glibc, glibc32
|
{ lib
|
||||||
|
, runCommand, glibc, glibc32
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -7,7 +8,15 @@ let
|
|||||||
in
|
in
|
||||||
runCommand "${nameVersion.name}-multi-${nameVersion.version}"
|
runCommand "${nameVersion.name}-multi-${nameVersion.version}"
|
||||||
# out as the first output is an exception exclusive to glibc
|
# out as the first output is an exception exclusive to glibc
|
||||||
{ outputs = [ "out" "bin" "dev" ]; } # TODO: no static version here (yet)
|
{
|
||||||
|
outputs = [ "out" "bin" "dev" ]; # TODO: no static version here (yet)
|
||||||
|
passthru = {
|
||||||
|
libgcc = lib.lists.filter (x: x!=null) [
|
||||||
|
(glibc64.libgcc or null)
|
||||||
|
(glibc32.libgcc or null)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
''
|
''
|
||||||
mkdir -p "$out/lib"
|
mkdir -p "$out/lib"
|
||||||
ln -s '${glibc64.out}'/lib/* "$out/lib"
|
ln -s '${glibc64.out}'/lib/* "$out/lib"
|
||||||
|
Loading…
Reference in New Issue
Block a user