theseus-os / rust

Fork of Rust to support Theseus OS targets and `std` atop Theseus. Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
0 stars 1 forks source link

Add `x86_64-unknown-theseus` target #1

Closed tsoutsman closed 2 years ago

tsoutsman commented 2 years ago

The target is based on Theseus/cfg/x86_64-theseus.json.

The difference between the existing .json file and new target spec can be viewed using cargo t --manifest-path compiler/rustc_target/Cargo.toml -- --nocapture and manually diffing the two debug outputs. The first is the original .json file, and the second is the updated target.

2c2
<     llvm_target: "x86_64-unknown-none-elf",
---
>     llvm_target: "x86_64-unknown-theseus",
66c66
<         has_thread_local: false,
---
>         has_thread_local: true,

has_thread_local was changed to true because as far as I understand, theseus supports thread locals. hermit sets llvm-target to "x86_64-unknown-hermit" (compiler/rustc_target/src/spec/x86_64_unknown_hermit.rs) so I don't think it matters.

Prior to merging, the following testing changes need to be reverted: