Commit 371c83b5 authored by Russ Cox's avatar Russ Cox

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 6e7d5d03
...@@ -1003,6 +1003,10 @@ func (l *Link) hostlink() { ...@@ -1003,6 +1003,10 @@ func (l *Link) hostlink() {
if !*FlagS && !debug_s { if !*FlagS && !debug_s {
argv = append(argv, "-gdwarf-2") 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 { } else {
argv = append(argv, "-s") argv = append(argv, "-s")
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment