This patch to libgo uses -Wc,-shared-libgcc on Solaris. The patch is
from Rainer Orth. This is for GCC PR 64900. Committed to mainline.
Ian
d6c9bdf267c4a97a7ad79aeedf7b970fff48d28e
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index c1abe89afb7..4520e543784 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-ace35ffba59c926d401a6d3f918bd3c85f48c8fd
+6e421340885c87c4987f27be4a16b7bedb86faaa
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index 3eccadbac67..d139d7818ec 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -837,7 +837,8 @@ libgo_go_objs = \
$(golangorg_x_sys_cpu_gccgo_x86_lo)
libgo_ldflags = \
- -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
+ -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS) \
+ $(OSLDFLAGS)
libgo_libadd = \
$(libgo_go_objs) ../libbacktrace/libbacktrace.la \
diff --git a/libgo/configure.ac b/libgo/configure.ac
index f8fe5f2ed98..0004819d967 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -442,6 +442,15 @@ AC_SUBST(OSCFLAGS)
dnl Check if assembler supports disabling hardware capability support.
GCC_CHECK_ASSEMBLER_HWCAP
+case "$target" in
+ *86*-*-solaris2.*)
+ # Link with -shared-libgcc on Solaris 11+/x86 as a workaround for
+ # PR go/64900.
+ OSLDFLAGS="-Wc,-shared-libgcc"
+ ;;
+esac
+AC_SUBST(OSLDFLAGS)
+
dnl Use -fsplit-stack when compiling C code if available.
AC_CACHE_CHECK([whether -fsplit-stack is supported],
[libgo_cv_c_split_stack_supported],