ARCH is taken from the CROSS_COMPILE prefix, so the Debian cross triplets
powerpc64le-linux-gnu- and loongarch64-linux-gnu- produced ARCH=powerpc64le
and ARCH=loongarch64, which the CONF_TARGET_ARCH chain did not recognise and
make stopped with "does not support cross compilation".
Map powerpc64le to PPC64 and loongarch64 to LOONGARCH64. The gdb host
triplet is derived from CROSS_COMPILE itself, so nothing else is needed.
Both targets matter for CI: ppc64el is an Ubuntu architecture with archive
packages for the target gmp/mpfr, and loongarch64 has a cross toolchain in
Ubuntu 26.04.
Signed-off-by: Dave Young <yangrr.2009(a)tsinghua.org.cn>
Assisted-by: LLM
Signed-off-by: Dave Young <yangrr.2009(a)tsinghua.org.cn>
---
Makefile | 4 ++++
README | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 5b56b2403413..9ca9e6d90d5a 100644
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,8 @@ else ifeq (${ARCH}, powerpc64)
CONF_TARGET_ARCH := PPC64
else ifeq (${ARCH}, ppc64le)
CONF_TARGET_ARCH := PPC64
+else ifeq (${ARCH}, powerpc64le)
+CONF_TARGET_ARCH := PPC64
else ifeq (${ARCH}, alpha)
CONF_TARGET_ARCH := ALPHA
else ifeq (${ARCH}, i386)
@@ -71,6 +73,8 @@ else ifeq (${ARCH}, sparc64)
CONF_TARGET_ARCH := SPARC64
else ifeq (${ARCH}, riscv64)
CONF_TARGET_ARCH := RISCV64
+else ifeq (${ARCH}, loongarch64)
+CONF_TARGET_ARCH := LOONGARCH64
else
$(error The current Arch(${ARCH}) does not support cross compilation)
endif
diff --git a/README b/README
index 271725ecbbd5..999ac3f60d5f 100644
--- a/README
+++ b/README
@@ -103,7 +103,7 @@
To cross compile the crash utility for aarch64 on x86_64:
$ make CROSS_COMPILE=aarch64-linux-gnu- -j`nproc`
- Supported arches for cross compilation: x86_64, x86, aarch64, s390x, powerpc64, alpha,
sparc64, mips, riscv64
+ Supported arches for cross compilation: x86_64, x86, aarch64, s390x, powerpc64,
powerpc64le, alpha, sparc64, mips, riscv64, loongarch64
The initial build will take several minutes because the embedded gdb module
must be configured and built. Alternatively, the crash source RPM file
--
2.51.1