cc-wrapper: use legacy -mmacosx-version-min for gcc

See https://github.com/NixOS/nixpkgs/pull/105026#discussion_r587169144
launchpad/nixpkgs/master
Andrew Childs 3 years ago
parent 362cb82b75
commit 8b59d52ca3
  1. 13
      pkgs/build-support/cc-wrapper/default.nix

@ -485,10 +485,15 @@ stdenv.mkDerivation {
substituteAll ${../wrapper-common/utils.bash} $out/nix-support/utils.bash
''
+ optionalString stdenv.targetPlatform.isDarwin ''
echo "-arch ${targetPlatform.darwinArch}" >> $out/nix-support/cc-cflags
echo "-m${targetPlatform.darwinPlatform}-version-min=${targetPlatform.darwinMinVersion}" >> $out/nix-support/cc-cflags-before
''
+ optionalString stdenv.targetPlatform.isDarwin (
let darwinPlatformForCC =
if (targetPlatform.darwinPlatform == "macos" && isGNU) then "macosx"
else targetPlatform.darwinPlatform;
in ''
echo "-arch ${targetPlatform.darwinArch}" >> $out/nix-support/cc-cflags
echo "-m${darwinPlatformForCC}-version-min=${targetPlatform.darwinMinVersion}" >> $out/nix-support/cc-cflags-before
''
)
##
## Extra custom steps

Loading…
Cancel
Save