1
0
mirror of https://github.com/golang/go synced 2024-11-17 20:54:48 -07:00

cmd/go: pass embedcfg to gccgo if supported

For #41191

Change-Id: I75d327759c3d9ef061c19a80b9b2619038dedf68
Reviewed-on: https://go-review.googlesource.com/c/go/+/281492
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
Ian Lance Taylor 2021-01-04 14:06:29 -08:00
parent 1b85e7c057
commit 0b0d004983

View File

@ -93,6 +93,12 @@ func (tools gccgoToolchain) gc(b *Builder, a *Action, archive string, importcfg,
args = append(args, "-I", root)
}
}
if embedcfg != nil && b.gccSupportsFlag(args[:1], "-fgo-embedcfg=/dev/null") {
if err := b.writeFile(objdir+"embedcfg", embedcfg); err != nil {
return "", nil, err
}
args = append(args, "-fgo-embedcfg="+objdir+"embedcfg")
}
if b.gccSupportsFlag(args[:1], "-ffile-prefix-map=a=b") {
if cfg.BuildTrimpath {