From 7b062482fbfcc7e1507a2124b5e3393e216900e7 Mon Sep 17 00:00:00 2001 From: wu-heng <41297446+wu-heng@users.noreply.github.com> Date: Mon, 23 Jul 2018 09:02:20 +0800 Subject: [PATCH 1/3] Update exec.go --- src/cmd/go/internal/work/exec.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index 5d3d2ef77fc21b..df0452b24fdfe4 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -714,6 +714,7 @@ func (b *Builder) build(a *Action) (err error) { } a.built = objpkg + a.Package.Shlib = "" return nil } From 93f882c0beff5f49da4f21daf844292400cb8465 Mon Sep 17 00:00:00 2001 From: wu-heng <41297446+wu-heng@users.noreply.github.com> Date: Mon, 23 Jul 2018 09:03:50 +0800 Subject: [PATCH 2/3] Update buildid.go --- src/cmd/go/internal/work/buildid.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/go/internal/work/buildid.go b/src/cmd/go/internal/work/buildid.go index 9a2528b9141676..3aa807756243a9 100644 --- a/src/cmd/go/internal/work/buildid.go +++ b/src/cmd/go/internal/work/buildid.go @@ -530,6 +530,7 @@ func (b *Builder) useCache(a *Action, p *load.Package, actionHash cache.ActionID } } a.built = file + a.Package.Shlib = "" a.Target = "DO NOT USE - using cache" a.buildID = buildID if p := a.Package; p != nil { From 1f5f489bbe40f149c890993190ebb8062129ae25 Mon Sep 17 00:00:00 2001 From: hengwu0 <41297446+hengwu0@users.noreply.github.com> Date: Thu, 28 Feb 2019 14:23:52 +0800 Subject: [PATCH 3/3] Fix mips64 instruction UNPREDICTABLE bug Replace `addu` with a `sll` instruction with a definite behavior (`sll` will discard the upper 32 bits of the 64 bits, then do sign extensions, with certain behavior). It won't have any UNPREDICTABLE expectation. --- src/cmd/internal/obj/mips/asm0.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cmd/internal/obj/mips/asm0.go b/src/cmd/internal/obj/mips/asm0.go index e4004be98d70c7..a21309a1ddeeda 100644 --- a/src/cmd/internal/obj/mips/asm0.go +++ b/src/cmd/internal/obj/mips/asm0.go @@ -1120,9 +1120,11 @@ func (c *ctxt0) asmout(p *obj.Prog, o *Optab, out []uint32) { case 1: /* mov r1,r2 ==> OR r1,r0,r2 */ a := AOR if p.As == AMOVW && c.ctxt.Arch.Family == sys.MIPS64 { - a = AADDU // sign-extended to high 32 bits - } - o1 = OP_RRR(c.oprrr(a), uint32(REGZERO), uint32(p.From.Reg), uint32(p.To.Reg)) + a = ASLL // sign-extended to high 32 bits + o1 = OP_RRR(c.oprrr(a), uint32(p.From.Reg), uint32(REGZERO), uint32(p.To.Reg)) + } else { + o1 = OP_RRR(c.oprrr(a), uint32(REGZERO), uint32(p.From.Reg), uint32(p.To.Reg)) + } case 2: /* add/sub r1,[r2],r3 */ r := int(p.Reg)