Open Zoxc opened 1 month ago
Thanks for the report. As I understand it, -C linker-plugin-lto
is not compatible with dynamic linking on Windows. Is that what you are describing?
Could you also give a minimal repro of it with the error message, and also the expected behavior?
As I understand it,
-C linker-plugin-lto
is not compatible with dynamic linking on Windows. Is that what you are describing?
Yeah.
Could you also give a minimal repro of it with the error message, and also the expected behavior?
The expected behavior would be for Cargo to never pass -C linker-plugin-lto
to rustc
, as Cargo doesn't support linker plugin LTO. Currently rustc
will just miscompile as it doesn't have proper safeguards in place, so there's no error message.
Cargo incorrectly uses
-C linker-plugin-lto
to request bitcode only crates.
Would you mind sharing an exact setup of the Cargo package, including Cargo.toml, Cargo configuration, and the cargo invocations, so that we can reproduce it correctly?
You can use https://github.com/rust-lang/rust/issues/127979 for that.
Problem
Cargo incorrectly uses
-C linker-plugin-lto
to request bitcode only crates. That's not what-C linker-plugin-lto
is intended for. On Windows it has the additional effect of changing how crates a linked together, making it incorrect to mix crates not built with-C linker-plugin-lto
with ones which are.This is a contributing factor to https://github.com/rust-lang/rust/issues/127979.
Steps
No response
Possible Solution(s)
No response
Notes
No response
Version
No response