Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 May 2018 13:50:33 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        FreeBSD Current <freebsd-current@freebsd.org>,  "freebsd-toolchain@FreeBSD.org" <freebsd-toolchain@freebsd.org>
Subject:   HEADS-UP: Linker issues building amd64 kernels with config & make
Message-ID:  <CAPyFy2CyLChddhe7ONpTiJHA3HBrXJ_DXFCbkPyYNA7AxnzeUA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
As of r333461 the amd64 kernel makes use of ifuncs, and requires
support in the linker. A safety belt added in r333470 enforces this,
and will produce an explicit error if the linker does not support
ifuncs.

lld is the default bootstrap linker for amd64 and has ifunc support.
The typical 'make buildworld' (or kernel-toolchain) followed by 'make
buildkernel' process will use lld and successfully link a working
kernel.

The old-style kernel build (using 'config' followed by a 'make' in the
kernel directory) uses the host linker (/usr/bin/ld). This still
defaults to GNU ld 2.17.50, which does not support ifuncs. This can be
worked around in one of two ways:

1. Install lld as the system linker (/usr/bin/ld), by adding
WITH_LLD_IS_LD to /etc/src.conf and building and install world.
WITH_LLD_IS_LD will become the default on amd64 in the near future -
I'm just waiting on updates to the lang/ghc port and another exp-run.

2. Override LD when you build the kernel:
$ LD=ld.lld make

These tool chain components will undergo additional changes for the next while.



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