Build Go tools for arm
Test: prebuilts/build-tools/build-prebuilts.sh
Change-Id: I915be7bb7451f27fcd4beba5e6487da7a01639a6
diff --git a/ui/build/config.go b/ui/build/config.go
index a4f778d..94b0781 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -1117,11 +1117,18 @@
func (c *configImpl) PrebuiltOS() string {
switch runtime.GOOS {
case "linux":
- return "linux-x86"
+ switch runtime.GOARCH {
+ case "amd64":
+ return "linux-x86"
+ case "arm64":
+ return "linux-arm64"
+ default:
+ panic(fmt.Errorf("Unknown GOARCH %s", runtime.GOARCH))
+ }
case "darwin":
return "darwin-x86"
default:
- panic("Unknown GOOS")
+ panic(fmt.Errorf("Unknown GOOS %s", runtime.GOOS))
}
}
@@ -1711,13 +1718,7 @@
}
func (c *configImpl) HostPrebuiltTag() string {
- if runtime.GOOS == "linux" {
- return "linux-x86"
- } else if runtime.GOOS == "darwin" {
- return "darwin-x86"
- } else {
- panic("Unsupported OS")
- }
+ return c.PrebuiltOS()
}
func (c *configImpl) KatiBin() string {
diff --git a/ui/build/path.go b/ui/build/path.go
index cc1d7e9..b92d799 100644
--- a/ui/build/path.go
+++ b/ui/build/path.go
@@ -20,7 +20,6 @@
"os"
"os/exec"
"path/filepath"
- "runtime"
"strings"
"github.com/google/blueprint/microfactory"
@@ -122,7 +121,7 @@
myPath, _ = filepath.Abs(myPath)
// Set up the checked-in prebuilts path directory for the current host OS.
- prebuiltsPath, _ := filepath.Abs("prebuilts/build-tools/path/" + runtime.GOOS + "-x86")
+ prebuiltsPath, _ := filepath.Abs("prebuilts/build-tools/path/" + config.PrebuiltOS())
myPath = prebuiltsPath + string(os.PathListSeparator) + myPath
// Set $PATH to be the directories containing the host tool symlinks, and
@@ -258,7 +257,7 @@
// We put some prebuilts in $PATH, since it's infeasible to add dependencies
// for all of them.
- prebuiltsPath, _ := filepath.Abs("prebuilts/build-tools/path/" + runtime.GOOS + "-x86")
+ prebuiltsPath, _ := filepath.Abs("prebuilts/build-tools/path/" + config.PrebuiltOS())
myPath = prebuiltsPath + string(os.PathListSeparator) + myPath
// Replace the $PATH variable with the path_interposer symlinks, and