-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Fails to link verbatim libary in 1.82 on macOS #132264
Comments
other crates using this lib crate will build successfully. it fails only for tests on the crate |
Looks like this was changed in #128400 to remove a backwards compatibility hack for tests. Maybe @petrochenkov could explain why it also affects verbatim? |
rust/compiler/rustc_codegen_ssa/src/back/linker.rs Lines 587 to 594 in 32b17d5
I found that rustc solves path for archive with I think it's very confusing that works for library crates and binary crates using them, but not working for test (or possibly binary crates with build.rs) builds. |
I don't think this is specific to I notice that |
…try> Apple: Fix direct linking with +verbatim Linking with `+verbatim` somewhat worked before, but only when the library was included as part of an rlib. Fixes rust-lang#132264. CC `@petrochenkov,` since you've worked on `+verbatim` before. `@rustbot` label O-apple A-linkage try-job: aarch64-apple try-job: x86_64-apple-2
…try> Apple: Fix direct linking with +verbatim Linking with `+verbatim` somewhat worked before, but only when the library was included as part of an rlib. Fixes rust-lang#132264. CC `@petrochenkov,` since you've worked on `+verbatim` before. `@rustbot` label O-apple A-linkage try-job: aarch64-apple try-job: x86_64-apple-2
Sorry I did not test that. |
Code
Full project to reproduce this bug is at https://github.com/anatawa12/rust-1.82-linker-regression
I tried to link .a file at
$OUT_DIR/testlib.a
with the followingbuild.rs
code.I ran
cargo +stable test
, linker reportedld: library 'testlib.a' not found
, but with rust 1.81.0 (cargo +1.81.0 test
) no linker error was reported.Rust 1.82.0 on linux works well AFAIK (not tested with this code above, but works with real-world case I found this regression)
full build log with verbose
Version it worked on
It most recently worked on: Rust 1.80 or 1.81 beta, and 1.81 stable on github actions
Version with regression
rustc --version --verbose
:Backtrace
No Compiler Crashes
Backtrace
The text was updated successfully, but these errors were encountered: