diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca372dd4..8119429c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,8 @@ jobs: rustup target add thumbv7em-none-eabi rustup target add thumbv7m-none-eabi rustup target add thumbv8m.main-none-eabi + rustup target add x86_64-unknown-none + rustup target add aarch64-unknown-none # Note that Renode is only provided for x86_64 targets. This matches the github runners. - name: Install Renode diff --git a/CMakeLists.txt b/CMakeLists.txt index 21c88e57..1009a159 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,10 @@ function(_rust_map_target) else() message(FATAL_ERROR "Rust: Unsupported riscv ISA") endif() + elseif(CONFIG_ARCH_POSIX AND CONFIG_64BIT AND (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64")) + set(RUST_TARGET "x86_64-unknown-none" PARENT_SCOPE) + elseif(CONFIG_ARCH_POSIX AND CONFIG_64BIT AND (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "aarch64")) + set(RUST_TARGET "aarch64-unknown-none" PARENT_SCOPE) else() message(FATAL_ERROR "Rust: Add support for other target") endif() diff --git a/Kconfig b/Kconfig index 4952d773..0b2d057b 100644 --- a/Kconfig +++ b/Kconfig @@ -8,7 +8,8 @@ menu "Rust Language Support" config RUST_SUPPORTED bool default y if ((CPU_CORTEX_M || \ - (RISCV && !RISCV_ISA_RV32E && !RISCV_ISA_RV128I)) && \ + (RISCV && !RISCV_ISA_RV32E && !RISCV_ISA_RV128I) || \ + (ARCH_POSIX && 64BIT)) && \ !TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) help Selected for platforms that have support for Rust. diff --git a/dt-rust.yaml b/dt-rust.yaml index 8eb8db92..c848277d 100644 --- a/dt-rust.yaml +++ b/dt-rust.yaml @@ -45,6 +45,7 @@ - "nordic,nrf52-flash-controller" - "nordic,nrf51-flash-controller" - "raspberrypi,pico-flash-controller" + - "zephyr,sim-flash" level: 0 actions: - type: instance