Build Go tools for arm
Test: prebuilts/build-tools/build-prebuilts.sh
Change-Id: I915be7bb7451f27fcd4beba5e6487da7a01639a6
diff --git a/android/arch.go b/android/arch.go
index 3cd6e4b..d6b2971 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -1553,7 +1553,7 @@
config.BuildOS = func() OsType {
switch runtime.GOOS {
case "linux":
- if Bool(config.productVariables.HostMusl) {
+ if Bool(config.productVariables.HostMusl) || runtime.GOARCH == "arm64" {
return LinuxMusl
}
return Linux
@@ -1565,11 +1565,25 @@
}()
config.BuildArch = func() ArchType {
- switch runtime.GOARCH {
- case "amd64":
- return X86_64
+ switch runtime.GOOS {
+ case "linux":
+ switch runtime.GOARCH {
+ case "amd64":
+ return X86_64
+ case "arm64":
+ return Arm64
+ default:
+ panic(fmt.Sprintf("unsupported arch: %s", runtime.GOARCH))
+ }
+ case "darwin":
+ switch runtime.GOARCH {
+ case "amd64":
+ return X86_64
+ default:
+ panic(fmt.Sprintf("unsupported arch: %s", runtime.GOARCH))
+ }
default:
- panic(fmt.Sprintf("unsupported Arch: %s", runtime.GOARCH))
+ panic(fmt.Sprintf("unsupported OS: %s", runtime.GOOS))
}
}()