From: Russ Cox Date: Thu, 30 Mar 2017 00:39:32 +0000 (-0400) Subject: cmd/link: do not pass -s through to host linker on macOS X-Git-Tag: go1.9beta1~919 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=371c83b594bf7af5a5b56f3ecfe1347e0b666dc2;p=gostls13.git cmd/link: do not pass -s through to host linker on macOS 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 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 7f056826c8..548b797f14 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -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") }