With previous CLs, internal linking without cgo should work well.
Enable it by default. And stop always requiring cgo.
Enable tests that were previously disabled due to the lack of
internal linking.
Updates #38485.
Change-Id: I45125b9c263fd21d6847aa6b14ecaea3a2989b29
Reviewed-on: https://go-review.googlesource.com/c/go/+/265121
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
}
case "ios":
return true
- case "darwin":
- if cfg.BuildContext.GOARCH == "arm64" {
- return true
- }
}
// Currently build modes c-shared, pie (on systems that do not
if goarch != "arm64" {
return true
}
- case "darwin", "ios":
+ case "ios":
if goarch == "arm64" {
return true
}
}()
}
- if sys.MustLinkExternal(objabi.GOOS, objabi.GOARCH) && !(objabi.GOOS == "darwin" && objabi.GOARCH == "arm64") { // XXX allow internal linking for darwin/arm64 but not change the default
+ if sys.MustLinkExternal(objabi.GOOS, objabi.GOARCH) {
return true, fmt.Sprintf("%s/%s requires external linking", objabi.GOOS, objabi.GOARCH)
}
default:
if extNeeded || (iscgo && externalobj) {
ctxt.LinkMode = LinkExternal
- } else if ctxt.IsDarwin() && ctxt.IsARM64() {
- ctxt.LinkMode = LinkExternal // default to external linking for now
} else {
ctxt.LinkMode = LinkInternal
}
switch runtime.GOOS {
case "aix":
return false
- case "darwin":
- switch runtime.GOARCH {
- case "arm64":
- return false
- }
case "dragonfly":
return false
case "freebsd":
if runtime.GOARCH != "arm64" {
return false
}
- case "darwin", "ios":
+ case "ios":
if runtime.GOARCH == "arm64" {
return false
}
// run
// +build !nacl,!js
-// +build !darwin !arm64
-
-// Skip on darwin/arm64 as it requires external linking, which brings in
-// cgo, causing deadlock detection not working.
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// run
// +build !nacl,!js
-// +build !darwin !arm64
-
-// Skip on darwin/arm64 as it requires external linking, which brings in
-// cgo, causing deadlock detection not working.
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style