Linking error in rustc_llvm when using rustc_interface #87733
Labels
A-driver
Area: rustc_driver that ties everything together into the `rustc` compiler
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When executing
rustc test.rs
on the code below, linking fails.The linker error is:
I'm using the
nightly-x86_64-pc-windows-msvc
toolchain via rustup. The compiler version isrustc 1.56.0-nightly (4e282795d 2021-07-31)
. The link.exe version is14.21.27702.2
.See my next comment for the error displayed by lld.
I can reproduce this error using the following crate types:
proc-macro
,dylib
andcdylib
. Thestaticlib
,rlib
andbin
crate types do not fail.Linking also fails with
extern crate rustc_llvm
instead ofrustc_interface
.May be related to #81381.
All the failing cases can be solved by an additional
extern crate rustc_driver
. Is it possible to use rustc_interface without linking with rustc_driver? If not, is there a way to suggest to the user to add a dependency on rustc_driver? It was difficult for me to figure out that the error does not manifest when rustc_driver is used.The text was updated successfully, but these errors were encountered: