rust: select correct architecture for armv5
authorLu jicong <jiconglu58@gmail.com>
Wed, 3 Jul 2024 11:51:28 +0000 (19:51 +0800)
committerTianling Shen <cnsztl@gmail.com>
Wed, 3 Jul 2024 18:09:45 +0000 (02:09 +0800)
Currently, armv5 and armv6 targets are both using armv6 rustc.
Without this patch, rust programs in armv5 targets throw illegal instruction
error.

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
lang/rust/rust-values.mk

index 534aaa02a056e52f10ef026768e973a91ec4f552..d423d0a87f2302e9c3cc0189f39dd8c5ccaa871c 100644 (file)
@@ -52,7 +52,9 @@ endif
 
 # ARM Logic
 ifeq ($(ARCH),arm)
-  ifeq ($(CONFIG_arm_v7),y)
+  ifeq ($(CONFIG_arm_v6)$(CONFIG_arm_v7),)
+    RUSTC_TARGET_ARCH:=$(subst arm,armv5te,$(RUSTC_TARGET_ARCH))
+  else ifeq ($(CONFIG_arm_v7),y)
     RUSTC_TARGET_ARCH:=$(subst arm,armv7,$(RUSTC_TARGET_ARCH))
   endif