public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
To: gcc-patches@gcc.gnu.org
Cc: rui314@gmail.com, pinskia@gcc.gnu.org, redi@gcc.gnu.org,
	rguenth@gcc.gnu.org, Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Subject: [PATCH] Do not prepend target triple to -fuse-ld=lld,mold.
Date: Mon, 16 Oct 2023 14:04:12 +0900	[thread overview]
Message-ID: <20231016050412.9960-1-ishitatsuyuki@gmail.com> (raw)

lld and mold are platform-agnostic and not prefixed with target triple.
Prepending the target triple makes it less likely to find the intended
linker executable.

A potential breaking change is that we no longer try to search for
triple-prefixed lld/mold binaries anymore. However, since there doesn't
seem to be support to build LLVM or mold with triple-prefixed executable
names, it seems better to just not bother with that case.

	PR driver/111605

gcc/Changelog:

	* collect2.cc (main): Do not prepend target triple to
	-fuse-ld=lld,mold.
---
 gcc/collect2.cc | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/gcc/collect2.cc b/gcc/collect2.cc
index 63b9a0c233a..c943f9f577c 100644
--- a/gcc/collect2.cc
+++ b/gcc/collect2.cc
@@ -865,12 +865,15 @@ main (int argc, char **argv)
   int i;
 
   for (i = 0; i < USE_LD_MAX; i++)
-    full_ld_suffixes[i]
 #ifdef CROSS_DIRECTORY_STRUCTURE
-      = concat (target_machine, "-", ld_suffixes[i], NULL);
-#else
-      = ld_suffixes[i];
-#endif
+    /* lld and mold are platform-agnostic and not prefixed with target
+       triple.  */
+    if (!(i == USE_LLD_LD || i == USE_MOLD_LD))
+      full_ld_suffixes[i] = concat (target_machine, "-", ld_suffixes[i],
+				    NULL);
+    else
+#endif
+      full_ld_suffixes[i] = ld_suffixes[i];
 
   p = argv[0] + strlen (argv[0]);
   while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
-- 
2.42.0


             reply	other threads:[~2023-10-16  5:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16  5:04 Tatsuyuki Ishi [this message]
2023-10-16  5:08 ` Sam James
2023-10-16  8:39 ` Richard Biener
2023-10-16  8:46   ` Tatsuyuki Ishi
2023-10-16  8:55     ` Richard Biener
2023-10-16  8:59       ` Tatsuyuki Ishi
2023-10-16  9:16         ` Richard Biener
2023-11-07 14:24           ` Tatsuyuki Ishi
2023-11-07 14:37             ` Richard Biener
2023-11-08 15:41               ` Tatsuyuki Ishi
2023-11-09 13:06                 ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231016050412.9960-1-ishitatsuyuki@gmail.com \
    --to=ishitatsuyuki@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pinskia@gcc.gnu.org \
    --cc=redi@gcc.gnu.org \
    --cc=rguenth@gcc.gnu.org \
    --cc=rui314@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).