mirror of
https://github.com/golang/go.git
synced 2025-05-30 19:52:53 +00:00
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/19686 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
9a184b22ee
commit
0e34737c9a
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user