]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.regabi] cmd/compile: fix GOEXPERIMENT=regabi builder
authorMatthew Dempsky <mdempsky@google.com>
Wed, 13 Jan 2021 07:55:08 +0000 (23:55 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 13 Jan 2021 23:07:18 +0000 (23:07 +0000)
I misread the FIXME comment in InitLSym the first time. It's referring
to how InitLSym is supposed to be called exactly once per
function (see function documentation), but this is evidently not
actually the case currently in GOEXPERIMENT=regabi mode.

So just move the NeedFuncSym call below the GOEXPERIMENT=regabi
workaround.

Also, to fix the linux-arm64-{aws,packet} builders, move the call to
reflectdata.WriteFuncSyms() to after the second batch of functions are
compiled. This is necessary to make sure we catch all the funcsyms
that can be added by late function compilation.

Change-Id: I6d6396d48e2ee29c1fb007fa2b99e065b36375db
Reviewed-on: https://go-review.googlesource.com/c/go/+/283552
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/ssagen/abi.go

index 753db80f764b1d201284a28b6e71219320ff47ac..3e55b7688e8c94842de697b26ecd5441f1163367 100644 (file)
@@ -111,7 +111,6 @@ func dumpdata() {
        numDecls := len(typecheck.Target.Decls)
 
        dumpglobls(typecheck.Target.Externs)
-       staticdata.WriteFuncSyms()
        reflectdata.CollectPTabs()
        numExports := len(typecheck.Target.Exports)
        addsignats(typecheck.Target.Externs)
@@ -151,6 +150,7 @@ func dumpdata() {
                objw.Global(zero, int32(reflectdata.ZeroSize), obj.DUPOK|obj.RODATA)
        }
 
+       staticdata.WriteFuncSyms()
        addGCLocals()
 
        if numExports != len(typecheck.Target.Exports) {
index dc27ec3a29f47801f41cfaf054ace1b713e483d9..f1226f6a47f3273c57cfb7ffaae7ea64d5e5104b 100644 (file)
@@ -138,13 +138,12 @@ func ReadSymABIs(file, myimportpath string) {
 // For body-less functions, we only create the LSym; for functions
 // with bodies call a helper to setup up / populate the LSym.
 func InitLSym(f *ir.Func, hasBody bool) {
-       staticdata.NeedFuncSym(f.Sym())
-
        // FIXME: for new-style ABI wrappers, we set up the lsym at the
        // point the wrapper is created.
        if f.LSym != nil && base.Flag.ABIWrap {
                return
        }
+       staticdata.NeedFuncSym(f.Sym())
        selectLSym(f, hasBody)
        if hasBody {
                setupTextLSym(f, 0)