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 33d96e92e apps/tools: Enable Rust sim builds on Intel Macs
33d96e92e is described below

commit 33d96e92e5bef22196e6fc98bc41763480044656
Author: Shoji Tokunaga <[email protected]>
AuthorDate: Mon Jun 1 15:30:14 2026 +0900

    apps/tools: Enable Rust sim builds on Intel Macs
    
    Select the Mach-O Rust target (x86_64-unknown-nuttx-macho.json) when
    building Rust apps for the simulator on x86_64 macOS.
    
    Signed-off-by: Shoji Tokunaga <[email protected]>
---
 cmake/nuttx_add_rust.cmake | 10 ++++++++--
 tools/Rust.mk              | 10 +++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/cmake/nuttx_add_rust.cmake b/cmake/nuttx_add_rust.cmake
index 8978c84f3..54b17255b 100644
--- a/cmake/nuttx_add_rust.cmake
+++ b/cmake/nuttx_add_rust.cmake
@@ -34,7 +34,8 @@ include(nuttx_parse_function_args)
 #   - riscv32: riscv32imc/imac/imafc-unknown-nuttx-elf
 #   - riscv64: riscv64imac/imafdc-unknown-nuttx-elf
 #   - x86: i686-unknown-nuttx
-#   - x86_64: x86_64-unknown-nuttx
+#   - x86_64: x86_64-unknown-nuttx-macho for sim on macOS,
+#              x86_64-unknown-nuttx otherwise
 #   - aarch64: aarch64-unknown-nuttx-macho for sim on macOS,
 #              aarch64-unknown-nuttx otherwise
 #
@@ -50,7 +51,12 @@ include(nuttx_parse_function_args)
 
 function(nuttx_rust_target_triple ARCHTYPE ABITYPE CPUTYPE OUTPUT)
   if(ARCHTYPE STREQUAL "x86_64")
-    set(TARGET_TRIPLE "${PROJECT_SOURCE_DIR}/tools/x86_64-unknown-nuttx.json")
+    if(CONFIG_ARCH_SIM AND CONFIG_HOST_MACOS)
+      set(TARGET_TRIPLE
+          "${PROJECT_SOURCE_DIR}/tools/x86_64-unknown-nuttx-macho.json")
+    else()
+      set(TARGET_TRIPLE 
"${PROJECT_SOURCE_DIR}/tools/x86_64-unknown-nuttx.json")
+    endif()
   elseif(ARCHTYPE STREQUAL "x86")
     set(TARGET_TRIPLE "${PROJECT_SOURCE_DIR}/tools/i486-unknown-nuttx.json")
   elseif(ARCHTYPE STREQUAL "aarch64")
diff --git a/tools/Rust.mk b/tools/Rust.mk
index 80abe2970..06b65f7c5 100644
--- a/tools/Rust.mk
+++ b/tools/Rust.mk
@@ -27,7 +27,8 @@
 #
 # Supported architectures and their target triples:
 #   - x86: i686-unknown-nuttx
-#   - x86_64: x86_64-unknown-nuttx
+#   - x86_64: x86_64-unknown-nuttx-macho for sim on macOS,
+#              x86_64-unknown-nuttx otherwise
 #   - armv7a: armv7a-nuttx-eabi, armv7a-nuttx-eabihf
 #   - thumbv6m: thumbv6m-nuttx-eabi
 #   - thumbv7a: thumbv7a-nuttx-eabi, thumbv7a-nuttx-eabihf
@@ -49,13 +50,16 @@
 define RUST_TARGET_TRIPLE
 $(or \
   $(and $(filter x86_64,$(LLVM_ARCHTYPE)), \
-    $(TOPDIR)/tools/x86_64-unknown-nuttx.json \
+    $(if $(and $(filter y,$(CONFIG_ARCH_SIM)),$(filter 
y,$(CONFIG_HOST_MACOS))), \
+      $(TOPDIR)/tools/x86_64-unknown-nuttx-macho.json, \
+      $(TOPDIR)/tools/x86_64-unknown-nuttx.json \
+    ) \
   ), \
   $(and $(filter x86,$(LLVM_ARCHTYPE)), \
     $(TOPDIR)/tools/i486-unknown-nuttx.json \
   ), \
   $(and $(filter aarch64,$(LLVM_ARCHTYPE)), \
-    $(if $(and $(filter sim,$(CONFIG_ARCH)),$(filter y,$(CONFIG_HOST_MACOS))), 
\
+    $(if $(and $(filter y,$(CONFIG_ARCH_SIM)),$(filter 
y,$(CONFIG_HOST_MACOS))), \
       $(TOPDIR)/tools/aarch64-unknown-nuttx-macho.json, \
       $(TOPDIR)/tools/aarch64-unknown-nuttx.json \
     ) \

Reply via email to