summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2018-07-09 14:08:02 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2018-07-09 14:13:28 +0200
commit4984a9c7c772ae5acfa5a283fa1bdbdae26a3c52 (patch)
tree1e9cb215a12424c2dce5fbea2ec8f926fccceb8d
parent3ddca04349e195c021fb9bee4d74c0405df20ed5 (diff)
downloadptxdist-4984a9c7c772ae5acfa5a283fa1bdbdae26a3c52.tar.gz
ptxdist-4984a9c7c772ae5acfa5a283fa1bdbdae26a3c52.tar.xz
wrapper: improve blacklist handling
Explicitly disable build-id if it is blacklisted. It may be enabled by default in the toolchain. Use TARGET_HARDEN_STACK to blacklist all stack protector options. Note: With 'dash', variables for a specific command remain set afterwards if the command is a shell function. Use '()' to make sure the existing value is not overwritten. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/wrapper/libwrapper.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/wrapper/libwrapper.sh b/scripts/wrapper/libwrapper.sh
index 2a144e169..1faea05d2 100644
--- a/scripts/wrapper/libwrapper.sh
+++ b/scripts/wrapper/libwrapper.sh
@@ -145,6 +145,9 @@ add_ld_args() {
if ${BUILDID}; then
add_opt_arg TARGET_BUILD_ID "${1}--build-id=sha1"
fi
+ if ! ( PTXCONF_TARGET_BUILD_ID=y test_opt TARGET_BUILD_ID ); then
+ add_arg "${1}--build-id=none"
+ fi
}
ld_add_ld_args() {
@@ -183,6 +186,8 @@ cc_add_fortify() {
}
cc_add_stack() {
+ # TARGET_HARDEN_STACK blacklists all stack protector options
+ ( PTXCONF_TARGET_HARDEN_STACK=y test_opt TARGET_HARDEN_STACK ) || return 0
if ${STDLIB}; then
add_opt_arg TARGET_HARDEN_STACK "-fstack-protector" "--param=ssp-buffer-size=4"
add_opt_arg TARGET_HARDEN_STACK_STRONG "-fstack-protector-strong"