diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 53428bb1c6f..f6c7a0152bb 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1213,7 +1213,7 @@ func hostlink() { if err := ioutil.WriteFile(src, []byte{}, 0666); err != nil { Ctxt.Diag("WriteFile trivial.c failed: %v", err) } - cmd := exec.Command(argv[0], "-no-pie", "trivial.c") + cmd := exec.Command(argv[0], "-c", "-no-pie", "trivial.c") cmd.Dir = tmpdir out, err := cmd.CombinedOutput() supported := err == nil && !bytes.Contains(out, []byte("unrecognized"))