mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
99e4ddd053
commit
c52beb1087
5 changed files with 85 additions and 4 deletions
|
|
@ -535,6 +535,12 @@ func (ctxt *Link) loadlib() {
|
|||
if *flagLibGCC == "" {
|
||||
*flagLibGCC = ctxt.findLibPathCmd("--print-libgcc-file-name", "libgcc")
|
||||
}
|
||||
if runtime.GOOS == "openbsd" && *flagLibGCC == "libgcc.a" {
|
||||
// On OpenBSD `clang --print-libgcc-file-name` returns "libgcc.a".
|
||||
// In this case we fail to load libgcc.a and can encounter link
|
||||
// errors - see if we can find libcompiler_rt.a instead.
|
||||
*flagLibGCC = ctxt.findLibPathCmd("--print-file-name=libcompiler_rt.a", "libcompiler_rt")
|
||||
}
|
||||
if *flagLibGCC != "none" {
|
||||
hostArchive(ctxt, *flagLibGCC)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue