From f2f3b6cd8fbe9f823fd6946f055bb70c3ef6f9db Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 25 May 2016 13:24:36 +0200 Subject: [PATCH] cmd/link: fix ARM gold linker check CL 23400 introduced a check to make sure the gold linker is used on ARM host links. The check itself works, but the error checking logic was reversed; fix it. I manually verified that the check now correctly rejects host links on my RPi2 running an ancient rasbian without the gold linker installed. Updates #15696 Change-Id: I927832620f0a60e91a71fdedf8cbd2550247b666 Reviewed-on: https://go-review.googlesource.com/23421 Run-TryBot: Elias Naur Reviewed-by: David Crawshaw TryBot-Result: Gobot Gobot --- src/cmd/link/internal/ld/lib.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 3860287e67..da00de8547 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1142,7 +1142,7 @@ func hostlink() { // back to ld.bfd. So we parse the version information // and provide a useful error if gold is missing. cmd := exec.Command(extld, "-fuse-ld=gold", "-Wl,--version") - if out, err := cmd.CombinedOutput(); err != nil { + if out, err := cmd.CombinedOutput(); err == nil { if !bytes.Contains(out, []byte("GNU gold")) { log.Fatalf("ARM external linker must be gold (issue #15696), but is not: %s", out) } -- 2.50.0