diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index bc9c199f778..77ecaf098ea 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -364,9 +364,9 @@ stdenv.mkDerivation { '' # 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 - + lib.optionalString (gccForLibs?libgcc) '' - echo "-L${gccForLibs.libgcc}/lib" >> $out/nix-support/cc-ldflags - '') + + concatMapStrings (libgcc: '' + echo "-L${libgcc}/lib" >> $out/nix-support/cc-ldflags + '') (lib.toList (gccForLibs.libgcc or []))) ## ## General libc support diff --git a/pkgs/development/compilers/llvm/multi.nix b/pkgs/development/compilers/llvm/multi.nix index ecea5d44037..7906f2b2bd6 100644 --- a/pkgs/development/compilers/llvm/multi.nix +++ b/pkgs/development/compilers/llvm/multi.nix @@ -46,7 +46,7 @@ let libc = gcc_multi_sysroot; }; - gccForLibs = gcc_multi_sysroot; + gccForLibs = gcc_multi_sysroot // { inherit (glibc_multi) libgcc; }; }; in clangMulti diff --git a/pkgs/development/libraries/glibc/multi.nix b/pkgs/development/libraries/glibc/multi.nix index be190d77c73..5cd48958ec2 100644 --- a/pkgs/development/libraries/glibc/multi.nix +++ b/pkgs/development/libraries/glibc/multi.nix @@ -1,4 +1,5 @@ -{ runCommand, glibc, glibc32 +{ lib +, runCommand, glibc, glibc32 }: let @@ -7,7 +8,15 @@ let in runCommand "${nameVersion.name}-multi-${nameVersion.version}" # 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" ln -s '${glibc64.out}'/lib/* "$out/lib"