Renato Golin via llvm-dev
2016-Oct-28 16:54 UTC
[llvm-dev] [cfe-dev] LLD to be the default linker in Clang
On 28 October 2016 at 17:41, Hans Wennborg <hans at chromium.org> wrote:> There's also -fuse-ld> > That's how I usually do it.Right, that gets rid of the override flag. Thanks! :) But the arguments about the default and the cross-compilation error still stand. cheers, --renato
Ed Maste via llvm-dev
2016-Oct-28 17:12 UTC
[llvm-dev] [cfe-dev] LLD to be the default linker in Clang
On 28 October 2016 at 16:54, Renato Golin via llvm-dev <llvm-dev at lists.llvm.org> wrote:> On 28 October 2016 at 17:41, Hans Wennborg <hans at chromium.org> wrote: >> There's also -fuse-ld>> >> That's how I usually do it. > > Right, that gets rid of the override flag. Thanks! :) > > But the arguments about the default and the cross-compilation error still stand.It should be possible to search the path for ld.lld first, then ld, but to me it seems like it will just be more confusing. Also AFAIK the -fuse-ld flag has no way to specify plain ld, although we could allow -fuse-ld= to specify that. Clang's current approach (ld from $PATH by default, or ld.arg from -fuse-ld=arg) suits us in FreeBSD. Today we have: /usr/bin/ld.bfd (GNU ld 2.17.50) /usr/bin/ld (ld.bfd symlink) We'll soon add /usr/bin/ld.lld and in fact we'll want the default to remain /usr/bin/ld until we're confident lld is a suitable replacement for all cases. At that point we'll change the ld symlink to ld.lld. Installing the binutils port adds: /usr/local/bin/ld.bfd /usr/local/bin/ld.gold /usr/local/bin/ld (/usr/local/bin/ld.bfd hardlink) The only downside of -fuse-ld= that I'm aware of affects GCC only, not Clang: GCC accepts only -fuse-ld=bfd and -fuse-ld=gold, and Davide's patch to add -fuse-ld=lld was met with hostility. But that shouldn't have any effect on Clang.
Renato Golin via llvm-dev
2016-Oct-28 17:38 UTC
[llvm-dev] [cfe-dev] LLD to be the default linker in Clang
On 28 October 2016 at 18:12, Ed Maste <emaste at freebsd.org> wrote:> It should be possible to search the path for ld.lld first, then ld, > but to me it seems like it will just be more confusing.Hum, for me it would be less confusing. :) GCC uses bfd by default, LLVM uses LLD. If you want to change, use -fuse-ld. What would be confusing in this scenario?> Clang's current approach (ld from $PATH by default, or ld.arg from > -fuse-ld=arg) suits us in FreeBSD. Today we have: > /usr/bin/ld.bfd (GNU ld 2.17.50) > /usr/bin/ld (ld.bfd symlink) > > We'll soon add > /usr/bin/ld.lldThis seems like a simple enough approach. I guess my problem is more about building toolchains than shipping them.> The only downside of -fuse-ld= that I'm aware of affects GCC only, not > Clang: GCC accepts only -fuse-ld=bfd and -fuse-ld=gold, and Davide's > patch to add -fuse-ld=lld was met with hostility. But that shouldn't > have any effect on Clang.Just had a look at the thread. Some silly comments were expected, but I think Davide has withdrawn his patch too early. AFAIK, there's absolutely nothing in the GCC license, moto and copyright statements that forbid the usage of a non-GNU linker, and the argument "lld has bugs" is pointless. I would try again. cheers, --renato
Rui Ueyama via llvm-dev
2016-Oct-28 17:48 UTC
[llvm-dev] [cfe-dev] LLD to be the default linker in Clang
On Fri, Oct 28, 2016 at 10:12 AM, Ed Maste via cfe-dev < cfe-dev at lists.llvm.org> wrote:> On 28 October 2016 at 16:54, Renato Golin via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > On 28 October 2016 at 17:41, Hans Wennborg <hans at chromium.org> wrote: > >> There's also -fuse-ld> >> > >> That's how I usually do it. > > > > Right, that gets rid of the override flag. Thanks! :) > > > > But the arguments about the default and the cross-compilation error > still stand. > > It should be possible to search the path for ld.lld first, then ld, > but to me it seems like it will just be more confusing. Also AFAIK > the -fuse-ld flag has no way to specify plain ld, although we could > allow -fuse-ld= to specify that. >IIUC, you can pass a full path to -fuse-ld, so -fuse-ld=`which ld` should specify the default ld. Clang's current approach (ld from $PATH by default, or ld.arg from> -fuse-ld=arg) suits us in FreeBSD. Today we have: > /usr/bin/ld.bfd (GNU ld 2.17.50) > /usr/bin/ld (ld.bfd symlink) > > We'll soon add > /usr/bin/ld.lld > and in fact we'll want the default to remain /usr/bin/ld until we're > confident lld is a suitable replacement for all cases. At that point > we'll change the ld symlink to ld.lld. > > Installing the binutils port adds: > > /usr/local/bin/ld.bfd > /usr/local/bin/ld.gold > /usr/local/bin/ld (/usr/local/bin/ld.bfd hardlink) > > The only downside of -fuse-ld= that I'm aware of affects GCC only, not > Clang: GCC accepts only -fuse-ld=bfd and -fuse-ld=gold, and Davide's > patch to add -fuse-ld=lld was met with hostility. But that shouldn't > have any effect on Clang. > _______________________________________________ > cfe-dev mailing list > cfe-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161028/35965610/attachment.html>