Commit 51e92d72 authored by Joel Sing's avatar Joel Sing Committed by Ian Lance Taylor

cmd/go: fix clang option handling

On OpenBSD -current, clang is available/installed as 'cc'. This means that
the existing clang check fails and the clang related flags are not enabled.
Fix this by enabling the clang flags if the compiler claims to support them.

Change-Id: I84d124d2409a10f87002c6cbfdb69b4c9a55981a
Reviewed-on: https://go-review.googlesource.com/60750Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 44e86bef
...@@ -3173,10 +3173,12 @@ func (b *Builder) ccompilerCmd(envvar, defcmd, objdir string) []string { ...@@ -3173,10 +3173,12 @@ func (b *Builder) ccompilerCmd(envvar, defcmd, objdir string) []string {
} }
} }
if strings.Contains(a[0], "clang") { // disable ASCII art in clang errors, if possible
// disable ASCII art in clang errors, if possible if b.gccSupportsFlag("-fno-caret-diagnostics") {
a = append(a, "-fno-caret-diagnostics") a = append(a, "-fno-caret-diagnostics")
// clang is too smart about command-line arguments }
// clang is too smart about command-line arguments
if b.gccSupportsFlag("-Qunused-arguments") {
a = append(a, "-Qunused-arguments") a = append(a, "-Qunused-arguments")
} }
......
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