]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: pass embedcfg to gccgo if supported
authorIan Lance Taylor <iant@golang.org>
Mon, 4 Jan 2021 22:06:29 +0000 (14:06 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 5 Jan 2021 23:13:49 +0000 (23:13 +0000)
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>
src/cmd/go/internal/work/gccgo.go

index 3ffd01c473b8100101970be351d86cd27813395f..45ff7c983837084c1387ca40f9f9877eda579046 100644 (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 {