svn commit: r309142 - in head: . gnu/usr.bin/binutils/ld share/mk tools/build/options usr.bin/clang/lld

Ed Maste emaste at freebsd.org
Fri Nov 25 19:38:10 UTC 2016


On 25 November 2016 at 08:15, Ed Maste <emaste at freebsd.org> wrote:
> Author: emaste
> Date: Fri Nov 25 13:15:28 2016
> New Revision: 309142
> URL: https://svnweb.freebsd.org/changeset/base/309142
>
> Log:
>   Add WITH_LLD_AS_LD build knob
>
>   If set it installs LLD as /usr/bin/ld.  LLD (as of version 3.9) is not
>   capable of linking the world and kernel, but can self-host and link many
>   substantial applications. GNU ld continues to be used for the world and
>   kernel build, regardless of how this knob is set.

There was some confusion on IRC about this, so let me clarify.

LLD 3.9 can link many applications on FreeBSD, including itself,
Clang, etc. It cannot link (all of) the FreeBSD kernel and world.
Additional changes have been made in LLD's subversion repo (after the
3.9 release), including improved linker script expression handling and
symbol version map support. These changes are needed to build FreeBSD
with lld.

With a recent LLD built from source it's possible to build a working
FreeBSD kernel and world excluding the boot loaders. I tested at
FreeBSD r309151 and LLD r287869.

The WITH_LLD_AS_LD knob does not affect buildworld. It will still
build a bootstrap GNU ld and use it to link all of the userland to be
installed. When WITH_LLD_AS_LD=yes installworld will install lld as
/usr/bin/ld in the resulting system. The knob is being made available
now for testing and experimentation, and to provide a linker in arm64
images that can be used to bootstrap either GNU ld or a later version
of LLD.


More information about the svn-src-all mailing list