[gofrontend] libgo: use -W,-shared-libgcc on Solaris

2 views
Skip to first unread message

Ian Lance Taylor (Gerrit)

unread,
Dec 19, 2025, 2:18:47 PM (2 days ago) Dec 19
to Cherry Mui, Than McIntosh, goph...@pubsubhelper.golang.org, Ian Lance Taylor, golang-co...@googlegroups.com
Attention needed from Cherry Mui and Than McIntosh

Ian Lance Taylor has uploaded the change for review

Ian Lance Taylor would like Cherry Mui and Than McIntosh to review this change.

Commit message

libgo: use -W,-shared-libgcc on Solaris

Patch from Rainer Orth.

For https://gcc.gnu.org/PR64900
Change-Id: I1d8c059009b2956b6e6d4f675fde79e72842ae11

Change diff

diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index 3eccadb..d139d78 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -837,7 +837,8 @@
$(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 0a2b7ee..6e194d0 100644
--- a/libgo/Makefile.in
+++ b/libgo/Makefile.in
@@ -453,6 +453,7 @@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OSCFLAGS = @OSCFLAGS@
+OSLDFLAGS = @OSLDFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
@@ -972,7 +973,8 @@
$(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 b1a2228..a46e48b 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -658,6 +658,7 @@
USING_SPLIT_STACK_FALSE
USING_SPLIT_STACK_TRUE
SPLIT_STACK
+OSLDFLAGS
HWCAP_CFLAGS
OSCFLAGS
GO_SYSCALL_OS_ARCH_FILE
@@ -11547,7 +11548,7 @@
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 @@
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 @@



+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 0b05551..aba4f8a 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -442,6 +442,15 @@
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 7c2e2e6..0b5e726 100644
--- a/libgo/testsuite/Makefile.in
+++ b/libgo/testsuite/Makefile.in
@@ -202,6 +202,7 @@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OSCFLAGS = @OSCFLAGS@
+OSLDFLAGS = @OSLDFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@

Change information

Files:
  • M libgo/Makefile.am
  • M libgo/Makefile.in
  • M libgo/configure
  • M libgo/configure.ac
  • M libgo/testsuite/Makefile.in
Change size: S
Delta: 5 files changed, 27 insertions(+), 4 deletions(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • Than McIntosh
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: gofrontend
Gerrit-Branch: master
Gerrit-Change-Id: I1d8c059009b2956b6e6d4f675fde79e72842ae11
Gerrit-Change-Number: 731482
Gerrit-PatchSet: 1
Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Than McIntosh <th...@golang.org>
Gerrit-Attention: Cherry Mui <cher...@google.com>
Gerrit-Attention: Than McIntosh <th...@golang.org>
unsatisfied_requirement
satisfied_requirement
open
diffy

Cherry Mui (Gerrit)

unread,
Dec 19, 2025, 2:35:31 PM (2 days ago) Dec 19
to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Than McIntosh, golang-co...@googlegroups.com
Attention needed from Ian Lance Taylor and Than McIntosh

Cherry Mui voted and added 2 comments

Votes added by Cherry Mui

Code-Review+1

2 comments

Commit Message
Line 7, Patchset 1 (Latest):libgo: use -W,-shared-libgcc on Solaris
Cherry Mui . unresolved

-Wc

File libgo/configure.ac
Line 448, Patchset 1 (Latest): # PR go/64900.
OSLDFLAGS="-Wc,-shared-libgcc"
Cherry Mui . unresolved

On the linked PR you replied that -shared-libgcc may not work and we instead want to use -lgcc -lgcc_s. Is it changed now?

Open in Gerrit

Related details

Attention is currently required from:
  • Ian Lance Taylor
  • Than McIntosh
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: gofrontend
    Gerrit-Branch: master
    Gerrit-Change-Id: I1d8c059009b2956b6e6d4f675fde79e72842ae11
    Gerrit-Change-Number: 731482
    Gerrit-PatchSet: 1
    Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Than McIntosh <th...@golang.org>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Than McIntosh <th...@golang.org>
    Gerrit-Comment-Date: Fri, 19 Dec 2025 19:35:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    open
    diffy

    Ian Lance Taylor (Gerrit)

    unread,
    Dec 19, 2025, 3:06:45 PM (2 days ago) Dec 19
    to Ian Lance Taylor, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
    Attention needed from Ian Lance Taylor and Than McIntosh

    Ian Lance Taylor uploaded new patchset

    Ian Lance Taylor uploaded patch set #2 to this change.
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ian Lance Taylor
    • Than McIntosh
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: newpatchset
    Gerrit-Project: gofrontend
    Gerrit-Branch: master
    Gerrit-Change-Id: I1d8c059009b2956b6e6d4f675fde79e72842ae11
    Gerrit-Change-Number: 731482
    Gerrit-PatchSet: 2
    unsatisfied_requirement
    open
    diffy

    Ian Lance Taylor (Gerrit)

    unread,
    Dec 19, 2025, 3:07:50 PM (2 days ago) Dec 19
    to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Cherry Mui, Than McIntosh, golang-co...@googlegroups.com
    Attention needed from Cherry Mui and Than McIntosh

    Ian Lance Taylor added 2 comments

    Commit Message
    Line 7, Patchset 1:libgo: use -W,-shared-libgcc on Solaris
    Cherry Mui . resolved

    -Wc

    Ian Lance Taylor

    Thanks, done.

    File libgo/configure.ac
    Line 448, Patchset 1: # PR go/64900.
    OSLDFLAGS="-Wc,-shared-libgcc"
    Cherry Mui . resolved

    On the linked PR you replied that -shared-libgcc may not work and we instead want to use -lgcc -lgcc_s. Is it changed now?

    Ian Lance Taylor

    Thanks. Since this is Solaris-specific, and it is working on Solaris, I've decided that I'm fine with it.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • Than McIntosh
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: gofrontend
      Gerrit-Branch: master
      Gerrit-Change-Id: I1d8c059009b2956b6e6d4f675fde79e72842ae11
      Gerrit-Change-Number: 731482
      Gerrit-PatchSet: 1
      Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Than McIntosh <th...@golang.org>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Attention: Than McIntosh <th...@golang.org>
      Gerrit-Comment-Date: Fri, 19 Dec 2025 20:07:46 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Cherry Mui <cher...@google.com>
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Cherry Mui (Gerrit)

      unread,
      Dec 19, 2025, 3:52:48 PM (2 days ago) Dec 19
      to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Than McIntosh, golang-co...@googlegroups.com
      Attention needed from Ian Lance Taylor and Than McIntosh

      Cherry Mui voted Code-Review+2

      Code-Review+2
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ian Lance Taylor
      • Than McIntosh
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: gofrontend
      Gerrit-Branch: master
      Gerrit-Change-Id: I1d8c059009b2956b6e6d4f675fde79e72842ae11
      Gerrit-Change-Number: 731482
      Gerrit-PatchSet: 2
      Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Than McIntosh <th...@golang.org>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Than McIntosh <th...@golang.org>
      Gerrit-Comment-Date: Fri, 19 Dec 2025 20:52:43 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Knyszek (Gerrit)

      unread,
      Dec 19, 2025, 5:38:21 PM (2 days ago) Dec 19
      to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Cherry Mui, Than McIntosh, golang-co...@googlegroups.com
      Attention needed from Ian Lance Taylor and Than McIntosh

      Michael Knyszek voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ian Lance Taylor
      • Than McIntosh
      Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: gofrontend
        Gerrit-Branch: master
        Gerrit-Change-Id: I1d8c059009b2956b6e6d4f675fde79e72842ae11
        Gerrit-Change-Number: 731482
        Gerrit-PatchSet: 2
        Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
        Gerrit-Reviewer: Than McIntosh <th...@golang.org>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Than McIntosh <th...@golang.org>
        Gerrit-Comment-Date: Fri, 19 Dec 2025 22:38:19 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Ian Lance Taylor (Gerrit)

        unread,
        Dec 19, 2025, 5:59:13 PM (2 days ago) Dec 19
        to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Cherry Mui, Than McIntosh, golang-co...@googlegroups.com
        Attention needed from Than McIntosh

        Ian Lance Taylor added 1 comment

        Patchset-level comments
        File-level comment, Patchset 2 (Latest):
        Ian Lance Taylor . resolved

        Thanks.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Than McIntosh
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: gofrontend
        Gerrit-Branch: master
        Gerrit-Change-Id: I1d8c059009b2956b6e6d4f675fde79e72842ae11
        Gerrit-Change-Number: 731482
        Gerrit-PatchSet: 2
        Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
        Gerrit-Reviewer: Than McIntosh <th...@golang.org>
        Gerrit-Attention: Than McIntosh <th...@golang.org>
        Gerrit-Comment-Date: Fri, 19 Dec 2025 22:59:10 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy

        Ian Lance Taylor (Gerrit)

        unread,
        Dec 19, 2025, 5:59:18 PM (2 days ago) Dec 19
        to Ian Lance Taylor, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Michael Knyszek, Cherry Mui, Than McIntosh, golang-co...@googlegroups.com

        Ian Lance Taylor submitted the change

        Change information

        Commit message:
        libgo: use -Wc,-shared-libgcc on Solaris


        Patch from Rainer Orth.

        For https://gcc.gnu.org/PR64900
        Change-Id: I1d8c059009b2956b6e6d4f675fde79e72842ae11
        Reviewed-by: Cherry Mui <cher...@google.com>
        Reviewed-by: Michael Knyszek <mkny...@google.com>
        Files:
        • M libgo/Makefile.am
        • M libgo/Makefile.in
        • M libgo/configure
        • M libgo/configure.ac
        • M libgo/testsuite/Makefile.in
        Change size: S
        Delta: 5 files changed, 27 insertions(+), 4 deletions(-)
        Branch: refs/heads/master
        Submit Requirements:
        • requirement satisfiedCode-Review: +2 by Cherry Mui, +1 by Michael Knyszek
        Open in Gerrit
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: merged
        Gerrit-Project: gofrontend
        Gerrit-Branch: master
        Gerrit-Change-Id: I1d8c059009b2956b6e6d4f675fde79e72842ae11
        Gerrit-Change-Number: 731482
        Gerrit-PatchSet: 3
        Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages