On Tue, Jan 22, 2019 at 12:46 AM Uros Bizjak <ubiz...@gmail.com> wrote: > > > I have committed a patch to update libgo to the Go 1.12beta2 release. > > > > As usual this sort of update is too large to include all changes in > > this e-mail. I've included changes to gccgo-specific files below. > > > > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed > > to mainline. > > Attached patch is needed to prevent panic on alphaec68-linux-gnu when > building test harness in gotools directory. It substitutes one > instance of hardcoded "gc" with build.Default.Compiler in place where > archSizes are determined. Please note that there are other similar > cases, which don't trigger panics for me, but are suspicious, too: > > [uros@localhost golang.org]$ grep -R "\"gc\"" * > x/tools/go/analysis/unitchecker/unitchecker.go: Sizes: > types.SizesFor("gc", build.Default.GOARCH), // assume gccgo ≡ gc? > x/tools/go/analysis/passes/asmdecl/asmdecl.go: arch.sizes = > types.SizesFor("gc", arch.name) > x/tools/go/analysis/passes/asmdecl/asmdecl.go: > arch.sizes = types.SizesFor("gc", "amd64") > x/tools/go/analysis/passes/printf/types.go:var archSizes = > types.SizesFor("gc", build.Default.GOARCH) > x/tools/go/analysis/passes/cgocall/cgocall.go: Sizes: > types.SizesFor("gc", build.Default.GOARCH), > > Patch was regression tested on alphaev68-linux-gnu, and fixes a bunch > of panics in gotools directory.
Thanks. I committed the larger change to mainline, as follows. This updates all the calls, except for the one in the asmdecl pass, which is not applicable to gccgo anyhow. Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 268131) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -fb44f62e7c01ebc987dad78875f593da18100007 +e3271f3e09337b951822ba5c596d8cfe3b94508e The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go =================================================================== --- libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go (revision 268084) +++ libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go (working copy) @@ -271,7 +271,7 @@ func typeCheckCgoSourceFiles(fset *token return importMap[path], nil }), // TODO(adonovan): Sizes should probably be provided by analysis.Pass. - Sizes: types.SizesFor("gc", build.Default.GOARCH), + Sizes: types.SizesFor("gccgo", build.Default.GOARCH), Error: func(error) {}, // ignore errors (e.g. unused import) } Index: libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go =================================================================== --- libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go (revision 268084) +++ libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go (working copy) @@ -236,4 +236,4 @@ func matchStructArgType(pass *analysis.P return true } -var archSizes = types.SizesFor("gc", build.Default.GOARCH) +var archSizes = types.SizesFor("gccgo", build.Default.GOARCH) Index: libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go =================================================================== --- libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go (revision 268084) +++ libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go (working copy) @@ -125,4 +125,4 @@ var ( uintptrBitSize = 8 * archSizes.Sizeof(types.Typ[types.Uintptr]) ) -var archSizes = types.SizesFor("gc", build.Default.GOARCH) +var archSizes = types.SizesFor("gccgo", build.Default.GOARCH) Index: libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go =================================================================== --- libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go (revision 268084) +++ libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go (working copy) @@ -221,7 +221,7 @@ func run(fset *token.FileSet, cfg *Confi }) tc := &types.Config{ Importer: importer, - Sizes: types.SizesFor("gc", build.Default.GOARCH), // assume gccgo ≡ gc? + Sizes: types.SizesFor("gccgo", build.Default.GOARCH), // assume gccgo ≡ gc? } info := &types.Info{ Types: make(map[ast.Expr]types.TypeAndValue),