rustc uses wrong build tools when compiling from MSVCΒ #133794
Closed
Description
opened on Dec 3, 2024
This is due to an issue in cc-rs
, rust-lang/cc-rs#1308, which is a dependency in rustc_llvm
/rustc_codegen_ssa
. There is a fix in progress (not yet released/merged): rust-lang/cc-rs#1310. This is a problem as of Rust 1.83.
The issue can be reproduced by creating a cargo workspace with an empty build.rs
, creating a new MSVC project within that workspace and running cargo build
from within the Pre-Build Event of that MSVC project. When targeting something other than the native arch, cargo/rustc will use the wrong build tools for linking or compilation.
I can provide more details/examples if necessary.
EDIT: This should be fixed on its own once cc
is updated.
Activity