https://gcc.gnu.org/g:69d23b51534bee413a4d1233d2737a7be82e6b80
commit r17-2044-g69d23b51534bee413a4d1233d2737a7be82e6b80 Author: Rainer Orth <[email protected]> Date: Wed Jul 1 10:48:38 2026 +0200 build: Remove --with-gnu-ld Like the gas case, after the removal of HAVE_GNU_LD and the gnu_ld variable, the --with-gnu-ld option has become unnecessary, too, so this patch removes it together with the gnu_ld_flag variable. Given that the vast majority of configurations use GNU ld or a compatible linker, the GNU ld annotation to the DEFAULT_LINKER configure message carries little additional information and is also removed. 2026-04-13 Rainer Orth <[email protected]> gcc: * configure.ac: Remove --with-gnu-ld, gnu_ld_flag. * configure: Regenerate. * config.gcc: Remove gnu_ld_flag. * doc/install.texi (Configuration, --with-gnu-ld): Remove. (Specific, all ELF targets): Remove GNU ld link. * doc/invoke.texi (IA-64 Options, -mgnu-ld): Remove comment. contrib: * config-list.mk (sparc64-sun-solaris2.11): Remove --with-gnu-ld. contrib/regression: * btest-gcc.sh (withopt): Likewise. Diff: --- contrib/config-list.mk | 2 +- contrib/regression/btest-gcc.sh | 3 +-- gcc/config.gcc | 4 ---- gcc/configure | 26 ++++---------------------- gcc/configure.ac | 14 +------------- gcc/doc/install.texi | 6 +----- gcc/doc/invoke.texi | 2 -- 7 files changed, 8 insertions(+), 49 deletions(-) diff --git a/contrib/config-list.mk b/contrib/config-list.mk index 795e97d56fa7..69f5aed476d3 100644 --- a/contrib/config-list.mk +++ b/contrib/config-list.mk @@ -99,7 +99,7 @@ LIST = \ sh-rtems sh-wrs-vxworks sparc-elf \ sparc-leon-elf sparc-rtems sparc-linux-gnu \ sparc-leon3-linux-gnuOPT-enable-target=all sparc-netbsdelf \ - sparc64-sun-solaris2.11OPT-with-gnu-ldOPT-enable-threads=posix \ + sparc64-sun-solaris2.11OPT-enable-threads=posix \ sparc-wrs-vxworks sparc64-elf sparc64-rtems sparc64-linux \ sparc64-netbsd sparc64-openbsd \ v850e1-elf v850e-elf v850-elf v850-rtems vax-linux-gnu \ diff --git a/contrib/regression/btest-gcc.sh b/contrib/regression/btest-gcc.sh index b198e02952c7..8b2642f98bc1 100755 --- a/contrib/regression/btest-gcc.sh +++ b/contrib/regression/btest-gcc.sh @@ -138,10 +138,9 @@ if [ $H_HOST = $H_TARGET ] ; then make $dashj all || exit 1 fi else - withopt="--with-gnu-ld" case "$H_TARGET" in *-linux*) ;; - *) withopt="$withopt --with-newlib";; + *) withopt="--with-newlib";; esac $SOURCE/configure --prefix=$PREFIX --target=$H_TARGET $withopt || exit 1 make $dashj || exit 1 diff --git a/gcc/config.gcc b/gcc/config.gcc index ddd5de5c8e80..15f663cfb642 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -54,10 +54,6 @@ # support, the default value of # $default_gnu_indirect_function is set to # "no" except for targets which are known to be OK. -# -# gnu_ld_flag One of yes, no or "" depending on whether GNU ld was -# explicitly requested, explicitly not requested or -# unspecified. # This file sets the following shell variables for use by the # autoconf-generated configure script: diff --git a/gcc/configure b/gcc/configure index 4cb05534137b..f9c09bf5f355 100755 --- a/gcc/configure +++ b/gcc/configure @@ -971,7 +971,6 @@ with_gxx_include_dir with_gxx_libcxx_include_dir with_cpp_install_dir enable_generated_files_in_srcdir -with_gnu_ld with_ld with_demangler_in_ld with_dsymutil @@ -1012,6 +1011,7 @@ with_picolibc with_zstd with_zstd_include with_zstd_lib +with_gnu_ld enable_rpath with_libiconv_prefix with_libiconv_type @@ -1869,7 +1869,6 @@ Optional Packages: --with-cpp-install-dir=DIR install the user visible C preprocessor in DIR (relative to PREFIX) as well as PREFIX/bin - --with-gnu-ld arrange to work with GNU ld --with-ld arrange to use the specified ld (full pathname) --with-demangler-in-ld try to use demangler in GNU ld --with-dsymutil arrange to use the specified dsymutil (full @@ -3925,16 +3924,6 @@ fi # Find default linker # ------------------- -# With GNU ld - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; gnu_ld_flag="$with_gnu_ld" -else - gnu_ld_flag= -fi - - case $target in *darwin*) ld64_flag=yes # Darwin can only use a ld64-compatible linker. @@ -3956,8 +3945,6 @@ fi if test x"${DEFAULT_LINKER+set}" = x"set"; then if test ! -x "$DEFAULT_LINKER"; then as_fn_error $? "cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" "$LINENO" 5 - elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then - gnu_ld_flag=yes elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep 'PROJECT:ld\(64\)*-' > /dev/null; then ld64_flag=yes fi @@ -3971,13 +3958,8 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a default linker was specified" >&5 $as_echo_n "checking whether a default linker was specified... " >&6; } if test x"${DEFAULT_LINKER+set}" = x"set"; then - if test x"$gnu_ld_flag" = x"no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_LINKER)" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_LINKER)" >&5 $as_echo "yes ($DEFAULT_LINKER)" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_LINKER - GNU ld)" >&5 -$as_echo "yes ($DEFAULT_LINKER - GNU ld)" >&6; } - fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -21939,7 +21921,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 21942 "configure" +#line 21924 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -22045,7 +22027,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 22048 "configure" +#line 22030 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 247d2f4691f5..4654826410e1 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -332,12 +332,6 @@ AC_SUBST(GENINSRC) # Find default linker # ------------------- -# With GNU ld -AC_ARG_WITH(gnu-ld, -[AS_HELP_STRING([--with-gnu-ld], [arrange to work with GNU ld])], -gnu_ld_flag="$with_gnu_ld", -gnu_ld_flag=) - case $target in *darwin*) ld64_flag=yes # Darwin can only use a ld64-compatible linker. @@ -356,8 +350,6 @@ DEFAULT_LINKER="$with_ld") if test x"${DEFAULT_LINKER+set}" = x"set"; then if test ! -x "$DEFAULT_LINKER"; then AC_MSG_ERROR([cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER]) - elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then - gnu_ld_flag=yes elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep 'PROJECT:ld\(64\)*-' > /dev/null; then ld64_flag=yes fi @@ -367,11 +359,7 @@ fi AC_MSG_CHECKING([whether a default linker was specified]) if test x"${DEFAULT_LINKER+set}" = x"set"; then - if test x"$gnu_ld_flag" = x"no"; then - AC_MSG_RESULT([yes ($DEFAULT_LINKER)]) - else - AC_MSG_RESULT([yes ($DEFAULT_LINKER - GNU ld)]) - fi + AC_MSG_RESULT([yes ($DEFAULT_LINKER)]) else AC_MSG_RESULT(no) fi diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 1adb7493585d..aab839952a04 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1211,10 +1211,6 @@ is installed in the directories listed above, or if you have multiple assemblers installed and want to choose one that is not found by the above rules. -@item @anchor{with-gnu-ld}--with-gnu-ld -Same as @uref{#with-gnu-as,,@option{--with-gnu-as}} -but for the linker. - @item --with-ld=@var{pathname} Same as @uref{#with-as,,@option{--with-as}} but for the linker. @@ -5307,7 +5303,7 @@ current GCC) is to be found in the GCC texinfo manual. @anchor{elf} @heading all ELF targets (SVR4, Solaris, etc.) C++ support is significantly better on ELF targets if you use the -@uref{./configure.html#with-gnu-ld,,GNU linker}; duplicate copies of +GNU linker; duplicate copies of inlines, vtables and template instantiations will be discarded automatically. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 247e95e968ff..9546523fd657 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -27398,8 +27398,6 @@ Generate (or don't) code for the GNU assembler. This is the default. @item -mgnu-ld @itemx -mno-gnu-ld Generate (or don't) code for the GNU linker. This is the default. -@c Also, this is the default if the configure option @option{--with-gnu-ld} -@c is used. @opindex mno-pic @item -mno-pic
