diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 300efce9c830..c6b0aece4530 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -132,10 +132,10 @@ rec { # extraBuildInputs are dropped in cross.nix, but darwin still needs them extraBuildInputs = [ pkgs.buildPackages.darwin.CF ]; mkDerivationFromStdenv = withOldMkDerivation old (stdenv: mkDerivationSuper: args: - (mkDerivationSuper args).overrideAttrs (finalAttrs: { - NIX_CFLAGS_LINK = toString (finalAttrs.NIX_CFLAGS_LINK or "") + (mkDerivationSuper args).overrideAttrs (prevAttrs: { + NIX_CFLAGS_LINK = toString (prevAttrs.NIX_CFLAGS_LINK or "") + lib.optionalString (stdenv.cc.isGNU or false) " -static-libgcc"; - nativeBuildInputs = (finalAttrs.nativeBuildInputs or []) + nativeBuildInputs = (prevAttrs.nativeBuildInputs or []) ++ lib.optionals stdenv.hasCC [ (pkgs.buildPackages.makeSetupHook { name = "darwin-portable-libSystem-hook";