From: Russ Cox Date: Thu, 30 Mar 2017 00:39:32 +0000 (-0400) Subject: [release-branch.go1.8] cmd/link: do not pass -s through to host linker on macOS X-Git-Tag: go1.8.1~20 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3a8841bcaf5e89bc3059ddbf251c1e9a533fdc95;p=gostls13.git [release-branch.go1.8] 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 Reviewed-on: https://go-review.googlesource.com/39606 TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 74d79d394c..a6ec97a9f9 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -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") }