2020-04-24 23:36:52 +00:00
|
|
|
# See cc-wrapper for comments.
|
|
|
|
var_templates_list=(
|
2020-06-18 07:06:33 +00:00
|
|
|
NIX_IGNORE_LD_THROUGH_GCC
|
|
|
|
NIX_LDFLAGS
|
|
|
|
NIX_LDFLAGS_BEFORE
|
2021-01-15 22:18:51 +00:00
|
|
|
NIX_DYNAMIC_LINKER
|
2020-06-18 07:06:33 +00:00
|
|
|
NIX_LDFLAGS_AFTER
|
|
|
|
NIX_LDFLAGS_HARDEN
|
|
|
|
NIX_HARDENING_ENABLE
|
2020-04-24 23:36:52 +00:00
|
|
|
)
|
|
|
|
var_templates_bool=(
|
2020-06-18 07:06:33 +00:00
|
|
|
NIX_SET_BUILD_ID
|
|
|
|
NIX_DONT_SET_RPATH
|
2020-04-24 23:36:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
accumulateRoles
|
|
|
|
|
|
|
|
for var in "${var_templates_list[@]}"; do
|
2020-06-18 07:06:33 +00:00
|
|
|
mangleVarList "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
|
|
|
for var in "${var_templates_bool[@]}"; do
|
2020-06-18 07:06:33 +00:00
|
|
|
mangleVarBool "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ -e @out@/nix-support/libc-ldflags ]; then
|
2020-06-18 07:06:33 +00:00
|
|
|
NIX_LDFLAGS_@suffixSalt@+=" $(< @out@/nix-support/libc-ldflags)"
|
2020-04-24 23:36:52 +00:00
|
|
|
fi
|
|
|
|
|
2021-01-15 22:18:51 +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
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
if [ -e @out@/nix-support/libc-ldflags-before ]; then
|
2020-06-18 07:06:33 +00:00
|
|
|
NIX_LDFLAGS_BEFORE_@suffixSalt@="$(< @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE_@suffixSalt@"
|
2020-04-24 23:36:52 +00:00
|
|
|
fi
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
export NIX_BINTOOLS_WRAPPER_FLAGS_SET_@suffixSalt@=1
|