{"id":2231906,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2231906/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/ydd1pfv41rj.fsf_-_@CeBiTec.Uni-Bielefeld.DE/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<ydd1pfv41rj.fsf_-_@CeBiTec.Uni-Bielefeld.DE>","date":"2026-05-01T14:56:16","name":"[v2,5/6] build: Remove $gnu_ld","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"75a72a95a555da5708e12fbf5d6c9ff7276cd39e","submitter":{"id":4362,"url":"http://patchwork.ozlabs.org/api/1.1/people/4362/?format=json","name":"Rainer Orth","email":"ro@CeBiTec.Uni-Bielefeld.DE"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/ydd1pfv41rj.fsf_-_@CeBiTec.Uni-Bielefeld.DE/mbox/","series":[{"id":502471,"url":"http://patchwork.ozlabs.org/api/1.1/series/502471/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=502471","date":"2026-05-01T14:56:16","name":null,"version":2,"mbox":"http://patchwork.ozlabs.org/series/502471/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2231906/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2231906/checks/","tags":{},"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=cebitec.uni-bielefeld.de header.i=@cebitec.uni-bielefeld.de\n header.a=rsa-sha256 header.s=20200306 header.b=Wd+FvTCm;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=cebitec.uni-bielefeld.de header.i=@cebitec.uni-bielefeld.de\n header.a=rsa-sha256 header.s=20200306 header.b=Wd+FvTCm","sourceware.org; dmarc=none (p=none dis=none)\n header.from=CeBiTec.Uni-Bielefeld.DE","sourceware.org;\n spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de","server2.sourceware.org;\n arc=none smtp.remote-ip=129.70.160.84"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g6Yz96LJfz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 02 May 2026 00:56:52 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 9048C43B5500\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  1 May 2026 14:56:50 +0000 (GMT)","from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE\n [129.70.160.84])\n by sourceware.org (Postfix) with ESMTPS id 236D144115CD\n for <gcc-patches@gcc.gnu.org>; Fri,  1 May 2026 14:56:19 +0000 (GMT)","from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1])\n by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 110C8C7E64;\n Fri,  1 May 2026 16:56:18 +0200 (CEST)","from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1])\n by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new,\n port 10026)\n with ESMTP id s6W-XyTcc_GQ; Fri,  1 May 2026 16:56:16 +0200 (CEST)","from manam.CeBiTec.Uni-Bielefeld.DE (p508551ea.dip0.t-ipconnect.de\n [80.133.81.234]) (Authenticated sender: ro)\n by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id B6659D8027;\n Fri,  1 May 2026 16:56:16 +0200 (CEST)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 9048C43B5500","OpenDKIM Filter v2.11.0 sourceware.org 236D144115CD"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 236D144115CD","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 236D144115CD","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777647379; cv=none;\n b=EtbTQq5Z7b+QGQvz8UHxue0Nw88bFlcscNXV9avAYuh6kPyrI3XuN5jZNWUP9/iBuq1pblKeKkBU4Tgxr+woymud3Qy30aCpHg4R2j3UKMxdJ2D8VkjMClOFICV/Q6+YwudfKVf7+4xp66I8plxnZYJklKtg8TKYPyAiqVlwnVQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777647379; c=relaxed/simple;\n bh=G533HjBsY/6QLljJm1IrxpTyTGy7omWZ+xwnZwHKssw=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=gW+kqSwYrz4nQ3S5fkTqgvGHwH/lS/RPUWQaD1eodfU6P6+dyHxmIYIOhuy/wIM13aS0x+aAVAR2ySxzOtm9LaWUEZCJeQJ60HyTAS2f3cC6dgtCs+AhwSO6JwWaFixqEFUVVVQc9L8xo7WufHCtUQHkQx9nuFzZol2RadE+G0I=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=\n cebitec.uni-bielefeld.de; h=content-type:content-type\n :mime-version:user-agent:message-id:date:date:references\n :in-reply-to:subject:subject:from:from:received:received; s=\n 20200306; t=1777647376; bh=G533HjBsY/6QLljJm1IrxpTyTGy7omWZ+xwnZ\n wHKssw=; b=Wd+FvTCmwHekvXtA+20Y1UfMxDtHs8vpvE4HwTcb2imPcpCWY25gT\n Yu3xk9R8CGmZJvbTTE+q50NxTnxQYCaftnZje5AHQcfsCLchMzRYnKXpZc5Os9eh\n jfu1X8lWTHHJbR1+eS69ChwMXlSYWlSvq6voJc9suRfqhU+hC/kKaPC2h3e2Qaoj\n 9BtVqC2h3F6VmZZ3BGTbArMIsYfL2mHXlwAr08VLS+AoxBFObPD+r72xmNz6dC3q\n NTE4b5D37gUf7pk1hHtS3U2OySL64XlPuLW2CZ+DeTc+pyUSgRq3Y8A8XumD/mx3\n foTYyZn9uKQ/poPpADXW2S96jHyFp9r9Q==","X-Virus-Scanned":"amavisd-new at cebitec.uni-bielefeld.de","From":"Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>","To":"John David Anglin <dave.anglin@bell.net>","Cc":"Alexandre Oliva <oliva@gnu.org>,  gcc-patches@gcc.gnu.org","Subject":"[PATCH v2 5/6] build: Remove $gnu_ld","In-Reply-To":"<3b98dd05-1f97-42ab-bc4f-f374c848306b@bell.net> (John David\n Anglin's message of \"Thu, 30 Apr 2026 15:02:46 -0400\")","References":"<yddlde5981d.fsf@CeBiTec.Uni-Bielefeld.DE>\n <orjytpje7k.fsf@lxoliva.fsfla.org>\n <yddzf2k653o.fsf@CeBiTec.Uni-Bielefeld.DE>\n <3b98dd05-1f97-42ab-bc4f-f374c848306b@bell.net>","Date":"Fri, 01 May 2026 16:56:16 +0200","Message-ID":"<ydd1pfv41rj.fsf_-_@CeBiTec.Uni-Bielefeld.DE>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","Content-Type":"multipart/mixed; boundary=\"=-=-=\"","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"Hi John,\n\n> On 2026-04-30 7:48 a.m., Rainer Orth wrote:\n>>>> <*-*-hpux*>: Assume gnu_ld=no.\n>>> IIUC these need changes.\n>> I don't think so: unless I'm missing something, the gnu_ld=yes case\n>> should already be handled by the previous $gcc_cv_ld --help check.  The\n>> current gnu_ld=no check should have been unnecessary.  John?\n>\n> If a 64-bit hpux target has the GNU assembler, then it should also have GNU ld.\n>\n> Only the 32-bit hppa*-*-hpux* target lacked GNU ld.  This target is no longer supported.\n> However, the default linker if not specified probably should remain HP ld on hppa*-*-hpux*\n> as it is better supported.  Not sure about ia64-*-hpux* but I believe this target no longer\n> supported.\n\nthis revised patch follows what I've done for Solaris ld: configure\nchecks whatever linker is either found on PATH or specified with\n--with-ld.  The $gcc_cv_ld -V part then determines which one it is and\nacts accordingly.  For Solaris, I've left it to install.texi to explain\nmy preference (Solaris ld) and the advantages and disadvantages of\neither, together with always recommending to use --with-ld.\n\nThat allows users to make an informed choice.\n\n> On a slightly different issue, if I try to build gcc with GNU ld with a version\n> of gcc built with HP ld, I have to explicity configure with --with-ld or export\n> DEFAULT_LINKER=/opt/gnu64/bin/ld.  This causes issues with the binutils ld testsuite:\n>\n> Using /home/dave/gnu/binutils/src/ld/testsuite/config/default.exp as\n> tool-and-target-specific interface file.\n> ERROR: ************************************************************************\n> ERROR: Your compiler apparently ignores -B when choosing ld.\n> ERROR: You will not be testing the new ld in many of the following tests.\n> ERROR: It seems you will be testing /opt/gnu64/bin/ld instead.\n> ERROR: ************************************************************************\n>\n> Is there a way to work around this or fix this?\n>\n> If I don't specify --with-ld when configuring, I end up with `ORIGINAL_LD_FOR_TARGET=\"/usr/ccs/bin/ld\"'\n> (i.e., HP ld) in collect-ld even if HP ld is not in PATH or COMPILER_PATH.  This causes\n> HP ld to be used even though I configured with --with-gnu-ld.\n\nTesting binutils is always a special case for exactly that reason.\nHere's what I do on Solaris:\n\n* Build and install Binutils into some prefix.\n\n* Prefix PATH with $prefix/bin, then build and install GCC into the\n  prefix *without* either --with-as or --with-ld.  This way, GNU ld is\n  picked up and gcc/configure determines that it's not Solaris ld.\n\nThe resulting gcc is used to build and test binutils trunk.  Again, it\npicks as/ld from PATH as above *and* allows gcc -B... to use the freshly\nbuilt gas and gld in the binutils tests.\n\nIt's certainly tedious to need such a special GCC build (which is\notherwise undesirable since PATH changes could cause it to use an\nincompatible assembler/linker not used during configure), but otherwise\nworks just fine.  Fortunately, you don't have to do this often, so once\nset up, you're set.\n\nHope this helps.\n\n\tRainer","diff":"# HG changeset patch\n# Parent  fe6b03587bee6fdd7df1519a6b8388979ea7fc1e\nbuild: Remove $gnu_ld\n\ndiff --git a/gcc/config.gcc b/gcc/config.gcc\n--- a/gcc/config.gcc\n+++ b/gcc/config.gcc\n@@ -194,9 +194,6 @@\n # The following variables are used in each case-construct to build up the\n # outgoing variables:\n #\n-#  gnu_ld\t\tSet to yes or no depending on whether the target\n-#\t\t\tsystem normally uses GNU ld.\n-#\n #  target_has_targetcm\tSet to yes or no depending on whether the target\n #\t\t\thas its own definition of targetcm.\n #\n@@ -245,7 +242,6 @@ target_cpu_default=\n gdb_needs_out_file_path=\n # Set this to control which thread package will be used.\n thread_file=\n-gnu_ld=\"$gnu_ld_flag\"\n default_use_cxa_atexit=no\n default_gnu_indirect_function=no\n target_gtfiles=\n@@ -845,7 +841,6 @@ case ${target} in\n   esac\n   ;;\n *-*-dragonfly*)\n-  gnu_ld=yes\n   tmake_file=\"t-slibgcc\"\n   case ${enable_threads} in\n     \"\" | yes | posix)\n@@ -884,7 +879,6 @@ case ${target} in\n   # The machine-specific section should not tamper with this\n   # ordering but may order all other entries of tm_file as it\n   # pleases around the provided core setting.\n-  gnu_ld=yes\n   fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\\..*//g'`\n   if test \"$fbsd_major\" = \"\"; then\n     echo \"Specify the major version number of the targeted FreeBSD release\"\n@@ -928,7 +922,6 @@ case ${target} in\n   ;;\n *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)\n   extra_options=\"$extra_options gnu-user.opt\"\n-  gnu_ld=yes\n   case ${enable_threads} in\n     \"\" | yes | posix) thread_file='posix' ;;\n   esac\n@@ -1016,7 +1009,6 @@ case ${target} in\n   tmake_file=\"t-netbsd t-slibgcc\"\n   extra_objs=\"${extra_objs} netbsd.o\"\n   d_target_objs=\"${d_target_objs} netbsd-d.o\"\n-  gnu_ld=yes\n   use_gcc_stdint=wrap\n   case ${enable_threads} in\n     \"\" | yes | posix) thread_file='posix' ;;\n@@ -1050,7 +1042,6 @@ case ${target} in\n   target_has_targetrustm=yes\n   ;;\n *-*-phoenix*)\n-  gnu_ld=yes\n   default_use_cxa_atexit=yes\n   ;;\n *-*-rtems*)\n@@ -1835,7 +1826,6 @@ frv-*-*linux*)\n \ttmake_file=\"${tmake_file} frv/t-frv frv/t-linux\"\n \t;;\n ft32-*-elf)\n-\tgnu_ld=yes\n \ttm_file=\"elfos.h newlib-stdint.h ${tm_file}\"\n \ttmake_file=\"${tmake_file} ft32/t-ft32\"\n \t;;\n@@ -1862,12 +1852,10 @@ amdgcn-*-amdhsa)\n \tthread_file=gcn\n \t;;\n moxie-*-elf)\n-\tgnu_ld=yes\n \ttm_file=\"elfos.h newlib-stdint.h ${tm_file}\"\n \ttmake_file=\"${tmake_file} moxie/t-moxie\"\n \t;;\n moxie-*-uclinux*)\n-\tgnu_ld=yes\n \ttm_file=\"elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h\"\n \ttmake_file=\"${tmake_file} moxie/t-moxie\"\n \t;;\n@@ -1876,7 +1864,6 @@ moxie-*-rtems*)\n \ttm_file=\"moxie/moxie.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h\"\n \t;;\n moxie-*-moxiebox*)\n-\tgnu_ld=yes\n \ttm_file=\"${tm_file} elfos.h moxie/moxiebox.h newlib-stdint.h\"\n \ttmake_file=\"${tmake_file} moxie/t-moxiebox\"\n \t;;\n@@ -1895,7 +1882,6 @@ hppa*64*-*-linux*)\n \t\t pa/pa64-linux.h\"\n \ttmake_file=\"${tmake_file} pa/t-pa pa/t-linux\"\n \td_target_objs=\"${d_target_objs} pa-d.o\"\n-\tgnu_ld=yes\n \t;;\n hppa*-*-linux*)\n \ttarget_cpu_default=\"MASK_PA_11|MASK_NO_SPACE_REGS|MASK_CALLER_COPIES\"\n@@ -1911,7 +1897,6 @@ hppa*-*-openbsd*)\n \textra_options=\"${extra_options} openbsd.opt\"\n \ttmake_file=\"pa/t-pa\"\n \td_target_objs=\"${d_target_objs} pa-d.o\"\n-\tgnu_ld=yes\n \t;;\n hppa*-*-netbsd*)\n \ttarget_cpu_default=\"MASK_PA_11|MASK_NO_SPACE_REGS\"\n@@ -1923,7 +1908,7 @@ hppa*-*-netbsd*)\n \t;;\n hppa*64*-*-hpux11*)\n \ttarget_cpu_default=\"MASK_PA_11|MASK_PA_20\"\n-\tif test x$gnu_ld = xyes\n+\tif test x$hpux_ld = xno\n \tthen\n \t\ttarget_cpu_default=\"${target_cpu_default}|MASK_GNU_LD\"\n \tfi\n@@ -2030,13 +2015,11 @@ i[34567]86-*-openbsd*)\n \ttm_file=\"${tm_file} i386/unix.h i386/att.h elfos.h\"\n \ttm_file=\"${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h\"\n \textra_options=\"${extra_options} openbsd.opt\"\n-\tgnu_ld=yes\n \t;;\n x86_64-*-openbsd*)\n \ttm_file=\"${tm_file} i386/unix.h i386/att.h elfos.h\"\n \ttm_file=\"${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/x86-64.h i386/openbsdelf.h\"\n \textra_options=\"${extra_options} openbsd.opt\"\n-\tgnu_ld=yes\n \t;;\n i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)\n \t\t\t# Intel 80386's running GNU/*\n@@ -2142,7 +2125,6 @@ i[34567]86-pc-msdosdjgpp*)\n \ttm_file=\"${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h\"\n \tnative_system_header_dir=/dev/env/DJDIR/include\n \textra_options=\"${extra_options} i386/djgpp.opt\"\n-\tgnu_ld=yes\n \tuse_gcc_stdint=wrap\n \t;;\n i[34567]86-*-lynxos*)\n@@ -2151,12 +2133,10 @@ i[34567]86-*-lynxos*)\n \ttmake_file=\"${tmake_file} t-lynx\"\n \textra_options=\"${extra_options} lynx.opt\"\n \tthread_file=lynx\n-\tgnu_ld=yes\n \t;;\n i[34567]86-*-nto-qnx*)\n \ttm_file=\"${tm_file} i386/att.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h\"\n \textra_options=\"${extra_options} i386/nto.opt\"\n-\tgnu_ld=yes\n \t;;\n i[34567]86-*-rtems*)\n \ttm_file=\"${tm_file} i386/unix.h i386/att.h elfos.h i386/i386elf.h i386/rtemself.h rtems.h newlib-stdint.h\"\n@@ -2327,7 +2307,6 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)\n \textra_objs=\"${extra_objs} winnt.o winnt-stubs.o winnt-dll.o\"\n \tc_target_objs=\"${c_target_objs} msformat-c.o\"\n \tcxx_target_objs=\"${cxx_target_objs} winnt-cxx.o msformat-c.o\"\n-\tgnu_ld=yes\n \tdefault_use_cxa_atexit=yes\n \tuse_gcc_stdint=wrap\n \tcase ${enable_threads} in\n@@ -2355,10 +2334,7 @@ ia64*-*-elf*)\n \ttmake_file=\"ia64/t-ia64\"\n \ttarget_cpu_default=\"0\"\n \ttarget_cpu_default=\"${target_cpu_default}|MASK_GNU_AS\"\n-\tif test x$gnu_ld = xyes\n-\tthen\n-\t\ttarget_cpu_default=\"${target_cpu_default}|MASK_GNU_LD\"\n-\tfi\n+\ttarget_cpu_default=\"${target_cpu_default}|MASK_GNU_LD\"\n \t;;\n ia64*-*-freebsd*)\n \ttm_file=\"${tm_file} elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h\"\n@@ -2551,7 +2527,6 @@ riscv*-*-linux*)\n \tesac\n \ttmake_file=\"${tmake_file} riscv/t-riscv riscv/t-linux\"\n \ttm_defines=\"${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1\"\n-\tgnu_ld=yes\n \tcase $target in\n \triscv32be-*|riscv64be-*)\n \t\ttm_defines=\"${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1\"\n@@ -2565,7 +2540,6 @@ riscv*-*-linux*)\n riscv*-*-gnu*)\n \ttm_file=\"elfos.h gnu-user.h gnu.h glibc-stdint.h ${tm_file} riscv/gnu.h\"\n \ttmake_file=\"${tmake_file} riscv/t-riscv\"\n-\tgnu_ld=yes\n \tcase $target in\n \triscv32be-*|riscv64be-*)\n \t\ttm_defines=\"${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1\"\n@@ -2592,7 +2566,6 @@ riscv*-*-elf* | riscv*-*-rtems*)\n \t  fi\n \tesac\n \ttmake_file=\"${tmake_file} riscv/t-riscv\"\n-\tgnu_ld=yes\n \tcase $target in\n \triscv32be-*|riscv64be-*)\n \t\ttm_defines=\"${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1\"\n@@ -2605,7 +2578,6 @@ riscv*-*-elf* | riscv*-*-rtems*)\n riscv*-*-freebsd*)\n \ttm_file=\"${tm_file} elfos.h ${fbsd_tm_file} riscv/freebsd.h\"\n \ttmake_file=\"${tmake_file} riscv/t-riscv\"\n-\tgnu_ld=yes\n \tcase $target in\n \triscv32be-*|riscv64be-*)\n \t\ttm_defines=\"${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1\"\n@@ -2625,7 +2597,6 @@ loongarch*-*-linux*)\n \ttm_file=\"${tm_file} loongarch/gnu-user.h loongarch/linux.h loongarch/loongarch-driver.h\"\n \textra_options=\"${extra_options} linux-android.opt\"\n \ttmake_file=\"${tmake_file} loongarch/t-multilib loongarch/t-linux\"\n-\tgnu_ld=yes\n \n \t# Force .init_array support.  The configure script cannot always\n \t# automatically detect that GAS supports it, yet we require it.\n@@ -2636,7 +2607,6 @@ loongarch*-*-elf*)\n \ttm_file=\"elfos.h newlib-stdint.h ${tm_file}\"\n \ttm_file=\"${tm_file} loongarch/elf.h loongarch/loongarch-driver.h\"\n \ttmake_file=\"${tmake_file} loongarch/t-multilib\"\n-\tgnu_ld=yes\n \n \t# For .init_array support.  The configure script cannot always\n \t# automatically detect that GAS supports it, yet we require it.\n@@ -2655,7 +2625,6 @@ mips*-img-linux*)\n \ttm_defines=\"${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R6 MIPS_ABI_DEFAULT=ABI_32\"\n \twith_arch_32=\"mips32r6\"\n \twith_arch_64=\"mips64r6\"\n-\tgnu_ld=yes\n \t;;\n mips*-mti-linux*)\n \ttm_file=\"elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h\"\n@@ -2664,7 +2633,6 @@ mips*-mti-linux*)\n \ttm_defines=\"${tm_defines} MIPS_ISA_DEFAULT=MIPS_ISA_MIPS32R2 MIPS_ABI_DEFAULT=ABI_32\"\n \twith_arch_32=\"mips32r2\"\n \twith_arch_64=\"mips64r2\"\n-\tgnu_ld=yes\n \t;;\n mips*-*-linux*)\t\t\t\t# Linux MIPS, either endian.\n \ttm_file=\"elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h\"\n@@ -3203,7 +3171,6 @@ powerpc-*-lynxos*)\n \ttmake_file=\"t-lynx rs6000/t-lynx\"\n \textra_options=\"${extra_options} rs6000/sysv4.opt lynx.opt\"\n \tthread_file=lynx\n-\tgnu_ld=yes\n \t;;\n powerpcle-*-elf*)\n \ttm_file=\"${tm_file} elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h\"\n@@ -3567,7 +3534,6 @@ sparc64-*-openbsd*)\n \ttm_file=\"${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h\"\n \textra_options=\"${extra_options} openbsd.opt\"\n \textra_options=\"${extra_options}\"\n-\tgnu_ld=yes\n \twith_cpu=ultrasparc\n \ttmake_file=\"${tmake_file} sparc/t-sparc\"\n \t;;\n@@ -3659,7 +3625,6 @@ xtensa*-*-uclinux*)\n \t;;\n am33_2.0-*-linux*)\n \ttm_file=\"mn10300/mn10300.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h\"\n-\tgnu_ld=yes\n \tuse_collect2=no\n \t;;\n m32c-*-elf*)\n@@ -6073,10 +6038,7 @@ case ${target} in\n \t\t;;\n \n \tmips*-*-*)\n-\t\tif test x$gnu_ld = xyes\n-\t\tthen\n-\t\t\ttarget_cpu_default2=\"MASK_SPLIT_ADDRESSES\"\n-\t\tfi\n+\t        target_cpu_default2=\"MASK_SPLIT_ADDRESSES\"\n \t\tcase ${target} in\n \t\t\tmips*el-*-*)\n \t\t\t\ttm_defines=\"TARGET_ENDIAN_DEFAULT=0 $tm_defines\"\ndiff --git a/gcc/configure b/gcc/configure\n--- a/gcc/configure\n+++ b/gcc/configure\n@@ -25612,14 +25612,17 @@ $as_echo_n \"checking Solaris linker... \"\n case $target in\n   *-*-solaris2*)\n     if $gcc_cv_ld -V 2>/dev/null | grep 'Solaris Link Editors' > /dev/null; then\n-      gnu_ld=no\n       solaris_ld=yes\n-    elif $gcc_cv_ld --version 2>/dev/null | grep GNU > /dev/null; then\n-      gnu_ld=yes\n+    fi\n+    ;;\n+  hppa*64*-*-hpux11*)\n+    if $gcc_cv_ld -V 2>/dev/null | grep 'linker command.*sgs.*ld PA64' > /dev/null; then\n+      hpux_ld=yes\n     fi\n     ;;\n   *)\n     solaris_ld=no\n+    hpux_ld=no\n     ;;\n esac\n { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $solaris_ld\" >&5\n@@ -25656,24 +25659,16 @@ _ACEOF\n \n \n # Check if we are using GNU ld if not already set.\n-if test -z \"$gnu_ld\"; then\n-  if $gcc_cv_ld --version 2>/dev/null | grep GNU > /dev/null; then\n-    gnu_ld=yes\n-  else\n-    gnu_ld=no\n-  fi\n-fi\n-\n-case \"$target:$gnu_ld\" in\n-  *-*-solaris2*:no)\n+case \"$target:$solaris_ld\" in\n+  *-*-solaris2*:yes)\n     # While Solaris ld has -m32/-m64 it usually determines the ELF class\n     # from the input objects.\n     ;;\n-  i?86-*-solaris2*:yes | x86_64-*-solaris2*:yes)\n+  i?86-*-solaris2*:* | x86_64-*-solaris2*:*)\n     ld_32_opt=-melf_i386_sol2\n     ld_64_opt=-melf_x86_64_sol2\n     ;;\n-  i?86-*-*:yes | x86_64-*-*:yes)\n+  i?86-*-*:* | x86_64-*-*:*)\n     ld_32_opt=-melf_i386\n     ld_64_opt=-melf_x86_64\n     ;;\n@@ -28461,11 +28456,9 @@ elif test x$gcc_cv_ld != x; then\n \t;;\n       # HP-UX ld uses -a flags to select between shared and archive.\n       *-*-hpux*)\n-\tif test x\"$gnu_ld\" = xno; then\n-\t  gcc_cv_ld_static_dynamic=yes\n-\t  gcc_cv_ld_static_option=\"-aarchive_shared\"\n-\t  gcc_cv_ld_dynamic_option=\"-adefault\"\n-\tfi\n+\tgcc_cv_ld_static_dynamic=yes\n+\tgcc_cv_ld_static_option=\"-aarchive_shared\"\n+\tgcc_cv_ld_dynamic_option=\"-adefault\"\n \t;;\n       # Solaris 2 ld always supports -Bstatic/-Bdynamic.\n       *-*-solaris2*)\n@@ -28492,21 +28485,27 @@ fi\n { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_static_dynamic\" >&5\n $as_echo \"$gcc_cv_ld_static_dynamic\" >&6; }\n \n-{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking linker --version-script option\" >&5\n-$as_echo_n \"checking linker --version-script option... \" >&6; }\n+{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking linker version script option\" >&5\n+$as_echo_n \"checking linker version script option... \" >&6; }\n gcc_cv_ld_version_script=no\n ld_version_script_option=''\n-if test $in_tree_ld = yes || test x\"$gnu_ld\" = xyes; then\n+if test $in_tree_ld = yes; then\n   gcc_cv_ld_version_script=yes\n   ld_version_script_option='--version-script'\n-elif test x$solaris_ld = xyes; then\n+elif test x$gcc_cv_ld != x; then\n+  # Check if linker supports --version-script option\n+  if $gcc_cv_ld --help 2>&1 | grep -- --version-script > /dev/null; then\n+    gcc_cv_ld_version_script=yes\n+    ld_version_script_option='--version-script'\n+  fi\n+fi\n+if test x$solaris_ld = xyes; then\n   # Solaris 2 ld always supports -M.  It also supports a subset of\n   # --version-script since Solaris 11.4, but requires\n   # -z gnu-version-script-compat to activate.\n   gcc_cv_ld_version_script=yes\n   ld_version_script_option='-M'\n fi\n-# Don't AC_DEFINE result, only used in jit/Make-lang.in so far.\n { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_version_script\" >&5\n $as_echo \"$gcc_cv_ld_version_script\" >&6; }\n \n@@ -28514,24 +28513,28 @@ $as_echo \"$gcc_cv_ld_version_script\" >&6\n { $as_echo \"$as_me:${as_lineno-$LINENO}: checking linker soname option\" >&5\n $as_echo_n \"checking linker soname option... \" >&6; }\n gcc_cv_ld_soname=no\n-if test $in_tree_ld = yes || test x\"$gnu_ld\" = xyes; then\n+if test $in_tree_ld = yes; then\n   gcc_cv_ld_soname=yes\n   ld_soname_option='-soname'\n elif test x$gcc_cv_ld != x; then\n-  case \"$target\" in\n-    *-*-darwin*)\n-      gcc_cv_ld_soname=yes\n-      ld_soname_option='-install_name'\n-      ;;\n-    # Solaris 2 ld always supports -h.  It also supports --soname for GNU\n-    # ld compatiblity since some Solaris 10 update.\n-    *-*-solaris2*)\n-      gcc_cv_ld_soname=yes\n-      ld_soname_option='-h'\n-      ;;\n-  esac\n-fi\n-# Don't AC_DEFINE result, only used in jit/Make-lang.in so far.\n+  # Check if linker supports -soname option\n+  if $gcc_cv_ld --help 2>&1 | grep -- -soname > /dev/null; then\n+    gcc_cv_ld_soname=yes\n+    ld_soname_option='-soname'\n+  fi\n+fi\n+case \"$target:$solaris_ld\" in\n+  *-*-darwin*:*)\n+    gcc_cv_ld_soname=yes\n+    ld_soname_option='-install_name'\n+    ;;\n+  # Solaris 2 ld always supports -h.  It also supports --soname for GNU\n+  # ld compatiblity since some Solaris 10 update.\n+  *-*-solaris2*:yes)\n+    gcc_cv_ld_soname=yes\n+    ld_soname_option='-h'\n+    ;;\n+esac\n { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_soname\" >&5\n $as_echo \"$gcc_cv_ld_soname\" >&6; }\n \n@@ -28544,7 +28547,7 @@ $as_echo_n \"checking linker --demangle s\n     if test \"$gcc_cv_gld_major_version\" -eq 2 -a \"$gcc_cv_gld_minor_version\" -ge 14 -o \"$gcc_cv_gld_major_version\" -gt 2; then \\\n       gcc_cv_ld_demangle=yes\n     fi\n-  elif test x$gcc_cv_ld != x -a x\"$gnu_ld\" = xyes; then\n+  elif test x$gcc_cv_ld != x; then\n     # Check if the GNU linker supports --demangle option\n     if $gcc_cv_ld --help 2>&1 | grep no-demangle > /dev/null; then\n       gcc_cv_ld_demangle=yes\ndiff --git a/gcc/configure.ac b/gcc/configure.ac\n--- a/gcc/configure.ac\n+++ b/gcc/configure.ac\n@@ -2813,14 +2813,17 @@ AC_MSG_CHECKING(Solaris linker)\n case $target in\n   *-*-solaris2*)\n     if $gcc_cv_ld -V 2>/dev/null | grep 'Solaris Link Editors' > /dev/null; then\n-      gnu_ld=no\n       solaris_ld=yes\n-    elif $gcc_cv_ld --version 2>/dev/null | grep GNU > /dev/null; then\n-      gnu_ld=yes\n+    fi\n+    ;;\n+  hppa*64*-*-hpux11*)\n+    if $gcc_cv_ld -V 2>/dev/null | grep 'linker command.*sgs.*ld PA64' > /dev/null; then\n+      hpux_ld=yes\n     fi\n     ;;\n   *)\n     solaris_ld=no\n+    hpux_ld=no\n     ;;\n esac\n AC_MSG_RESULT($solaris_ld)\n@@ -2846,24 +2849,16 @@ AC_SUBST(ORIGINAL_PLUGIN_LD_FOR_TARGET)\n AC_DEFINE_UNQUOTED(PLUGIN_LD_SUFFIX, \"$PLUGIN_LD_SUFFIX\", [Specify plugin linker])\n \n # Check if we are using GNU ld if not already set.\n-if test -z \"$gnu_ld\"; then\n-  if $gcc_cv_ld --version 2>/dev/null | grep GNU > /dev/null; then\n-    gnu_ld=yes\n-  else\n-    gnu_ld=no\n-  fi\n-fi\n-\n-case \"$target:$gnu_ld\" in\n-  *-*-solaris2*:no)\n+case \"$target:$solaris_ld\" in\n+  *-*-solaris2*:yes)\n     # While Solaris ld has -m32/-m64 it usually determines the ELF class\n     # from the input objects.\n     ;;\n-  i?86-*-solaris2*:yes | x86_64-*-solaris2*:yes)\n+  i?86-*-solaris2*:* | x86_64-*-solaris2*:*)\n     ld_32_opt=-melf_i386_sol2\n     ld_64_opt=-melf_x86_64_sol2\n     ;;\n-  i?86-*-*:yes | x86_64-*-*:yes)\n+  i?86-*-*:* | x86_64-*-*:*)\n     ld_32_opt=-melf_i386\n     ld_64_opt=-melf_x86_64\n     ;;\n@@ -4342,11 +4337,9 @@ elif test x$gcc_cv_ld != x; then\n \t;;\n       # HP-UX ld uses -a flags to select between shared and archive.\n       *-*-hpux*)\n-\tif test x\"$gnu_ld\" = xno; then\n-\t  gcc_cv_ld_static_dynamic=yes\n-\t  gcc_cv_ld_static_option=\"-aarchive_shared\"\n-\t  gcc_cv_ld_dynamic_option=\"-adefault\"\n-\tfi\n+\tgcc_cv_ld_static_dynamic=yes\n+\tgcc_cv_ld_static_option=\"-aarchive_shared\"\n+\tgcc_cv_ld_dynamic_option=\"-adefault\"\n \t;;\n       # Solaris 2 ld always supports -Bstatic/-Bdynamic.\n       *-*-solaris2*)\n@@ -4365,43 +4358,53 @@ if test x\"$gcc_cv_ld_static_dynamic\" = x\n fi\n AC_MSG_RESULT($gcc_cv_ld_static_dynamic)\n \n-AC_MSG_CHECKING(linker --version-script option)\n+AC_MSG_CHECKING(linker version script option)\n gcc_cv_ld_version_script=no\n ld_version_script_option=''\n-if test $in_tree_ld = yes || test x\"$gnu_ld\" = xyes; then\n+if test $in_tree_ld = yes; then\n   gcc_cv_ld_version_script=yes\n   ld_version_script_option='--version-script'\n-elif test x$solaris_ld = xyes; then\n+elif test x$gcc_cv_ld != x; then\n+  # Check if linker supports --version-script option\n+  if $gcc_cv_ld --help 2>&1 | grep -- --version-script > /dev/null; then\n+    gcc_cv_ld_version_script=yes\n+    ld_version_script_option='--version-script'\n+  fi\n+fi\n+if test x$solaris_ld = xyes; then\n   # Solaris 2 ld always supports -M.  It also supports a subset of\n   # --version-script since Solaris 11.4, but requires\n   # -z gnu-version-script-compat to activate.\n   gcc_cv_ld_version_script=yes\n   ld_version_script_option='-M'\n fi\n-# Don't AC_DEFINE result, only used in jit/Make-lang.in so far.\n AC_MSG_RESULT($gcc_cv_ld_version_script)\n AC_SUBST(ld_version_script_option)\n \n AC_MSG_CHECKING(linker soname option)\n gcc_cv_ld_soname=no\n-if test $in_tree_ld = yes || test x\"$gnu_ld\" = xyes; then\n+if test $in_tree_ld = yes; then\n   gcc_cv_ld_soname=yes\n   ld_soname_option='-soname'\n elif test x$gcc_cv_ld != x; then\n-  case \"$target\" in\n-    *-*-darwin*)\n-      gcc_cv_ld_soname=yes\n-      ld_soname_option='-install_name'\n-      ;;\n-    # Solaris 2 ld always supports -h.  It also supports --soname for GNU\n-    # ld compatiblity since some Solaris 10 update.\n-    *-*-solaris2*)\n-      gcc_cv_ld_soname=yes\n-      ld_soname_option='-h'\n-      ;;\n-  esac\n-fi\n-# Don't AC_DEFINE result, only used in jit/Make-lang.in so far.\n+  # Check if linker supports -soname option\n+  if $gcc_cv_ld --help 2>&1 | grep -- -soname > /dev/null; then\n+    gcc_cv_ld_soname=yes\n+    ld_soname_option='-soname'\n+  fi\n+fi\n+case \"$target:$solaris_ld\" in\n+  *-*-darwin*:*)\n+    gcc_cv_ld_soname=yes\n+    ld_soname_option='-install_name'\n+    ;;\n+  # Solaris 2 ld always supports -h.  It also supports --soname for GNU\n+  # ld compatiblity since some Solaris 10 update.\n+  *-*-solaris2*:yes)\n+    gcc_cv_ld_soname=yes\n+    ld_soname_option='-h'\n+    ;;\n+esac\n AC_MSG_RESULT($gcc_cv_ld_soname)\n AC_SUBST(ld_soname_option)\n \n@@ -4412,7 +4415,7 @@ if test x\"$demangler_in_ld\" = xyes; then\n     if test \"$gcc_cv_gld_major_version\" -eq 2 -a \"$gcc_cv_gld_minor_version\" -ge 14 -o \"$gcc_cv_gld_major_version\" -gt 2; then \\\n       gcc_cv_ld_demangle=yes\n     fi\n-  elif test x$gcc_cv_ld != x -a x\"$gnu_ld\" = xyes; then\n+  elif test x$gcc_cv_ld != x; then\n     # Check if the GNU linker supports --demangle option\n     if $gcc_cv_ld --help 2>&1 | grep no-demangle > /dev/null; then\n       gcc_cv_ld_demangle=yes\n","prefixes":["v2","5/6"]}