]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: support C-shared buildmode on macOS/ARM64
authorCherry Zhang <cherryyz@google.com>
Sun, 4 Oct 2020 03:58:29 +0000 (23:58 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 6 Oct 2020 22:56:00 +0000 (22:56 +0000)
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>
src/cmd/dist/test.go
src/cmd/internal/sys/supported.go
src/cmd/link/internal/ld/lib.go

index d37454c6519ced6adc1a1bf7c49b7c32246020e8..03e6866d620be3e981efeeda8b50f988ec480625 100644 (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":
index f97f663f2ac6168c2c65f06f91ac761ed32b48a2..8d87e95655f1741f438a3408fe014f51a8101b64 100644 (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
                }
index 9fb85becec93187ff36bb8b1db6d2d115eaa505b..5fe028d3219af3fff42d17a7b0d55ab78ec491f1 100644 (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")