Skip to contentSkip to conversation

Add HOST_ARCH detection for armv5tel and armv6l

PATCH In review Ben Wolsieffer 2 participants 2 messages Apr 27, 2025 – May 5, 2025 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add HOST_ARCH detection for armv5tel and armv6l

Since 7506c15, HOST_ARCH is now used by the EFI loader even when CONFIG_SANDBOX is disabled. When cross-compiling, the Makefile defines HOST_ARCH based on the cross-compiler prefix, but this definition fails to cover some common compiler prefixes. When cross-compiling U-Boot in nixpkgs, we use CROSS_COMPILE=armv6l-unknown-linux-gnueabihf-, which results in HOST_ARCH being undefined and causes a build failure.

Fix this by adding armv6l to the match for ARM. Also add armv5tel, as this is another possible ARM compiler prefix.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 73939748e54..a6535c71576 100644
@@ -30,7 +30,7 @@ else ifneq (,$(findstring $(MK_ARCH), "i386" "i486" "i586" "i686"))
   export HOST_ARCH=$(HOST_ARCH_X86)
 else ifneq (,$(findstring $(MK_ARCH), "aarch64" "armv8l"))
   export HOST_ARCH=$(HOST_ARCH_AARCH64)
-else ifneq (,$(findstring $(MK_ARCH), "arm" "armv7" "armv7a" "armv7l"))
+else ifneq (,$(findstring $(MK_ARCH), "arm" "armv5tel" "armv6l" "armv7" "armv7a" "armv7l"))
   export HOST_ARCH=$(HOST_ARCH_ARM)
 else ifeq ("riscv32", $(MK_ARCH))
   export HOST_ARCH=$(HOST_ARCH_RISCV32)
Signature · 1 line
2.49.0
#1 lore raw
Quoted 8 lines · Ben Wolsieffer

Since 7506c15, HOST_ARCH is now used by the EFI loader even when CONFIG_SANDBOX is disabled. When cross-compiling, the Makefile defines HOST_ARCH based on the cross-compiler prefix, but this definition fails to cover some common compiler prefixes. When cross-compiling U-Boot in nixpkgs, we use CROSS_COMPILE=armv6l-unknown-linux-gnueabihf-, which results in HOST_ARCH being undefined and causes a build failure.

[...]

Applied to u-boot/master, thanks!

[1/1] Add HOST_ARCH detection for armv5tel and armv6l

      commit: 03f5101ff50d1b449c65a4483c725b4ae0446c62
Signature · 1 line
Tom