]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Makefile: disable PIE before testing asm goto
authorMichal Kubecek <mkubecek@suse.cz>
Wed, 16 May 2018 05:51:36 +0000 (07:51 +0200)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 17 May 2018 13:36:40 +0000 (22:36 +0900)
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>
Makefile

index ba090852805c845480ef117fb27a36687877ff34..89be971fa9be13ab40ffe8d63fe26d3a0173f4b0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -500,6 +500,9 @@ RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
 RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG)))
 export RETPOLINE_CFLAGS
 
+KBUILD_CFLAGS  += $(call cc-option,-fno-PIE)
+KBUILD_AFLAGS  += $(call cc-option,-fno-PIE)
+
 # check for 'asm goto'
 ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
   CC_HAVE_ASM_GOTO := 1
@@ -621,8 +624,6 @@ endif # $(dot-config)
 # Defaults to vmlinux, but the arch makefile usually adds further targets
 all: vmlinux
 
-KBUILD_CFLAGS  += $(call cc-option,-fno-PIE)
-KBUILD_AFLAGS  += $(call cc-option,-fno-PIE)
 CFLAGS_GCOV    := -fprofile-arcs -ftest-coverage \
        $(call cc-option,-fno-tree-loop-im) \
        $(call cc-disable-warning,maybe-uninitialized,)