]> Cypherpunks repositories - gostls13.git/commitdiff
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>
Thu, 30 Mar 2017 02:45:45 +0000 (02:45 +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>
src/cmd/link/internal/ld/lib.go

index 7f056826c8a8bd17abc35f9bb42e712e9d229e28..548b797f14bbd5f1a7d37be7a48dd505685447d2 100644 (file)
@@ -1003,6 +1003,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")
        }