diff options
author | [email protected] <[email protected]> | 2010-09-13 06:13:19 -0400 |
---|---|---|
committer | H. Peter Anvin <[email protected]> | 2010-09-13 15:53:16 -0700 |
commit | 08c2b394b98786ebb067e2a54d08f1f6f0d247da (patch) | |
tree | fcbd20a7dfc1b75c270fcc5ce815babd78a9c8bb | |
parent | 2fd818642a3c3a257f3b1262145a52bc1bfebd26 (diff) |
x86, build: Disable -fPIE when compiling with CONFIG_CC_STACKPROTECTOR=y
The arch/x86/Makefile uses scripts/gcc-x86_$(BITS)-has-stack-protector.sh
to check if cc1 supports -fstack-protector. When -fPIE is passed to cc1,
these scripts fail causing stack protection to be disabled even when it
is available.
This fix is similar to commit c47efe5548abbf53c2f66e06dcb46183b11d6b22
Reported-by: Kai Dietrich <[email protected]>
Signed-off-by: Magnus Granberg <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Anthony G. Basile <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
-rw-r--r-- | arch/x86/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 8aa1b59b9074..e8c8881351b3 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -74,7 +74,7 @@ endif ifdef CONFIG_CC_STACKPROTECTOR cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh - ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(biarch)),y) + ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC) $(KBUILD_CPPFLAGS) $(biarch)),y) stackp-y := -fstack-protector KBUILD_CFLAGS += $(stackp-y) else |