kbuild: add -fno-PIE flag unconditionally
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 14 Dec 2018 08:05:37 +0000 (17:05 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 16 Dec 2018 15:33:44 +0000 (00:33 +0900)
This flag is documented in the GCC 4.6 manual, and recognized by
Clang as well. Let's rip off the cc-option switch.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Makefile

index 6f3df2d786dd3f918b36d00d951e9105f892769f..2d15726fb546101e3e0f8e7717c9be322f006d52 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -426,9 +426,9 @@ LINUXINCLUDE    := \
                -I$(objtree)/include \
                $(USERINCLUDE)
 
-KBUILD_AFLAGS   := -D__ASSEMBLY__
+KBUILD_AFLAGS   := -D__ASSEMBLY__ -fno-PIE
 KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-                  -fno-strict-aliasing -fno-common -fshort-wchar \
+                  -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
                   -Werror-implicit-function-declaration \
                   -Wno-format-security \
                   -std=gnu89
@@ -514,9 +514,6 @@ RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc
 export RETPOLINE_CFLAGS
 export RETPOLINE_VDSO_CFLAGS
 
-KBUILD_CFLAGS  += $(call cc-option,-fno-PIE)
-KBUILD_AFLAGS  += $(call cc-option,-fno-PIE)
-
 # check for 'asm goto'
 ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
   CC_HAVE_ASM_GOTO := 1