cc-wrapper: Remove redundant hardening

GCC just passes `-z ...` flags to ld unaltered, and they are already
passed to LD anyways. On the other hand, `-pie` affects gcc behavior
too.
This commit is contained in:
John Ericson 2017-08-25 01:14:43 -04:00 committed by Robin Gloster
parent 823fb278d3
commit 822a8d0148
2 changed files with 2 additions and 1 deletions

View File

@ -43,6 +43,7 @@ if [[ -z "${hardeningDisableMap[all]:-}" ]]; then
hardeningCFlags+=('-fPIE')
if [[ ! ("$*" =~ " -shared " || "$*" =~ " -static ") ]]; then
if [[ -n "${NIX_DEBUG:-}" ]]; then echo HARDENING: enabling LDFlags -pie >&2; fi
hardeningCFlags+=('-pie')
hardeningLDFlags+=('-pie')
fi
;;

View File

@ -138,7 +138,7 @@ if [ "$dontLink" != 1 ]; then
# Add the flags that should only be passed to the compiler when
# linking.
extraAfter+=($NIX_@infixSalt@_CFLAGS_LINK "${hardeningLDFlags[@]}")
extraAfter+=($NIX_@infixSalt@_CFLAGS_LINK)
# Add the flags that should be passed to the linker (and prevent
# `ld-wrapper' from adding NIX_@infixSalt@_LDFLAGS again).