From 5ad4d97be96f7ec325e9be2323975d2c79aaaccb Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 30 Aug 2018 16:06:25 +0100 Subject: [PATCH] [x86] Allow generating user-space headers without a compiler --- debian/changelog | 1 + ...ting-user-space-headers-without-a-co.patch | 47 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 49 insertions(+) create mode 100644 debian/patches/bugfix/x86/x86-allow-generating-user-space-headers-without-a-co.patch diff --git a/debian/changelog b/debian/changelog index 43a7e2a3d..010b2cfc9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ linux (4.19~rc1-1~exp1) UNRELEASED; urgency=medium * locking/lockdep: Delete unnecesary #include (fixes liblockdep build) * [hppa] debian/control: Simplify build-dependencies for 64-bit toolchain * Compile with gcc-8 on all architectures + * [x86] Allow generating user-space headers without a compiler -- Ben Hutchings Mon, 27 Aug 2018 14:36:54 +0100 diff --git a/debian/patches/bugfix/x86/x86-allow-generating-user-space-headers-without-a-co.patch b/debian/patches/bugfix/x86/x86-allow-generating-user-space-headers-without-a-co.patch new file mode 100644 index 000000000..550fcc31f --- /dev/null +++ b/debian/patches/bugfix/x86/x86-allow-generating-user-space-headers-without-a-co.patch @@ -0,0 +1,47 @@ +From: Ben Hutchings +Date: Wed, 29 Aug 2018 20:26:46 +0100 +Subject: x86: Allow generating user-space headers without a compiler +Forwarded: https://lore.kernel.org/lkml/20180829194317.GA4765@decadent.org.uk/T/#u + +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 +Signed-off-by: Ben Hutchings +--- + arch/x86/Makefile | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/arch/x86/Makefile b/arch/x86/Makefile +index 94859241bc3e..7df47ff45f68 100644 +--- a/arch/x86/Makefile ++++ b/arch/x86/Makefile +@@ -175,10 +175,6 @@ ifdef CONFIG_FUNCTION_GRAPH_TRACER + endif + endif + +-ifndef CC_HAVE_ASM_GOTO +- $(error Compiler lacks asm-goto support.) +-endif +- + # + # Jump labels need '-maccumulate-outgoing-args' for gcc < 4.5.2 to prevent a + # GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46226). There's no way +@@ -312,6 +308,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 diff --git a/debian/patches/series b/debian/patches/series index 69caeabb4..f79eed35f 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -75,6 +75,7 @@ bugfix/x86/mmap-add-an-exception-to-the-stack-gap-for-hotspot-jvm.patch bugfix/powerpc/powerpc-lib-sstep-fix-building-for-powerpcspe.patch bugfix/powerpc/powerpc-lib-makefile-don-t-pull-in-quad.o-for-32-bit.patch bugfix/arm/arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch +bugfix/x86/x86-allow-generating-user-space-headers-without-a-co.patch # Arch features features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch