libgo patch committed: Update to Go1.12beta2

Uros Bizjak ubizjak@gmail.com
Tue Jan 22 08:46:00 GMT 2019


Hello!

> 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.

Uros.
-------------- next part --------------
diff --git a/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go b/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go
index 56b150b2b132..beb0b124b0e5 100644
--- a/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go
+++ b/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go
@@ -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(build.Default.Compiler, build.Default.GOARCH)


More information about the Gcc-patches mailing list