[OE-core] [PATCH] kernel.bbclass: set HOSTLDFLAGS in KCONFIG_CONFIG_COMMAND

Bruce Ashfield bruce.ashfield at windriver.com
Fri Jan 26 14:47:01 UTC 2018


On 2018-01-25 3:26 PM, Cal Sullivan wrote:
> 
> 
> On 01/25/2018 06:21 AM, Bruce Ashfield wrote:
>> On 01/24/2018 10:12 PM, California Sullivan wrote:
>>> Kernel v4.14 and newer contain the following in their Makefile:
>>>
>>> HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS)
>>> HOSTLDFLAGS  := $(HOST_LFS_LDFLAGS)
>>>
>>> This breaks our menuconfig, because it can no longer find ncurses if its
>>> not on the host machine. This can be seen in linux-yocto-dev, for
>>> example:
>>>
>>> [clsulliv at clsulliv build]$ bitbake virtual/kernel -c menuconfig
>>>
>>>    GEN     ./Makefile
>>>    HOSTLD  scripts/kconfig/mconf
>>> /home/clsulliv/yocto/poky/build/tmp/hosttools/ld: cannot find -lncurses
>>> /home/clsulliv/yocto/poky/build/tmp/hosttools/ld: cannot find -ltinfo
>>> collect2: error: ld returned 1 exit status
>>> make[3]: *** [scripts/Makefile.host:99: scripts/kconfig/mconf] Error 1
>>> make[2]: *** 
>>> [/home/clsulliv/yocto/poky/build/tmp/work-shared/intel-corei7-64/kernel-source/Makefile:504: 
>>> menuconfig] Error 2
>>> make[1]: *** [Makefile:146: sub-make] Error 2
>>> make: *** [Makefile:24: __sub-make] Error 2
>>> Command failed.
>>> Press any key to continue...
>>
>> Does this fix still require a kernel patch ? I was trying to test
>> it out here, and may have messed up the steps.
>>
>> If I remove ncurses-dev from my builder, I'm not able to get a
>> working menuconfig no matter what combination of this patch
>> applied (or not) or my menuconfig patch applied (or not).
>>
>> I can say that having this applied didn't break my menuconfig,
>> but I wasn't able to fully test.
>>
>> Should I expect a builder without ncurses-dev + just this patch
>> to be able to run menuconfig ?
> We still need the patch "menuconfig,check-lxdiaglog.sh: Allow 
> specification of ncurses location", as seen here: 
> https://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-dev/commit/?h=standard/base&id=26911f4ada6374ff3f0b7f98364b7a93756a180b 
> 
> 
> Two separate fixes in the same area unfortunately.
> 
> Locally I am doing 'bitbake linux-yocto-dev -c menuconfig' and I am 
> getting a working menuconfig with my patch, and no ncurses-dev(el) 
> installed on my host machine. If you're not, I worry that there might be 
> more host contamination that we haven't discovered.
> 
> Could you share the errors you're hitting?

I retested this morning, since I was doing a lot of different things
yesterday .. and I wanted to be sure that I had things right.

During my new tests, I can get menuconfig to launch with ncurses-dev
removed on my builder, if I have your patch + the one I carry in
linux-yocto.

It was my revert of the kernel patch that was getting me into the
"never able to build menuconfig" loop.

So no issues with this change, it doesn't break anything and definitely
lets me launch menuconfig when ncurses-dev isn't present on the builder.

I'll resend that kernel patch upstream.

Bruce

> 
> Thanks,
> Cal
> 
>>
>> Bruce
>>
>>>
>>> Fix this by setting HOSTLDFLAGS to ${BUILD_LDFLAGS} in our
>>> 'make menuconfig' command.
>>>
>>> Signed-off-by: California Sullivan <california.l.sullivan at intel.com>
>>> ---
>>>   meta/classes/kernel.bbclass | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>> index 2f6eca382e9..e4df1531c19 100644
>>> --- a/meta/classes/kernel.bbclass
>>> +++ b/meta/classes/kernel.bbclass
>>> @@ -531,6 +531,8 @@ addtask savedefconfig after do_configure
>>>     inherit cml1
>>>   +KCONFIG_CONFIG_COMMAND_append = " HOSTLDFLAGS='${BUILD_LDFLAGS}'"
>>> +
>>>   EXPORT_FUNCTIONS do_compile do_install do_configure
>>>     # kernel-base becomes kernel-${KERNEL_VERSION}
>>>
>>
> 




More information about the Openembedded-core mailing list