Commit 3034be60 authored by Russ Cox's avatar Russ Cox

[dev.garbage] all: merge dev.cc (723ca3789b88) into dev.garbage

Brings in Linux time signature fixes. Should fix build.

TBR=austin
CC=golang-codereviews
https://golang.org/cl/176870043
parents 0fcf54b3 2ceca80e
...@@ -498,7 +498,6 @@ span9(Link *ctxt, LSym *cursym) ...@@ -498,7 +498,6 @@ span9(Link *ctxt, LSym *cursym)
if(oprange[AANDN].start == nil) if(oprange[AANDN].start == nil)
buildop(ctxt); buildop(ctxt);
bflag = 0;
c = 0; c = 0;
p->pc = c; p->pc = c;
......
...@@ -256,9 +256,9 @@ Dconv(Fmt *fp) ...@@ -256,9 +256,9 @@ Dconv(Fmt *fp)
//if(v >= INITTEXT) //if(v >= INITTEXT)
// v -= INITTEXT-HEADR; // v -= INITTEXT-HEADR;
if(a->sym != nil) if(a->sym != nil)
sprint(str, "%s+%.5lux(BRANCH)", a->sym->name, v); sprint(str, "%s+%.5ux(BRANCH)", a->sym->name, v);
else else
sprint(str, "%.5lux(BRANCH)", v); sprint(str, "%.5ux(BRANCH)", v);
} else if(a->u.branch != nil) } else if(a->u.branch != nil)
sprint(str, "%lld", a->u.branch->pc); sprint(str, "%lld", a->u.branch->pc);
else if(a->sym != nil) else if(a->sym != nil)
...@@ -316,7 +316,7 @@ Mconv(Fmt *fp) ...@@ -316,7 +316,7 @@ Mconv(Fmt *fp)
if(a->offset != 0) if(a->offset != 0)
sprint(str, "%s+%lld(SB)", s->name, a->offset); sprint(str, "%s+%lld(SB)", s->name, a->offset);
else else
sprint(str, "%s(SB)", s->name, a->offset); sprint(str, "%s(SB)", s->name);
break; break;
case D_STATIC: case D_STATIC:
......
...@@ -202,7 +202,7 @@ addstacksplit(Link *ctxt, LSym *cursym) ...@@ -202,7 +202,7 @@ addstacksplit(Link *ctxt, LSym *cursym)
Prog *p, *q, *p1, *p2, *q1; Prog *p, *q, *p1, *p2, *q1;
int o, mov, aoffset; int o, mov, aoffset;
vlong textstksiz, textarg; vlong textstksiz, textarg;
int32 autoffset, autosize; int32 autosize;
if(ctxt->symmorestack[0] == nil) { if(ctxt->symmorestack[0] == nil) {
ctxt->symmorestack[0] = linklookup(ctxt, "runtime.morestack", 0); ctxt->symmorestack[0] = linklookup(ctxt, "runtime.morestack", 0);
...@@ -217,9 +217,6 @@ addstacksplit(Link *ctxt, LSym *cursym) ...@@ -217,9 +217,6 @@ addstacksplit(Link *ctxt, LSym *cursym)
p = cursym->text; p = cursym->text;
parsetextconst(p->to.offset, &textstksiz, &textarg); parsetextconst(p->to.offset, &textstksiz, &textarg);
autoffset = textstksiz;
if(autoffset < 0)
autoffset = 0;
cursym->args = p->to.offset>>32; cursym->args = p->to.offset>>32;
cursym->locals = textstksiz; cursym->locals = textstksiz;
......
...@@ -180,8 +180,8 @@ type timespec struct { ...@@ -180,8 +180,8 @@ type timespec struct {
tv_nsec int64 tv_nsec int64
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
type timeval struct { type timeval struct {
......
...@@ -185,8 +185,8 @@ type timespec struct { ...@@ -185,8 +185,8 @@ type timespec struct {
tv_nsec int32 tv_nsec int32
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = x ts.tv_sec = int32(x)
} }
type timeval struct { type timeval struct {
......
...@@ -196,8 +196,8 @@ type timespec struct { ...@@ -196,8 +196,8 @@ type timespec struct {
tv_nsec int64 tv_nsec int64
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
type timeval struct { type timeval struct {
......
...@@ -157,8 +157,8 @@ type timespec struct { ...@@ -157,8 +157,8 @@ type timespec struct {
pad_cgo_0 [4]byte pad_cgo_0 [4]byte
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
type timeval struct { type timeval struct {
......
...@@ -130,8 +130,8 @@ type timespec struct { ...@@ -130,8 +130,8 @@ type timespec struct {
tv_nsec int32 tv_nsec int32
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = x ts.tv_sec = int32(x)
} }
func (ts *timespec) set_nsec(x int32) { func (ts *timespec) set_nsec(x int32) {
......
...@@ -92,8 +92,8 @@ type timespec struct { ...@@ -92,8 +92,8 @@ type timespec struct {
tv_nsec int64 tv_nsec int64
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
func (ts *timespec) set_nsec(x int32) { func (ts *timespec) set_nsec(x int32) {
......
...@@ -84,8 +84,8 @@ type timespec struct { ...@@ -84,8 +84,8 @@ type timespec struct {
tv_nsec int32 tv_nsec int32
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = x ts.tv_sec = int32(x)
} }
func (ts *timespec) set_nsec(x int32) { func (ts *timespec) set_nsec(x int32) {
......
...@@ -138,8 +138,8 @@ type timespec struct { ...@@ -138,8 +138,8 @@ type timespec struct {
tv_nsec int32 tv_nsec int32
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
func (ts *timespec) set_nsec(x int32) { func (ts *timespec) set_nsec(x int32) {
......
...@@ -149,8 +149,8 @@ type timespec struct { ...@@ -149,8 +149,8 @@ type timespec struct {
tv_nsec int64 tv_nsec int64
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
func (ts *timespec) set_nsec(x int32) { func (ts *timespec) set_nsec(x int32) {
......
...@@ -50,9 +50,12 @@ func setup_auxv(argc int32, argv **byte) { ...@@ -50,9 +50,12 @@ func setup_auxv(argc int32, argv **byte) {
for i := 0; auxv[i] != _AT_NULL; i += 2 { for i := 0; auxv[i] != _AT_NULL; i += 2 {
switch auxv[i] { switch auxv[i] {
case _AT_RANDOM: // kernel provided 16-byte worth of random data case _AT_RANDOM: // kernel provides a pointer to 16-bytes worth of random data
if auxv[i+1] != 0 { if auxv[i+1] != 0 {
randomNumber = *(*uint32)(unsafe.Pointer(uintptr(auxv[i+1]))) // the pointer provided may not be word alined, so we must to treat it
// as a byte array.
rnd := (*[16]byte)(unsafe.Pointer(uintptr(auxv[i+1])))
randomNumber = uint32(rnd[0]) | uint32(rnd[1])<<8 | uint32(rnd[2])<<16 | uint32(rnd[3])<<24
} }
case _AT_PLATFORM: // v5l, v6l, v7l case _AT_PLATFORM: // v5l, v6l, v7l
......
...@@ -605,10 +605,11 @@ done: ...@@ -605,10 +605,11 @@ done:
} }
//go:nosplit //go:nosplit
func _sfloat2(pc uint32, regs *[15]uint32) { func _sfloat2(pc uint32, regs [15]uint32) (newpc uint32) {
systemstack(func() { systemstack(func() {
pc = sfloat2(pc, regs) newpc = sfloat2(pc, &regs)
}) })
return
} }
func _sfloatpanic() func _sfloatpanic()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment