Like the gas/solaris_as case, a testcase actually checks if Solaris ld
is in use.  This patch uses the et-static framework to introduce a
solaris_ld effective target for this.

Other uses of the existing gld effective target are about GNU ld
features and remain untouched.

Bootstrapped without regressions on i386-pc-solaris2.11,
sparc-sun-solaris2.11 (as/ld and gas/gld), and x86_64-pc-linux-gnu.

To be committed to trunk after some et-static soak time.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2026-05-10  Rainer Orth  <[email protected]>

        gcc/testsuite:
        * lib/et-static.def (solaris_ld): New effective target.

        * g++.dg/eh/unwind-direct.C: Check solaris_ld instead of !gld.

        gcc:
        * doc/sourcebuild.texi (Effective-Target Keywords, Other
        attributes): Document solaris_ld.

# HG changeset patch
# Parent  9c0a49a739f445dcc30a8759a9a682d04f6a117f
testsuite: Use solaris_ld effective target

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -3180,6 +3180,9 @@ Target defaults to short enums.
 @item solaris_as
 Target uses the Solaris @command{as}.
 
+@item solaris_ld
+Target uses the Solaris @command{ld}.
+
 @item stack_size
 @anchor{stack_size_et}
 Target has limited stack size.  The stack size limit can be obtained using the
diff --git a/gcc/testsuite/g++.dg/eh/unwind-direct.C b/gcc/testsuite/g++.dg/eh/unwind-direct.C
--- a/gcc/testsuite/g++.dg/eh/unwind-direct.C
+++ b/gcc/testsuite/g++.dg/eh/unwind-direct.C
@@ -1,5 +1,5 @@
 // PR target/59788
-// { dg-do run { target { *-*-solaris2* && { ! gld } } } }
+// { dg-do run { target solaris_ld } }
 // { dg-options "-Wl,-Bdirect" }
 
 #include <stdexcept>
diff --git a/gcc/testsuite/lib/et-static.def b/gcc/testsuite/lib/et-static.def
--- a/gcc/testsuite/lib/et-static.def
+++ b/gcc/testsuite/lib/et-static.def
@@ -31,3 +31,7 @@ your linker supports GNU style response 
 solaris_as
 HAVE_SOLARIS_AS
 using the Solaris assembler
+
+solaris_ld
+HAVE_SOLARIS_LD
+using the Solaris linker

Reply via email to