Commit a0abecf1 authored by David Crawshaw's avatar David Crawshaw

cmd/link: ensure -fuse-ld=gold uses gold

Fixes #15696

Change-Id: I134e918dc56f79a72a04aa54f415371884113d2a
Reviewed-on: https://go-review.googlesource.com/23400Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 7b9d3ff4
......@@ -1137,6 +1137,16 @@ func hostlink() {
//
// In both cases, switch to gold.
argv = append(argv, "-fuse-ld=gold")
// If gold is not installed, gcc will silently switch
// 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 !bytes.Contains(out, []byte("GNU gold")) {
log.Fatalf("ARM external linker must be gold (issue #15696), but is not: %s", out)
}
}
}
}
......
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