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++.
This commit is contained in:
Augie Fackler
2026-03-04 15:48:08 -05:00
parent b90dc1e597
commit cbc711ea01
+2 -2
View File
@@ -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}");