x86: Allow generating user-space headers without a compiler
authorBen Hutchings <ben@decadent.org.uk>
Wed, 29 Aug 2018 19:43:17 +0000 (20:43 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 31 Aug 2018 15:08:22 +0000 (17:08 +0200)
When bootstrapping an architecture, it's usual to generate the kernel's
user-space headers (make headers_install) before building a compiler.  Move
the compiler check (for asm goto support) to the archprepare target so that
it is only done when building code for the target.

Fixes: e501ce957a78 ("x86: Force asm-goto")
Reported-by: Helmut Grohne <helmutg@debian.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180829194317.GA4765@decadent.org.uk
arch/x86/Makefile

index 8fc8f94ef5f54a8f3b9360bc51b715177429e9a0..8f6e7eb8ae9fc2342b79cb0fc65de922dee11f2e 100644 (file)
@@ -175,10 +175,6 @@ ifdef CONFIG_FUNCTION_GRAPH_TRACER
   endif
 endif
 
-ifndef CC_HAVE_ASM_GOTO
-  $(error Compiler lacks asm-goto support.)
-endif
-
 ifeq ($(ACCUMULATE_OUTGOING_ARGS), 1)
        # This compiler flag is not supported by Clang:
        KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args,)
@@ -300,6 +296,13 @@ PHONY += vdso_install
 vdso_install:
        $(Q)$(MAKE) $(build)=arch/x86/entry/vdso $@
 
+archprepare: checkbin
+checkbin:
+ifndef CC_HAVE_ASM_GOTO
+       @echo Compiler lacks asm-goto support.
+       @exit 1
+endif
+
 archclean:
        $(Q)rm -rf $(objtree)/arch/i386
        $(Q)rm -rf $(objtree)/arch/x86_64