-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
riscv32imac-unknown-xous-elf: add target #97577
Conversation
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
|
This comment has been minimized.
This comment has been minimized.
To speed up the review process of this PR, you could directly add to your initial message the answers to the Tier 3 "Target tier policy". Example here #94872 (comment). As well as adding an entry in Btw, to fix the CI issue use |
da3d1ec
to
14c3d07
Compare
I expect the best place would be within your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but going to leave the r+ to someone more familiar with our tier policy and target support.
Sounds good. I've made those changes, and it also now passes CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, see the nits inline, r=me after.
@rustbot author
|
||
## Cross-compilation | ||
|
||
This target can be cross-compiled from any hosts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This target can be cross-compiled from any hosts. | |
This target can be cross-compiled from any host. |
@@ -1032,6 +1032,8 @@ supported_targets! { | |||
("x86_64-unknown-none", x86_64_unknown_none), | |||
|
|||
("mips64-openwrt-linux-musl", mips64_openwrt_linux_musl), | |||
|
|||
("riscv32imac-unknown-xous-elf", riscv32imac_unknown_xous_elf), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you group this alongside all the other riscv targets in this list?
// emit_debug_gdb_scripts: false, | ||
// eh_frame_header: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why it'd be worthwhile to keep these commented out? If not, consider just removing the lines.
Error: The "Author" shortcut only works on pull requests. Please let |
1 similar comment
Error: The "Author" shortcut only works on pull requests. Please let |
Xous is a microkernel operating system designed to run on small systems. The kernel contains a wide range of userspace processes that provide common services such as console output, networking, and time access. The kernel and its services are completely written in Rust using a custom build of libstd. This adds support for this target to upstream Rust so that we can drop support for our out-of-tree `target.json` file. Add a Tier 3 target for Xous running on RISC-V. Signed-off-by: Sean Cross <[email protected]>
Signed-off-by: Sean Cross <[email protected]>
Signed-off-by: Sean Cross <[email protected]>
@bors r+ Thanks! |
📌 Commit dc78970 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a2da4af): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
This PR starts the process of upstreaming support for our operating system, thanks to a suggestion from @yaahc on Twitter. We have maintained a fork of Rust and have made changes to improve support for our platform since Rust 1.51. Now we would like to upstream these changes.
Xous is a microkernel operating system designed to run on small systems. The kernel contains a wide range of userspace processes that provide common services such as console output, networking, and time access.
The kernel and its services are completely written in Rust using a custom build of libstd. This adds support for this target to upstream Rust so that we can drop support for our out-of-tree
target.json
file.This first patch adds a Tier 3 target for Xous running on RISC-V. Future patches will add libstd support, but those patches require changes to
dlmalloc
andcompiler_builtins
.I will be the target maintainer for this target on matters that pertain to the
xous
part of the triple. For matters pertaining to theriscv32imac
part of the triple, there should be no difference from all otherriscv
targets. If there are issues, I will address issues regarding the target.This is a new OS, so I have taken the
riscv32imac-unknown-none-elf
target and changed theos
section of the triple. This follows convention on targets such asriscv32gc-unknown-linux-gnu
andmipsel-unknown-linux-uclibc
. An argument could be made for omitting the-elf
section of the triple, such asriscv32imc-esp-espidf
, however I'm not certain what benefit that has.I feel that the target name does not introduce any ambiguity.
The only unusual requirement for building the
compiler-builtins
crate is a standard RISC-V C compiler supported bycc-rs
, and using this target does not require any additional software beyond what is shipped byrustup
.All of the additional code will use Apache-2.0.
Agreed, and there is no problem here.
The only new dependency will be the
xous
crate, which is licensedMIT OR Apache-2.0
Linking is performed by
rust-lld
There are no terms. Xous is completely open. It runs on open hardware. We even provide the source to the CPU.
This paragraph makes sense, but I don't think it's directed at me.
This paragraph also does not appear to be directed at me.
So far we have:
These will be merged as part of libstd in a future patch once I submit support for Xous in
dlmalloc
andcompiler-builtins
.Testing is currently done on real hardware or in a Renode emulator. I can add documentation on how to do this in a future patch, and I would need instructions on where to add said documentation.
Alright.
Sounds good.
This shouldn't affect any other targets, so this is understood.
This shouldn't come up right away.
xous
is a new operating system, and most features are keyed off oftarget(os = "xous")
rather than a given architecture.