bintools: only add macos flags when targeting macOS

We can’t set this for cross-compiling since we use the GNU linker.
Instead, set these flags only when targetPlatform is macOS.

Fixes #80754

Fixes #83141
This commit is contained in:
Matthew Bauer
2020-03-23 00:32:45 -04:00
parent b0c75e811a
commit b0b0a06788
2 changed files with 5 additions and 2 deletions
@@ -248,6 +248,11 @@ stdenv.mkDerivation {
printWords "''${ldflagsBefore[@]}" > $out/nix-support/libc-ldflags-before
'')
+ optionalString stdenv.targetPlatform.isMacOS ''
# Ensure consistent LC_VERSION_MIN_MACOSX and remove LC_UUID.
echo "-macosx_version_min 10.12 -sdk_version 10.12 -no_uuid" >> $out/nix-support/libc-ldflags-before
''
+ optionalString (!nativeTools) ''
##
## User env support