aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile13
-rw-r--r--arch/x86/Makefile4
2 files changed, 11 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index d65e2e229017..6fb6fd28a124 100644
--- a/Makefile
+++ b/Makefile
@@ -494,6 +494,13 @@ RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
494RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG))) 494RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG)))
495export RETPOLINE_CFLAGS 495export RETPOLINE_CFLAGS
496 496
497# check for 'asm goto'
498ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
499 CC_HAVE_ASM_GOTO := 1
500 KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
501 KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
502endif
503
497ifeq ($(config-targets),1) 504ifeq ($(config-targets),1)
498# =========================================================================== 505# ===========================================================================
499# *config targets only - make sure prerequisites are updated, and descend 506# *config targets only - make sure prerequisites are updated, and descend
@@ -658,12 +665,6 @@ KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \
658# Tell gcc to never replace conditional load with a non-conditional one 665# Tell gcc to never replace conditional load with a non-conditional one
659KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) 666KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
660 667
661# check for 'asm goto'
662ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
663 KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
664 KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
665endif
666
667include scripts/Makefile.kcov 668include scripts/Makefile.kcov
668include scripts/Makefile.gcc-plugins 669include scripts/Makefile.gcc-plugins
669 670
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 498c1b812300..d798e36d103c 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -181,6 +181,10 @@ ifdef CONFIG_FUNCTION_GRAPH_TRACER
181 endif 181 endif
182endif 182endif
183 183
184ifndef CC_HAVE_ASM_GOTO
185 $(error Compiler lacks asm-goto support.)
186endif
187
184# 188#
185# Jump labels need '-maccumulate-outgoing-args' for gcc < 4.5.2 to prevent a 189# Jump labels need '-maccumulate-outgoing-args' for gcc < 4.5.2 to prevent a
186# GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46226). There's no way 190# GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46226). There's no way