Skip to content

Commit

Permalink
tools/Rust.defs: Use 'gnu' target for Linux and 'darwin' for macOS
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
no1wudi authored and xiaoxiang781216 committed Jan 28, 2025
1 parent a2e8bb8 commit abcbb1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/Rust.defs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit abcbb1e

Please sign in to comment.