From cbc711ea01a0febedc3b5880afa1081dfda0a5b0 Mon Sep 17 00:00:00 2001 From: Augie Fackler Date: Wed, 4 Mar 2026 15:48:08 -0500 Subject: [PATCH] rustc_llvm: add missing `-` to flag-comparison logic The build script here wants to sniff for `-stdlib=libc++` but was missing the leading dashes. We caught this on the Rust/LLVM HEADs builder which also uses libc++. --- compiler/rustc_llvm/build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs index 7a1c95da29ea1..45d5bbd020f43 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs @@ -476,7 +476,7 @@ fn main() { // C++ runtime library if !target.contains("msvc") { if let Some(s) = llvm_static_stdcpp { - assert!(cxxflags_iter.all(|flag| flag != "stdlib=libc++")); + assert!(cxxflags_iter.all(|flag| flag != "-stdlib=libc++")); let path = PathBuf::from(s); println!("cargo:rustc-link-search=native={}", path.parent().unwrap().display()); if target.contains("windows") { @@ -484,7 +484,7 @@ fn main() { } else { println!("cargo:rustc-link-lib=static={stdcppname}"); } - } else if cxxflags_iter.any(|flag| flag == "stdlib=libc++") { + } else if cxxflags_iter.any(|flag| flag == "-stdlib=libc++") { println!("cargo:rustc-link-lib=c++"); } else { println!("cargo:rustc-link-lib={stdcppname}");