From 528887cd2c1ebcda1a788ed2f060ffd1b4887801 Mon Sep 17 00:00:00 2001
From: Sui Chen <suichen6@gmail.com>
Date: Mon, 13 Jun 2022 17:46:49 +0000
Subject: [PATCH] Remove "check_build_deps" build steps

When building with Bitbake, we want Bitbake to manage our dependencies,
so we remove the "check_build_deps" steps from Perfetto.

Also setting "is_cross_compiling" to true, so that the host-side tools
(such as protoc) will always be generated using the native toolchain,
rather than the Bitbake-generated one.

Signed-off-by: Sui Chen <suichen6@gmail.com>
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
---
Upstream-Status: Pending

 gn/BUILD.gn                  |  1 -
 gn/standalone/BUILD.gn       | 20 ++++++++++----------
 gn/standalone/BUILDCONFIG.gn |  5 +++--
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 9ce3145cac..67656b6648 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -127,7 +127,6 @@ group("default_deps") {
   deps = [ ":gen_buildflags" ]
   if (perfetto_build_standalone) {
     public_deps = [
-      "//gn/standalone:check_build_deps",
       "//gn/standalone/libc++:deps",
       "//gn/standalone/sanitizers:deps",
     ]
diff --git a/gn/standalone/BUILD.gn b/gn/standalone/BUILD.gn
index 2d0a4b2916..740266a964 100644
--- a/gn/standalone/BUILD.gn
+++ b/gn/standalone/BUILD.gn
@@ -514,13 +514,13 @@ config("android_liblog") {
 }
 
 # Checks that tools/install-build-deps has been run since it last changed.
-perfetto_check_build_deps("check_build_deps") {
-  args = [ "--no-dev-tools" ]
-}
-
-perfetto_check_build_deps("check_build_deps_android") {
-  args = [
-    "--no-dev-tools",
-    "--android",
-  ]
-}
+#perfetto_check_build_deps("check_build_deps") {
+#  args = [ "--no-dev-tools" ]
+#}
+#
+#perfetto_check_build_deps("check_build_deps_android") {
+#  args = [
+#    "--no-dev-tools",
+#    "--android",
+#  ]
+#}
diff --git a/gn/standalone/BUILDCONFIG.gn b/gn/standalone/BUILDCONFIG.gn
index 8e2be2ae1b..0faff46e50 100644
--- a/gn/standalone/BUILDCONFIG.gn
+++ b/gn/standalone/BUILDCONFIG.gn
@@ -62,8 +62,9 @@ declare_args() {
   # the ossfuzz sanitizer overrides this to true. In that config the
   # host/target cpu and arch are identical, but we want to build only the
   # targets with the sanitizer/fuzzer flags
-  is_cross_compiling =
-      target_cpu != host_cpu || target_os != host_os || target_triplet != ""
+
+  # for Bitbake build
+  is_cross_compiling = true
 }
 default_configs = [
   "//gn/standalone:default",
-- 
2.43.0

