My project doesn't build since Rust 1.46.0, it builds fine with Rust 1.45.0 (and 1.44.0).
I've found that the linker (which is link.exe
on Windows) is invoked with /WHOLEARCHIVE:somelib.lib
where somelib.lib
is the external static library linked with the project (via cargo:rustc-link-lib=static=somelib.lib
). That means, before the linker is called with:
link.exe ... "somelib.lib" ...
now it is called with:
link.exe ... "somelib.lib" "/WHOLEARCHIVE:somelib.lib" ...
How can I disable the linker option /WHOLEARCHIVE:...
?