diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-06-30 13:44:37 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-06-30 13:44:37 +0000 |
commit | 16f676d6bbd4f930b0017ccb20cebe5a29e17545 (patch) | |
tree | 0d554b4f16bdef502035b743457fc29ffcc5e7f7 /nixpkgs/pkgs/build-support/cc-wrapper/cc-wrapper.sh | |
parent | e7caacc4c122b7641bb66a4c2595289347a4996c (diff) | |
parent | 3a8d7958a610cd3fec3a6f424480f91a1b259185 (diff) | |
download | nixlib-16f676d6bbd4f930b0017ccb20cebe5a29e17545.tar nixlib-16f676d6bbd4f930b0017ccb20cebe5a29e17545.tar.gz nixlib-16f676d6bbd4f930b0017ccb20cebe5a29e17545.tar.bz2 nixlib-16f676d6bbd4f930b0017ccb20cebe5a29e17545.tar.lz nixlib-16f676d6bbd4f930b0017ccb20cebe5a29e17545.tar.xz nixlib-16f676d6bbd4f930b0017ccb20cebe5a29e17545.tar.zst nixlib-16f676d6bbd4f930b0017ccb20cebe5a29e17545.zip |
Merge commit '3a8d7958a610cd3fec3a6f424480f91a1b259185'
Diffstat (limited to 'nixpkgs/pkgs/build-support/cc-wrapper/cc-wrapper.sh')
-rw-r--r-- | nixpkgs/pkgs/build-support/cc-wrapper/cc-wrapper.sh | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/nixpkgs/pkgs/build-support/cc-wrapper/cc-wrapper.sh index 2e62aef46048..aa25de336418 100644 --- a/nixpkgs/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/nixpkgs/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -29,9 +29,10 @@ cc1=0 cxxInclude=1 cxxLibrary=1 cInclude=1 -setDynamicLinker=1 expandResponseParams "$@" +linkType=$(checkLinkType "$@") + declare -i n=0 nParams=${#params[@]} while (( "$n" < "$nParams" )); do @@ -60,8 +61,6 @@ while (( "$n" < "$nParams" )); do cxxInclude=0 elif [ "$p" = -nostdinc++ ]; then cxxInclude=0 - elif [[ "$p" = -static || "$p" = -static-pie ]]; then - setDynamicLinker=0 elif [[ "$p" != -?* ]]; then # A dash alone signifies standard input; it is not a flag nonFlagArgs=1 @@ -151,24 +150,24 @@ if [ "$dontLink" != 1 ]; then # Add the flags that should only be passed to the compiler when # linking. - extraAfter+=($NIX_CFLAGS_LINK_@suffixSalt@) + extraAfter+=($(filterRpathFlags "$linkType" $NIX_CFLAGS_LINK_@suffixSalt@)) # Add the flags that should be passed to the linker (and prevent # `ld-wrapper' from adding NIX_LDFLAGS_@suffixSalt@ again). - for i in $NIX_LDFLAGS_BEFORE_@suffixSalt@; do + for i in $(filterRpathFlags "$linkType" $NIX_LDFLAGS_BEFORE_@suffixSalt@); do extraBefore+=("-Wl,$i") done - if [[ "$setDynamicLinker" = 1 && -n "$NIX_DYNAMIC_LINKER_@suffixSalt@" ]]; then + if [[ "$linkType" == dynamic && -n "$NIX_DYNAMIC_LINKER_@suffixSalt@" ]]; then extraBefore+=("-Wl,-dynamic-linker=$NIX_DYNAMIC_LINKER_@suffixSalt@") fi - for i in $NIX_LDFLAGS_@suffixSalt@; do + for i in $(filterRpathFlags "$linkType" $NIX_LDFLAGS_@suffixSalt@); do if [ "${i:0:3}" = -L/ ]; then extraAfter+=("$i") else extraAfter+=("-Wl,$i") fi done - export NIX_LDFLAGS_SET_@suffixSalt@=1 + export NIX_LINK_TYPE_@suffixSalt@=$linkType fi # As a very special hack, if the arguments are just `-v', then don't |