Merge "Support setting target_sdk_version separately from sdk_version"
diff --git a/scripts/build-ndk-prebuilts.sh b/scripts/build-ndk-prebuilts.sh
index 0143d1e..81f8564 100755
--- a/scripts/build-ndk-prebuilts.sh
+++ b/scripts/build-ndk-prebuilts.sh
@@ -44,18 +44,6 @@
"Platform_version_active_codenames": ${PLATFORM_VERSION_ALL_CODENAMES},
"DeviceName": "generic_arm64",
- "DeviceArch": "arm64",
- "DeviceArchVariant": "armv8-a",
- "DeviceCpuVariant": "denver64",
- "DeviceAbi": [
- "arm64-v8a"
- ],
- "DeviceSecondaryArch": "arm",
- "DeviceSecondaryArchVariant": "armv7-a-neon",
- "DeviceSecondaryCpuVariant": "denver",
- "DeviceSecondaryAbi": [
- "armeabi-v7a"
- ],
"HostArch": "x86_64",
"Malloc_not_svelte": false,
"Safestack": false,
diff --git a/ui/build/path.go b/ui/build/path.go
index 52658ef..8260ff9 100644
--- a/ui/build/path.go
+++ b/ui/build/path.go
@@ -19,6 +19,7 @@
"io/ioutil"
"os"
"path/filepath"
+ "runtime"
"strings"
"github.com/google/blueprint/microfactory"
@@ -144,6 +145,13 @@
}
myPath, _ = filepath.Abs(myPath)
+
+ // Use the toybox prebuilts on linux
+ if runtime.GOOS == "linux" {
+ toyboxPath, _ := filepath.Abs("prebuilts/build-tools/toybox/linux-x86")
+ myPath = toyboxPath + string(os.PathListSeparator) + myPath
+ }
+
config.Environment().Set("PATH", myPath)
config.pathReplaced = true
}
diff --git a/ui/build/paths/config.go b/ui/build/paths/config.go
index e846b03..b4d76c4 100644
--- a/ui/build/paths/config.go
+++ b/ui/build/paths/config.go
@@ -25,6 +25,10 @@
// Whether to exit with an error instead of invoking the underlying tool.
Error bool
+
+ // Whether we use a toybox prebuilt for this tool. Since we don't have
+ // toybox for Darwin, we'll use the host version instead.
+ Toybox bool
}
var Allowed = PathConfig{
@@ -55,6 +59,13 @@
Error: true,
}
+var Toybox = PathConfig{
+ Symlink: false,
+ Log: true,
+ Error: true,
+ Toybox: true,
+}
+
func GetConfig(name string) PathConfig {
if config, ok := Configuration[name]; ok {
return config
@@ -138,8 +149,6 @@
"todos": Allowed,
"touch": Allowed,
"tr": Allowed,
- "true": Allowed,
- "uname": Allowed,
"uniq": Allowed,
"unix2dos": Allowed,
"unzip": Allowed,
@@ -166,10 +175,9 @@
"ld.gold": Forbidden,
"pkg-config": Forbidden,
- // We've got prebuilts of these
- //"dtc": Forbidden,
- //"lz4": Forbidden,
- //"lz4c": Forbidden,
+ // On linux we'll use the toybox version of these instead
+ "true": Toybox,
+ "uname": Toybox,
}
func init() {
@@ -177,5 +185,13 @@
Configuration["md5"] = Allowed
Configuration["sw_vers"] = Allowed
Configuration["xcrun"] = Allowed
+
+ // We don't have toybox prebuilts for darwin, so allow the
+ // host versions.
+ for name, config := range Configuration {
+ if config.Toybox {
+ Configuration[name] = Allowed
+ }
+ }
}
}