-
Notifications
You must be signed in to change notification settings - Fork 13.3k
linker: Implicitly link native libs as whole-archive in some more cases #95606
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
Conversation
if whole_archive == Some(true) | ||
|| (whole_archive == None && default_to_whole_archive(sess, crate_type, cmd)) | ||
// Backward compatibility case: this can be a rlib (so `+whole-archive` cannot | ||
// be added explicitly if necessary, see the error in `fn link_rlib`) compiled | ||
// as an executable due to `--test`. Use whole-archive implicitly, like before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we cannot determine whether it would be a rlib or not if --test
weren't passed, because the rlib-ness is typically specified by cargo.
#95561, for example still looks like an executable if we ignore --test
in fn collect_crate_types
.
Thanks for jumping on this so quickly! @bors r+ p=1 Fixing nightly regression |
📌 Commit a169d33 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ac4b345): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Partially revert changes from #93901 to address regressions like #95561.
Fixes #95561
r? @wesleywiser