]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.8] cmd/link: do not pass -s through to host linker on macOS
authorRuss Cox <rsc@golang.org>
Thu, 30 Mar 2017 00:39:32 +0000 (20:39 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 5 Apr 2017 16:23:00 +0000 (16:23 +0000)
This keeps the host linker from printing
ld: warning: option -s is obsolete and being ignored

Fixes #19775.

Change-Id: I18dd4e4b3f59cbf35dad770fd65e6baea5a7347f
Reviewed-on: https://go-review.googlesource.com/38851
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/39606
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/link/internal/ld/lib.go

index 74d79d394c641fa59bf174825f5a3514b3a085fe..a6ec97a9f9b6f89b4b7634cc538345179b5093f9 100644 (file)
@@ -998,6 +998,10 @@ func (l *Link) hostlink() {
 
        if !*FlagS && !debug_s {
                argv = append(argv, "-gdwarf-2")
+       } else if Headtype == obj.Hdarwin {
+               // Recent versions of macOS print
+               //      ld: warning: option -s is obsolete and being ignored
+               // so do not pass any arguments.
        } else {
                argv = append(argv, "-s")
        }