cmd/link: support plugin on macOS/ARM64

Updates #38485.

Change-Id: I8295f7fad55b1f9701162f9d2902b3499137c64d
Reviewed-on: https://go-review.googlesource.com/c/go/+/259441
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Zhang 2020-10-03 16:26:37 -04:00
parent 3923460dda
commit 7d6b304f12
6 changed files with 62 additions and 36 deletions

View file

@ -1254,7 +1254,9 @@ func (ctxt *Link) hostlink() {
// -headerpad is incompatible with -fembed-bitcode.
argv = append(argv, "-Wl,-headerpad,1144")
}
if ctxt.DynlinkingGo() && !ctxt.Arch.InFamily(sys.ARM, sys.ARM64) {
if ctxt.DynlinkingGo() && objabi.GOOS != "ios" {
// -flat_namespace is deprecated on iOS.
// It is useful for supporting plugins. We don't support plugins on iOS.
argv = append(argv, "-Wl,-flat_namespace")
}
if !combineDwarf {