Use hermetic ckati/makeparallel prebuilts
Currently, we're building against the native host version of libc++ and
other headers. Instead, use prebuilts of ckati/makeparallel built with
Soong against the included libc++ and sysroot. Building ckati /
makeparallel doesn't work well in unbundled branches that don't have all
of the libc++ dependencies to do successful host builds.
KATI is default variable defined when running under Kati, don't use it
for other purposes. Use CKATI instead.
Bug: 27533820
Change-Id: I82d66f5e34e3341a3cee4c5c83cd1d9a54d057ff
diff --git a/core/config.mk b/core/config.mk
index 021a26e..85c850a 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -442,6 +442,8 @@
#
# Tools that are prebuilts for TARGET_BUILD_APPS
#
+prebuilt_sdk_tools := prebuilts/sdk/tools
+prebuilt_sdk_tools_bin := $(prebuilt_sdk_tools)/$(HOST_OS)/bin
ACP := $(HOST_OUT_EXECUTABLES)/acp
AIDL := $(HOST_OUT_EXECUTABLES)/aidl
@@ -455,13 +457,14 @@
DX := $(HOST_OUT_EXECUTABLES)/dx
MAINDEXCLASSES := $(HOST_OUT_EXECUTABLES)/mainDexClasses
+# Always use prebuilts for ckati and makeparallel
+CKATI := $(prebuilt_sdk_tools_bin)/ckati
+MAKEPARALLEL := $(prebuilt_sdk_tools_bin)/makeparallel
+
USE_PREBUILT_SDK_TOOLS_IN_PLACE := true
# Override the definitions above for unbundled and PDK builds
ifneq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)))
-prebuilt_sdk_tools := prebuilts/sdk/tools
-prebuilt_sdk_tools_bin := $(prebuilt_sdk_tools)/$(HOST_OS)/bin
-
ACP := $(prebuilt_sdk_tools_bin)/acp
AIDL := $(prebuilt_sdk_tools_bin)/aidl
AAPT := $(prebuilt_sdk_tools_bin)/aapt
@@ -479,6 +482,8 @@
BCC_COMPAT := $(prebuilt_sdk_tools_bin)/bcc_compat
endif # TARGET_BUILD_PDK
endif # TARGET_BUILD_APPS || TARGET_BUILD_PDK
+prebuilt_sdk_tools :=
+prebuilt_sdk_tools_bin :=
# ---------------------------------------------------------------