mirror of
https://github.com/rust-lang/rust.git
synced 2026-07-28 02:22:18 -04:00
Filter host libstdc++ ABI flag in rustc_llvm cross builds
This commit is contained in:
@@ -160,6 +160,12 @@ impl<'a> IntoIterator for &'a LlvmConfigOutput {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_libstdcxx_cxx11_abi_flag(flag: &str) -> bool {
|
||||
flag == "-D_GLIBCXX_USE_CXX11_ABI"
|
||||
|| flag.starts_with("-D_GLIBCXX_USE_CXX11_ABI=")
|
||||
|| flag == "-U_GLIBCXX_USE_CXX11_ABI"
|
||||
}
|
||||
|
||||
fn main() {
|
||||
if cfg!(feature = "check_only") {
|
||||
return;
|
||||
@@ -255,6 +261,14 @@ fn main() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// This is a libstdc++ implementation detail for the C++ library that
|
||||
// built the runnable llvm-config. When cross-compiling, target LLVM may
|
||||
// have been built against a target libstdc++ with a different default.
|
||||
// Let the target compiler/toolchain select its ABI instead.
|
||||
if is_crossed && is_libstdcxx_cxx11_abi_flag(flag.as_ref()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if flag.starts_with("-flto") {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user