lld vs ld linker for CUSTOM 12.0 KERNEL

Babas Abasov babas.abasov at mail.ru
Tue Feb 26 21:49:21 UTC 2019


Hi!

The default "ld" linker does not work for 12.0 custom kernel building in i386 subtree.

( file:///usr/local/share/doc/freebsd/en_US.ISO8859-1/books/handbook/kernelconfi
g-building.html )

The current kernel build instruction is:

# make buildkernel KERNCONF=MYKERNEL

It does not work for i386 arch with default linker.

The correct command may be:

# make buildkernel LD=ld.lld KERNCONF=MYKERNEL

                       
The solution description found in a blog:

==
http://uyota.m.asablo.jp/blog/2018/09/18/8961866
20180510:
        The amd64 kernel now requires a ld that supports ifunc to produce a
        working kernel, either lld or a newer binutils. lld is built by default
        on amd64, and the 'buildkernel' target uses it automatically. However,
        it is not the default linker, so building the kernel the traditional
        way requires LD=ld.lld on the command line (or LD=/usr/local/bin/ld for
        binutils port/package). lld will soon be default, and this requirement
        will go away.
==

The 12.0 HANDBOOK should be updated.

 -------
Regards, BABAS.



More information about the freebsd-doc mailing list