diff options
Diffstat (limited to 'pkgs/build-support/bintools-wrapper/ld-wrapper.sh')
-rw-r--r-- | pkgs/build-support/bintools-wrapper/ld-wrapper.sh | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh index abecf6a8e5d1e..81b5a90edd5c2 100644 --- a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh @@ -20,7 +20,6 @@ if [ -z "${NIX_BINTOOLS_WRAPPER_FLAGS_SET_@suffixSalt@:-}" ]; then source @out@/nix-support/add-flags.sh fi -setDynamicLinker=1 # Optionally filter out paths not refering to the store. expandResponseParams "$@" @@ -48,11 +47,6 @@ if [[ "${NIX_ENFORCE_PURITY:-}" = 1 && -n "${NIX_STORE:-}" # Our ld is not built with sysroot support (Can we fix that?) : else - if [[ "$p" = -static || "$p" = -static-pie ]]; then - # Using a dynamic linker for static binaries can lead to crashes. - # This was observed for rust binaries. - setDynamicLinker=0 - fi rest+=("$p") fi n+=1 @@ -69,11 +63,6 @@ extraBefore=(${hardeningLDFlags[@]+"${hardeningLDFlags[@]}"}) if [ -z "${NIX_LDFLAGS_SET_@suffixSalt@:-}" ]; then extraAfter+=($NIX_LDFLAGS_@suffixSalt@) extraBefore+=($NIX_LDFLAGS_BEFORE_@suffixSalt@) - # By adding dynamic linker to extraBefore we allow the users set their - # own dynamic linker as NIX_LD_FLAGS will override earlier set flags - if [ "$setDynamicLinker" = 1 ]; then - extraBefore+=("-dynamic-linker" "$NIX_DYNAMIC_LINKER_@suffixSalt@") - fi fi extraAfter+=($NIX_LDFLAGS_AFTER_@suffixSalt@) @@ -145,7 +134,7 @@ then done fi -if [[ "$link32" = "0" && "$setDynamicLinker" = 1 && -e "@out@/nix-support/dynamic-linker-m32" ]]; then +if [ -e "@out@/nix-support/dynamic-linker-m32" ] && (( "$link32" )); then # We have an alternate 32-bit linker and we're producing a 32-bit ELF, let's # use it. extraAfter+=( |