authorbors <bors@rust-lang.org> 2025-08-07 23:29:58 UTC
committerbors <bors@rust-lang.org> 2025-08-07 23:29:58 UTC
loga980cd4311ae4b5bf9099d418e32643d068f1344
tree99cefa2c1322d9fc420b5513573c4ecbbcdfd3f8
parent2fd855fbfc8239285aa2d596f76a8cc75e17ce02
parentd37fae309d66ea337269eeb46a990f0675ad1684

Auto merge of #143807 - rperier:rustc_llvm_werror, r=cuviper

Pass -Werror when building the LLVM wrapper cc rust-lang/rust#109712

1 files changed, 10 insertions(+), 0 deletions(-)

compiler/rustc_llvm/build.rs+10
......@@ -171,6 +171,16 @@ fn main() {
171171 let cxxflags = output(&mut cmd);
172172 let mut cfg = cc::Build::new();
173173 cfg.warnings(false);
174
175 // Prevent critical warnings when we're compiling from rust-lang/rust CI,
176 // except on MSVC, as the compiler throws warnings that are only reported
177 // for this platform. See https://github.com/rust-lang/rust/pull/145031#issuecomment-3162677202
178 // FIXME(llvm22): It looks like the specific problem code has been removed
179 // in https://github.com/llvm/llvm-project/commit/e8fc808bf8e78a3c80d1f8e293a92677b92366dd,
180 // retry msvc once we bump our LLVM version.
181 if std::env::var_os("CI").is_some() && !target.contains("msvc") {
182 cfg.warnings_into_errors(true);
183 }
174184 for flag in cxxflags.split_whitespace() {
175185 // Ignore flags like `-m64` when we're doing a cross build
176186 if is_crossed && flag.starts_with("-m") {