mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 17:33:09 +00:00
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:
parent
b0c75e811a
commit
b0b0a06788
@ -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
|
||||
|
@ -36,9 +36,7 @@ in rec {
|
||||
export NIX_IGNORE_LD_THROUGH_GCC=1
|
||||
export SDKROOT=
|
||||
|
||||
# Ensure consistent LC_VERSION_MIN_MACOSX and remove LC_UUID.
|
||||
export MACOSX_DEPLOYMENT_TARGET=${macosVersionMin}
|
||||
export NIX_LDFLAGS+=" -macosx_version_min ${macosVersionMin} -sdk_version ${appleSdkVersion} -no_uuid"
|
||||
|
||||
# Workaround for https://openradar.appspot.com/22671534 on 10.11.
|
||||
export gl_cv_func_getcwd_abort_bug=no
|
||||
|
Loading…
Reference in New Issue
Block a user