I've committed a patch to the libgo library to update it to Go 1.6rc1, the first release candidate for the Go 1.6 release. As usual with major libgo updates, the change is too large to include here. I've attached the changes to gccgo-specific files.
This update does not have many OS-specific changes, but please do let me know about any problems building on different systems. Bootstrapped and ran Go tests on x86_64-pc-linux-gnu. Committed to mainline. Ian gotools/ChangeLog: 2016-02-03 Ian Lance Taylor <i...@google.com> * Makefile.am (go_cmd_gofmt_files): Update to Go 1.6rc1 by adding internal.go. * Makefile.in: Rebuild.
Index: libgo/MERGE =================================================================== --- libgo/MERGE (revision 232239) +++ libgo/MERGE (working copy) @@ -1,4 +1,4 @@ -f2e4c8b5fb3660d793b2c545ef207153db0a34b1 +036b8fd40b60830ca1d152f17148e52b96d8aa6c The first line of this file holds the git revision number of the last merge done from the master library sources. Index: libgo/Makefile.am =================================================================== --- libgo/Makefile.am (revision 232239) +++ libgo/Makefile.am (working copy) @@ -846,9 +846,7 @@ go_net_common_files = \ go/net/parse.go \ go/net/pipe.go \ go/net/fd_poll_runtime.go \ - go/net/port.go \ go/net/port_unix.go \ - go/net/race0.go \ $(go_net_sendfile_file) \ go/net/sock_posix.go \ $(go_net_sock_file) \ @@ -1018,7 +1016,7 @@ go_os_files = \ $(go_os_sys_file) \ $(go_os_cloexec_file) \ go/os/types.go \ - go/os/types_notwin.go + go/os/types_unix.go go_path_files = \ go/path/match.go \ @@ -1100,7 +1098,8 @@ go_strings_files = \ go/strings/replace.go \ go/strings/search.go \ go/strings/strings.go \ - go/strings/strings_decl.go + go/strings/strings_decl.go \ + go/strings/strings_generic.go go_strings_c_files = \ go/strings/indexbyte.c @@ -1109,7 +1108,6 @@ go_sync_files = \ go/sync/mutex.go \ go/sync/once.go \ go/sync/pool.go \ - go/sync/race0.go \ go/sync/runtime.go \ go/sync/rwmutex.go \ go/sync/waitgroup.go @@ -1196,7 +1194,6 @@ go_compress_bzip2_files = \ go_compress_flate_files = \ go/compress/flate/copy.go \ go/compress/flate/deflate.go \ - go/compress/flate/fixedhuff.go \ go/compress/flate/huffman_bit_writer.go \ go/compress/flate/huffman_code.go \ go/compress/flate/inflate.go \ @@ -1367,7 +1364,8 @@ go_debug_dwarf_files = \ go/debug/dwarf/unit.go go_debug_elf_files = \ go/debug/elf/elf.go \ - go/debug/elf/file.go + go/debug/elf/file.go \ + go/debug/elf/reader.go go_debug_gosym_files = \ go/debug/gosym/pclntab.go \ go/debug/gosym/symtab.go @@ -1450,7 +1448,6 @@ go_go_build_files = \ go/go/build/read.go \ go/go/build/syslist.go go_go_constant_files = \ - go/go/constant/go14.go \ go/go/constant/value.go go_go_doc_files = \ go/go/doc/comment.go \ @@ -1461,7 +1458,8 @@ go_go_doc_files = \ go/go/doc/reader.go \ go/go/doc/synopsis.go go_go_format_files = \ - go/go/format/format.go + go/go/format/format.go \ + go/go/format/internal.go go_go_importer_files = \ go/go/importer/importer.go go_go_parser_files = \ @@ -1489,7 +1487,6 @@ go_go_types_files = \ go/go/types/eval.go \ go/go/types/expr.go \ go/go/types/exprstring.go \ - go/go/types/go12.go \ go/go/types/initorder.go \ go/go/types/labels.go \ go/go/types/lookup.go \ @@ -1512,6 +1509,7 @@ go_go_types_files = \ go/go/types/universe.go go_go_internal_gcimporter_files = \ + go/go/internal/gcimporter/bimport.go \ go/go/internal/gcimporter/exportdata.go \ go/go/internal/gcimporter/gcimporter.go go_go_internal_gccgoimporter_files = \ @@ -1578,20 +1576,46 @@ go_index_suffixarray_files = \ go/index/suffixarray/qsufsort.go \ go/index/suffixarray/suffixarray.go -go_internal_format_files = \ - go/internal/format/format.go +go_internal_golang_org_x_net_http2_hpack_files = \ + go/internal/golang.org/x/net/http2/hpack/encode.go \ + go/internal/golang.org/x/net/http2/hpack/hpack.go \ + go/internal/golang.org/x/net/http2/hpack/huffman.go \ + go/internal/golang.org/x/net/http2/hpack/tables.go +go_internal_race_files = \ + go/internal/race/doc.go \ + go/internal/race/norace.go go_internal_singleflight_files = \ go/internal/singleflight/singleflight.go if LIBGO_IS_LINUX -internal_syscall_unix_getrandom_file = go/internal/syscall/unix/getrandom_linux.go +if LIBGO_IS_386 +internal_syscall_unix_getrandom_files = go/internal/syscall/unix/getrandom_linux.go go/internal/syscall/unix/getrandom_linux_386.go +else +if LIBGO_IS_X86_64 +internal_syscall_unix_getrandom_files = go/internal/syscall/unix/getrandom_linux.go go/internal/syscall/unix/getrandom_linux_amd64.go +else +if LIBGO_IS_ARM +internal_syscall_unix_getrandom_files = go/internal/syscall/unix/getrandom_linux.go go/internal/syscall/unix/getrandom_linux_arm.go +else +if LIBGO_IS_PPC64 +internal_syscall_unix_getrandom_files = go/internal/syscall/unix/getrandom_linux.go go/internal/syscall/unix/getrandom_linux_ppc64x.go else -internal_syscall_unix_getrandom_file = +if LIBGO_IS_MIPS64 +internal_syscall_unix_getrandom_files = go/internal/syscall/unix/getrandom_linux.go go/internal/syscall/unix/getrandom_linux_mips64x.go +else +internal_syscall_unix_getrandom_files = go/internal/syscall/unix/getrandom_linux.go go/internal/syscall/unix/getrandom_linux_generic.go +endif +endif +endif +endif +endif +else +internal_syscall_unix_getrandom_files = endif go_internal_syscall_unix_files = \ go/internal/syscall/unix/dummy.go \ - $(internal_syscall_unix_getrandom_file) + $(internal_syscall_unix_getrandom_files) go_internal_testenv_files = \ go/internal/testenv/testenv.go @@ -1608,15 +1632,19 @@ go_math_big_files = \ go/math/big/arith.go \ go/math/big/arith_decl_pure.go \ go/math/big/decimal.go \ + go/math/big/doc.go \ go/math/big/float.go \ go/math/big/floatconv.go \ + go/math/big/floatmarsh.go \ go/math/big/ftoa.go \ go/math/big/int.go \ + go/math/big/intmarsh.go \ go/math/big/intconv.go \ go/math/big/nat.go \ go/math/big/natconv.go \ go/math/big/rat.go \ go/math/big/ratconv.go \ + go/math/big/ratmarsh.go \ go/math/big/roundingmode_string.go go_math_cmplx_files = \ go/math/cmplx/abs.go \ @@ -1654,9 +1682,11 @@ go_net_http_files = \ go/net/http/cookie.go \ go/net/http/filetransport.go \ go/net/http/fs.go \ + go/net/http/h2_bundle.go \ go/net/http/header.go \ go/net/http/jar.go \ go/net/http/lex.go \ + go/net/http/method.go \ go/net/http/request.go \ go/net/http/response.go \ go/net/http/server.go \ @@ -1698,7 +1728,8 @@ go_net_http_httputil_files = \ go/net/http/httputil/persist.go \ go/net/http/httputil/reverseproxy.go go_net_http_internal_files = \ - go/net/http/internal/chunked.go + go/net/http/internal/chunked.go \ + go/net/http/internal/testcert.go if LIBGO_IS_LINUX go_net_internal_socktest_sys = go/net/internal/socktest/sys_cloexec.go @@ -1731,6 +1762,7 @@ go_os_exec_files = \ go/os/exec/lp_unix.go go_os_signal_files = \ + go/os/signal/doc.go \ go/os/signal/signal.go \ go/os/signal/signal_unix.go @@ -1999,7 +2031,7 @@ go_base_syscall_files = \ go/syscall/syscall_errno.go \ go/syscall/libcall_support.go \ go/syscall/libcall_posix.go \ - go/syscall/race0.go \ + go/syscall/msan0.go \ go/syscall/socket.go \ go/syscall/sockcmsg_unix.go \ go/syscall/str.go \ @@ -2229,7 +2261,8 @@ libgo_go_objs = \ image/jpeg.lo \ image/png.lo \ index/suffixarray.lo \ - internal/format.lo \ + internal/golang.org/x/net/http2/hpack.lo \ + internal/race.lo \ internal/singleflight.lo \ internal/syscall/unix.lo \ internal/testenv.lo \ @@ -2358,7 +2391,7 @@ CHECK = \ elif test "$(GOBENCH)" != ""; then \ $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --bench="$(GOBENCH)" $(GOTESTFLAGS) $(go_$(subst /,_,$(@D))_test_files); \ else \ - if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" $(GOTESTFLAGS) $(go_$(subst /,_,$(@D))_test_files) >>$@-testlog 2>&1; then \ + if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst .,_,$(subst /,_,$(@D)))_files)" $(GOTESTFLAGS) $(go_$(subst /,_,$(@D))_test_files) >>$@-testlog 2>&1; then \ echo "PASS: $(@D)" >> $@-testlog; \ echo "PASS: $(@D)"; \ echo "PASS: $(@D)" > $@-testsum; \ @@ -3350,14 +3383,23 @@ index/suffixarray/check: $(CHECK_DEPS) @$(CHECK) .PHONY: index/suffixarray/check -@go_include@ internal/format.lo.dep -internal/format.lo.dep: $(go_internal_format_files) +@go_include@ internal/golang.org/x/net/http2/hpack.lo.dep +internal/golang.org/x/net/http2/hpack.lo.dep: $(go_internal_golang_org_x_net_http2_hpack_files) + $(BUILDDEPS) +internal/golang.org/x/net/http2/hpack.lo: $(go_internal_golang_org_x_net_http2_hpack_files) + $(BUILDPACKAGE) +internal/golang.org/x/net/http2/hpack/check: $(CHECK_DEPS) + @$(CHECK) +.PHONY: internal/golang.org/x/net/http2/hpack/check + +@go_include@ internal/race.lo.dep +internal/race.lo.dep: $(go_internal_race_files) $(BUILDDEPS) -internal/format.lo: $(go_internal_format_files) +internal/race.lo: $(go_internal_race_files) $(BUILDPACKAGE) -internal/format/check: $(CHECK_DEPS) +internal/race/check: $(CHECK_DEPS) @$(CHECK) -.PHONY: internal/format/check +.PHONY: internal/race/check @go_include@ internal/singleflight.lo.dep internal/singleflight.lo.dep: $(go_internal_singleflight_files) @@ -4013,7 +4055,9 @@ image/color/palette.gox: image/color/pal index/suffixarray.gox: index/suffixarray.lo $(BUILDGOX) -internal/format.gox: internal/format.lo +internal/golang.org/x/net/http2/hpack.gox: internal/golang.org/x/net/http2/hpack.lo + $(BUILDGOX) +internal/race.gox: internal/race.lo $(BUILDGOX) internal/singleflight.gox: internal/singleflight.lo $(BUILDGOX) @@ -4217,6 +4261,7 @@ TEST_PACKAGES = \ image/jpeg/check \ image/png/check \ index/suffixarray/check \ + internal/golang.org/x/net/http2/hpack/check \ internal/singleflight/check \ internal/trace/check \ io/ioutil/check \ Index: libgo/VERSION =================================================================== --- libgo/VERSION (revision 232239) +++ libgo/VERSION (working copy) @@ -1 +1 @@ -go1.5.1 \ No newline at end of file +go1.6rc1 \ No newline at end of file Index: libgo/configure.ac =================================================================== --- libgo/configure.ac (revision 232239) +++ libgo/configure.ac (working copy) @@ -316,6 +316,7 @@ AM_CONDITIONAL(LIBGO_IS_MIPSO32, test $m AM_CONDITIONAL(LIBGO_IS_MIPSN32, test $mips_abi = n32) AM_CONDITIONAL(LIBGO_IS_MIPSN64, test $mips_abi = n64) AM_CONDITIONAL(LIBGO_IS_MIPSO64, test $mips_abi = o64) +AM_CONDITIONAL(LIBGO_IS_MIPS64, test $mips_abi = n64 -o $mips_abi = o64) AM_CONDITIONAL(LIBGO_IS_PPC, test $is_ppc = yes) AM_CONDITIONAL(LIBGO_IS_PPC64, test $is_ppc64 = yes) AM_CONDITIONAL(LIBGO_IS_PPC64LE, test $is_ppc64le = yes) Index: libgo/runtime/go-signal.c =================================================================== --- libgo/runtime/go-signal.c (revision 232239) +++ libgo/runtime/go-signal.c (working copy) @@ -33,105 +33,107 @@ extern void __splitstack_setcontext(void #define D SigDefault /* Signal actions. This collects the sigtab tables for several - different targets from the master library. SIGKILL, SIGCONT, and - SIGSTOP are not listed, as we don't want to set signal handlers for - them. */ + different targets from the master library. SIGKILL and SIGSTOP are + not listed, as we don't want to set signal handlers for them. */ SigTab runtime_sigtab[] = { #ifdef SIGHUP - { SIGHUP, N + K }, + { SIGHUP, N + K, NULL }, #endif #ifdef SIGINT - { SIGINT, N + K }, + { SIGINT, N + K, NULL }, #endif #ifdef SIGQUIT - { SIGQUIT, N + T }, + { SIGQUIT, N + T, NULL }, #endif #ifdef SIGILL - { SIGILL, T }, + { SIGILL, T, NULL }, #endif #ifdef SIGTRAP - { SIGTRAP, T }, + { SIGTRAP, T, NULL }, #endif #ifdef SIGABRT - { SIGABRT, N + T }, + { SIGABRT, N + T, NULL }, #endif #ifdef SIGBUS - { SIGBUS, P }, + { SIGBUS, P, NULL }, #endif #ifdef SIGFPE - { SIGFPE, P }, + { SIGFPE, P, NULL }, #endif #ifdef SIGUSR1 - { SIGUSR1, N }, + { SIGUSR1, N, NULL }, #endif #ifdef SIGSEGV - { SIGSEGV, P }, + { SIGSEGV, P, NULL }, #endif #ifdef SIGUSR2 - { SIGUSR2, N }, + { SIGUSR2, N, NULL }, #endif #ifdef SIGPIPE - { SIGPIPE, N }, + { SIGPIPE, N, NULL }, #endif #ifdef SIGALRM - { SIGALRM, N }, + { SIGALRM, N, NULL }, #endif #ifdef SIGTERM - { SIGTERM, N + K }, + { SIGTERM, N + K, NULL }, #endif #ifdef SIGSTKFLT - { SIGSTKFLT, T }, + { SIGSTKFLT, T, NULL }, #endif #ifdef SIGCHLD - { SIGCHLD, N }, + { SIGCHLD, N, NULL }, +#endif +#ifdef SIGCONT + { SIGCONT, N + D, NULL }, #endif #ifdef SIGTSTP - { SIGTSTP, N + D }, + { SIGTSTP, N + D, NULL }, #endif #ifdef SIGTTIN - { SIGTTIN, N + D }, + { SIGTTIN, N + D, NULL }, #endif #ifdef SIGTTOU - { SIGTTOU, N + D }, + { SIGTTOU, N + D, NULL }, #endif #ifdef SIGURG - { SIGURG, N }, + { SIGURG, N, NULL }, #endif #ifdef SIGXCPU - { SIGXCPU, N }, + { SIGXCPU, N, NULL }, #endif #ifdef SIGXFSZ - { SIGXFSZ, N }, + { SIGXFSZ, N, NULL }, #endif #ifdef SIGVTALRM - { SIGVTALRM, N }, + { SIGVTALRM, N, NULL }, #endif #ifdef SIGPROF - { SIGPROF, N }, + { SIGPROF, N, NULL }, #endif #ifdef SIGWINCH - { SIGWINCH, N }, + { SIGWINCH, N, NULL }, #endif #ifdef SIGIO - { SIGIO, N }, + { SIGIO, N, NULL }, #endif #ifdef SIGPWR - { SIGPWR, N }, + { SIGPWR, N, NULL }, #endif #ifdef SIGSYS - { SIGSYS, N }, + { SIGSYS, N, NULL }, #endif #ifdef SIGEMT - { SIGEMT, T }, + { SIGEMT, T, NULL }, #endif #ifdef SIGINFO - { SIGINFO, N }, + { SIGINFO, N, NULL }, #endif #ifdef SIGTHR - { SIGTHR, N }, + { SIGTHR, N, NULL }, #endif - { -1, 0 } + { -1, 0, NULL } }; #undef N #undef K @@ -526,6 +528,9 @@ os_sigpipe (void) struct sigaction sa; int i; + if (__go_sigsend (SIGPIPE)) + return; + memset (&sa, 0, sizeof sa); sa.sa_handler = SIG_DFL; Index: libgo/runtime/runtime.c =================================================================== --- libgo/runtime/runtime.c (revision 232239) +++ libgo/runtime/runtime.c (working copy) @@ -20,23 +20,28 @@ enum { // The cached value is a uint32 in which the low bit // is the "crash" setting and the top 31 bits are the // gotraceback value. -static uint32 traceback_cache = ~(uint32)0; +enum { + tracebackCrash = 1 << 0, + tracebackAll = 1 << 1, + tracebackShift = 2, +}; +static uint32 traceback_cache = 2 << tracebackShift; +static uint32 traceback_env; extern volatile intgo runtime_MemProfileRate __asm__ (GOSYM_PREFIX "runtime.MemProfileRate"); -// The GOTRACEBACK environment variable controls the -// behavior of a Go program that is crashing and exiting. -// GOTRACEBACK=0 suppress all tracebacks -// GOTRACEBACK=1 default behavior - show tracebacks but exclude runtime frames -// GOTRACEBACK=2 show tracebacks including runtime frames -// GOTRACEBACK=crash show tracebacks including runtime frames, then crash (core dump etc) +// gotraceback returns the current traceback settings. +// +// If level is 0, suppress all tracebacks. +// If level is 1, show tracebacks, but exclude runtime frames. +// If level is 2, show tracebacks including runtime frames. +// If all is set, print all goroutine stacks. Otherwise, print just the current goroutine. +// If crash is set, crash (core dump, etc) after tracebacking. int32 runtime_gotraceback(bool *crash) { - String s; - const byte *p; uint32 x; if(crash != nil) @@ -44,20 +49,9 @@ runtime_gotraceback(bool *crash) if(runtime_m()->traceback != 0) return runtime_m()->traceback; x = runtime_atomicload(&traceback_cache); - if(x == ~(uint32)0) { - s = runtime_getenv("GOTRACEBACK"); - p = s.str; - if(s.len == 0) - x = 1<<1; - else if(s.len == 5 && runtime_strcmp((const char *)p, "crash") == 0) - x = (2<<1) | 1; - else - x = runtime_atoi(p, s.len)<<1; - runtime_atomicstore(&traceback_cache, x); - } if(crash != nil) - *crash = x&1; - return x>>1; + *crash = x&tracebackCrash; + return x>>tracebackShift; } static int32 argc; @@ -319,6 +313,31 @@ runtime_signalstack(byte *p, int32 n) *(int *)0xf1 = 0xf1; } +void setTraceback(String level) + __asm__ (GOSYM_PREFIX "runtime_debug.SetTraceback"); + +void setTraceback(String level) { + uint32 t; + + if (level.len == 4 && __builtin_memcmp(level.str, "none", 4) == 0) { + t = 0; + } else if (level.len == 0 || (level.len == 6 && __builtin_memcmp(level.str, "single", 6) == 0)) { + t = 1 << tracebackShift; + } else if (level.len == 3 && __builtin_memcmp(level.str, "all", 3) == 0) { + t = (1<<tracebackShift) | tracebackAll; + } else if (level.len == 6 && __builtin_memcmp(level.str, "system", 6) == 0) { + t = (2<<tracebackShift) | tracebackAll; + } else if (level.len == 5 && __builtin_memcmp(level.str, "crash", 5) == 0) { + t = (2<<tracebackShift) | tracebackAll | tracebackCrash; + } else { + t = (runtime_atoi(level.str, level.len)<<tracebackShift) | tracebackAll; + } + + t |= traceback_env; + + runtime_atomicstore(&traceback_cache, t); +} + DebugVars runtime_debug; // Holds variables parsed from GODEBUG env var, @@ -331,11 +350,22 @@ static struct { int32* value; } dbgvar[] = { {"allocfreetrace", &runtime_debug.allocfreetrace}, + {"cgocheck", &runtime_debug.cgocheck}, {"efence", &runtime_debug.efence}, + {"gccheckmark", &runtime_debug.gccheckmark}, + {"gcpacertrace", &runtime_debug.gcpacertrace}, + {"gcshrinkstackoff", &runtime_debug.gcshrinkstackoff}, + {"gcstackbarrieroff", &runtime_debug.gcstackbarrieroff}, + {"gcstackbarrierall", &runtime_debug.gcstackbarrierall}, + {"gcstoptheworld", &runtime_debug.gcstoptheworld}, {"gctrace", &runtime_debug.gctrace}, {"gcdead", &runtime_debug.gcdead}, + {"invalidptr", &runtime_debug.invalidptr}, + {"sbrk", &runtime_debug.sbrk}, + {"scavenge", &runtime_debug.scavenge}, {"scheddetail", &runtime_debug.scheddetail}, {"schedtrace", &runtime_debug.schedtrace}, + {"wbshadow", &runtime_debug.wbshadow}, }; void @@ -345,17 +375,7 @@ runtime_parsedebugvars(void) const byte *p, *pn; intgo len; intgo i, n; - bool tmp; - // gotraceback caches the GOTRACEBACK setting in traceback_cache. - // gotraceback can be called before the environment is available. - // traceback_cache must be reset after the environment is made - // available, in order for the environment variable to take effect. - // The code is fixed differently in Go 1.4. - // This is a limited fix for Go 1.3.3. - traceback_cache = ~(uint32)0; - runtime_gotraceback(&tmp); - s = runtime_getenv("GODEBUG"); if(s.len == 0) return; @@ -378,6 +398,20 @@ runtime_parsedebugvars(void) len -= (pn - p) - 1; p = pn + 1; } + + setTraceback(runtime_getenv("GOTRACEBACK")); + traceback_env = traceback_cache; +} + +// SetTracebackEnv is like runtime/debug.SetTraceback, but it raises +// the "environment" traceback level, so later calls to +// debug.SetTraceback (e.g., from testing timeouts) can't lower it. +void SetTracebackEnv(String level) + __asm__ (GOSYM_PREFIX "runtime.SetTracebackEnv"); + +void SetTracebackEnv(String level) { + setTraceback(level); + traceback_env = traceback_cache; } // Poor mans 64-bit division. Index: libgo/runtime/runtime.h =================================================================== --- libgo/runtime/runtime.h (revision 232239) +++ libgo/runtime/runtime.h (working copy) @@ -329,6 +329,7 @@ struct SigTab { int32 sig; int32 flags; + void* fwdsig; }; enum { @@ -338,8 +339,7 @@ enum SigPanic = 1<<3, // if the signal is from the kernel, panic SigDefault = 1<<4, // if the signal isn't explicitly requested, don't monitor it SigHandling = 1<<5, // our signal handler is registered - SigIgnored = 1<<6, // the signal was ignored before we registered for it - SigGoExit = 1<<7, // cause all runtime procs to exit (only used on Plan 9). + SigGoExit = 1<<6, // cause all runtime procs to exit (only used on Plan 9). }; // Layout of in-memory per-function information prepared by linker @@ -450,11 +450,22 @@ struct CgoMal struct DebugVars { int32 allocfreetrace; + int32 cgocheck; int32 efence; + int32 gccheckmark; + int32 gcpacertrace; + int32 gcshrinkstackoff; + int32 gcstackbarrieroff; + int32 gcstackbarrierall; + int32 gcstoptheworld; int32 gctrace; int32 gcdead; + int32 invalidptr; + int32 sbrk; + int32 scavenge; int32 scheddetail; int32 schedtrace; + int32 wbshadow; }; extern bool runtime_precisestack; Index: libgo/runtime/signal_unix.c =================================================================== --- libgo/runtime/signal_unix.c (revision 232239) +++ libgo/runtime/signal_unix.c (working copy) @@ -24,14 +24,15 @@ runtime_initsig(void) if((t->flags == 0) || (t->flags & SigDefault)) continue; + t->fwdsig = runtime_getsig(i); + // For some signals, we respect an inherited SIG_IGN handler // rather than insist on installing our own default handler. // Even these signals can be fetched using the os/signal package. switch(t->sig) { case SIGHUP: case SIGINT: - if(runtime_getsig(i) == GO_SIG_IGN) { - t->flags = SigNotify | SigIgnored; + if(t->fwdsig == GO_SIG_IGN) { continue; } } @@ -60,8 +61,7 @@ runtime_sigenable(uint32 sig) if((t->flags & SigNotify) && !(t->flags & SigHandling)) { t->flags |= SigHandling; - if(runtime_getsig(i) == GO_SIG_IGN) - t->flags |= SigIgnored; + t->fwdsig = runtime_getsig(i); runtime_setsig(i, runtime_sighandler, true); } } @@ -83,12 +83,9 @@ runtime_sigdisable(uint32 sig) if(t == nil) return; - if((t->flags & SigNotify) && (t->flags & SigHandling)) { + if((sig == SIGHUP || sig == SIGINT) && t->fwdsig == GO_SIG_IGN) { t->flags &= ~SigHandling; - if(t->flags & SigIgnored) - runtime_setsig(i, GO_SIG_IGN, true); - else - runtime_setsig(i, GO_SIG_DFL, true); + runtime_setsig(i, t->fwdsig, true); } } @@ -133,18 +130,6 @@ runtime_resetcpuprofiler(int32 hz) } void -os_sigpipe(void) -{ - int32 i; - - for(i = 0; runtime_sigtab[i].sig != -1; i++) - if(runtime_sigtab[i].sig == SIGPIPE) - break; - runtime_setsig(i, GO_SIG_DFL, false); - runtime_raise(SIGPIPE); -} - -void runtime_unblocksignals(void) { sigset_t sigset_none; Index: gotools/Makefile.am =================================================================== --- gotools/Makefile.am (revision 233109) +++ gotools/Makefile.am (working copy) @@ -76,6 +76,7 @@ go_cmd_go_files = \ go_cmd_gofmt_files = \ $(cmdsrcdir)/gofmt/doc.go \ $(cmdsrcdir)/gofmt/gofmt.go \ + $(cmdsrcdir)/gofmt/internal.go \ $(cmdsrcdir)/gofmt/rewrite.go \ $(cmdsrcdir)/gofmt/simplify.go