[amd64] kbuild: Add -fno-PIE to scripts/gcc-x86_64-has-stack-protector.sh

This commit is contained in:
Ben Hutchings 2016-11-03 16:51:48 -06:00
parent 25e532ff97
commit 7aecddec04
1 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,7 @@ Also add to KBUILD_AFLAGSi due to:
|arch/x86/entry/vdso/vdso32/note.S:1:0: sorry, unimplemented: -mfentry isnt supported for 32-bit in c ombination with -fpic
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
[bwh: Also add the option to scripts/gcc-x86_64-has-stack-protector.sh]
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@ -35,3 +36,13 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
--- a/scripts/gcc-x86_64-has-stack-protector.sh
+++ b/scripts/gcc-x86_64-has-stack-protector.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -mcmodel=kernel -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
+echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
if [ "$?" -eq "0" ] ; then
echo y
else