Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 May 2018 13:46:43 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Oliver Pinter <oliver.pinter@hardenedbsd.org>
Cc:        "Rodney W. Grimes" <freebsd-rwg@pdx.rh.cn85.dnsmgr.net>,  Hans Petter Selasky <hps@selasky.org>, Emeric POUPON <emeric.poupon@stormshield.eu>,  Ed Maste <emaste@freebsd.org>, freebsd-arch <freebsd-arch@freebsd.org>
Subject:   Re: Can't build kernel anymore: amd64 kernel requires linker ifunc support
Message-ID:  <CANCZdfp_GYSazyPJYhrBcbsvrJ989HD52OfoTfMn9eNCmbXHDA@mail.gmail.com>
In-Reply-To: <CAPQ4fftHqK1KvrMi1Vbkuh_p5ZDRSz6eNJQX3QUJPsgmNSJ9nA@mail.gmail.com>
References:  <CAPyFy2A-aWa5oKukOKWeAN3BCB07nXzLbO%2B_Txp5HHk0C0h9_g@mail.gmail.com> <201805161511.w4GFBCTQ001108@pdx.rh.CN85.dnsmgr.net> <CAPQ4fftHqK1KvrMi1Vbkuh_p5ZDRSz6eNJQX3QUJPsgmNSJ9nA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 16, 2018 at 1:34 PM, Oliver Pinter <
oliver.pinter@hardenedbsd.org> wrote:

> On 5/16/18, Rodney W. Grimes <freebsd-rwg@pdx.rh.cn85.dnsmgr.net> wrote:
> >> On 16 May 2018 at 09:35, Rodney W. Grimes
> >> <freebsd-rwg@pdx.rh.cn85.dnsmgr.net> wrote:
> >> >>
> >> >> LD=ld.lld make
> >> >>
> >> >> is the magic here. The kernel needs a new linker to properly link in
> >> >> the
> >> >> ifunc, and that's not our ancient ld. lld does it, as does the
> >> >> latter-day
> >> >> binutils.
> >> >
> >> > Since this now seems to be a mandatory thing to get a kernel built
> >> > can it please be set in the Makefile that is needing it?
> >>
> >> It's already handled by the Makefile that needs it when using the
> >> normal build process - i.e., "make buildworld buildkernel" (or
> >> toolchain or kernel-toolchain followed by buildkernel).
> >>
> >> The failure arises when building a kernel the "old" way, using config
> >> and then and make in the kernel directory. This inherently uses the
> >> host's linker (/usr/bin/ld), which is too old to link the kernel. We
> >> can't just add LD=ld.lld to the kernel's Makefile(s), because it would
> >> break external toolchain and other cases where users use a specific
> >> linker. I hope to introduce a KERNEL_LD Make variable that controls
> >> the linker used for the kernel link, but it's more involved than a one
> >> or two line change for the same reason that we can't just set
> >> LD=ld.lld.
> >>
> >> ld.lld will start being installed as /usr/bin/ld once these two issues
> >> are resolved:
> > ...
> >
> > In the meantime what about reverting the ifunc usage until this
> > can be done?
>
> Nope. If somebody take trouble over compiling their kernel manually,
> then at least
> read the documentation, how to compile their system in the new way.
> We talking about 12-CURRENT and not about 1X-STABLE branches....


IMHO, this is an acceptable breakage for -current. This is on the 'experts
only' path and there's a note in UPDATING to cope. We don't intend to keep
it that way forever, and the benefit of getting useful testing from a wider
audience in this case, imho, out weights the minor inconvenience for the
small minority of users that go old-school.

Warner



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