-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustc --test -l static=somelib.a links with --whole-archive #116910
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@petrochenkov @lqd @bjorn3 or whoever wants to look at linkage troubles today |
Looks like it is a back compat hack: rust/compiler/rustc_codegen_ssa/src/back/link.rs Lines 2471 to 2478 in a01382d
|
Not sure to understand why tests are special, but it's intentional from #95606 indeed. Feels like a bad workaround for missing +whole-archive modifiers in some projects? |
My reading from the code comment is that you can't aren't allowed to use |
Why is that not allowed? That would be the root issue then? |
It seems like |
The |
Fixed in #128400. |
linker: Remove the "`--whole-archive` in test mode" backcompat hack Fixes rust-lang#116910.
linker: Remove the "`--whole-archive` in test mode" backcompat hack Fixes rust-lang#116910.
linker: Remove the "`--whole-archive` in test mode" backcompat hack Fixes rust-lang/rust#116910.
linker: Remove the "`--whole-archive` in test mode" backcompat hack Fixes rust-lang/rust#116910.
Originally reported as #116900, but the actual bug affects every libraries and platforms.
rustc --test -l static:+verbatim=libsomelib.a
generates the linker command-Wl,--whole-archive -l:libsomelib.a -Wl,--no-whole-archive
. Without--test
it correctly doesn't link whole archive.It is expected to link whole archive only if passing
+whole-archive
modifier.The text was updated successfully, but these errors were encountered: