-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustc --test
ignores static:-whole-archive
link modifiers
#100066
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
This is a bug introduced in #95606. |
@dcsommer |
@petrochenkov Sure, I'll create a PR. I'm not sure what tests to include, however. I had been looking at that exact code and almost submitted a PR earlier, but I wasn't sure about the whole context of that code and all the compatibility needs. |
You can try adding a test case with |
Fix backwards-compatibility check for tests with `+whole-archive` Fixes rust-lang#100066
Fix backwards-compatibility check for tests with `+whole-archive` Fixes rust-lang#100066
Uh oh!
There was an error while loading. Please reload this page.
I am attempting to use the (now stabilized) RFC 2951 syntax to control how my test binary is compiled. I have created a repro at https://github.com/dcsommer/rustc-linking
In
run.sh
, I tellrustc
to link 2 static libraries, one with (+whole-archive) and one without (-whole-archive). I add a nonsense link argument so I can inspect the produced link line.I expect to see
libbar.a
linked without whole archive.Instead, I see both
foo
andbar
libraries linked with --whole-archive:This may be related to the default
+bundle
documented here. When I use nightly and specify-bundle
it works as expected:However, I cannot use the nightly toolchain, so I cannot use
-bundle
, and+bundle
seems inappropriate for a final binary crate types like cdylib, staticlib, and executables anyway.Tested with 1.62.1 stable and 1.64 nightly.
Possibly related issues: #99429, #73632
The text was updated successfully, but these errors were encountered: