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

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 28 11:08:48 PDT 2016


On 28 October 2016 at 18:53, Rui Ueyama <ruiu at google.com> wrote:
> In practice, I think your proposal can be read for most people as a proposal
> to do dogfooding LLD more widely in LLVM by making it the default linker.
> I've been using LLD as default for a long period of time (probably a year)
> and saw no problem. So it should be doable. Do people okay with that?
> Probably, as long as it works, no one would really care, maybe?

Dog-feeding and keeping linkers honest. Yes.

Just like Clang made C++ compilers honest and IAS made assemblers
honest. It's about time we do that to linkers.

With the integrated assembler, as soon as it was good quality enough
in one arch, we turned on by default and asked people to report a bug
and meanwhile use "-no-integrated-as" in their flags.

As we migrated the ARM back-end to use IAS, we decided to change it by
default even though a few programs didn't compile entirely (mostly due
to GNU extensions). We still have some programs that don't compile
with IAS, and we're working on the bugs that we see in bugzilla, but
they're by far the exception. Most of the remaining cases were fixed
in the user's code.

The AArch64 port is finishing its stage 1, aka. bootstrap. The
buildbot I'm setting up it to prove it works as well as make sure we
don't regress. From there, test-suite, then chromium and firefox are
the next targets.

The ARM port is work in progress, but will follow a similar path, and
once it's working well, we'll want to make it the default in Clang.

So, we need to make sure the "does it work" flag is correct. There are
two modes, native and cross, and they can have different values at
different times. We'll have to validate them separately.

To begin with, I would set LLD the default on native x86_64 only,
because that's what gets tested the most nowadays. As soon as AArch64
bootstraps and passes the test-suite, we can do the same for native,
but not cross. Same for ARM.

The good news is that when you "apt-get install clang", you don't get
LLD. So, unless people are installing LLD in their systems explicitly,
or are building LLD from sources with Clang, they will *not* use LLD.

The only confusion, maybe, is in FreeBSD if they have all linkers
installed but still don't want to use LLD as the default for Clang. It
should be trivial to change that with a one-line patch, in the Clang
driver, though. At least until they have validated enough.

cheers,
--renato


More information about the llvm-dev mailing list