1
0
mirror of https://github.com/golang/go synced 2024-11-17 06:04:47 -07:00

cmd/link: support C-shared buildmode on macOS/ARM64

It just works, after the plugin work.

Updates #38485.

Change-Id: I55aa11b380a33a729fccb731b77f48bc7d0dea2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/259443
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Zhang 2020-10-03 23:58:29 -04:00
parent 234de9e1c2
commit f8e554021b
3 changed files with 2 additions and 5 deletions

View File

@ -992,7 +992,7 @@ func (t *tester) supportedBuildmode(mode string) bool {
case "c-shared":
switch pair {
case "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-s390x",
"darwin-amd64",
"darwin-amd64", "darwin-arm64",
"freebsd-amd64",
"android-arm", "android-arm64", "android-386",
"windows-amd64", "windows-386":

View File

@ -69,7 +69,7 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
case "linux/amd64", "linux/arm", "linux/arm64", "linux/386", "linux/ppc64le", "linux/s390x",
"android/amd64", "android/arm", "android/arm64", "android/386",
"freebsd/amd64",
"darwin/amd64",
"darwin/amd64", "darwin/arm64",
"windows/amd64", "windows/386":
return true
}

View File

@ -1329,9 +1329,6 @@ func (ctxt *Link) hostlink() {
case BuildModeCShared:
if ctxt.HeadType == objabi.Hdarwin {
argv = append(argv, "-dynamiclib")
if ctxt.Arch.Family != sys.AMD64 {
argv = append(argv, "-Wl,-read_only_relocs,suppress")
}
} else {
// ELF.
argv = append(argv, "-Wl,-Bsymbolic")