https://gcc.gnu.org/g:15f7c5896191818a02c65f958edb5af3f527ebf0

commit r16-6305-g15f7c5896191818a02c65f958edb5af3f527ebf0
Author: Ian Lance Taylor <[email protected]>
Date:   Fri Dec 19 11:17:48 2025 -0800

    libgo: use -Wc,-shared-libgcc on Solaris
    
    Patch from Rainer Orth.
    
    For GCC PR go/64900
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/731482

Diff:
---
 gcc/go/gofrontend/MERGE     |  2 +-
 libgo/Makefile.am           |  3 ++-
 libgo/Makefile.in           |  4 +++-
 libgo/configure             | 14 ++++++++++++--
 libgo/configure.ac          |  9 +++++++++
 libgo/testsuite/Makefile.in |  1 +
 6 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index c1abe89afb7e..4520e543784a 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 3eccadbac67b..d139d7818ec4 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/Makefile.in b/libgo/Makefile.in
index 0a2b7ee55301..6e194d084dae 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -453,6 +453,7 @@ OBJCOPY = @OBJCOPY@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OSCFLAGS = @OSCFLAGS@
+OSLDFLAGS = @OSLDFLAGS@
 OTOOL = @OTOOL@
 OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
@@ -972,7 +973,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 b/libgo/configure
index bba3c7aa7804..fa290d43ba21 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -658,6 +658,7 @@ GO_SPLIT_STACK
 USING_SPLIT_STACK_FALSE
 USING_SPLIT_STACK_TRUE
 SPLIT_STACK
+OSLDFLAGS
 HWCAP_CFLAGS
 OSCFLAGS
 GO_SYSCALL_OS_ARCH_FILE
@@ -11547,7 +11548,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11550 "configure"
+#line 11551 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11653,7 +11654,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11656 "configure"
+#line 11657 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14457,6 +14458,15 @@ $as_echo "$ac_hwcap_flags" >&6; }
 
 
 
+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
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -fsplit-stack is 
supported" >&5
 $as_echo_n "checking whether -fsplit-stack is supported... " >&6; }
 if ${libgo_cv_c_split_stack_supported+:} false; then :
diff --git a/libgo/configure.ac b/libgo/configure.ac
index f8fe5f2ed98f..0004819d967d 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],
diff --git a/libgo/testsuite/Makefile.in b/libgo/testsuite/Makefile.in
index 7c2e2e62fcf3..0b5e7263dcc3 100644
--- a/libgo/testsuite/Makefile.in
+++ b/libgo/testsuite/Makefile.in
@@ -202,6 +202,7 @@ OBJCOPY = @OBJCOPY@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OSCFLAGS = @OSCFLAGS@
+OSLDFLAGS = @OSLDFLAGS@
 OTOOL = @OTOOL@
 OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@

Reply via email to