Skip to content

Commit

Permalink
cmd/link: do not pass -s through to host linker on macOS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rsc committed Mar 30, 2017
1 parent 6e7d5d0 commit 371c83b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cmd/link/internal/ld/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 371c83b

Please sign in to comment.