[llvm-dev] [cfe-dev] LLD to be the default linker in Clang

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Sun Oct 30 06:09:02 PDT 2016


On 30 October 2016 at 01:43, Sean Silva <chisophugis at gmail.com> wrote:
> We currently have both the FreeBSD and the PlayStation effort underway for
> making LLD/ELF a default production system linker. IMO, we should wait for
> at least one of those efforts to stabilize before contemplating "flipping
> the switch" globally in the way you described. Also, ideally we'll be happy
> with the results of some sort of Linux-specific testing such as building
> Debian or Gentoo.

Hi Sean,

First of all, let me be clear: I'm not proposing we "flip the switch
globally" at all.

I'm well aware of the efforts in using LLD as the default linker, and
in no way I'm suggesting we "jump the gun" and derail their efforts.

I was just adding another dimension, orthogonal to their efforts, in
hope more people would see the value of using LLD.

Richard's flag to switch behaviour between LLVM and System is a much
better proposal than mine, and achieves what I wanted to do in a much
nicer way.

The compiler-rt + libgcc_s vs. libunwind is a real problem that has no
nice solution today.

The bugs that we find in old linkers and can't fix because the
platform won't update or GNU won't re-relase is a real problem.

Each of those problems has a solution using compiler flags (the RT one
is not trivial), but all of them together do make Clang hard to use if
you want new functionality.

New uses building Clang/LLVM will *have* to rely on their system
libraries and tools, unless they use a myriad of magic flags, even
though they're building a linker, all necessary libraries, a debugger,
etc.

Making it the default is too big a hammer, but having one simple flag
(ex. --llvm-env or --llvm-tools + --llvm-libs) would make *all* those
problems go away.

On systems that really need to be self-consistent (I'm assuming
Windows), then this could be the default, and users would need to use
flags like --system-env, etc. instead.

cheers,
--renato


More information about the llvm-dev mailing list