libgo: support x32 as GOARCH=amd64p32 GOOS=linux

This is enough to let libgo build when configured using
    --with-multilib-list=m64,m32,mx32.  I don't have an x32-enabled kernel
    so I haven't tested whether it executes correctly.
    
    For https://gcc.gnu.org/PR87470
    
    Reviewed-on: https://go-review.googlesource.com/138817

From-SVN: r264772
This commit is contained in:
Ian Lance Taylor 2018-10-01 20:17:11 +00:00
parent 1b28253347
commit 44ef03008c
7 changed files with 38 additions and 5 deletions

View File

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

12
libgo/configure vendored
View File

@ -13685,7 +13685,19 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
GOARCH=386
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __ILP32__
#error x32
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
GOARCH=amd64
else
GOARCH=amd64p32
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;

View File

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

View File

@ -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"

View File

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

View File

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

View File

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