Line 0
Link Here
|
0 |
-- a/Makefile |
1 |
#!/bin/sh |
|
|
2 |
# Test if gcc default to -fPIE/-fpie |
3 |
|
4 |
cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y" |
5 |
int main(void) |
6 |
{ |
7 |
#if !(defined(__PIE__) || defined(__pie__)) |
8 |
#error "Compiler don't default to PIE" |
9 |
#endif |
10 |
return 0; |
11 |
} |
12 |
END |
|
|
13 |
++ b/Makefile |
Lines 674-679
ifdef CONFIG_CC_STACKPROTECTOR
Link Here
|
674 |
endif |
674 |
endif |
675 |
KBUILD_CFLAGS += $(stackp-flag) |
675 |
KBUILD_CFLAGS += $(stackp-flag) |
676 |
|
676 |
|
|
|
677 |
# Force off for compilers that enable PIE by default. |
678 |
ifeq ($(CONFIG_SHELL) $(srctree)/scripts/gcc-default-pie.sh $(CC), y) |
679 |
KBUILD_CFLAGS += -fno-PIE |
680 |
KBUILD_ASFLAG += -fno-PIE |
681 |
endif |
682 |
|
677 |
ifeq ($(cc-name),clang) |
683 |
ifeq ($(cc-name),clang) |
678 |
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) |
684 |
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) |
679 |
KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,) |
685 |
KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,) |