2017-08-28 18:56:08 +00:00
|
|
|
# See cc-wrapper for comments.
|
|
|
|
var_templates_list=(
|
2020-04-28 04:08:48 +00:00
|
|
|
NIX_IGNORE_LD_THROUGH_GCC
|
|
|
|
NIX_LDFLAGS
|
|
|
|
NIX_LDFLAGS_BEFORE
|
2020-12-25 20:52:42 +00:00
|
|
|
NIX_DYNAMIC_LINKER
|
2020-04-28 04:08:48 +00:00
|
|
|
NIX_LDFLAGS_AFTER
|
|
|
|
NIX_LDFLAGS_HARDEN
|
|
|
|
NIX_HARDENING_ENABLE
|
2017-08-28 18:56:08 +00:00
|
|
|
)
|
|
|
|
var_templates_bool=(
|
2020-04-28 04:08:48 +00:00
|
|
|
NIX_SET_BUILD_ID
|
|
|
|
NIX_DONT_SET_RPATH
|
2017-08-28 18:56:08 +00:00
|
|
|
)
|
|
|
|
|
2018-05-07 17:15:34 +00:00
|
|
|
accumulateRoles
|
2017-08-28 18:56:08 +00:00
|
|
|
|
|
|
|
for var in "${var_templates_list[@]}"; do
|
2020-04-28 04:08:48 +00:00
|
|
|
mangleVarList "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
|
2017-08-28 18:56:08 +00:00
|
|
|
done
|
|
|
|
for var in "${var_templates_bool[@]}"; do
|
2020-04-28 04:08:48 +00:00
|
|
|
mangleVarBool "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
|
2017-08-28 18:56:08 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ -e @out@/nix-support/libc-ldflags ]; then
|
2020-04-28 04:08:48 +00:00
|
|
|
NIX_LDFLAGS_@suffixSalt@+=" $(< @out@/nix-support/libc-ldflags)"
|
2017-08-28 18:56:08 +00:00
|
|
|
fi
|
|
|
|
|
2020-12-25 20:52:42 +00:00
|
|
|
if [ -z "$NIX_DYNAMIC_LINKER_@suffixSalt@" ] && [ -e @out@/nix-support/ld-set-dynamic-linker ]; then
|
|
|
|
NIX_DYNAMIC_LINKER_@suffixSalt@="$(< @out@/nix-support/dynamic-linker)"
|
|
|
|
fi
|
|
|
|
|
2017-08-28 18:56:08 +00:00
|
|
|
if [ -e @out@/nix-support/libc-ldflags-before ]; then
|
2020-04-28 04:08:48 +00:00
|
|
|
NIX_LDFLAGS_BEFORE_@suffixSalt@="$(< @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE_@suffixSalt@"
|
2017-08-28 18:56:08 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-28 04:08:48 +00:00
|
|
|
export NIX_BINTOOLS_WRAPPER_FLAGS_SET_@suffixSalt@=1
|