HomeFreeBSD

Enable ld.lld as bootstrap linker by default on i386

Description

Enable ld.lld as bootstrap linker by default on i386

Akin to r327783 for amd64. lld has been usable for amd64 for quite some
time, but a couple of issues remained that affected i386. These were
recently addressed upstream in lld and merged into FreeBSD (r326831,
r326879, r326897, r326957), so we can now use ld.lld on i386 as well.

Similarly to amd64 this change enables lld only as the bootstrap linker
(used to link the kernel and userland libraries and executables), while
GNU ld.bfd is still installed as /usr/bin/ld and used for ports builds.

The ports collection is essentially ready to use lld as the system
linker for amd64, but many ports still have trouble with lld on i386,
because lld defaults to -ztext, disallowing relocations against readonly
segments. Thus switching the system linker (WITH_LLD_IS_LD) will happen
later on a per-arch basis.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation

Details

Provenance
emasteAuthored on
Parents
rS327822: Skip IRELATIVE relocations when loader processes ELF files.
Branches
Unknown
Tags
Unknown