Skip to content

Commit 5f6e0fe

Browse files
masahir0yhdeller
authored andcommitted
parisc: Fix compile failure when building 64-bit kernel natively
Commit 23243c1 ("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: 23243c1 ("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>
1 parent 8ef5b28 commit 5f6e0fe

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,11 @@ ifeq ($(ARCH),sparc64)
404404
SRCARCH := sparc
405405
endif
406406

407+
# Additional ARCH settings for parisc
408+
ifeq ($(ARCH),parisc64)
409+
SRCARCH := parisc
410+
endif
411+
407412
export cross_compiling :=
408413
ifneq ($(SRCARCH),$(SUBARCH))
409414
cross_compiling := 1

arch/parisc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ CHECKFLAGS += -D__hppa__=1
2525
ifdef CONFIG_64BIT
2626
UTS_MACHINE := parisc64
2727
CHECKFLAGS += -D__LP64__=1
28-
CC_ARCHES = hppa64
2928
LD_BFD := elf64-hppa-linux
3029
else # 32-bit
31-
CC_ARCHES = hppa hppa2.0 hppa1.1
3230
LD_BFD := elf32-hppa-linux
3331
endif
3432

3533
# select defconfig based on actual architecture
36-
ifeq ($(shell uname -m),parisc64)
34+
ifeq ($(ARCH),parisc64)
3735
KBUILD_DEFCONFIG := generic-64bit_defconfig
36+
CC_ARCHES := hppa64
3837
else
3938
KBUILD_DEFCONFIG := generic-32bit_defconfig
39+
CC_ARCHES := hppa hppa2.0 hppa1.1
4040
endif
4141

4242
export LD_BFD

scripts/subarch.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
88
-e s/sun4u/sparc64/ \
99
-e s/arm.*/arm/ -e s/sa110/arm/ \
10-
-e s/s390x/s390/ -e s/parisc64/parisc/ \
10+
-e s/s390x/s390/ \
1111
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
1212
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
1313
-e s/riscv.*/riscv/)

0 commit comments

Comments
 (0)