From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 2FE333858296; Mon, 16 Oct 2023 05:08:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2FE333858296 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2FE333858296 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697432938; cv=none; b=maofSB0aFNIl1k1MSIq3W8ge5Y8qoCHmZ3Egs5rLug6UymhDSKZZse2Dv2GjXhOip60/wNe20QQMC/Hob6ElDWh0hUFeg0KhsivGLmXsUNsRgDa2I0DpD+hKGU6oGTWks2TvXf8BTDjiQog31AVMGQ0Em4hLl6PSjV/lSKajeho= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697432938; c=relaxed/simple; bh=vyz0OnYiH1lMZdjLBDmHRaqN/pZRzWaln8KePYt+8ag=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=EYMqOC3vS6GzIRWaOBFZyH4win9/kG+MZAB6GxZ+MvCkRWBbcuB8MP+RtbCfVOIzIaH8YX5z6YBkPwaTYzohxDTVzYXh+5vJLp6P2zYEaZJfsMz0++OPl/IhbFvfpp3unp8mFgK9QsxJE3gH4XVLZB4E1WvA//PwQ+zA1GBrDT8= ARC-Authentication-Results: i=1; server2.sourceware.org References: <20231016050412.9960-1-ishitatsuyuki@gmail.com> User-agent: mu4e 1.10.7; emacs 30.0.50 From: Sam James To: Tatsuyuki Ishi Cc: rui314@gmail.com, pinskia@gcc.gnu.org, redi@gcc.gnu.org, rguenth@gcc.gnu.org, gcc-patches@gcc.gnu.org, =?utf-8?B?TWljaGHFgiBHw7Ny?= =?utf-8?B?bnk=?= Subject: Re: [PATCH] Do not prepend target triple to -fuse-ld=lld,mold. Date: Mon, 16 Oct 2023 06:08:30 +0100 Organization: Gentoo In-reply-to: <20231016050412.9960-1-ishitatsuyuki@gmail.com> Message-ID: <87wmvnjgrf.fsf@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tatsuyuki Ishi writes: > 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. > We do provide those symlinks for LLVM in Gentoo, but we don't for mold. > 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]))