Re: [PATCH] libgo: Don't assume sys.GoarchAmd64 == 64-bit pointer

2018-10-01 Thread Ian Lance Taylor
"H.J. Lu" writes: > On Sat, Sep 29, 2018 at 9:01 PM Ian Lance Taylor wrote: >> >> "H.J. Lu" writes: >> >> > On x86-64, sys.GoarchAmd64 == 1 for -mx32. But -mx32 has 32-bit >> > pointer, not 64-bit. There is >> > >> > // _64bit = 1 on 64-bit systems, 0 on 32-bit systems >> > _64bit = 1 << (^ui

Re: [PATCH] libgo: Don't assume sys.GoarchAmd64 == 64-bit pointer

2018-09-30 Thread H.J. Lu
On Sat, Sep 29, 2018 at 9:01 PM Ian Lance Taylor wrote: > > "H.J. Lu" writes: > > > On x86-64, sys.GoarchAmd64 == 1 for -mx32. But -mx32 has 32-bit > > pointer, not 64-bit. There is > > > > // _64bit = 1 on 64-bit systems, 0 on 32-bit systems > > _64bit = 1 << (^uintptr(0) >> 63) / 2 > > > > We

Re: [PATCH] libgo: Don't assume sys.GoarchAmd64 == 64-bit pointer

2018-09-29 Thread Ian Lance Taylor
"H.J. Lu" writes: > On x86-64, sys.GoarchAmd64 == 1 for -mx32. But -mx32 has 32-bit > pointer, not 64-bit. There is > > // _64bit = 1 on 64-bit systems, 0 on 32-bit systems > _64bit = 1 << (^uintptr(0) >> 63) / 2 > > We should check both _64bit and sys.GoarchAmd64. Thanks, but I think the corr

[PATCH] libgo: Don't assume sys.GoarchAmd64 == 64-bit pointer

2018-09-29 Thread H.J. Lu
On x86-64, sys.GoarchAmd64 == 1 for -mx32. But -mx32 has 32-bit pointer, not 64-bit. There is // _64bit = 1 on 64-bit systems, 0 on 32-bit systems _64bit = 1 << (^uintptr(0) >> 63) / 2 We should check both _64bit and sys.GoarchAmd64. PR go/87470 * go/runtime/malloc.go (arenaBas