aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-03-29 20:39:32 -0400
committerRuss Cox <rsc@golang.org>2017-04-05 16:23:00 +0000
commit3a8841bcaf5e89bc3059ddbf251c1e9a533fdc95 (patch)
tree3cdc4ac4f8148cca8cd58562014c45b870864626
parent6c5abcf21a319e36419ef4b9e147f38ba9c84637 (diff)
downloadgo-3a8841bcaf5e89bc3059ddbf251c1e9a533fdc95.tar.gz
go-3a8841bcaf5e89bc3059ddbf251c1e9a533fdc95.zip
[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 <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>
-rw-r--r--src/cmd/link/internal/ld/lib.go4
1 files changed, 4 insertions, 0 deletions
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")
}