-
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
Enable lld explicitly for hexagon-unknown-linux-musl #115622
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
These commits modify compiler targets. |
Tested with the https://github.com/quic/toolchain_for_hexagon/releases/tag/v17.0.0-rc3 release of the toolchain.
29b4f94
to
584198d
Compare
@androm3da The second case is quite common for various targets, and targets typically don't put clang into the target spec in this case, people just specify it in In that second case the only change required from the hexagon target to make it clang-compatible would be removing the |
Typical use case would probably be for users to download the cross toolchain and use that as the linker frontend. Although at some point it might be nice to make it work well for the native toolchain use case, too.
Okay, I can make this change. |
Some more detail: I made this change because I got link errors from symbols that could be resolved to |
For all builtin calls emitted by the compiler there should be a definition in https://github.com/rust-lang/compiler-builtins (which is a Rust port/equivalent of compiler-rt). (That's why most targets use |
Gee -- most if not all of the target-specific builtins that I am thinking of for
Okay, so |
AFAIK, compiler-builtins pull some assembly (and C?) code from compiler-rt, so hexagon support may amount so some build system tweaks.
|
…nkov Allow target specs to use an LLD flavor, and self-contained linking components This PR allows: - target specs to use an LLD linker-flavor: this is needed to switch `x86_64-unknown-linux-gnu` to using LLD, and is currently not possible because the current flavor json serialization fails to roundtrip on the modern linker-flavors. This can e.g. be seen in rust-lang#115622 (comment) which explains where an `Lld::Yes` is ultimately deserialized into an `Lld::No`. - target specs to declare self-contained linking components: this is needed to switch `x86_64-unknown-linux-gnu` to using `rust-lld` - adds an end-to-end test of a custom target json simulating `x86_64-unknown-linux-gnu` being switched to using `rust-lld` - disables codegen backends from participating because they don't support `-Zgcc-ld=lld` which is the basis of mcp510. r? `@petrochenkov:` if the approach discussed rust-lang#115622 (comment) and on zulip would work for you: basically, see if we can emit only modern linker flavors in the json specs, but accept both old and new flavors while reading them, to fix the roundtrip issue. The backwards compatible `LinkSelfContainedDefault` variants are still serialized and deserialized in `crt-objects-fallback`, while the spec equivalent of e.g. `-Clink-self-contained=+linker` is serialized into a different json object (with future-proofing to incorporate `crt-objects-fallback` in the future). --- I've been test-driving this in rust-lang#113382 to test actually switching `x86_64-unknown-linux-gnu` to `rust-lld` (and fix what needs to be fixed in CI, bootstrap, etc), and it seems to work fine.
Allow target specs to use an LLD flavor, and self-contained linking components This PR allows: - target specs to use an LLD linker-flavor: this is needed to switch `x86_64-unknown-linux-gnu` to using LLD, and is currently not possible because the current flavor json serialization fails to roundtrip on the modern linker-flavors. This can e.g. be seen in rust-lang/rust#115622 (comment) which explains where an `Lld::Yes` is ultimately deserialized into an `Lld::No`. - target specs to declare self-contained linking components: this is needed to switch `x86_64-unknown-linux-gnu` to using `rust-lld` - adds an end-to-end test of a custom target json simulating `x86_64-unknown-linux-gnu` being switched to using `rust-lld` - disables codegen backends from participating because they don't support `-Zgcc-ld=lld` which is the basis of mcp510. r? `@petrochenkov:` if the approach discussed rust-lang/rust#115622 (comment) and on zulip would work for you: basically, see if we can emit only modern linker flavors in the json specs, but accept both old and new flavors while reading them, to fix the roundtrip issue. The backwards compatible `LinkSelfContainedDefault` variants are still serialized and deserialized in `crt-objects-fallback`, while the spec equivalent of e.g. `-Clink-self-contained=+linker` is serialized into a different json object (with future-proofing to incorporate `crt-objects-fallback` in the future). --- I've been test-driving this in rust-lang/rust#113382 to test actually switching `x86_64-unknown-linux-gnu` to `rust-lld` (and fix what needs to be fixed in CI, bootstrap, etc), and it seems to work fine.
@petrochenkov I think I understand it now -- I made some local change like this and it appears to build a
|
☔ The latest upstream changes (presumably #117716) made this pull request unmergeable. Please resolve the merge conflicts. |
ping from triage - can you post your status on this PR? This PR has not received an update in a few months. FYI: when a PR is ready for review, send a message containing Or if you're not going to continue, please close it. Thank you! |
Thanks for the reminder @JohnCSimon - I was waiting to see a stable release with my changes but that's not necessary. This PR is obsolete since d5c39d0 landed. The intent was to fix link errors due to unresolved symbols for compiler-emitted dependencies that would be resolved to |
Allow target specs to use an LLD flavor, and self-contained linking components This PR allows: - target specs to use an LLD linker-flavor: this is needed to switch `x86_64-unknown-linux-gnu` to using LLD, and is currently not possible because the current flavor json serialization fails to roundtrip on the modern linker-flavors. This can e.g. be seen in rust-lang/rust#115622 (comment) which explains where an `Lld::Yes` is ultimately deserialized into an `Lld::No`. - target specs to declare self-contained linking components: this is needed to switch `x86_64-unknown-linux-gnu` to using `rust-lld` - adds an end-to-end test of a custom target json simulating `x86_64-unknown-linux-gnu` being switched to using `rust-lld` - disables codegen backends from participating because they don't support `-Zgcc-ld=lld` which is the basis of mcp510. r? `@petrochenkov:` if the approach discussed rust-lang/rust#115622 (comment) and on zulip would work for you: basically, see if we can emit only modern linker flavors in the json specs, but accept both old and new flavors while reading them, to fix the roundtrip issue. The backwards compatible `LinkSelfContainedDefault` variants are still serialized and deserialized in `crt-objects-fallback`, while the spec equivalent of e.g. `-Clink-self-contained=+linker` is serialized into a different json object (with future-proofing to incorporate `crt-objects-fallback` in the future). --- I've been test-driving this in rust-lang/rust#113382 to test actually switching `x86_64-unknown-linux-gnu` to `rust-lld` (and fix what needs to be fixed in CI, bootstrap, etc), and it seems to work fine.
Allow target specs to use an LLD flavor, and self-contained linking components This PR allows: - target specs to use an LLD linker-flavor: this is needed to switch `x86_64-unknown-linux-gnu` to using LLD, and is currently not possible because the current flavor json serialization fails to roundtrip on the modern linker-flavors. This can e.g. be seen in rust-lang/rust#115622 (comment) which explains where an `Lld::Yes` is ultimately deserialized into an `Lld::No`. - target specs to declare self-contained linking components: this is needed to switch `x86_64-unknown-linux-gnu` to using `rust-lld` - adds an end-to-end test of a custom target json simulating `x86_64-unknown-linux-gnu` being switched to using `rust-lld` - disables codegen backends from participating because they don't support `-Zgcc-ld=lld` which is the basis of mcp510. r? `@petrochenkov:` if the approach discussed rust-lang/rust#115622 (comment) and on zulip would work for you: basically, see if we can emit only modern linker flavors in the json specs, but accept both old and new flavors while reading them, to fix the roundtrip issue. The backwards compatible `LinkSelfContainedDefault` variants are still serialized and deserialized in `crt-objects-fallback`, while the spec equivalent of e.g. `-Clink-self-contained=+linker` is serialized into a different json object (with future-proofing to incorporate `crt-objects-fallback` in the future). --- I've been test-driving this in rust-lang/rust#113382 to test actually switching `x86_64-unknown-linux-gnu` to `rust-lld` (and fix what needs to be fixed in CI, bootstrap, etc), and it seems to work fine.
Tested with the https://github.com/quic/toolchain_for_hexagon/releases/tag/v17.0.0-rc3 release of the toolchain.