Skip to content

Commit 0b0d004

Browse files
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 <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 1b85e7c commit 0b0d004

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cmd/go/internal/work/gccgo.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ func (tools gccgoToolchain) gc(b *Builder, a *Action, archive string, importcfg,
9393
args = append(args, "-I", root)
9494
}
9595
}
96+
if embedcfg != nil && b.gccSupportsFlag(args[:1], "-fgo-embedcfg=/dev/null") {
97+
if err := b.writeFile(objdir+"embedcfg", embedcfg); err != nil {
98+
return "", nil, err
99+
}
100+
args = append(args, "-fgo-embedcfg="+objdir+"embedcfg")
101+
}
96102

97103
if b.gccSupportsFlag(args[:1], "-ffile-prefix-map=a=b") {
98104
if cfg.BuildTrimpath {

0 commit comments

Comments
 (0)