-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
metadata: Ignore sysroot when doing the manual native lib search in rustc #138273
Merged
+46
−47
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some changes occurred in compiler/rustc_codegen_ssa |
@bors rollup=iffy |
@bors r+ |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 13, 2025
metadata: Ignore sysroot when doing the manual native lib search in rustc This is the opposite alternative to rust-lang#138170 and another way to make native library search consistent between rustc and linker. This way the directory list searched by rustc is still a prefix of the directory list considered by linker, but it's a shorter prefix than in rust-lang#138170. We can include the sysroot directories into rustc's search again later if the issues with rust-lang#138170 are resolved, it will be a backward compatible change. This may break some code doing weird things on unstable rustc, or tier 2-3 targets, like bundling `libunwind.a` or sanitizers into something. Note that this doesn't affect shipped `libc.a`, because it lives in `self-contained` directories in sysroot, and `self-contained` sysroot is already not included into the rustc's search. All libunwind and sanitizer libs should be moved to `self-contained` sysroot too eventually. With the consistent search directory list between rustc and linker we can make rustc own the native library search (at least for static libs) and use linker search only as a fallback (like in rust-lang#123436). This will allow addressing issues like rust-lang#132394 once and for all on all targets. r? `@bjorn3`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 13, 2025
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#126856 (remove deprecated tool `rls`) - rust-lang#133981 (rustdoc-json: Refractor and document Id's) - rust-lang#136842 (Add libstd support for Trusty targets) - rust-lang#137355 (Implement `read_buf` and vectored read/write for SGX stdio) - rust-lang#137457 (fix for issue 132802: x86 code in `wasm32-unknown-unknown` binaries) - rust-lang#138162 (Update the standard library to Rust 2024) - rust-lang#138273 (metadata: Ignore sysroot when doing the manual native lib search in rustc) - rust-lang#138346 (naked functions: on windows emit `.endef` without the symbol name) - rust-lang#138370 (Simulate OOM for the `try_oom_error` test) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 13, 2025
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#126856 (remove deprecated tool `rls`) - rust-lang#133981 (rustdoc-json: Refractor and document Id's) - rust-lang#136842 (Add libstd support for Trusty targets) - rust-lang#137355 (Implement `read_buf` and vectored read/write for SGX stdio) - rust-lang#138162 (Update the standard library to Rust 2024) - rust-lang#138273 (metadata: Ignore sysroot when doing the manual native lib search in rustc) - rust-lang#138346 (naked functions: on windows emit `.endef` without the symbol name) - rust-lang#138370 (Simulate OOM for the `try_oom_error` test) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 13, 2025
Rollup merge of rust-lang#138273 - petrochenkov:nonatroot, r=bjorn3 metadata: Ignore sysroot when doing the manual native lib search in rustc This is the opposite alternative to rust-lang#138170 and another way to make native library search consistent between rustc and linker. This way the directory list searched by rustc is still a prefix of the directory list considered by linker, but it's a shorter prefix than in rust-lang#138170. We can include the sysroot directories into rustc's search again later if the issues with rust-lang#138170 are resolved, it will be a backward compatible change. This may break some code doing weird things on unstable rustc, or tier 2-3 targets, like bundling `libunwind.a` or sanitizers into something. Note that this doesn't affect shipped `libc.a`, because it lives in `self-contained` directories in sysroot, and `self-contained` sysroot is already not included into the rustc's search. All libunwind and sanitizer libs should be moved to `self-contained` sysroot too eventually. With the consistent search directory list between rustc and linker we can make rustc own the native library search (at least for static libs) and use linker search only as a fallback (like in rust-lang#123436). This will allow addressing issues like rust-lang#132394 once and for all on all targets. r? ``@bjorn3``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the opposite alternative to #138170 and another way to make native library search consistent between rustc and linker.
This way the directory list searched by rustc is still a prefix of the directory list considered by linker, but it's a shorter prefix than in #138170.
We can include the sysroot directories into rustc's search again later if the issues with #138170 are resolved, it will be a backward compatible change.
This may break some code doing weird things on unstable rustc, or tier 2-3 targets, like bundling
libunwind.a
or sanitizers into something.Note that this doesn't affect shipped
libc.a
, because it lives inself-contained
directories in sysroot, andself-contained
sysroot is already not included into the rustc's search. All libunwind and sanitizer libs should be moved toself-contained
sysroot too eventually.With the consistent search directory list between rustc and linker we can make rustc own the native library search (at least for static libs) and use linker search only as a fallback (like in #123436). This will allow addressing issues like #132394 once and for all on all targets.
r? @bjorn3