diff options
author | Kees Cook <keescook@chromium.org> | 2013-12-19 14:35:58 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-12-20 03:38:40 -0500 |
commit | 19952a92037e752f9d3bbbad552d596f9a56e146 (patch) | |
tree | 8a1930b4775cb17865c03faf55eafdd7b97be8ba /Makefile | |
parent | b0031f227e47919797dc0e1c1990f3ef151ff0cc (diff) |
stackprotector: Unify the HAVE_CC_STACKPROTECTOR logic between architectures
Instead of duplicating the CC_STACKPROTECTOR Kconfig and
Makefile logic in each architecture, switch to using
HAVE_CC_STACKPROTECTOR and keep everything in one place. This
retains the x86-specific bug verification scripts.
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org
Cc: linux-arch@vger.kernel.org
Link: http://lkml.kernel.org/r/1387481759-14535-2-git-send-email-keescook@chromium.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -595,10 +595,18 @@ ifneq ($(CONFIG_FRAME_WARN),0) | |||
595 | KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN}) | 595 | KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN}) |
596 | endif | 596 | endif |
597 | 597 | ||
598 | # Force gcc to behave correct even for buggy distributions | 598 | # Handle stack protector mode. |
599 | ifndef CONFIG_CC_STACKPROTECTOR | 599 | ifdef CONFIG_CC_STACKPROTECTOR |
600 | KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) | 600 | stackp-flag := -fstack-protector |
601 | ifeq ($(call cc-option, $(stackp-flag)),) | ||
602 | $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \ | ||
603 | -fstack-protector not supported by compiler)) | ||
604 | endif | ||
605 | else | ||
606 | # Force off for distro compilers that enable stack protector by default. | ||
607 | stackp-flag := $(call cc-option, -fno-stack-protector) | ||
601 | endif | 608 | endif |
609 | KBUILD_CFLAGS += $(stackp-flag) | ||
602 | 610 | ||
603 | # This warning generated too much noise in a regular build. | 611 | # This warning generated too much noise in a regular build. |
604 | # Use make W=1 to enable this warning (see scripts/Makefile.build) | 612 | # Use make W=1 to enable this warning (see scripts/Makefile.build) |