mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
apps/cmake: Fix aarch64 NuttX Rust target specs
Add aarch64 Rust target specs for NuttX, including a Mach-O variant for macOS sim builds. Use the NuttX custom targets instead of aarch64-apple-darwin so Rust std is built with target_os=nuttx while still producing link-compatible objects for sim. Signed-off-by: Shoji Tokunaga <toku@mac.com>
This commit is contained in:
parent
1081225509
commit
9796690b7b
4 changed files with 18 additions and 79 deletions
|
|
@ -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)
|
||||
#
|
||||
|
|
@ -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)), \
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
"arch": "x86",
|
||||
"cpu": "i486",
|
||||
"crt-objects-fallback": "false",
|
||||
"data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128",
|
||||
"features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float",
|
||||
"default-dwarf-version": 2,
|
||||
"dynamic-linking": true,
|
||||
"has-rpath": true,
|
||||
"has-thread-local": true,
|
||||
"linker-flavor": "gnu-lld",
|
||||
"llvm-target": "i486-unknown-nuttx",
|
||||
"max-atomic-width": 64,
|
||||
"metadata": {
|
||||
"description": "32-bit x86, resricted to i486",
|
||||
"host_tools": false,
|
||||
"std": true,
|
||||
"tier": 3
|
||||
},
|
||||
"no-default-libraries": true,
|
||||
"os": "nuttx",
|
||||
"position-independent-executables": false,
|
||||
"relro-level": "full",
|
||||
"rustc-abi": "x86-softfloat",
|
||||
"stack-probes": {
|
||||
"kind": "inline"
|
||||
},
|
||||
"target-family": [
|
||||
"unix"
|
||||
],
|
||||
"target-mcount": "__mcount",
|
||||
"target-pointer-width": 32
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
{
|
||||
"arch": "x86_64",
|
||||
"cpu": "x86-64",
|
||||
"crt-objects-fallback": "false",
|
||||
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
|
||||
"disable-redzone": true,
|
||||
"features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float",
|
||||
"linker": "rust-lld",
|
||||
"linker-flavor": "gnu-lld",
|
||||
"llvm-target": "x86_64-unknown-nuttx",
|
||||
"max-atomic-width": 64,
|
||||
"metadata": {
|
||||
"description": "x86_64 target for NuttX RTOS with softfloat",
|
||||
"host_tools": false,
|
||||
"std": true,
|
||||
"tier": 3
|
||||
},
|
||||
"panic-strategy": "abort",
|
||||
"plt-by-default": false,
|
||||
"position-independent-executables": true,
|
||||
"relro-level": "full",
|
||||
"rustc-abi": "x86-softfloat",
|
||||
"stack-probes": {
|
||||
"kind": "inline"
|
||||
},
|
||||
"static-position-independent-executables": true,
|
||||
"supported-sanitizers": [
|
||||
"kcfi",
|
||||
"kernel-address"
|
||||
],
|
||||
"os": "nuttx",
|
||||
"target-family": [
|
||||
"unix"
|
||||
],
|
||||
"target-pointer-width": 64
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue