diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 4efed40631983..33df804d5efec 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -321,6 +321,11 @@ stdenv.mkDerivation { && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs != null) '' echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags + + # Pull in 'cc.out' target to get 'libstdc++fs.a'. It should be in + # 'cc.lib'. But it's a gcc package bug. + # TODO(trofi): remove once gcc is fixed to move libraries to .lib output. + echo "-L${gccForLibs}/${optionalString (targetPlatform != hostPlatform) "/${targetPlatform.config}"}/lib" >> $out/nix-support/cc-ldflags '' ##