perfetto: fix compile on CI debug
The libstdc++ bundled in buster-backports really does not seem to get
along with the system clang-8 used on debug bots. Fix the issue by
instead using libc++ on the bot (which we newly install).
libstdc++ is still covered by the GCC bot: the clang + libstdc++
combo wasn't covered anyway before aosp/2281848 landed.
Change-Id: I6f9d752f38cdbdec06b89ce59809afce9b41647d
diff --git a/gn/standalone/BUILD.gn b/gn/standalone/BUILD.gn
index 52da358..0d17328 100644
--- a/gn/standalone/BUILD.gn
+++ b/gn/standalone/BUILD.gn
@@ -237,6 +237,11 @@
not_needed([ "hermetic_clang_suppressions" ])
}
+ if (is_clang && !is_hermetic_clang && !is_wasm) {
+ cflags_cc += [ "-stdlib=" + non_hermetic_clang_stdlib ]
+ ldflags += [ "-stdlib=" + non_hermetic_clang_stdlib ]
+ }
+
if (is_lto) {
cflags += [ "-flto=full" ]
ldflags += [ "-flto=full" ]
diff --git a/gn/standalone/toolchain/llvm.gni b/gn/standalone/toolchain/llvm.gni
index 75bc5ff..3726411 100644
--- a/gn/standalone/toolchain/llvm.gni
+++ b/gn/standalone/toolchain/llvm.gni
@@ -16,6 +16,11 @@
declare_args() {
is_hermetic_clang = is_clang && (is_linux_host || is_win_host)
+ if (is_linux_host) {
+ non_hermetic_clang_stdlib = "libstdc++"
+ } else {
+ non_hermetic_clang_stdlib = "libc++"
+ }
}
assert(!is_hermetic_clang || is_clang, "is_hermetic_clang requires is_clang")