-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
linker: Avoid library duplication with /WHOLEARCHIVE
#84866
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
It's worth noting that the current behavior implied whole archive for all libraries passed, right? So this could regress code in theory? It seems OK to have the more limited and arguably correct behavior, though. @bors r+ |
📌 Commit 71c509b894dc67b152522d756ce3e9216cc95eef has been approved by |
No? In GNU syntax the previous behavior was |
Oh, I misread the PR description slightly - I thought we were currently emitting |
This comment has been minimized.
This comment has been minimized.
@bors r=Mark-Simulacrum |
📌 Commit fb9feb3 has been approved by |
…lacrum linker: Avoid library duplication with `/WHOLEARCHIVE` Looks like in rust-lang#72785 I misinterpreted how the `link.exe`'s `/WHOLEARCHIVE` flag works. It's not necessary to write `mylib /WHOLEARCHIVE:mylib` to mark `mylib` as whole archive, `/WHOLEARCHIVE:mylib` alone is enough. https://docs.microsoft.com/en-us/cpp/build/reference/wholearchive-include-all-library-object-files?view=msvc-160
…lacrum linker: Avoid library duplication with `/WHOLEARCHIVE` Looks like in rust-lang#72785 I misinterpreted how the `link.exe`'s `/WHOLEARCHIVE` flag works. It's not necessary to write `mylib /WHOLEARCHIVE:mylib` to mark `mylib` as whole archive, `/WHOLEARCHIVE:mylib` alone is enough. https://docs.microsoft.com/en-us/cpp/build/reference/wholearchive-include-all-library-object-files?view=msvc-160
Rollup of 9 pull requests Successful merges: - rust-lang#84254 (illumos should put libc last in library search order) - rust-lang#84442 (Unify rustc and rustdoc parsing of `cfg()`) - rust-lang#84655 (Cleanup of `wasm`) - rust-lang#84866 (linker: Avoid library duplication with `/WHOLEARCHIVE`) - rust-lang#84930 (rename LLVM target for RustyHermit) - rust-lang#84991 (rustc: Support Rust-specific features in -Ctarget-feature) - rust-lang#85029 (SGX mutex is movable) - rust-lang#85030 (Rearrange SGX split module files) - rust-lang#85033 (some further small cleanups) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Looks like in #72785 I misinterpreted how the
link.exe
's/WHOLEARCHIVE
flag works.It's not necessary to write
mylib /WHOLEARCHIVE:mylib
to markmylib
as whole archive,/WHOLEARCHIVE:mylib
alone is enough.https://docs.microsoft.com/en-us/cpp/build/reference/wholearchive-include-all-library-object-files?view=msvc-160