summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2018-05-16 01:51:36 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-17 09:36:40 -0400
commit8438ee76b004ef66d125ade64c91fc128047d244 (patch)
tree3c174fe99238cf40d957fc4bb4844019226ed0a7 /Makefile
parentc64ba044ed57ea72cc1c7b14a8dcfb6ded5a759c (diff)
Makefile: disable PIE before testing asm goto
Since commit e501ce957a78 ("x86: Force asm-goto"), aarch64 build on distributions which enable PIE by default (e.g. openSUSE Tumbleweed) does not detect support for asm goto correctly. The problem is that ARM specific part of scripts/gcc-goto.sh fails with PIE even with recent gcc versions. Moving the asm goto detection up in Makefile put it before the place where we disable PIE. As a result, kernel is built without jump label support. Move the lines disabling PIE before the asm goto test to make it work. Fixes: e501ce957a78 ("x86: Force asm-goto") Reported-by: Andreas Faerber <afaerber@suse.com> Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ba090852805c..89be971fa9be 100644
--- a/Makefile
+++ b/Makefile
@@ -500,6 +500,9 @@ RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
500RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG))) 500RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG)))
501export RETPOLINE_CFLAGS 501export RETPOLINE_CFLAGS
502 502
503KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
504KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
505
503# check for 'asm goto' 506# check for 'asm goto'
504ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) 507ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
505 CC_HAVE_ASM_GOTO := 1 508 CC_HAVE_ASM_GOTO := 1
@@ -621,8 +624,6 @@ endif # $(dot-config)
621# Defaults to vmlinux, but the arch makefile usually adds further targets 624# Defaults to vmlinux, but the arch makefile usually adds further targets
622all: vmlinux 625all: vmlinux
623 626
624KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
625KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
626CFLAGS_GCOV := -fprofile-arcs -ftest-coverage \ 627CFLAGS_GCOV := -fprofile-arcs -ftest-coverage \
627 $(call cc-option,-fno-tree-loop-im) \ 628 $(call cc-option,-fno-tree-loop-im) \
628 $(call cc-disable-warning,maybe-uninitialized,) 629 $(call cc-disable-warning,maybe-uninitialized,)