Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions cmake/nuttx_add_rust.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ include(nuttx_parse_function_args)
# - riscv64: riscv64imac/imafdc-unknown-nuttx-elf
# - x86: i686-unknown-nuttx
# - x86_64: x86_64-unknown-nuttx
# - aarch64: aarch64-apple-darwin
# - aarch64: aarch64-unknown-nuttx-macho for sim on macOS,
# aarch64-unknown-nuttx otherwise
#
# Inputs:
# ARCHTYPE - Architecture type (e.g. thumbv7m, riscv32)
Expand All @@ -48,15 +49,17 @@ include(nuttx_parse_function_args)
# ~~~

function(nuttx_rust_target_triple ARCHTYPE ABITYPE CPUTYPE OUTPUT)
get_filename_component(APPDIR "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/.."
ABSOLUTE)
if(ARCHTYPE STREQUAL "x86_64")
set(TARGET_TRIPLE "${APPDIR}/tools/x86_64-unknown-nuttx.json")
set(TARGET_TRIPLE "${PROJECT_SOURCE_DIR}/tools/x86_64-unknown-nuttx.json")
elseif(ARCHTYPE STREQUAL "x86")
set(TARGET_TRIPLE "${APPDIR}/tools/i486-unknown-nuttx.json")
set(TARGET_TRIPLE "${PROJECT_SOURCE_DIR}/tools/i486-unknown-nuttx.json")
elseif(ARCHTYPE STREQUAL "aarch64")
if(APPLE)
set(TARGET_TRIPLE "aarch64-apple-darwin")
if(CONFIG_ARCH_SIM AND CONFIG_HOST_MACOS)
set(TARGET_TRIPLE
"${PROJECT_SOURCE_DIR}/tools/aarch64-unknown-nuttx-macho.json")
else()
set(TARGET_TRIPLE
"${PROJECT_SOURCE_DIR}/tools/aarch64-unknown-nuttx.json")
endif()
elseif(ARCHTYPE MATCHES "thumb")
if(ARCHTYPE MATCHES "thumbv8m")
Expand Down
11 changes: 8 additions & 3 deletions tools/Rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
# - thumbv8m.base: thumbv8m.base-nuttx-eabi, thumbv8m.base-nuttx-eabihf
# - riscv32: riscv32imc/imac/imafc-unknown-nuttx-elf
# - riscv64: riscv64imac/imafdc-unknown-nuttx-elf
# - aarch64: aarch64-unknown-nuttx-macho for sim on macOS,
# aarch64-unknown-nuttx otherwise
#
# Usage: $(call RUST_TARGET_TRIPLE)
#
Expand All @@ -47,13 +49,16 @@
define RUST_TARGET_TRIPLE
$(or \
$(and $(filter x86_64,$(LLVM_ARCHTYPE)), \
$(APPDIR)/tools/x86_64-unknown-nuttx.json \
$(TOPDIR)/tools/x86_64-unknown-nuttx.json \
), \
$(and $(filter x86,$(LLVM_ARCHTYPE)), \
$(APPDIR)/tools/i486-unknown-nuttx.json \
$(TOPDIR)/tools/i486-unknown-nuttx.json \
), \
$(and $(filter aarch64,$(LLVM_ARCHTYPE)), \
$(if $(filter y,$(CONFIG_HOST_MACOS)),aarch64-apple-darwin) \
$(if $(and $(filter sim,$(CONFIG_ARCH)),$(filter y,$(CONFIG_HOST_MACOS))), \
$(TOPDIR)/tools/aarch64-unknown-nuttx-macho.json, \
$(TOPDIR)/tools/aarch64-unknown-nuttx.json \
) \
), \
$(and $(filter thumb%,$(LLVM_ARCHTYPE)), \
$(if $(filter thumbv8m%,$(LLVM_ARCHTYPE)), \
Expand Down
33 changes: 0 additions & 33 deletions tools/i486-unknown-nuttx.json

This file was deleted.

36 changes: 0 additions & 36 deletions tools/x86_64-unknown-nuttx.json

This file was deleted.

Loading