https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121458
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Rainer Orth <[email protected]>: https://gcc.gnu.org/g:5afd19be0d7b7d781522538187619b625d0a390e commit r16-5272-g5afd19be0d7b7d781522538187619b625d0a390e Author: Rainer Orth <[email protected]> Date: Fri Nov 14 09:12:34 2025 +0100 build: Require binutils 2.30+ on Solaris [PR121457, PR121458] I recently noticed that gcc/configure.ac contains quite a number of checks for Solaris ld and GNU ld versions that can be massively simplified. GCC trunk only supports Solaris 11.4, thus Solaris ld is at least at version 5.11-1.3159 (the one in 11.4 FCS), and GNU ld can be required to be at least 2.30.1, the version bundled in 11.4 FCS. This way quite a number of special cases can simply be removed, as well as some macros that depend on them and the code they guard. To ensure that nobody tries to use an older self-compiled version of GNU ld, the minimum version is checked at configure time. This change also allowed to fix two bugs that were caused by checks for *_sol2 among the linker emulations listed by gld -V, which are only valid when targetting Solaris. Before those checks were done irrespective of target, causing checks to go wrong when a version of binutils configured with --enable-targets=all was used. Since now all versions of GNU ld supported on Solaris are known to support those *_sol2 emulations, the checks can be replaced by hardcoding the emulations when targetting Solaris. Bootstrapped without regressions on i386-pc-solaris2.11, sparc-sun-solaris2.11, and x86_64-pc-linux-gnu. 2025-09-22 Rainer Orth <[email protected]> gcc: PR target/121458 PR target/121457 * configure.ac: Fix typos. <*-*-solaris2*>: Require GNU ld 2.30. (comdat_group) <*-*-solaris2.1[1-9]*>: Always set to yes. (ld_ix86_gld_32_opt): Only use -melf_i386_sol2 for Solaris target. (ld_ix86_gld_64_opt): Likewise with -melf_x86_64_sol. (gcc_cv_ld_eh_frame_hdr) <*-*-solaris2*>: Likewise. (gcc_cv_ld_pie) <*-*-solaris2*>: Remove special cases. (gcc_cv_ld_compress_debug) <*-*-solaris2*>: Remove guard. (gcc_cv_ld_as_needed): Simplify guard. (gcc_cv_ld_sol2_emulation): Remove. (gcc_cv_solaris_crts): Remove. * configure: Regenerate. * config.in: Regenerate. * config/sol2.h (STARTFILE_CRTBEGIN_SPEC): Remove !HAVE_LD_PIE support. (ENDFILE_CRTEND_SPEC): Likewise. (LD_PIE_SPEC): Likewise. [USE_GLD] (LINK_EH_SPEC): Set unconditionally. * config/i386/sol2.h [USE_GLD]: Remove !HAVE_LD_SOL2_EMULATION support. * config/sparc/sol2.h: Likewise. * doc/install.texi (Specific, *-*-solaris2*): Update bundled gcc versions. Raise required binutils version. Remove binutils 2.44 caveat.
