aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorZach Riggle <riggle@google.com>2018-10-08 17:57:53 -0500
committerDmitry Vyukov <dvyukov@google.com>2018-10-10 11:54:53 +0200
commitf37861df632a8e4c78cb3f174820eb915efb7ae2 (patch)
tree64e7bfb118392e9fdc74331a8cc30044cbe2efb5 /sys
parent8b311eafa7f32ebcae67cdf5e16aa1ab3fc77e7f (diff)
targets: Use OS=linux when GOOS=android
This avoids the issue of "android" not having any registered configurations or syscalls / ioctls / etc, when built with GOOS=android. This occurs when building in Google3, since --config=android_arm64 selects the Android toolchain.
Diffstat (limited to 'sys')
-rw-r--r--sys/targets/targets.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index 98a2fa9d0..24fcd5392 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -302,8 +302,12 @@ func init() {
initTarget(target, OS, arch)
}
}
+ goos := runtime.GOOS
+ if goos == "android" {
+ goos = "linux"
+ }
for _, target := range List["test"] {
- target.CCompiler = List[runtime.GOOS][runtime.GOARCH].CCompiler
+ target.CCompiler = List[goos][runtime.GOARCH].CCompiler
}
}