]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link/internal/ld: omit deprecated linker argument for iOS builds
authorElias Naur <elias.naur@gmail.com>
Tue, 27 Nov 2018 15:07:14 +0000 (16:07 +0100)
committerElias Naur <elias.naur@gmail.com>
Tue, 27 Nov 2018 15:21:22 +0000 (15:21 +0000)
After CL 151139 introduced a plugin test, the macOS linker for iOS
outputs:

ld: warning: -flat_namespace is deprecated on iOS

Omit the -flat_namespace flag on iOS; plugins are not supported on
iOS, and unlikely to ever be.

Change-Id: I2d08f8b984efcfd442d572b4a0f3a2c95c551b9f
Reviewed-on: https://go-review.googlesource.com/c/151300
Run-TryBot: Elias Naur <elias.naur@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/lib.go

index 458d7a43175d0dbabf627d5dd5dd2442577711f3..9b04e3ce11113c71027a34c16b68cd8e54f69e39 100644 (file)
@@ -1122,7 +1122,7 @@ func (ctxt *Link) hostlink() {
        switch ctxt.HeadType {
        case objabi.Hdarwin:
                argv = append(argv, "-Wl,-headerpad,1144")
-               if ctxt.DynlinkingGo() {
+               if ctxt.DynlinkingGo() && !ctxt.Arch.InFamily(sys.ARM, sys.ARM64) {
                        argv = append(argv, "-Wl,-flat_namespace")
                }
                if ctxt.BuildMode == BuildModeExe && !ctxt.Arch.InFamily(sys.ARM64) {