-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustc --test
ignores static:-whole-archive
link modifiers
#100066
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
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: