Skip to contentSkip to conversation

crash: Fix cross compilation for 32-bit arm

PATCH New Khem Raj 1 participant 1 message Jul 1

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 crash: Fix cross compilation for 32-bit arm

The upstream crash Makefile CONF_TARGET_ARCH mapping (used when CROSS_COMPILE is set) enumerates most of OE supported arches but omits 32-bit arm. Building with CROSS_COMPILE=arm-* therefore aborts at Makefile parse time:

Makefile:75: *** The current Arch(arm) does not support cross compilation. Stop.

ARM is already a valid crash target (defs.h/configure.c), so add a patch mapping the normalized "arm" arch to CONF_TARGET_ARCH=ARM like every other supported arch.

Verified by cross building crash for qemuarm (arm-yoe-linux-gnueabi-):

Cc Ricardo Salveti <[email protected]>
---
 meta-oe/recipes-kernel/crash/crash.inc        |  1 +
 ...pport-cross-compiling-for-32-bit-arm.patch | 36 +++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 meta-oe/recipes-kernel/crash/crash/0001-Makefile-support-cross-compiling-for-32-bit-arm.patch
meta-oe/recipes-kernel/crash/crash.inc +1 -0
index dd231134b2..d6447ebe49 100644
@@ -19,6 +19,7 @@ SRC_URI = "git://github.com/crash-utility/${BPN}.git;branch=master;protocol=http
            file://gdb_build_jobs_and_not_write_crash_target.patch \
            file://0001-symbol-fix-S-cannot-work-with-kaslr-detection.patch \
            file://0001-Use-CC-env-var-to-get-compiler-version.patch \
+           file://0001-Makefile-support-cross-compiling-for-32-bit-arm.patch \
           "
 # 0001-Use-CC-env-var-to-get-compiler-version.patch:
 # to get the right compiler info into ./crash --buildinfo
meta-oe/recipes-kernel/crash/crash/0001-Makefile-support-cross-compiling-for-32-bit-arm.patch new file +36 -0
new file mode 100644
index 0000000000..102674000b
@@ -0,0 +1,36 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Mon, 30 Jun 2026 00:00:00 +0000
+Subject: [PATCH] Makefile: support cross compiling for 32-bit arm
+
+The CONF_TARGET_ARCH cross-compilation mapping enumerates aarch64,
+s390x, powerpc64, ppc64le, alpha, i386, mips, sparc64 and riscv64 but
+omits 32-bit arm. As a result, building with CROSS_COMPILE=arm-* (e.g.
+arm-poky-linux-gnueabi-) aborts at Makefile parse time with:
+
+    Makefile:75: *** The current Arch(arm) does not support cross compilation.  Stop.
+
+ARM is already a valid crash target (defs.h/configure.c), so map the
+normalized "arm" arch to CONF_TARGET_ARCH=ARM like every other arch.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 1111111..2222222 100644
+--- a/Makefile
++++ b/Makefile
+@@ -55,6 +55,8 @@ ifeq (${ARCH}, x86_64)
+ CONF_TARGET_ARCH := X86_64
+ else ifeq (${ARCH}, aarch64)
+ CONF_TARGET_ARCH := ARM64
++else ifeq (${ARCH}, arm)
++CONF_TARGET_ARCH := ARM
+ else ifeq (${ARCH}, s390x)
+ CONF_TARGET_ARCH := S390X
+ else ifeq (${ARCH}, powerpc64)
+--
+2.43.0