{"id":2230240,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2230240/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/yddqznx9846.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":"<yddqznx9846.fsf@CeBiTec.Uni-Bielefeld.DE>","date":"2026-04-29T14:03:21","name":"[4/6] Remove HAVE_GNU_LD","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"478193bf1a95d4078c540aab15bacdedcf4b9392","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/yddqznx9846.fsf@CeBiTec.Uni-Bielefeld.DE/mbox/","series":[{"id":502070,"url":"http://patchwork.ozlabs.org/api/1.1/series/502070/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=502070","date":"2026-04-29T13:59:25","name":"Remove HAVE_GNU_{AS,LD} etc.","version":1,"mbox":"http://patchwork.ozlabs.org/series/502070/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2230240/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2230240/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=TmLPl9EF;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::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=TmLPl9EF","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\n [IPv6:2620:52:6:3111::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 4g5JvS0CQPz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 00:04:20 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 0AE8E4BA9005\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 14:04:18 +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 2801D4BB5898;\n Wed, 29 Apr 2026 14:03:24 +0000 (GMT)","from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1])\n by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 50A3DC1F65;\n Wed, 29 Apr 2026 16:03:23 +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 Bt3REyzb6ylr; Wed, 29 Apr 2026 16:03:22 +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 7BB79C21CB;\n Wed, 29 Apr 2026 16:03:22 +0200 (CEST)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 0AE8E4BA9005","OpenDKIM Filter v2.11.0 sourceware.org 2801D4BB5898"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 2801D4BB5898","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 2801D4BB5898","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777471404; cv=none;\n b=XjDQ31bfk2SOs9DPlb+EHmZI58I9Bfnfk0FETTO1oPRyHedO1HIv8oyFy0HzX1iEQwtFoumt92WpSNXbCpDZcag9/q2FlxnKyzBkpLlWnRryX+PMqGk9IVSOqF/jFhCJdmSctSIro07H/Ql1euwCH8UhiHuytV75pIa0/uw2AOE=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777471404; c=relaxed/simple;\n bh=B3UwRkFbfs0lDMCSwKCo0lZl+1fl4LTCOmBnzenRhi4=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=VY8pn7sacj2XFjfmYrZ+0O1DZPXgusoP78njtWha+CQ/8X8YclIsttvECtCswmwbTcjsQ+jPBEpU16cO8YbgX4JUyQGhuIBLSDaIYBLoCTbI9Ow3A4cmuu0vgp1n5l3seGZEoiwZaU8O+FjifisZSc44NNuYm/MBNlAiw92ViPA=","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:subject:subject\n :from:from:received:received; s=20200306; t=1777471402; bh=B3UwR\n kFbfs0lDMCSwKCo0lZl+1fl4LTCOmBnzenRhi4=; b=TmLPl9EFQUHD/adskjNUs\n UCv0PkaBJ04CHUHbYofXQgvapFue6U5rhZ8BaX193cV3aFhckeSJy3nwsx0yZSqA\n nxw3uOqSi0h7Qr3flasTuwG7Qr1ToatGJwB8jIa092snVj2ZtQM0Ewkb6qiNEUMk\n Mom0YHQbtujX8jA+BQT3zAEcafWVal9F28iyRmne2mu2KNCcNhqMJjgJnl9OSwhK\n eVmLzuOUBLZfMuOgiz5NLBJapeeiT8AwBUX71uqA9oGfT1bia8MgjrR/Ow7lSemP\n UihA3RSnEdOsX+Ey+OpLPQepB8EjepSxLJ4xdeAjNnt5n5Hlig10QeUPTnVwzFEQ\n g==","X-Virus-Scanned":"amavisd-new at cebitec.uni-bielefeld.de","From":"Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>","To":"gcc-patches@gcc.gnu.org","Cc":"Alexandre Oliva <aoliva@gcc.gnu.org>,\n Eric Botcazou <ebotcazou@adacore.com>, Douglas Rupp\n <douglas.b.rupp@gmail.com>, Tristan Gingold <tgingold@free.fr>","Subject":"[PATCH 4/6] Remove HAVE_GNU_LD","Date":"Wed, 29 Apr 2026 16:03:21 +0200","Message-ID":"<yddqznx9846.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":"Similar to HAVE_GNU_AS, there's only a single use of HAVE_GNU_LD left,\ni.e. linker support for GNU style response files.  Therefore this patch\nreplaces it with the result of a new configure test, HAVE_LD_AT_FILE.\n\nApart from that, there's a reference in alpha/vms.h.  However, there's\nno documentation on the support status of the alpha*-dec-*vms*\nconfiguration.  The last non-mechanical change to VMS files in\ngcc/config dates back to 2014, so I've left that alone.\n\nOk for trunk?\n\n\tRainer","diff":"# HG changeset patch\n# Parent  dc41f922db16b303ab469b3519fe549ad59ab271\nRemove HAVE_GNU_LD\n\ndiff --git a/gcc/ada/link.c b/gcc/ada/link.c\n--- a/gcc/ada/link.c\n+++ b/gcc/ada/link.c\n@@ -160,9 +160,9 @@ const char *__gnat_object_library_extens\n unsigned char __gnat_separate_run_path_options = 0;\n const char *__gnat_default_libgcc_subdir = \"lib\";\n \n-#elif (HAVE_GNU_LD)\n-/*  These are the settings for all systems that use gnu ld. GNU style response\n-    file is supported, the shared library default is STATIC.  */\n+#elif (HAVE_LD_AT_FILE)\n+/*  These are the settings for all systems that support GNU style response\n+    files.  The shared library default is STATIC.  */\n \n const char *__gnat_object_file_option = \"-Wl,@\";\n const char *__gnat_run_path_option = \"\";\ndiff --git a/gcc/collect2.cc b/gcc/collect2.cc\n--- a/gcc/collect2.cc\n+++ b/gcc/collect2.cc\n@@ -718,7 +718,7 @@ maybe_run_lto_and_relink (char **lto_ld_\n \n       /* Run the linker again, this time replacing the object files\n          optimized by the LTO with the temporary file generated by the LTO.  */\n-      fork_execute (\"ld\", out_lto_ld_argv, HAVE_GNU_LD && at_file_supplied,\n+      fork_execute (\"ld\", out_lto_ld_argv, HAVE_LD_AT_FILE && at_file_supplied,\n \t\t    \"ld_args\");\n       /* We assume that temp files were created, and therefore we need to take\n          that into account (maybe run dsymutil).  */\n@@ -731,7 +731,7 @@ maybe_run_lto_and_relink (char **lto_ld_\n     {\n       /* Our caller is relying on us to do the link\n          even though there is no LTO back end work to be done.  */\n-      fork_execute (\"ld\", lto_ld_argv, HAVE_GNU_LD && at_file_supplied,\n+      fork_execute (\"ld\", lto_ld_argv, HAVE_LD_AT_FILE && at_file_supplied,\n \t\t    \"ld_args\");\n       /* No LTO objects were found, so no new temp file.  */\n       post_ld_pass (/*temp_file*/false);\n@@ -749,7 +749,7 @@ do_link (char **ld_argv, const char *ats\n   const char *prog = \"ld\";\n   pex = collect_execute (prog, ld_argv, NULL, NULL,\n \t\t\t PEX_LAST | PEX_SEARCH,\n-\t\t\t HAVE_GNU_LD && at_file_supplied, atsuffix);\n+\t\t\t HAVE_LD_AT_FILE && at_file_supplied, atsuffix);\n   int ret = collect_wait (prog, pex);\n   if (ret)\n     {\n@@ -1809,7 +1809,8 @@ main (int argc, char **argv)\n     maybe_run_lto_and_relink (ld2_argv, object_lst, object, true);\n   else\n     {\n-      fork_execute (\"ld\", ld2_argv, HAVE_GNU_LD && at_file_supplied, \"ld_args\");\n+      fork_execute (\"ld\", ld2_argv, HAVE_LD_AT_FILE && at_file_supplied,\n+\t\t    \"ld_args\");\n       post_ld_pass (/*temp_file*/false);\n     }\n \ndiff --git a/gcc/config.in b/gcc/config.in\n--- a/gcc/config.in\n+++ b/gcc/config.in\n@@ -1616,12 +1616,6 @@\n #endif\n \n \n-/* Define to 1 if using GNU ld. */\n-#ifndef USED_FOR_TARGET\n-#undef HAVE_GNU_LD\n-#endif\n-\n-\n /* Define if the gold linker supports split stack and is available as a\n    non-default */\n #ifndef USED_FOR_TARGET\n@@ -1703,6 +1697,12 @@\n #endif\n \n \n+/* Define if your linker supports GNU style response files. */\n+#ifndef USED_FOR_TARGET\n+#undef HAVE_LD_AT_FILE\n+#endif\n+\n+\n /* Define if your linker supports emulation avrxmega2_flmap. */\n #ifndef USED_FOR_TARGET\n #undef HAVE_LD_AVR_AVRXMEGA2_FLMAP\ndiff --git a/gcc/configure b/gcc/configure\n--- a/gcc/configure\n+++ b/gcc/configure\n@@ -13100,13 +13100,6 @@ $as_echo \"#define USE_LONG_LONG_FOR_WIDE\n \n fi\n \n-gnu_ld_bool=`if test x\"$gnu_ld\" = x\"yes\"; then echo 1; else echo 0; fi`\n-\n-cat >>confdefs.h <<_ACEOF\n-#define HAVE_GNU_LD $gnu_ld_bool\n-_ACEOF\n-\n-\n count=a\n for f in $host_xm_file; do\n \tcount=${count}x\n@@ -21949,7 +21942,7 @@ else\n   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n   lt_status=$lt_dlunknown\n   cat > conftest.$ac_ext <<_LT_EOF\n-#line 21952 \"configure\"\n+#line 21945 \"configure\"\n #include \"confdefs.h\"\n \n #if HAVE_DLFCN_H\n@@ -22055,7 +22048,7 @@ else\n   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n   lt_status=$lt_dlunknown\n   cat > conftest.$ac_ext <<_LT_EOF\n-#line 22058 \"configure\"\n+#line 22051 \"configure\"\n #include \"confdefs.h\"\n \n #if HAVE_DLFCN_H\n@@ -26782,6 +26775,28 @@ $as_echo \"#define HAVE_GAS_HIDDEN 1\" >>c\n \n fi\n \n+{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking linker supports GNU style respones files\" >&5\n+$as_echo_n \"checking linker supports GNU style respones files... \" >&6; }\n+gcc_cv_ld_at_file=no\n+if test $in_tree_ld = yes ; then\n+  gcc_cv_ld_at_file=yes\n+elif test x\"$gcc_cv_as\" != x -a x\"$gcc_cv_ld\" != x; then\n+  echo '.byte 0' > conftest.s\n+  echo conftest.o > conftest.at\n+  if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \\\n+     && $gcc_cv_ld -r -o conftest2.o @conftest.at > /dev/null 2>&1; then\n+    gcc_cv_ld_at_file=yes\n+  fi\n+  rm -f conftest.* conftest2.*\n+fi\n+\n+cat >>confdefs.h <<_ACEOF\n+#define HAVE_LD_AT_FILE `if test $gcc_cv_ld_at_file = yes; then echo 1; else echo 0; fi`\n+_ACEOF\n+\n+{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_ro_rw_mix\" >&5\n+$as_echo \"$gcc_cv_ld_ro_rw_mix\" >&6; }\n+\n { $as_echo \"$as_me:${as_lineno-$LINENO}: checking linker read-only and read-write section mixing\" >&5\n $as_echo_n \"checking linker read-only and read-write section mixing... \" >&6; }\n gcc_cv_ld_ro_rw_mix=unknown\ndiff --git a/gcc/configure.ac b/gcc/configure.ac\n--- a/gcc/configure.ac\n+++ b/gcc/configure.ac\n@@ -2020,9 +2020,6 @@ if test x$use_long_long_for_widest_fast_\n efficiently supported by the host hardware.])\n fi\n \n-gnu_ld_bool=`if test x\"$gnu_ld\" = x\"yes\"; then echo 1; else echo 0; fi`\n-AC_DEFINE_UNQUOTED(HAVE_GNU_LD, $gnu_ld_bool, [Define to 1 if using GNU ld.])\n-\n count=a\n for f in $host_xm_file; do\n \tcount=${count}x\n@@ -3379,6 +3376,24 @@ if test $gcc_cv_as_hidden = yes && test \n   [Define if your assembler and linker support .hidden.])\n fi\n \n+AC_MSG_CHECKING(linker supports GNU style respones files)\n+gcc_cv_ld_at_file=no\n+if test $in_tree_ld = yes ; then\n+  gcc_cv_ld_at_file=yes\n+elif test x\"$gcc_cv_as\" != x -a x\"$gcc_cv_ld\" != x; then\n+  echo '.byte 0' > conftest.s\n+  echo conftest.o > conftest.at\n+  if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \\\n+     && $gcc_cv_ld -r -o conftest2.o @conftest.at > /dev/null 2>&1; then\n+    gcc_cv_ld_at_file=yes\n+  fi\n+  rm -f conftest.* conftest2.*\n+fi\n+AC_DEFINE_UNQUOTED(HAVE_LD_AT_FILE,\n+  [`if test $gcc_cv_ld_at_file = yes; then echo 1; else echo 0; fi`],\n+  [Define if your linker supports GNU style response files.])\n+AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix)\n+\n AC_MSG_CHECKING(linker read-only and read-write section mixing)\n gcc_cv_ld_ro_rw_mix=unknown\n if test $in_tree_ld = yes ; then\ndiff --git a/gcc/testsuite/gcc.misc-tests/outputs.exp b/gcc/testsuite/gcc.misc-tests/outputs.exp\n--- a/gcc/testsuite/gcc.misc-tests/outputs.exp\n+++ b/gcc/testsuite/gcc.misc-tests/outputs.exp\n@@ -50,15 +50,8 @@ if !$skip_lto {\n     set ltop [check_linker_plugin_available]\n }\n \n-# Check for GNU LD.  Some files like .ld1_args depend on this.  This\n-# should really be testing whether HAVE_GNU_LD was set by configure.\n-# If we find GNU ld here, but the compiler wasn't configured\n-# --with-gnu-ld or with DEFAULT_LINKER pointing at GNU ld, on a target\n-# that doesn't set gnu_ld=yes unconditionally, configure and thus\n-# collect2 will conservatively assume there's no support for @file in\n-# the linker, but our atfile tests will expect ld1_args files to be\n-# created, and thus fail.  Configuring the compiler --with-gnu-ld\n-# fixes this.\n+# Check for GNU ld.  Some files like .ld1_args depend on this.  This\n+# should really be testing whether the linker supports GNU style response files.\n set gld [check_effective_target_gld]\n \n # Prepare additional options to be used for linking.\n","prefixes":["4/6"]}