From 4f8e688afc2506eddabbd279978474b42330dbde Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 7 Aug 2016 22:32:46 +0000 Subject: [PATCH] internal/syscall/unix: fix syscalls for alpha, ia64, s390 Also change the configure script to set GOARCH correctly for ia64, and add ia64 as a processor to match.sh and gotest. Reviewed-on: https://go-review.googlesource.com/25549 From-SVN: r239225 --- gcc/go/gofrontend/MERGE | 2 +- libgo/configure | 23 +++++++++++++++++-- libgo/configure.ac | 6 +++++ .../syscall/unix/getrandom_linux_alpha.go | 9 ++++++++ .../syscall/unix/getrandom_linux_ia64.go | 9 ++++++++ .../syscall/unix/getrandom_linux_s390.go | 9 ++++++++ libgo/match.sh | 4 ++-- libgo/testsuite/gotest | 4 ++-- 8 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 libgo/go/internal/syscall/unix/getrandom_linux_alpha.go create mode 100644 libgo/go/internal/syscall/unix/getrandom_linux_ia64.go create mode 100644 libgo/go/internal/syscall/unix/getrandom_linux_s390.go diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 4128898c484..a5d7f51f1ad 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -b50a0c3fa975186f934b76e25dae42eb65148d67 +eeeeff3e3dd6c09aaefdf13cce99a5beff47a095 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/configure b/libgo/configure index d8105dbab36..756f62e137c 100755 --- a/libgo/configure +++ b/libgo/configure @@ -660,6 +660,8 @@ LIBGO_IS_MIPS_FALSE LIBGO_IS_MIPS_TRUE LIBGO_IS_M68K_FALSE LIBGO_IS_M68K_TRUE +LIBGO_IS_IA64_FALSE +LIBGO_IS_IA64_TRUE LIBGO_IS_ARM64_FALSE LIBGO_IS_ARM64_TRUE LIBGO_IS_ARM_FALSE @@ -11128,7 +11130,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11131 "configure" +#line 11133 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11234,7 +11236,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11237 "configure" +#line 11239 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13635,6 +13637,7 @@ is_386=no is_alpha=no is_arm=no is_arm64=no +is_ia64=no is_m68k=no mips_abi=unknown is_ppc=no @@ -13679,6 +13682,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext GOARCH=amd64 fi ;; + ia64-*-*) + is_ia64=yes + GOARCH=ia64 + ;; m68k*-*-*) is_m68k=yes GOARCH=m68k @@ -13848,6 +13855,14 @@ else LIBGO_IS_ARM64_FALSE= fi + if test $is_ia64 = yes; then + LIBGO_IS_IA64_TRUE= + LIBGO_IS_IA64_FALSE='#' +else + LIBGO_IS_IA64_TRUE='#' + LIBGO_IS_IA64_FALSE= +fi + if test $is_m68k = yes; then LIBGO_IS_M68K_TRUE= LIBGO_IS_M68K_FALSE='#' @@ -15799,6 +15814,10 @@ if test -z "${LIBGO_IS_ARM64_TRUE}" && test -z "${LIBGO_IS_ARM64_FALSE}"; then as_fn_error "conditional \"LIBGO_IS_ARM64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${LIBGO_IS_IA64_TRUE}" && test -z "${LIBGO_IS_IA64_FALSE}"; then + as_fn_error "conditional \"LIBGO_IS_IA64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${LIBGO_IS_M68K_TRUE}" && test -z "${LIBGO_IS_M68K_FALSE}"; then as_fn_error "conditional \"LIBGO_IS_M68K\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libgo/configure.ac b/libgo/configure.ac index e4b314e5f8c..21ece733f34 100644 --- a/libgo/configure.ac +++ b/libgo/configure.ac @@ -191,6 +191,7 @@ is_386=no is_alpha=no is_arm=no is_arm64=no +is_ia64=no is_m68k=no mips_abi=unknown is_ppc=no @@ -229,6 +230,10 @@ changequote([,])dnl GOARCH=amd64 fi ;; + ia64-*-*) + is_ia64=yes + GOARCH=ia64 + ;; m68k*-*-*) is_m68k=yes GOARCH=m68k @@ -311,6 +316,7 @@ AM_CONDITIONAL(LIBGO_IS_386, test $is_386 = yes) AM_CONDITIONAL(LIBGO_IS_ALPHA, test $is_alpha = yes) AM_CONDITIONAL(LIBGO_IS_ARM, test $is_arm = yes) AM_CONDITIONAL(LIBGO_IS_ARM64, test $is_arm64 = yes) +AM_CONDITIONAL(LIBGO_IS_IA64, test $is_ia64 = yes) AM_CONDITIONAL(LIBGO_IS_M68K, test $is_m68k = yes) AM_CONDITIONAL(LIBGO_IS_MIPS, test $mips_abi != unknown) AM_CONDITIONAL(LIBGO_IS_MIPSO32, test $mips_abi = o32) diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_alpha.go b/libgo/go/internal/syscall/unix/getrandom_linux_alpha.go new file mode 100644 index 00000000000..9587b5aa4ca --- /dev/null +++ b/libgo/go/internal/syscall/unix/getrandom_linux_alpha.go @@ -0,0 +1,9 @@ +// Copyright 2016 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 = 511 diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_ia64.go b/libgo/go/internal/syscall/unix/getrandom_linux_ia64.go new file mode 100644 index 00000000000..d20ba238fcf --- /dev/null +++ b/libgo/go/internal/syscall/unix/getrandom_linux_ia64.go @@ -0,0 +1,9 @@ +// Copyright 2016 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 = 1339 diff --git a/libgo/go/internal/syscall/unix/getrandom_linux_s390.go b/libgo/go/internal/syscall/unix/getrandom_linux_s390.go new file mode 100644 index 00000000000..e3bc4ee355c --- /dev/null +++ b/libgo/go/internal/syscall/unix/getrandom_linux_s390.go @@ -0,0 +1,9 @@ +// Copyright 2016 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 = 349 diff --git a/libgo/match.sh b/libgo/match.sh index e415acdbc2c..f626112642b 100755 --- a/libgo/match.sh +++ b/libgo/match.sh @@ -116,7 +116,7 @@ for f in $gofiles; do android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag1=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | mipso32 | mipsn32 | mipsn64 | mipso64 | ppc | s390 | s390x | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | mipso32 | mipsn32 | mipsn64 | mipso64 | ppc | s390 | s390x | sparc | sparc64) tag1=nonmatchingtag ;; esac @@ -128,7 +128,7 @@ for f in $gofiles; do android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag2=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | mipso32 | mipsn32 | mipsn64 | mipso64 | ppc | s390 | s390x | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | mipso32 | mipsn32 | mipsn64 | mipso64 | ppc | s390 | s390x | sparc | sparc64) tag2=nonmatchingtag ;; esac diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest index 0957805a78d..77722c2dd0f 100755 --- a/libgo/testsuite/gotest +++ b/libgo/testsuite/gotest @@ -295,7 +295,7 @@ x) android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag1=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | mipso32 | mipsn32 | mipsn64 | mipso64 | ppc | s390 | s390x | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | mipso32 | mipsn32 | mipsn64 | mipso64 | ppc | s390 | s390x | sparc | sparc64) tag1=nonmatchingtag ;; esac @@ -307,7 +307,7 @@ x) android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag2=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | mipso32 | mipsn32 | mipsn64 | mipso64 | ppc | s390 | s390x | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | mipso32 | mipsn32 | mipsn64 | mipso64 | ppc | s390 | s390x | sparc | sparc64) tag2=nonmatchingtag ;; esac -- 2.30.2