From 2548b447f67ed7f3e492012ca14c9ab312887ce0 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Sun, 18 Nov 2018 20:57:21 -0800 Subject: [PATCH] Use prebuilt llvm-rs-cc for unbundled build Matches the make logic. Bug: 117295826 Test: tapas com.android.media && m Change-Id: Ie97220af9c72540d5f5cfd5f9f9e04f5edfea781 --- cc/rs.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cc/rs.go b/cc/rs.go index 7c9f5d389..5421b9252 100644 --- a/cc/rs.go +++ b/cc/rs.go @@ -16,13 +16,22 @@ package cc import ( "android/soong/android" + "path/filepath" + "runtime" "strings" "github.com/google/blueprint" ) func init() { - pctx.HostBinToolVariable("rsCmd", "llvm-rs-cc") + pctx.VariableFunc("rsCmd", func(ctx android.PackageVarContext) string { + if ctx.Config().UnbundledBuild() { + // Use RenderScript prebuilts for unbundled builds but not PDK builds + return filepath.Join("prebuilts/sdk/tools", runtime.GOOS, "bin/llvm-rs-cc") + } else { + return pctx.HostBinToolPath(ctx, "llvm-rs-cc").String() + } + }) } var rsCppCmdLine = strings.Replace(`