Commit 0e34737c authored by Damien Neil's avatar Damien Neil

cmd/go: don't assume cc supports -gno-record-gcc-switches

NetBSD's C compiler appears to support -fdebug-prefix-map but
not -gno-record-gcc-switches. Remove assumption that support
for the former implies the latter.

Change-Id: Iecad9e4f497ea4edc1ce440010e6fe19dc3e0566
Reviewed-on: https://go-review.googlesource.com/19686Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 9a184b22
......@@ -2930,12 +2930,15 @@ func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string {
// Tell gcc not to include the work directory in object files.
if b.gccSupportsFlag("-fdebug-prefix-map=a=b") {
// -gno-record-gcc-switches is supported by all gcc/clang
// versions that support -fdebug-prefix-map.
a = append(a, "-gno-record-gcc-switches")
a = append(a, "-fdebug-prefix-map="+b.work+"=/tmp/go-build")
}
// Tell gcc not to include flags in object files, which defeats the
// point of -fdebug-prefix-map above.
if b.gccSupportsFlag("-gno-record-gcc-switches") {
a = append(a, "-gno-record-gcc-switches")
}
// On OS X, some of the compilers behave as if -fno-common
// is always set, and the Mach-O linker in 6l/8l assumes this.
// See https://golang.org/issue/3253.
......
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