tools/Rust.defs: Use 'gnu' target for Linux and 'darwin' for macOS

Summary:
- Updated `Rust.defs` to use `gnu` as the target for Linux systems and `darwin` for macOS systems
- This change aligns with Rust toolchain conventions, where `gnu` is used to declare the system environment rather than the actual ABI name (e.g., `sysv`)

Impact:
- No functional changes - the Rust toolchain interprets `gnu` correctly for Linux targets
- Improves consistency with Rust toolchain conventions and reduces potential confusion
- Maintains compatibility with existing Rust builds on Linux and macOS systems

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2025-01-27 22:43:38 +08:00 committed by Xiang Xiao
parent a2e8bb83a4
commit abcbb1eebd

View file

@ -38,13 +38,13 @@ ifeq ($(CONFIG_ARCH_SIM),y)
ifeq ($(CONFIG_HOST_LINUX),y)
ifeq ($(LLVM_ARCHTYPE),x86)
# Only for x86 based host or x64 but m32 build
RUSTFLAGS += --target i686-unknown-linux-$(LLVM_ABITYPE)
RUSTFLAGS += --target i686-unknown-linux-gnu
else
# For other archs, such as aarch64, arm etc
RUSTFLAGS += --target $(LLVM_ARCHTYPE)-unknown-linux-$(LLVM_ABITYPE)
RUSTFLAGS += --target $(LLVM_ARCHTYPE)-unknown-linux-gnu
endif
else ifeq ($(CONFIG_HOST_MACOS),y)
RUSTFLAGS += --target $(LLVM_ARCHTYPE)-apple-$(LLVM_ABITYPE)
RUSTFLAGS += --target $(LLVM_ARCHTYPE)-apple-darwin
endif
else ifeq ($(CONFIG_ARCH_RISCV),y)
# Target triple is riscv[32|64][isa]-unknown-none-elf