Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jun 2017 17:21:11 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        "freebsd-toolchain@freebsd.org" <freebsd-toolchain@freebsd.org>
Subject:   June 2017 update on using LLVM's lld linker in the FreeBSD base system
Message-ID:  <CAPyFy2Cr7c2hHhdkb0KjNBF9coKzMhS5iX9dm8jptVY-bpArfw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Another update on using LLD as the FreeBSD base system linker:

> We now have LLD 4.0.0 in the tree and it can build all of
> FreeBSD/amd64 kernel and world, and most of ports.

LLD 4.0.0 is in HEAD and stable/11, and WITH_LLD_IS_LD and
WITH_LLD_BOOTSTRAP are enabled by default for arm64 on both branches.
There are a few post-4.0.0 bugfixes in LLD that we need to import into
HEAD in short order and MFC for the 11.1 release.

It is possible to build both the amd64 and arm64 world + kernel with
WITH_LLD_IS_LLD and WITH_LLD_BOOTSTRAP. My daily driver desktop and
laptop are using LLD as /usr/bin/ld.

>> 6. Request ports exp-runs and issue a call for testing with 3rd party
>> software. Fix issues found during this process.
>
> This is in progress now, in PR 214864. There are currently 270 failing
> ports and 963 skipped. The top ten failing ports (by # skipped) are
> responsible for 808 of the skipped; addressing those should allow us
> to build nearly 98% of the ports collection with LLD.

bapt@ and I discussed this at BSDCan and we intend to create a way to
flag ports that don't build with LLD. Then the ports infrastructure
can automatically use ld.bfd, until the issue is addressed in the
individual port or in LLD. It will be something like
"USES=linker:not_lld" or "LLD_UNSAFE=yes" or so.

>> 7. Switch /usr/bin/ld to ld.lld by default in head for the Clang-using
>> architectures. Add a WITHOUT_LLD_AS_LD knob to switch back to GNU ld.
>
> While there is still no timeline set for this, it is already done for
> arm64 (where we have no in-tree GNU ld available), and it is close to
> being feasible for amd64. Further investigation is needed on i386 and
> 32-bit arm before moving forward here.

Once the ports infrastructure is in place I plan to enable LLD as
/usr/bin/ld by default on amd64.

Outstanding issues with i386 and 32-bit arm prevent us from turning it
on for those architectures right now. The LLVM tracking bug in
http://llvm.org/pr23214 depends on those individual issues; i386
should be relatively straightforward, while arm needs more work.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2Cr7c2hHhdkb0KjNBF9coKzMhS5iX9dm8jptVY-bpArfw>