This is an automated email from the ASF dual-hosted git repository.
lupyuen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 72bedd5c5 apps/tools: Make hello_rust_cargo buildable with make
72bedd5c5 is described below
commit 72bedd5c5df72f85daa65f4ddeac54efcf84c080
Author: Shoji Tokunaga <[email protected]>
AuthorDate: Tue May 26 10:06:13 2026 +0900
apps/tools: Make hello_rust_cargo buildable with make
* Add JSON specification compatibility flag.
* Add Rust target conversion support for `aarch64` on macOS.
Signed-off-by: Shoji Tokunaga <[email protected]>
---
tools/Rust.mk | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/Rust.mk b/tools/Rust.mk
index 8e037aef6..3a5f72806 100644
--- a/tools/Rust.mk
+++ b/tools/Rust.mk
@@ -52,6 +52,9 @@ $(or \
$(and $(filter x86,$(LLVM_ARCHTYPE)), \
$(APPDIR)/tools/i486-unknown-nuttx.json \
), \
+ $(and $(filter aarch64,$(LLVM_ARCHTYPE)), \
+ $(if $(filter y,$(CONFIG_HOST_MACOS)),aarch64-apple-darwin) \
+ ), \
$(and $(filter thumb%,$(LLVM_ARCHTYPE)), \
$(if $(filter thumbv8m%,$(LLVM_ARCHTYPE)), \
$(if $(filter
cortex-m23,$(LLVM_CPUTYPE)),thumbv8m.base,thumbv8m.main)-nuttx-$(LLVM_ABITYPE),
\
@@ -91,7 +94,7 @@ ifeq ($(CONFIG_DEBUG_FULLOPT),y)
define RUST_CARGO_BUILD
NUTTX_INCLUDE_DIR=$(TOPDIR)/include:$(TOPDIR)/include/arch \
RUSTFLAGS="-Zunstable-options -Cpanic=immediate-abort" \
- cargo build --release -Zbuild-std=std,panic_abort \
+ cargo build --release -Zbuild-std=std,panic_abort -Zjson-target-spec \
--manifest-path $(2)/$(1)/Cargo.toml \
--target $(call RUST_TARGET_TRIPLE)
endef
@@ -99,7 +102,7 @@ else
define RUST_CARGO_BUILD
@echo "Building Rust code with cargo..."
NUTTX_INCLUDE_DIR=$(TOPDIR)/include:$(TOPDIR)/include/arch \
- cargo build -Zbuild-std=std,panic_abort \
+ cargo build -Zbuild-std=std,panic_abort -Zjson-target-spec \
--manifest-path $(2)/$(1)/Cargo.toml \
--target $(call RUST_TARGET_TRIPLE)
endef