From 371c83b594bf7af5a5b56f3ecfe1347e0b666dc2 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 29 Mar 2017 20:39:32 -0400 Subject: [PATCH] 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 --- src/cmd/link/internal/ld/lib.go | 4 ++++ 1 file changed, 4 insertions(+) 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") } -- 2.48.1