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).

+15 -6
+3 -3
pkgs/build-support/cc-wrapper/default.nix
··· 364 '' 365 # this ensures that when clang passes -lgcc_s to lld (as it does 366 # when building e.g. firefox), lld is able to find libgcc_s.so 367 - + lib.optionalString (gccForLibs?libgcc) '' 368 - echo "-L${gccForLibs.libgcc}/lib" >> $out/nix-support/cc-ldflags 369 - '') 370 371 ## 372 ## General libc support
··· 364 '' 365 # this ensures that when clang passes -lgcc_s to lld (as it does 366 # when building e.g. firefox), lld is able to find libgcc_s.so 367 + + concatMapStrings (libgcc: '' 368 + echo "-L${libgcc}/lib" >> $out/nix-support/cc-ldflags 369 + '') (lib.toList (gccForLibs.libgcc or []))) 370 371 ## 372 ## General libc support
+1 -1
pkgs/development/compilers/llvm/multi.nix
··· 46 libc = gcc_multi_sysroot; 47 }; 48 49 - gccForLibs = gcc_multi_sysroot; 50 }; 51 52 in clangMulti
··· 46 libc = gcc_multi_sysroot; 47 }; 48 49 + gccForLibs = gcc_multi_sysroot // { inherit (glibc_multi) libgcc; }; 50 }; 51 52 in clangMulti
+11 -2
pkgs/development/libraries/glibc/multi.nix
··· 1 - { runCommand, glibc, glibc32 2 }: 3 4 let ··· 7 in 8 runCommand "${nameVersion.name}-multi-${nameVersion.version}" 9 # out as the first output is an exception exclusive to glibc 10 - { outputs = [ "out" "bin" "dev" ]; } # TODO: no static version here (yet) 11 '' 12 mkdir -p "$out/lib" 13 ln -s '${glibc64.out}'/lib/* "$out/lib"
··· 1 + { lib 2 + , runCommand, glibc, glibc32 3 }: 4 5 let ··· 8 in 9 runCommand "${nameVersion.name}-multi-${nameVersion.version}" 10 # out as the first output is an exception exclusive to glibc 11 + { 12 + outputs = [ "out" "bin" "dev" ]; # TODO: no static version here (yet) 13 + passthru = { 14 + libgcc = lib.lists.filter (x: x!=null) [ 15 + (glibc64.libgcc or null) 16 + (glibc32.libgcc or null) 17 + ]; 18 + }; 19 + } 20 '' 21 mkdir -p "$out/lib" 22 ln -s '${glibc64.out}'/lib/* "$out/lib"