Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkgs/build-support/cc-wrapper/cc-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ extraBefore=(${hardeningCFlags[@]+"${hardeningCFlags[@]}"} $NIX_CFLAGS_COMPILE_B

if [ "$dontLink" != 1 ]; then

# Disable the -dynamic-linker flag if NIX_DYNAMIC_LINKER is the special darwin
# value. -dynamic-linker is not supported on darwin systems.
if [[ "$NIX_DYNAMIC_LINKER_@suffixSalt@" = "darwin" ]]; then
setDynamicLinker=0
fi

# Add the flags that should only be passed to the compiler when
# linking.
extraAfter+=($NIX_CFLAGS_LINK_@suffixSalt@)
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ let
else "";

useGccForLibs = isClang
&& libcxx == null
&& !(stdenv.targetPlatform.useLLVM or false)
&& !(stdenv.targetPlatform.useAndroidPrebuilt or false)
&& gccForLibs != null;
Expand Down Expand Up @@ -154,6 +153,7 @@ stdenv.mkDerivation {
local dst="$1"
local wrapper="$2"
export prog="$3"
export isdarwin="${toString targetPlatform.isDarwin or false}"
substituteAll "$wrapper" "$out/bin/$dst"
chmod +x "$out/bin/$dst"
}
Expand Down
1 change: 1 addition & 0 deletions pkgs/stdenv/darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ in rec {
export NIX_ENFORCE_NO_NATIVE=''${NIX_ENFORCE_NO_NATIVE-1}
export NIX_ENFORCE_PURITY=''${NIX_ENFORCE_PURITY-1}
export NIX_IGNORE_LD_THROUGH_GCC=1
export NIX_DYNAMIC_LINKER="darwin"
unset SDKROOT

export MACOSX_DEPLOYMENT_TARGET=${macosVersionMin}
Expand Down