From 4d7a5edb7e476a321365151a3253395c25185341 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Wed, 16 Nov 2016 01:05:34 -0500 Subject: [PATCH] cmd/link/internal/ld: always show output from external linker Fixes #17935. Change-Id: I49b0f6cee29ea76ed62b8faa5d6d1f51be41bf84 Reviewed-on: https://go-review.googlesource.com/33301 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/link/internal/ld/lib.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 0f3b46d972f273..b69e3a60182978 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1260,7 +1260,9 @@ func (l *Link) hostlink() { if out, err := exec.Command(argv[0], argv[1:]...).CombinedOutput(); err != nil { Exitf("running %s failed: %v\n%s", argv[0], err, out) - } else if l.Debugvlog != 0 && len(out) > 0 { + } else if len(out) > 0 { + // always print external output even if the command is successful, so that we don't + // swallow linker warnings (see https://golang.org/issue/17935). l.Logf("%s", out) }