From 1f3e1724e364bf1a0ca3ff4877896a56afe838c9 Mon Sep 17 00:00:00 2001 From: "longchun.lc" Date: Sat, 12 Jan 2019 11:09:12 +0800 Subject: [PATCH] stack-protector: fix CC_HAS_STACKPROTECTOR_NONE depend on -fno-stack-protector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit(2a61f4747eeaa85ce26ca9fbd81421b15facd018)rename CC_STACKPROTECTOR_NONE config. but unfortunately if the compiler support option -fno-stack-protector, CC_HAS_STACKPROTECTOR_NONE will not be disabled. CC_HAS_STACKPROTECTOR_NONE and CC_STACKPROTECTOR_STRONG will be enabled at once, as the following conditions: 1. gcc support -fno-stack-protector & -fstack-protector-strong 2. enabled CC_STACKPROTECTOR_STRONG & STACKPROTECTOR 3. disabled CC_HAS_STACKPROTECTOR_NONE --- arch/Kconfig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/Kconfig b/arch/Kconfig index 4cfb6de..11492d9 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -444,7 +444,11 @@ config HAVE_STACKPROTECTOR - it has implemented a stack canary (e.g. __stack_chk_guard) config CC_HAS_STACKPROTECTOR_NONE - def_bool $(cc-option,-fno-stack-protector) + bool "None" + depends on $(cc-option,-fno-stack-protector) + default n + help + Disable "stack-protector" GCC feature. config STACKPROTECTOR bool "Stack Protector buffer overflow detection" -- 2.7.4