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

See https://github.com/NixOS/nixpkgs/pull/105026#discussion_r587169144
This commit is contained in:
Andrew Childs 2021-03-05 17:34:46 +09:00
parent 362cb82b75
commit 8b59d52ca3

View File

@ -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