diff --git a/pkgs/baseenv/ld-wrapper.sh b/pkgs/baseenv/ld-wrapper.sh new file mode 100644 index 000000000000..e6a2fe74c5e8 --- /dev/null +++ b/pkgs/baseenv/ld-wrapper.sh @@ -0,0 +1,17 @@ +#! /bin/sh + +IFS=" " +extra=($NIX_CFLAGS_LINK $NIX_LDFLAGS) +if test "$NIX_STRIP_DEBUG" == "1"; then + extra=(${extra[@]} -s) +fi + +if test "$NIX_DEBUG" == "1"; then + echo "extra flags to @LD@:" >&2 + for i in ${extra[@]}; do + echo " $i" >&2 + done +fi + +IFS= +exec $NIX_LD $@ ${extra[@]}