From 2da56ec4c3fa20d5e1dfcc8b1e3c9a79bbed2834 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 6 Nov 2017 20:59:32 +0000 Subject: libgo: pass flags to recursive make "make check" runs make recursively to check each package. Pass the flags through. So it is possible to run "make check" with different settings easily. Reviewed-on: https://go-review.googlesource.com/76029 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254475 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgo/Makefile.am | 4 ++-- libgo/Makefile.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libgo') diff --git a/libgo/Makefile.am b/libgo/Makefile.am index bd0bbddd4ed..9bbda2de46e 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -1474,7 +1474,7 @@ check-am: @for f in $(TEST_PACKAGES); do \ rm -f $$f-testsum $$f-testlog; \ done - -@$(MAKE) -k $(TEST_PACKAGES) + -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES) @for f in $(TEST_PACKAGES); do \ if test -f $$f-testsum; then \ cat $$f-testsum >> libgo.sum; \ @@ -1488,7 +1488,7 @@ check-multi: $(MULTIDO) $(AM_MAKEFLAGS) DO=check-am multi-do # $(MAKE) bench: - -@$(MAKE) -k $(TEST_PACKAGES) GOBENCH=. + -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES) GOBENCH=. MOSTLYCLEANFILES = \ s-runtime_sysinfo s-sigtab s-runtime-inc s-zstdpkglist \ diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 064df58f00e..fa9da9394fe 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -3446,7 +3446,7 @@ check-am: @for f in $(TEST_PACKAGES); do \ rm -f $$f-testsum $$f-testlog; \ done - -@$(MAKE) -k $(TEST_PACKAGES) + -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES) @for f in $(TEST_PACKAGES); do \ if test -f $$f-testsum; then \ cat $$f-testsum >> libgo.sum; \ @@ -3460,7 +3460,7 @@ check-multi: $(MULTIDO) $(AM_MAKEFLAGS) DO=check-am multi-do # $(MAKE) bench: - -@$(MAKE) -k $(TEST_PACKAGES) GOBENCH=. + -@$(MAKE) $(AM_MAKEFLAGS) -k $(TEST_PACKAGES) GOBENCH=. mostlyclean-local: find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f -- cgit v1.2.1 From eeca2a437d49722cfe58b974ba350007bef6bad6 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 9 Nov 2017 21:56:59 +0000 Subject: sync/atomic, runtime/internal/atomic: don't assume reads from 0 fail For a misaligned address force a panic rather than assuming that reading from the address 0 will cause one. Reviewed-on: https://go-review.googlesource.com/69850 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254610 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgo/go/runtime/internal/atomic/atomic.c | 14 +++++++------- libgo/go/runtime/panic.go | 1 + libgo/go/sync/atomic/atomic.c | 12 ++++++------ libgo/runtime/runtime.h | 2 ++ 4 files changed, 16 insertions(+), 13 deletions(-) (limited to 'libgo') diff --git a/libgo/go/runtime/internal/atomic/atomic.c b/libgo/go/runtime/internal/atomic/atomic.c index b584656f817..24820f22a42 100644 --- a/libgo/go/runtime/internal/atomic/atomic.c +++ b/libgo/go/runtime/internal/atomic/atomic.c @@ -34,7 +34,7 @@ uint64_t Load64 (uint64_t *ptr) { if (((uintptr_t) ptr & 7) != 0) - ptr = NULL; + panicmem (); return __atomic_load_n (ptr, __ATOMIC_ACQUIRE); } @@ -66,7 +66,7 @@ int64_t Loadint64 (int64_t *ptr) { if (((uintptr_t) ptr & 7) != 0) - ptr = NULL; + panicmem (); return __atomic_load_n (ptr, __ATOMIC_ACQUIRE); } @@ -88,7 +88,7 @@ uint64_t Xadd64 (uint64_t *ptr, int64_t delta) { if (((uintptr_t) ptr & 7) != 0) - ptr = NULL; + panicmem (); return __atomic_add_fetch (ptr, (uint64_t) delta, __ATOMIC_SEQ_CST); } @@ -110,7 +110,7 @@ int64_t Xaddint64 (int64_t *ptr, int64_t delta) { if (((uintptr_t) ptr & 7) != 0) - ptr = NULL; + panicmem (); return __atomic_add_fetch (ptr, delta, __ATOMIC_SEQ_CST); } @@ -132,7 +132,7 @@ uint64_t Xchg64 (uint64_t *ptr, uint64_t new) { if (((uintptr_t) ptr & 7) != 0) - ptr = NULL; + panicmem (); return __atomic_exchange_n (ptr, new, __ATOMIC_SEQ_CST); } @@ -184,7 +184,7 @@ _Bool Cas64 (uint64_t *ptr, uint64_t old, uint64_t new) { if (((uintptr_t) ptr & 7) != 0) - ptr = NULL; + panicmem (); return __atomic_compare_exchange_n (ptr, &old, new, false, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED); } @@ -226,7 +226,7 @@ void Store64 (uint64_t *ptr, uint64_t val) { if (((uintptr_t) ptr & 7) != 0) - ptr = NULL; + panicmem (); __atomic_store_n (ptr, val, __ATOMIC_SEQ_CST); } diff --git a/libgo/go/runtime/panic.go b/libgo/go/runtime/panic.go index 2f656038a9e..c39a58d0c4b 100644 --- a/libgo/go/runtime/panic.go +++ b/libgo/go/runtime/panic.go @@ -22,6 +22,7 @@ import ( //go:linkname makefuncreturning runtime.makefuncreturning //go:linkname gorecover runtime.gorecover //go:linkname deferredrecover runtime.deferredrecover +//go:linkname panicmem runtime.panicmem // Temporary for C code to call: //go:linkname throw runtime.throw diff --git a/libgo/go/sync/atomic/atomic.c b/libgo/go/sync/atomic/atomic.c index 7e04027c3f1..32cbf03c5cf 100644 --- a/libgo/go/sync/atomic/atomic.c +++ b/libgo/go/sync/atomic/atomic.c @@ -26,7 +26,7 @@ int64_t SwapInt64 (int64_t *addr, int64_t new) { if (((uintptr_t) addr & 7) != 0) - addr = NULL; + panicmem (); return __atomic_exchange_n (addr, new, __ATOMIC_SEQ_CST); } @@ -48,7 +48,7 @@ uint64_t SwapUint64 (uint64_t *addr, uint64_t new) { if (((uintptr_t) addr & 7) != 0) - addr = NULL; + panicmem (); return __atomic_exchange_n (addr, new, __ATOMIC_SEQ_CST); } @@ -215,7 +215,7 @@ LoadInt64 (int64_t *addr) int64_t v; if (((uintptr_t) addr & 7) != 0) - addr = NULL; + panicmem (); v = *addr; while (! __sync_bool_compare_and_swap (addr, v, v)) v = *addr; @@ -247,7 +247,7 @@ LoadUint64 (uint64_t *addr) uint64_t v; if (((uintptr_t) addr & 7) != 0) - addr = NULL; + panicmem (); v = *addr; while (! __sync_bool_compare_and_swap (addr, v, v)) v = *addr; @@ -308,7 +308,7 @@ StoreInt64 (int64_t *addr, int64_t val) int64_t v; if (((uintptr_t) addr & 7) != 0) - addr = NULL; + panicmem (); v = *addr; while (! __sync_bool_compare_and_swap (addr, v, val)) v = *addr; @@ -338,7 +338,7 @@ StoreUint64 (uint64_t *addr, uint64_t val) uint64_t v; if (((uintptr_t) addr & 7) != 0) - addr = NULL; + panicmem (); v = *addr; while (! __sync_bool_compare_and_swap (addr, v, val)) v = *addr; diff --git a/libgo/runtime/runtime.h b/libgo/runtime/runtime.h index dd5a958888f..39b5ef883bd 100644 --- a/libgo/runtime/runtime.h +++ b/libgo/runtime/runtime.h @@ -211,6 +211,8 @@ extern uint32 runtime_panicking(void) extern bool runtime_isstarted; extern bool runtime_isarchive; +extern void panicmem(void) __asm__ (GOSYM_PREFIX "runtime.panicmem"); + /* * common functions and data */ -- cgit v1.2.1 From bf1eb034ff2b711ba7ad585812cc7e391105e705 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 14 Nov 2017 14:26:04 +0000 Subject: libgo: adapt Solaris 12 references With the change in the Solaris release model (no more major releases like Solaris 12 but only minor ones like 11.4), the Solaris 12 references in GCC need to be adapted. Patch by Rainer Orth. Reviewed-on: https://go-review.googlesource.com/77490 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254729 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgo/Makefile.am | 2 +- libgo/Makefile.in | 2 +- libgo/configure.ac | 2 +- libgo/mkrsysinfo.sh | 8 ++++---- libgo/mksysinfo.sh | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'libgo') diff --git a/libgo/Makefile.am b/libgo/Makefile.am index 9bbda2de46e..f0ecf92ca7d 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -1191,7 +1191,7 @@ syscall/wait.lo: go/syscall/wait.c runtime.inc @$(MKDIR_P) syscall $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c -# Solaris 12 changed the type of fields in struct stat. +# 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 if HAVE_STAT_TIMESPEC diff --git a/libgo/Makefile.in b/libgo/Makefile.in index fa9da9394fe..794c125516a 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -1218,7 +1218,7 @@ extra_check_libs_cmd_go_internal_load = $(abs_builddir)/libgotool.a extra_check_libs_cmd_go_internal_work = $(abs_builddir)/libgotool.a @HAVE_STAT_TIMESPEC_FALSE@@LIBGO_IS_SOLARIS_TRUE@matchargs_os = -# Solaris 12 changed the type of fields in struct stat. +# Solaris 11.4 changed the type of fields in struct stat. # Use a build tag, based on a configure check, to cope. @HAVE_STAT_TIMESPEC_TRUE@@LIBGO_IS_SOLARIS_TRUE@matchargs_os = --tag=solaristag @LIBGO_IS_SOLARIS_FALSE@matchargs_os = diff --git a/libgo/configure.ac b/libgo/configure.ac index 4bfe1698d32..7b0c629653f 100644 --- a/libgo/configure.ac +++ b/libgo/configure.ac @@ -752,7 +752,7 @@ STRUCT_EPOLL_EVENT_FD_OFFSET=${libgo_cv_c_epoll_event_fd_offset} AC_SUBST(STRUCT_EPOLL_EVENT_FD_OFFSET) dnl Check if uses timespec_t for st_?tim members. Introduced -dnl in Solaris 12 for XPG7 compatibility. +dnl in Solaris 11.4 for XPG7 compatibility. AC_EGREP_HEADER([timespec_t.*st_atim], [sys/stat.h], [have_stat_timespec=yes], [have_stat_timespec=no]) AM_CONDITIONAL(HAVE_STAT_TIMESPEC, test $have_stat_timespec = yes) diff --git a/libgo/mkrsysinfo.sh b/libgo/mkrsysinfo.sh index aee0163c365..40bc34bbe4e 100755 --- a/libgo/mkrsysinfo.sh +++ b/libgo/mkrsysinfo.sh @@ -168,22 +168,22 @@ grep '^type _zone_net_addr_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr/[16]byte/' \ >> ${OUT} -# The Solaris 12 _flow_arp_desc_t struct. +# The Solaris 11.4 _flow_arp_desc_t struct. grep '^type _flow_arp_desc_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr_t/[16]byte/g' \ >> ${OUT} -# The Solaris 12 _flow_l3_desc_t struct. +# The Solaris 11.4 _flow_l3_desc_t struct. grep '^type _flow_l3_desc_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr_t/[16]byte/g' \ >> ${OUT} -# The Solaris 12 _mac_ipaddr_t struct. +# The Solaris 11.3 _mac_ipaddr_t struct. grep '^type _mac_ipaddr_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr_t/[16]byte/g' \ >> ${OUT} -# The Solaris 12 _mactun_info_t struct. +# The Solaris 11.3 _mactun_info_t struct. grep '^type _mactun_info_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr_t/[16]byte/g' \ >> ${OUT} diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh index cbe5b979418..c3495de72f6 100755 --- a/libgo/mksysinfo.sh +++ b/libgo/mksysinfo.sh @@ -1295,22 +1295,22 @@ grep '^type _zone_net_addr_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr/[16]byte/' \ >> ${OUT} -# The Solaris 12 _flow_arp_desc_t struct. +# The Solaris 11.4 _flow_arp_desc_t struct. grep '^type _flow_arp_desc_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr_t/[16]byte/g' \ >> ${OUT} -# The Solaris 12 _flow_l3_desc_t struct. +# The Solaris 11.4 _flow_l3_desc_t struct. grep '^type _flow_l3_desc_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr_t/[16]byte/g' \ >> ${OUT} -# The Solaris 12 _mac_ipaddr_t struct. +# The Solaris 11.3 _mac_ipaddr_t struct. grep '^type _mac_ipaddr_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr_t/[16]byte/g' \ >> ${OUT} -# The Solaris 12 _mactun_info_t struct. +# The Solaris 11.3 _mactun_info_t struct. grep '^type _mactun_info_t ' gen-sysinfo.go | \ sed -e 's/_in6_addr_t/[16]byte/g' \ >> ${OUT} -- cgit v1.2.1 From 9273bda788af05b36c62610680efa89252065b93 Mon Sep 17 00:00:00 2001 From: ro Date: Tue, 14 Nov 2017 18:31:01 +0000 Subject: Adapt Solaris 12 references libgcc: * config.host (*-*-solaris2*): Adapt comment for Solaris 12 renaming. * config/sol2/crtpg.c (__start_crt_compiler): Likewise. * configure.ac (libgcc_cv_solaris_crts): Likewise. * configure: Regenerate. gcc: * config.gcc (*-*-solaris2*): Enable default_use_cxa_atexit since Solaris 11. Update comment. * configure.ac (gcc_cv_ld_pid): Adapt comment for Solaris 12 renaming. * config/sol2.h (STARTFILE_SPEC): Likewise. * configure: Regenerate. gcc/testsuite: * lib/target-supports.exp (check_effective_target_pie): Adapt comment for Solaris 12 renaming. * gcc.dg/torture/pr60092.c: Remove *-*-solaris2.11* dg-xfail-run-if. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254737 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgo/configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libgo') diff --git a/libgo/configure b/libgo/configure index 1e5e41bed21..4e838166484 100755 --- a/libgo/configure +++ b/libgo/configure @@ -11114,7 +11114,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11117 "configure" +#line 11118 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11220,7 +11220,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11223 "configure" +#line 11224 "configure" #include "confdefs.h" #if HAVE_DLFCN_H -- cgit v1.2.1