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
This commit is contained in:
Ian Lance Taylor
2025-12-19 11:17:48 -08:00
parent 68501f9d89
commit 15f7c58961
6 changed files with 28 additions and 5 deletions

View File

@@ -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.

View File

@@ -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 \

View File

@@ -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 \

14
libgo/configure vendored
View File

@@ -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 :

View File

@@ -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],

View File

@@ -202,6 +202,7 @@ OBJCOPY = @OBJCOPY@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OSCFLAGS = @OSCFLAGS@
OSLDFLAGS = @OSLDFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@