]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
parisc: Fix compile failure when building 64-bit kernel natively
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 10 Jun 2021 02:03:31 +0000 (11:03 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:42:20 +0000 (13:42 +0200)
commit 5f6e0fe01b6b33894cf6f61b359ab5a6d2b7674e upstream.

Commit 23243c1ace9f ("arch: use cross_compiling to check whether it is
a cross build or not") broke 64-bit parisc builds on 32-bit parisc
systems.

Helge mentioned:
  - 64-bit parisc userspace is not supported yet [1]
  - hppa gcc does not support "-m64" flag [2]

That means, parisc developers working on a 32-bit parisc machine need
to use hppa64-linux-gnu-gcc (cross compiler) for building the 64-bit
parisc kernel.

After the offending commit, gcc is used in such a case because
both $(SRCARCH) and $(SUBARCH) are 'parisc', hence cross_compiling is
unset.

A correct way is to introduce ARCH=parisc64 because building the 64-bit
parisc kernel on a 32-bit parisc system is not exactly a native build,
but rather a semi-cross build.

[1]: https://lore.kernel.org/linux-parisc/5dfd81eb-c8ca-b7f5-e80e-8632767c022d@gmx.de/#t
[2]: https://lore.kernel.org/linux-parisc/89515325-fc21-31da-d238-6f7a9abbf9a0@gmx.de/

Fixes: 23243c1ace9f ("arch: use cross_compiling to check whether it is a cross build or not")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Cc: <stable@vger.kernel.org> # v5.13+
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Makefile
arch/parisc/Makefile
scripts/subarch.include

index ddbd64b92a7231bb00adf0faccd396061379270b..5b6be5b8141333de8d6ebb1ec57732765608fee7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -404,6 +404,11 @@ ifeq ($(ARCH),sparc64)
        SRCARCH := sparc
 endif
 
+# Additional ARCH settings for parisc
+ifeq ($(ARCH),parisc64)
+       SRCARCH := parisc
+endif
+
 export cross_compiling :=
 ifneq ($(SRCARCH),$(SUBARCH))
 cross_compiling := 1
index aed8ea29268bb65b600cf5a8a1c6594b1393eaa4..2d019aa73b8f02d5469f3cf30f3e27996a22b551 100644 (file)
@@ -25,18 +25,18 @@ CHECKFLAGS  += -D__hppa__=1
 ifdef CONFIG_64BIT
 UTS_MACHINE    := parisc64
 CHECKFLAGS     += -D__LP64__=1
-CC_ARCHES      = hppa64
 LD_BFD         := elf64-hppa-linux
 else # 32-bit
-CC_ARCHES      = hppa hppa2.0 hppa1.1
 LD_BFD         := elf32-hppa-linux
 endif
 
 # select defconfig based on actual architecture
-ifeq ($(shell uname -m),parisc64)
+ifeq ($(ARCH),parisc64)
        KBUILD_DEFCONFIG := generic-64bit_defconfig
+       CC_ARCHES := hppa64
 else
        KBUILD_DEFCONFIG := generic-32bit_defconfig
+       CC_ARCHES := hppa hppa2.0 hppa1.1
 endif
 
 export LD_BFD
index 650682821126c39fb145b924b8340a07eeec1bd7..776849a3c500fb8d9e419ab29aeadac380de5614 100644 (file)
@@ -7,7 +7,7 @@
 SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
                                  -e s/sun4u/sparc64/ \
                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
-                                 -e s/s390x/s390/ -e s/parisc64/parisc/ \
+                                 -e s/s390x/s390/ \
                                  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
                                  -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
                                  -e s/riscv.*/riscv/)