lkml.org 
[lkml]   [2013]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch core/stackprotector] stackprotector: Fix build when compiler lacks support
8779657d29c0 ("stackprotector: Introduce CONFIG_CC_STACKPROTECTOR_STRONG") 
causes the build to break when the compiler doesn't support
-fstack-protector-strong:

cc1: error: unrecognized command line option ‘-fstack-protector-strong’
cc1: error: unrecognized command line option ‘-fstack-protector-strong’

with at least gcc 4.6.3.

Instead of breaking the build, just warn of the failure and disable the
feature.

Signed-off-by: David Rientjes <rientjes@google.com>
---
Makefile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -603,10 +603,11 @@ ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
-fstack-protector not supported by compiler))
endif
else ifdef CONFIG_CC_STACKPROTECTOR_STRONG
- stackp-flag := -fstack-protector-strong
- ifeq ($(call cc-option, $(stackp-flag)),)
+ ifeq ($(call cc-option, -fstack-protector-strong),)
$(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \
-fstack-protector-strong not supported by compiler)
+ else
+ stackp-flag := -fstack-protector-strong
endif
else
# Force off for distro compilers that enable stack protector by default.
\
 
 \ /
  Last update: 2013-12-30 23:21    [W:0.077 / U:2.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site