cc-wrapper: fix detection of unsupported linker flags

This commit is contained in:
Franz Pletz
2016-08-24 10:59:52 +02:00
parent 17234ca073
commit 8576aea57c
2 changed files with 10 additions and 11 deletions
@@ -4,17 +4,11 @@ hardeningCFlags=()
hardeningLDFlags=()
hardeningDisable=${hardeningDisable:-""}
if [[ -z "@ld_supports_bindnow@" ]]; then
hardeningDisable+=" bindnow"
fi
if [[ -z "@ld_supports_relro@" ]]; then
hardeningDisable+=" relro"
fi
hardeningDisable+=" @hardening_unsupported_flags@"
if [[ -n "$NIX_DEBUG" ]]; then echo HARDENING: Value of '$hardeningDisable': $hardeningDisable >&2; fi
if [[ ! $hardeningDisable == "all" ]]; then
if [[ ! $hardeningDisable =~ "all" ]]; then
if [[ -n "$NIX_DEBUG" ]]; then echo 'HARDENING: Is active (not completely disabled with "all" flag)' >&2; fi
for flag in "${hardeningFlags[@]}"
do