From d738fcc5dd7f70eec40a395595fb39ee67afa6e7 Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Mon, 23 Sep 2013 16:09:59 +0200 Subject: [PATCH] gcc: fixed parse-config to only inject -fstack-protector if we have a proper compiler supporting it Note: At stage 0 (toolchain) we are building a static gcc with explicitely disabled stack-smashing protection. --- base/gcc/parse-config | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base/gcc/parse-config b/base/gcc/parse-config index a21abeaa2..a044d7965 100644 --- a/base/gcc/parse-config +++ b/base/gcc/parse-config @@ -18,7 +18,11 @@ # if [ "${SDECFG_DEFAULT_CC:0:3}" = "gcc" -a "$SDECFG_PKG_GCC_STACKPRO" = 1 ]; then if ! hasflag NO-SSP; then - var_append GCC_WRAPPER_INSERT ' ' '-fstack-protector' + if pkginstalled -f gcc; then + var_append GCC_WRAPPER_INSERT ' ' '-fstack-protector' + else + echo_warning 'Disabling GCC stack-protector (not supported by toolchain gcc)' + fi else echo_warning 'Package incompatible with GCC stack-protector, disabled' fi