diff options
| author | Joel Sing <joel@sing.id.au> | 2018-12-17 01:18:51 +1100 |
|---|---|---|
| committer | Joel Sing <joel@sing.id.au> | 2018-12-18 12:02:45 +0000 |
| commit | c52beb108779b8d983136fa5200ab91005c6de49 (patch) | |
| tree | ca2694faa55674db60001bdda1e95cf95ca67a8b /src/cmd/dist | |
| parent | 99e4ddd053fada36038f7fd4e7220d789e30e48a (diff) | |
| download | go-c52beb108779b8d983136fa5200ab91005c6de49.tar.xz | |
runtime,cmd/dist,cmd/link: add cgo support on openbsd/arm
Add support for cgo on openbsd/arm.The gcc shipped with base OpenBSD armv7
is old/inadequate, so use clang by default.
Change-Id: I945a26d369378952d357727718e69249411e1127
Reviewed-on: https://go-review.googlesource.com/c/154381
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/dist')
| -rw-r--r-- | src/cmd/dist/build.go | 2 | ||||
| -rw-r--r-- | src/cmd/dist/main.go | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index 8d7b14d17c..da677c81ad 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -1448,7 +1448,7 @@ var cgoEnabled = map[string]bool{ "netbsd/arm": true, "openbsd/386": true, "openbsd/amd64": true, - "openbsd/arm": false, + "openbsd/arm": true, "plan9/386": false, "plan9/amd64": false, "plan9/arm": false, diff --git a/src/cmd/dist/main.go b/src/cmd/dist/main.go index bf08869afb..bab8ab781a 100644 --- a/src/cmd/dist/main.go +++ b/src/cmd/dist/main.go @@ -65,6 +65,13 @@ func main() { case "freebsd": // Since FreeBSD 10 gcc is no longer part of the base system. defaultclang = true + case "openbsd": + // The gcc available on OpenBSD armv7 is old/inadequate (for example, lacks + // __sync_fetch_and_*/__sync_*_and_fetch) and will likely be removed in the + // not-to-distant future - use clang instead. + if runtime.GOARCH == "arm" { + defaultclang = true + } case "solaris": // Even on 64-bit platform, solaris uname -m prints i86pc. out := run("", CheckExit, "isainfo", "-n") |
