On Mon, Jan 6, 2020 at 12:54 PM Michał Górny <[email protected]> wrote:
>
> On Mon, 2020-01-06 at 12:43 -0500, Mike Gilbert wrote:
> > On Sun, Jan 5, 2020 at 1:27 AM Michał Górny <[email protected]> wrote:
> > > +# @FUNCTION: kernel-build_src_configure
> > > +# @DESCRIPTION:
> > > +# Prepare the toolchain for building the kernel, get the default .config
> > > +# or restore savedconfig, and get build tree configured for modprep.
> > > +kernel-build_src_configure() {
> > > +       debug-print-function ${FUNCNAME} "${@}"
> > > +
> > > +       # force ld.bfd if we can find it easily
> > > +       local LD="$(tc-getLD)"
> > > +       if type -P "${LD}.bfd" &>/dev/null; then
> > > +               LD+=.bfd
> > > +       fi
> >
> > Is there some reason not to use the tc-ld-disable-gold function?
> >
>
> Yes.  As the name says, it covers gold usage only and not lld.

It might be a good idea to copy this logic to handle multi-word LD values.

https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/toolchain-funcs.eclass#n498

Or, a nicer alternative would be to refactor tc-ld-disable-gold into 2
functions: move most of the logic into a new function
"tc-ld-force-bfd", and update tc-ld-disable-gold to call the former if
tc-ld-is-gold is true. I can write a patch for that if you agree.

Reply via email to