On Wed, Sep 26, 2018 at 7:50 AM, H.J. Lu <hjl.to...@gmail.com> wrote: > On Mon, Sep 24, 2018 at 2:46 PM, Ian Lance Taylor <i...@golang.org> wrote: >> I've committed a patch to update libgo to the 1.11 release. As usual >> for these updates, the patch is too large to attach to this e-mail >> message. I've attached some of the more relevant directories. This >> update required some minor patches to the gotools directory and the Go >> testsuite, also included here. Bootstrapped and ran Go testsuite on >> x86_64-pc-linux-gnu. Committed to mainline. >> >> Ian >> >> 2018-09-24 Ian Lance Taylor <i...@golang.org> >> >> * Makefile.am (mostlyclean-local): Run chmod on check-go-dir to >> make sure it is writable. >> (check-go-tools): Likewise. >> (check-vet): Copy internal/objabi to check-vet-dir. >> * Makefile.in: Rebuild. > > When building with -mx32, I got > > /export/gnu/import/git/sources/gcc/libgo/go/runtime/malloc.go:309:44: > error: integer constant overflow > 309 | arenaBaseOffset uintptr = sys.GoarchAmd64 * (1 << 47) > | ^
Thanks. I fixed this problem by switching to using amd64p32 on x32. Bootstrapped and ran testsuite on x86_64-pc-linux-gnu using --with-multilib-list=m64,m32,mx32. However, I ran this on a kernel without x32 support, so while building succeeds, I couldn't actually run any tests. Let me know how they do. Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 264771) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -013a9e68c9a31f888733d46182d19f9e5d956f27 +2f56d51c6b3104242613c74b02fa6c63a2fe16c5 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/configure.ac =================================================================== --- libgo/configure.ac (revision 264648) +++ libgo/configure.ac (working copy) @@ -252,8 +252,13 @@ changequote([,])dnl #ifdef __x86_64__ #error 64-bit #endif], -[GOARCH=386], -[GOARCH=amd64]) + [GOARCH=386], + AC_COMPILE_IFELSE([ +#ifdef __ILP32__ +#error x32 +#endif], + [GOARCH=amd64], + [GOARCH=amd64p32])) ;; ia64-*-*) GOARCH=ia64 Index: libgo/go/hash/crc32/crc32_amd64p32.go =================================================================== --- libgo/go/hash/crc32/crc32_amd64p32.go (revision 264648) +++ libgo/go/hash/crc32/crc32_amd64p32.go (working copy) @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build ignore + package crc32 import "internal/cpu" Index: libgo/go/internal/syscall/unix/getrandom_linux_amd64p32.go =================================================================== --- libgo/go/internal/syscall/unix/getrandom_linux_amd64p32.go (nonexistent) +++ libgo/go/internal/syscall/unix/getrandom_linux_amd64p32.go (working copy) @@ -0,0 +1,9 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package unix + +// Linux getrandom system call number. +// See GetRandom in getrandom_linux.go. +const randomTrap uintptr = 0x40000000 + 318 Index: libgo/go/runtime/lfstack_32bit.go =================================================================== --- libgo/go/runtime/lfstack_32bit.go (revision 264648) +++ libgo/go/runtime/lfstack_32bit.go (working copy) @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build 386 arm nacl armbe m68k mips mipsle mips64p32 mips64p32le nios2 ppc s390 sh shbe sparc +// +build 386 amd64p32 arm nacl armbe m68k mips mipsle mips64p32 mips64p32le nios2 ppc s390 sh shbe sparc package runtime Index: libgo/goarch.sh =================================================================== --- libgo/goarch.sh (revision 264648) +++ libgo/goarch.sh (working copy) @@ -57,10 +57,15 @@ case $goarch in defaultphyspagesize=8192 pcquantum=4 ;; - amd64 | amd64p32) + amd64) family=AMD64 hugepagesize="1 << 21" ;; + amd64p32) + family=AMD64 + hugepagesize="1 << 21" + ptrsize=4 + ;; arm | armbe) family=ARM cachelinesize=32