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.
Index: libgo/MERGE =================================================================== --- libgo/MERGE (revision 264542) +++ libgo/MERGE (working copy) @@ -1,4 +1,4 @@ -fe8a0d12b14108cbe2408b417afcaab722b0727c +41e62b8c49d21659b48a95216e3062032285250f The first line of this file holds the git revision number of the last merge done from the master library sources. Index: libgo/VERSION =================================================================== --- libgo/VERSION (revision 264542) +++ libgo/VERSION (working copy) @@ -1 +1 @@ -go1.10.3 +go1.11 Index: libgo/Makefile.am =================================================================== --- libgo/Makefile.am (revision 264542) +++ libgo/Makefile.am (working copy) @@ -541,6 +541,7 @@ s-objabi: Makefile echo 'const defaultGO386 = `sse2`' >> objabi.go.tmp echo 'const defaultGOARM = `5`' >> objabi.go.tmp echo 'const defaultGOMIPS = `hardfloat`' >> objabi.go.tmp + echo 'const defaultGOMIPS64 = `hardfloat`' >> objabi.go.tmp echo 'const defaultGOOS = runtime.GOOS' >> objabi.go.tmp echo 'const defaultGOARCH = runtime.GOARCH' >> objabi.go.tmp echo 'const defaultGO_EXTLINK_ENABLED = ``' >> objabi.go.tmp @@ -608,7 +609,7 @@ noinst_DATA += zdefaultcc.go zstdpkglist.go: s-zstdpkglist; @true s-zstdpkglist: Makefile rm -f zstdpkglist.go.tmp - echo 'package build' > zstdpkglist.go.tmp + echo 'package goroot' > zstdpkglist.go.tmp echo "" >> zstdpkglist.go.tmp echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's|[a-z0-9_/]*_c\.lo||g' | sed 's|\([a-z0-9_/]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp @@ -707,6 +708,7 @@ PACKAGES = $(shell cat $(srcdir)/libgo-p libgo_go_objs = \ $(addsuffix .lo,$(PACKAGES)) \ bytes/index.lo \ + internal/bytealg/bytealg.lo \ reflect/makefunc_ffi_c.lo \ strings/index.lo \ $(syscall_lib_clone_lo) \ @@ -718,7 +720,8 @@ libgo_go_objs = \ log/syslog/syslog_c.lo \ $(os_lib_inotify_lo) \ runtime/internal/atomic_c.lo \ - sync/atomic_c.lo + sync/atomic_c.lo \ + internal/cpu/cpu_gccgo.lo libgo_ldflags = \ -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS) @@ -960,8 +963,8 @@ runtime_pprof_check_GOCFLAGS = -static-l extra_go_files_runtime_internal_sys = version.go runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys) -extra_go_files_go_build = zstdpkglist.go -go/build.lo.dep: $(extra_go_files_go_build) +extra_go_files_internal_goroot = zstdpkglist.go +internal/goroot.lo.dep: $(extra_go_files_internal_goroot) extra_go_files_go_types = gccgosizes.go go/types.lo.dep: $(extra_go_files_go_types) @@ -976,6 +979,16 @@ extra_check_libs_cmd_go_internal_cache = extra_check_libs_cmd_go_internal_generate = $(abs_builddir)/libgotool.a extra_check_libs_cmd_go_internal_get = $(abs_builddir)/libgotool.a extra_check_libs_cmd_go_internal_load = $(abs_builddir)/libgotool.a +extra_check_libs_cmd_go_internal_imports = $(abs_builddir)/libgotool.a +extra_check_libs_cmd_go_internal_modconv = $(abs_builddir)/libgotool.a +extra_check_libs_cmd_go_internal_modfetch = $(abs_builddir)/libgotool.a +extra_check_libs_cmd_go_internal_modfetch_codehost = $(abs_builddir)/libgotool.a +extra_check_libs_cmd_go_internal_modfile = $(abs_builddir)/libgotool.a +extra_check_libs_cmd_go_internal_modload = $(abs_builddir)/libgotool.a +extra_check_libs_cmd_go_internal_module = $(abs_builddir)/libgotool.a +extra_check_libs_cmd_go_internal_mvs = $(abs_builddir)/libgotool.a +extra_check_libs_cmd_go_internal_search = $(abs_builddir)/libgotool.a +extra_check_libs_cmd_go_internal_web2 = $(abs_builddir)/libgotool.a extra_check_libs_cmd_go_internal_work = $(abs_builddir)/libgotool.a extra_check_libs_cmd_vet_internal_cfg = $(abs_builddir)/libgotool.a @@ -990,6 +1003,9 @@ bytes/index.lo: go/bytes/indexbyte.c run strings/index.lo: go/strings/indexbyte.c runtime.inc @$(MKDIR_P) strings $(LTCOMPILE) -c -o $@ $(srcdir)/go/strings/indexbyte.c +internal/bytealg/bytealg.lo: go/internal/bytealg/bytealg.c runtime.inc + @$(MKDIR_P) internal/bytealg + $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/bytealg/bytealg.c # Use a C function with a fixed number of arguments to call a C # varargs function. @@ -1024,6 +1040,11 @@ syscall/wait.lo: go/syscall/wait.c runti @$(MKDIR_P) syscall $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c +# internal/cpu needs some C code. +internal/cpu/cpu_gccgo.lo: go/internal/cpu/cpu_gccgo.c runtime.inc + @$(MKDIR_P) internal/cpu + $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/cpu/cpu_gccgo.c + # Solaris 11.4 changed the type of fields in struct stat. # Use a build tag, based on a configure check, to cope. if LIBGO_IS_SOLARIS Index: libgo/check-packages.txt =================================================================== --- libgo/check-packages.txt (revision 264542) +++ libgo/check-packages.txt (working copy) @@ -3,9 +3,23 @@ archive/zip bufio bytes cmd/go/internal/cache +cmd/go/internal/dirhash cmd/go/internal/generate cmd/go/internal/get +cmd/go/internal/imports cmd/go/internal/load +cmd/go/internal/modconv +cmd/go/internal/modfetch +cmd/go/internal/modfetch/codehost +cmd/go/internal/modfile +cmd/go/internal/modload +cmd/go/internal/module +cmd/go/internal/mvs +cmd/go/internal/par +cmd/go/internal/search +cmd/go/internal/semver +cmd/go/internal/txtar +cmd/go/internal/web2 cmd/go/internal/work cmd/internal/buildid cmd/internal/edit @@ -29,6 +43,7 @@ crypto/dsa crypto/ecdsa crypto/elliptic crypto/hmac +crypto/internal/subtle crypto/md5 crypto/rand crypto/rc4 @@ -76,11 +91,15 @@ go/printer go/scanner go/token go/types +golang_org/x/crypto/internal/chacha20 golang_org/x/crypto/chacha20poly1305 golang_org/x/crypto/chacha20poly1305/internal/chacha20 golang_org/x/crypto/cryptobyte golang_org/x/crypto/curve25519 golang_org/x/crypto/poly1305 +golang_org/x/net/dns/dnsmessage +golang_org/x/net/http/httpguts +golang_org/x/net/http/httpproxy golang_org/x/net/http2/hpack golang_org/x/net/idna golang_org/x/net/lex/httplex @@ -98,6 +117,7 @@ image/draw image/jpeg image/png index/suffixarray +internal/cpu internal/poll internal/singleflight internal/trace Index: libgo/gotool-packages.txt =================================================================== --- libgo/gotool-packages.txt (revision 264542) +++ libgo/gotool-packages.txt (working copy) @@ -4,6 +4,7 @@ cmd/go/internal/cache cmd/go/internal/cfg cmd/go/internal/clean cmd/go/internal/cmdflag +cmd/go/internal/dirhash cmd/go/internal/doc cmd/go/internal/envcmd cmd/go/internal/fix @@ -11,15 +12,32 @@ cmd/go/internal/fmtcmd cmd/go/internal/generate cmd/go/internal/get cmd/go/internal/help +cmd/go/internal/imports cmd/go/internal/list cmd/go/internal/load +cmd/go/internal/modcmd +cmd/go/internal/modconv +cmd/go/internal/modfetch +cmd/go/internal/modfetch/codehost +cmd/go/internal/modfile +cmd/go/internal/modget +cmd/go/internal/modinfo +cmd/go/internal/modload +cmd/go/internal/module +cmd/go/internal/mvs +cmd/go/internal/par cmd/go/internal/run +cmd/go/internal/search +cmd/go/internal/semver cmd/go/internal/str cmd/go/internal/test cmd/go/internal/tool +cmd/go/internal/txtar cmd/go/internal/version cmd/go/internal/vet cmd/go/internal/web +cmd/go/internal/web2 +cmd/go/internal/webtest cmd/go/internal/work cmd/internal/browser cmd/internal/buildid Index: libgo/libgo-packages.txt =================================================================== --- libgo/libgo-packages.txt (revision 264542) +++ libgo/libgo-packages.txt (working copy) @@ -19,7 +19,8 @@ crypto/dsa crypto/ecdsa crypto/elliptic crypto/hmac -crypto/internal/cipherhw +crypto/internal/randutil +crypto/internal/subtle crypto/md5 crypto/rand crypto/rc4 @@ -70,12 +71,16 @@ go/printer go/scanner go/token go/types +golang_org/x/crypto/internal/chacha20 golang_org/x/crypto/chacha20poly1305 golang_org/x/crypto/chacha20poly1305/internal/chacha20 golang_org/x/crypto/cryptobyte golang_org/x/crypto/cryptobyte/asn1 golang_org/x/crypto/curve25519 golang_org/x/crypto/poly1305 +golang_org/x/net/dns/dnsmessage +golang_org/x/net/http/httpguts +golang_org/x/net/http/httpproxy golang_org/x/net/http2/hpack golang_org/x/net/idna golang_org/x/net/internal/nettest @@ -103,6 +108,9 @@ image/internal/imageutil image/jpeg image/png index/suffixarray +internal/bytealg +internal/cpu +internal/goroot internal/nettrace internal/poll internal/race Index: libgo/match.sh =================================================================== --- libgo/match.sh (revision 264542) +++ libgo/match.sh (working copy) @@ -116,7 +116,7 @@ for f in $gofiles; do aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag1=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64 | wasm) tag1=nonmatchingtag ;; esac @@ -128,7 +128,7 @@ for f in $gofiles; do aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag2=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64 | wasm) tag2=nonmatchingtag ;; esac Index: libgo/merge.sh =================================================================== --- libgo/merge.sh (revision 264542) +++ libgo/merge.sh (working copy) @@ -128,7 +128,7 @@ echo ${rev} > VERSION (cd ${NEWDIR}/src && find . -name '*.go' -print) | while read f; do skip=false case "$f" in - ./cmd/cgo/* | ./cmd/go/* | ./cmd/gofmt/* | ./cmd/internal/browser/* | ./cmd/internal/objabi/* | ./cmd/internal/buildid/*) + ./cmd/buildid/* | ./cmd/cgo/* | ./cmd/go/* | ./cmd/gofmt/* | ./cmd/testjson/* | ./cmd/vet/* | ./cmd/internal/browser/* | ./cmd/internal/buildid/* | ./cmd/internal/edit/* | ./cmd/internal/objabi/* | ./cmd/internal/testj2on/* ) ;; ./cmd/*) skip=true Index: libgo/runtime/go-caller.c =================================================================== --- libgo/runtime/go-caller.c (revision 264542) +++ libgo/runtime/go-caller.c (working copy) @@ -210,17 +210,6 @@ Caller (int skip) /* Look up the function name, file name, and line number for a PC. */ struct funcfileline_return -{ - String retfn; - String retfile; - intgo retline; -}; - -struct funcfileline_return -runtime_funcfileline (uintptr targetpc, int32 index) - __asm__ (GOSYM_PREFIX "runtime.funcfileline"); - -struct funcfileline_return runtime_funcfileline (uintptr targetpc, int32 index) { struct funcfileline_return ret; Index: libgo/runtime/go-runtime-error.c =================================================================== --- libgo/runtime/go-runtime-error.c (revision 264542) +++ libgo/runtime/go-runtime-error.c (working copy) @@ -60,16 +60,29 @@ extern void __go_runtime_error (int32) _ void __go_runtime_error (int32 i) { + struct funcfileline_return fileline; + bool in_runtime; + + fileline = runtime_funcfileline ((uintptr) runtime_getcallerpc(), 0); + in_runtime = (fileline.retfn.len > 0 + && (__builtin_strncmp ((const char *) fileline.retfn.str, + "runtime.", 8) + == 0)); + switch (i) { case SLICE_INDEX_OUT_OF_BOUNDS: case ARRAY_INDEX_OUT_OF_BOUNDS: case STRING_INDEX_OUT_OF_BOUNDS: + if (in_runtime) + runtime_throw ("index out of range"); runtime_panicstring ("index out of range"); case SLICE_SLICE_OUT_OF_BOUNDS: case ARRAY_SLICE_OUT_OF_BOUNDS: case STRING_SLICE_OUT_OF_BOUNDS: + if (in_runtime) + runtime_throw ("slice bounds out of range"); runtime_panicstring ("slice bounds out of range"); case NIL_DEREFERENCE: Index: libgo/runtime/panic.c =================================================================== --- libgo/runtime/panic.c (revision 264542) +++ libgo/runtime/panic.c (working copy) @@ -37,3 +37,11 @@ runtime_panicstring(const char *s) runtime_newErrorCString(s, &err); runtime_panic(err); } + +extern void runtime_abort(void) __asm__(GOSYM_PREFIX "runtime.abort"); + +void +runtime_abort() +{ + abort(); +} Index: libgo/runtime/runtime.h =================================================================== --- libgo/runtime/runtime.h (revision 264542) +++ libgo/runtime/runtime.h (working copy) @@ -403,8 +403,6 @@ void runtime_panic(Eface) /* * runtime c-called (but written in Go) */ -void runtime_newTypeAssertionError(const String*, const String*, const String*, const String*, Eface*) - __asm__ (GOSYM_PREFIX "runtime.NewTypeAssertionError"); void runtime_newErrorCString(const char*, Eface*) __asm__ (GOSYM_PREFIX "runtime.NewErrorCString"); @@ -479,10 +477,10 @@ extern void *getitab(const struct __go_t __asm__ (GOSYM_PREFIX "runtime.getitab"); extern void runtime_cpuinit(void); +extern void setRandomNumber(uint32) + __asm__ (GOSYM_PREFIX "runtime.setRandomNumber"); extern void setIsCgo(void) __asm__ (GOSYM_PREFIX "runtime.setIsCgo"); -extern void setCpuidECX(uint32) - __asm__ (GOSYM_PREFIX "runtime.setCpuidECX"); extern void setSupportAES(bool) __asm__ (GOSYM_PREFIX "runtime.setSupportAES"); extern void typedmemmove(const Type *, void *, const void *) @@ -493,3 +491,14 @@ extern Sched* runtime_getsched(void) __asm__ (GOSYM_PREFIX "runtime.getsched"); extern void setpagesize(uintptr_t) __asm__(GOSYM_PREFIX "runtime.setpagesize"); + +struct funcfileline_return +{ + String retfn; + String retfile; + intgo retline; +}; + +struct funcfileline_return +runtime_funcfileline (uintptr targetpc, int32 index) + __asm__ (GOSYM_PREFIX "runtime.funcfileline"); Index: libgo/runtime/runtime_c.c =================================================================== --- libgo/runtime/runtime_c.c (revision 264542) +++ libgo/runtime/runtime_c.c (working copy) @@ -33,6 +33,17 @@ runtime_atoi(const byte *p, intgo len) return n; } +// A random number from the GNU/Linux auxv array. +static uint32 randomNumber; + +// Set the random number from Go code. + +void +setRandomNumber(uint32 r) +{ + randomNumber = r; +} + #if defined(__i386__) || defined(__x86_64__) || defined (__s390__) || defined (__s390x__) // When cputicks is just asm instructions, skip the split stack @@ -85,8 +96,8 @@ runtime_cputicks(void) #else // Currently cputicks() is used in blocking profiler and to seed runtime·fastrand(). // runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler. - // TODO: need more entropy to better seed fastrand. - return runtime_nanotime(); + // randomNumber provides better seeding of fastrand. + return runtime_nanotime() + randomNumber; #endif } @@ -193,7 +204,6 @@ runtime_cpuinit() } } if (__get_cpuid(1, &eax, &ebx, &ecx, &edx)) { - setCpuidECX(ecx); #if defined(__i386__) if ((edx & bit_SSE2) != 0) { hasSSE2 = true; Index: libgo/testsuite/gotest =================================================================== --- libgo/testsuite/gotest (revision 264542) +++ libgo/testsuite/gotest (working copy) @@ -314,7 +314,7 @@ x) aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag1=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le·| nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le·| nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64 | wasm) tag1=nonmatchingtag ;; esac @@ -326,7 +326,7 @@ x) aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag2=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le·| nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le·| nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64 | wasm) tag2=nonmatchingtag ;; esac