-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
add support for the l4-bender linker on the x86_64-unknown-l4re-uclibc tier 3 target #85967
Conversation
Some changes occured to rustc_codegen_cranelift cc @bjorn3 |
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matthewjasper (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
1bbb9f7
to
f52fe68
Compare
fn control_flow_guard(&mut self) {} | ||
|
||
fn no_crt_objects(&mut self) {} | ||
} |
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.
The interface looks like more or less like an ld
linker, I'd suggest to avoid adding a new linker flavor for a start and reuse GccLinker
(especially given that the set of linker flavors accepted by -C linker-flavor
is a stable public interface).
The interface looks like more or less like an `ld` linker, I'd suggest to avoid adding a new linker flavor for a start and reuse `GccLinker` (especially given that the set of linker flavors accepted by `-C linker-flavor` is a stable public interface).
It is impossible to pass in arguments with spaces to the linker due to the way
how this is implemented for linkers in Rustc. I talked to Alex Crichton
@alexcrichton (hopefully the correct nick) a long time ago and the suggested
way has been to add a new variant. L4-bender is indeed internally using ld
but it `bends` the arguments and adds quite some things and custom options. If
I recall correctly, even the order of the arguments matters, something that
cannot be influenced from outside. One notable one is the `--` that separates
l4-bender arguments from ld arguments that are passed through. How should this
be done?
If a new linker flavour is really not an option, I would ask the compiler team
to resume the discussion on how to quote spaces in linker flags.
|
This comment has been minimized.
This comment has been minimized.
I think the points made here seem to give reasonable support for adding a new linker flavor for this case. |
I think the points made here seem to give reasonable support for adding a new linker flavor for this case.
Could we get some more support, e.g. by a rustc CI, to detect breakage
earlier? Or is this something that should be done on the L4Re side due to the
tier 3 support level?
|
I think the latter. My understanding of the tier 3 support level is that it is not meant to impose new burdens on the existing infrastructure. |
We discussed this in today's T-compiler weekly triage meeting. Some further review of the target tier policy led us to conclude that an MCP is not strictly required here. I'm going to double-check the points that @petrochenkov made about the linker, but I'm currently inclined to trust @humenda 's judgement here. Question for @humenda and @atopia : should either or both of you be recorded as maintainers for the x86_64-unknown-l4re-uclibc target? Is there anyone else who should also be on such a list of maintainers for the target? |
I'll look in more details, this all still look pretty suspicious to me. |
Here's the version of this PR, but without introducing a new linker flavor - petrochenkov@d3b02f3 Also, if there are some issues with passing arguments with whitespaces, then it's better to make a separate issue (with examples from practice, showing how they behave now, and how they should behave instead) and solve it once and for all, instead of introducing more hacks for specific targets. |
(I'd also suggest submitting the library changes separately, in that case they will get a more appropriate reviewer familiar with library conventions and will likely land faster.) |
r=me after squashing commits. |
- Fix style errors. - L4-bender does not yet support dynamic linking. - Stack unwinding is not yet supported for x86_64-unknown-l4re-uclibc. For now, just abort on panics. - Use GNU-style linker options where possible. As suggested by review: - Use standard GNU-style ld syntax for relro flags. - Use standard GNU-style optimization flags and logic. - Use standard GNU-style ld syntax for --subsystem. - Don't read environment variables in L4Bender linker. Thanks to CARGO_ENCODED_RUSTFLAGS introduced in rust-lang#9601, l4-bender's arguments can now be passed from the L4Re build system without resorting to custom parsing of environment variables.
f74ca9e
to
29d6235
Compare
@rustbot ready |
@bors r+ |
📌 Commit 29d6235 has been approved by |
…henkov add support for the l4-bender linker on the x86_64-unknown-l4re-uclibc tier 3 target This PR contains the work by `@humenda` to update support for the `x86_64-unknown-l4re-uclibc` tier 3 target (published at [humenda/rust](https://github.com/humenda/rust)), rebased and adapted to current rust in follow up commits by myself. The publishing of the rebased changes is authorized and preferred by the original author. As the goal was to distort the original work as little as possible, individual commits introduce changes that are incompatible to the newer code base that the changes were rebased on. These incompatibilities have been remedied in follow up commits, so that the PR as a whole should result in a clean update of the target. If you prefer another strategy to mainline these changes while preserving attribution, please let me know.
…henkov add support for the l4-bender linker on the x86_64-unknown-l4re-uclibc tier 3 target This PR contains the work by ``@humenda`` to update support for the `x86_64-unknown-l4re-uclibc` tier 3 target (published at [humenda/rust](https://github.com/humenda/rust)), rebased and adapted to current rust in follow up commits by myself. The publishing of the rebased changes is authorized and preferred by the original author. As the goal was to distort the original work as little as possible, individual commits introduce changes that are incompatible to the newer code base that the changes were rebased on. These incompatibilities have been remedied in follow up commits, so that the PR as a whole should result in a clean update of the target. If you prefer another strategy to mainline these changes while preserving attribution, please let me know.
…askrgr Rollup of 9 pull requests Successful merges: - rust-lang#85967 (add support for the l4-bender linker on the x86_64-unknown-l4re-uclibc tier 3 target) - rust-lang#92828 (Print a helpful message if unwinding aborts when it reaches a nounwind function) - rust-lang#93012 (Update pulldown-cmark version to fix markdown list issue) - rust-lang#93116 (Simplify use of `map_or`) - rust-lang#93132 (Increase the format version of rustdoc-json-types) - rust-lang#93147 (Interner cleanups) - rust-lang#93153 (Reject unsupported naked functions) - rust-lang#93170 (Add missing GUI test explanations) - rust-lang#93172 (rustdoc: remove dashed underline under main heading) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Update stdlib for the l4re target This PR contains the work by `@humenda` and myself to update standard library support for the x86_64-unknown-l4re-uclibc tier 3 target, split out from humenda/rust as requested in rust-lang#85967. The changes have been rebased on current master and updated in follow up commits by myself. The publishing of the changes is authorized and preferred by the original author. To preserve attribution, when standard library changes were introduced as part of other changes to the compiler, I have kept the changes concerning the standard library and altered the commit messages as indicated. Any incompatibilities have been remedied in follow up commits, so that the PR as a whole should result in a clean update of the target.
Update stdlib for the l4re target This PR contains the work by ``@humenda`` and myself to update standard library support for the x86_64-unknown-l4re-uclibc tier 3 target, split out from humenda/rust as requested in rust-lang#85967. The changes have been rebased on current master and updated in follow up commits by myself. The publishing of the changes is authorized and preferred by the original author. To preserve attribution, when standard library changes were introduced as part of other changes to the compiler, I have kept the changes concerning the standard library and altered the commit messages as indicated. Any incompatibilities have been remedied in follow up commits, so that the PR as a whole should result in a clean update of the target.
This PR contains the work by @humenda to update support for the
x86_64-unknown-l4re-uclibc
tier 3 target (published at humenda/rust), rebased and adapted to current rust in follow up commits by myself. The publishing of the rebased changes is authorized and preferred by the original author. As the goal was to distort the original work as little as possible, individual commits introduce changes that are incompatible to the newer code base that the changes were rebased on. These incompatibilities have been remedied in follow up commits, so that the PR as a whole should result in a clean update of the target.If you prefer another strategy to mainline these changes while preserving attribution, please let me know.