-
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
Unresolved LLVM symbols when linking rustc_driver. #81381
Comments
@MarnixKuijs that looks like a version mismatch in the c++ standard library. Try updating your version of MSVC build tools. |
My MSVC build tools are the latest:
One problem that I faced was this. Which I circumvented by commenting out |
I have gone and tested MSVC v142,14.20..14.28 I even tried MSVC v141,14.16. All of them result in the same linker errors. |
This comment has been minimized.
This comment has been minimized.
There was some issues, nightly-2021-01-11-x86_64-pc-windows-msvc works for bootstrap, at least better works. |
I have tested with different bootstrap compilers, but nothing seems to effect anything |
I got the rustc_driver to link, by setting |
When building llvm from source it seems to default to
|
I'm getting an error similar to this, but using the |
I'm also experiencing linker errors related to llvm when building rustc_driver. Using |
…c` to get a compiler command line. When attempting to build rustc with LLVM on Windows, I noticed that the CRT flag provided to the C and C++ Compilers was inconsistent: ``` "-DCMAKE_C_FLAGS=-nologo -MT -Brepro" "-DCMAKE_CXX_FLAGS=-nologo -MD -Brepro" ``` Since the bootstrapper also sets the various `LLVM_USE_CRT` variables, this resulted in cl.exe reporting a bunch of warnings: ``` cl : Command line warning D9025 : overriding '/MD' with '/MT' ``` The root cause for this is that `cc_detect::find` was creating a `cc::Build` twice, but didn't set `static_crt` the second time. It's possible that this what is also causing rust-lang#81381
Ensure that `static_crt` is set in the bootstrapper whenever using `cc-rs` to get a compiler command line. When attempting to build rustc with LLVM on Windows, I noticed that the CRT flag provided to the C and C++ Compilers was inconsistent: ``` "-DCMAKE_C_FLAGS=-nologo -MT -Brepro" "-DCMAKE_CXX_FLAGS=-nologo -MD -Brepro" ``` Since the bootstrapper also sets the various `LLVM_USE_CRT` variables, this resulted in cl.exe reporting a bunch of warnings: ``` cl : Command line warning D9025 : overriding '/MD' with '/MT' ``` The root cause for this is that `cc_detect::find` was creating a `cc::Build` twice, but didn't set `static_crt` the second time. It's possible that this what is also causing rust-lang#81381
Ensure that `static_crt` is set in the bootstrapper whenever using `cc-rs` to get a compiler command line. When attempting to build rustc with LLVM on Windows, I noticed that the CRT flag provided to the C and C++ Compilers was inconsistent: ``` "-DCMAKE_C_FLAGS=-nologo -MT -Brepro" "-DCMAKE_CXX_FLAGS=-nologo -MD -Brepro" ``` Since the bootstrapper also sets the various `LLVM_USE_CRT` variables, this resulted in cl.exe reporting a bunch of warnings: ``` cl : Command line warning D9025 : overriding '/MD' with '/MT' ``` The root cause for this is that `cc_detect::find` was creating a `cc::Build` twice, but didn't set `static_crt` the second time. It's possible that this what is also causing rust-lang#81381
It's been a while - is anyone still running into this issue? |
I do not know if this helps you, but I've also come about the same linker error with a slightly different setup. In your issue, you fail to link against CRT symbols when the MSVC version ? linker tries to link Notably, switching the compiler from Clang to Clang-CL MSVC was the workaround fix for me. I mention this because If this is not useful, I do not wish to derail your issue at all. |
This issue is not tracking arbitrary "unresolved external symbols" errors. This is specifically about unresolved LLVM symbols when building rustc_driver. |
It's been a very long time since I have attempted it, so I'm not sure if it's still an issue. |
Closing this since there hasn't been a reproduction. |
The linking of
rustc_driver
will fail when using a custom llvm through thellvm-config
setting in theconfig.toml
.Meta
Backtrace
The text was updated successfully, but these errors were encountered: