cc-wrapper: Pull variable mangler into utils.sh

In preparation for splitting out binutils-wrapper
This commit is contained in:
John Ericson
2017-09-01 11:44:54 -04:00
parent 94c0267fc1
commit 1f5807d760
5 changed files with 24 additions and 16 deletions
+1 -10
View File
@@ -36,16 +36,7 @@ fi
# We need to mangle names for hygiene, but also take parameters/overrides
# from the environment.
for var in "${var_templates[@]}"; do
outputVar="${var/+/_@infixSalt@_}"
export ${outputVar}+=''
# For each role we serve, we accumulate the input parameters into our own
# cc-wrapper-derivation-specific environment variables.
for infix in "${role_infixes[@]}"; do
inputVar="${var/+/${infix}}"
if [ -v "$inputVar" ]; then
export ${outputVar}+="${!outputVar:+ }${!inputVar}"
fi
done
mangleVarList "$var" "${role_infixes[@]}"
done
# `-B@out@/bin' forces cc to use ld-wrapper.sh when calling ld.