On Sun, Nov 16, 2025 at 9:04 PM Sam James <[email protected]> wrote:
>
> Andreas Schwab <[email protected]> writes:
>
> > On Nov 16 2025, Martin Liška wrote:
> >
> >> @@ -3287,7 +3299,7 @@ elif test x"$gcc_cv_as" != x -a x"$gcc_cv_ld" != x 
> >> -a x"$gcc_cv_objdump" != x ;
> >>       && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \
> >>       && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1; then
> >>      if $gcc_cv_ld -shared -o conftest1.so conftest1.o \
> >> -       conftest2.o conftest3.o > /dev/null 2>&1 \
> >> +       conftest2.o conftest3.o --no-gc-sections > /dev/null 2>&1 \
> >>         || $gcc_cv_ld -r -o conftest1.so conftest1.o \
> >>        conftest2.o conftest3.o > /dev/null 2>&1; then
> >>        gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \
> >
> > That looks unrelated.
>
> It actually isn't, but it should be explained in the commit message and
> ideally done as a first commit. See
> https://github.com/davidlattimore/wild/issues/1298#issuecomment-3527872708.

I am not sure that change will work with say the solaris linker. It is
still the recommended linker for solaris too
(https://gcc.gnu.org/install/specific.html#x-x-solaris2):
```
For linking, the Solaris linker is preferred. If you want to use the
GNU linker instead, the version in Solaris 11.4, from GNU Binutils
2.30.1 or newer (in /usr/gnu/bin/ld and /usr/bin/gld), works. However,
it generally lacks platform specific features, so better stay with
Solaris ld. To use the LTO linker plugin (-fuse-linker-plugin) with
GNU ld, GNU Binutils must be configured with --enable-largefile. To
use Solaris ld, we recommend to configure with --without-gnu-ld
--with-ld=/usr/bin/ld to guarantee the right linker is found
irrespective of the user’s PATH.
```
Oh I just looked and solaris linker added the option as a
compatibility with the GNU linker
(https://docs.oracle.com/cd/E88353_01/html/E37839/ld-1.html).

The only other one that this might make a difference for is HPUX where
the GNU linker is NOT supported:
from  https://gcc.gnu.org/install/specific.html#hppa64-hp-hpux11 :
```
Only the HP linker is supported. Thus, it is best to explicitly
configure the target with the --with-ld=… option.
```
So this might break there, I don't know if this test would work with
the hp linker though.
(and yes hppa64-hp-hpux11 was working on the trunk as of a little over
a month ago: 
https://gcc.gnu.org/pipermail/gcc-testresults/2025-October/858909.html).

Thanks,
Andrew Pinski

Thanks,
Andrew Pinski

Reply via email to