<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 29, 2016 at 9:14 AM, Ioan-Adrian Ratiu <span dir="ltr"><<a href="mailto:adrian.ratiu@ni.com" target="_blank">adrian.ratiu@ni.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 29 Aug 2016, Bruce Ashfield <<a href="mailto:bruce.ashfield@gmail.com">bruce.ashfield@gmail.com</a>> wrote:<br>
> On Mon, Aug 29, 2016 at 5:19 AM, Ioan-Adrian Ratiu <<a href="mailto:adrian.ratiu@ni.com">adrian.ratiu@ni.com</a>><br>
> wrote:<br>
><br>
>> do_kernel_configme calls merge_config.sh (installed in the sysroot by<br>
>> the kern-tools-native recipe) which calls make to fill in any missing<br>
>> symbols from the resulting merged config.<br>
><br>
><br>
> That's not what it does ... but that isn't important.<br>
<br>
</span>Can you please explain in a simple sentence what it does?<br></blockquote><div><br></div><div>It concatenates/merges configuration fragments.<br><br></div><div>The need to run make, or fill in any additional symbols is the optional behaviour<br></div><div>of the script and isn't the essential service of what it provides. Since for the<br></div><div>most part, it does very little if well specified configs and defconfigs are passed.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
><br>
><br>
>><br>
>> This errors out on my system because of sysroot poisoning [1]. Here is<br>
>> a partial output from my .kernel-meta/cfg/merge_config_<wbr>build.log (this<br>
>> file is created in do_kernel_configme() while callig merge_config.sh):<br>
>><br>
>> make[1]: Entering directory '/media/adi/ssd/nilrt-master/<br>
>> build/tmp-glibc/work/x64-<wbr>nilrt-linux/linux-nilrt/4.1+<br>
>> gitAUTOINC+a7e53ecc27-r0/<wbr>linux-x64-standard-build'<br>
>> HOSTCC scripts/basic/fixdep<br>
>> /media/adi/ssd/nilrt-master/<wbr>build/tmp-glibc/work-shared/<br>
>> x64/kernel-source/scripts/<wbr>basic/fixdep.c:106:23: fatal error:<br>
>> sys/types.h: No such file or directory<br>
>> compilation terminated.<br>
>> make[2]: *** [/media/adi/ssd/nilrt-master/<wbr>build/tmp-glibc/work-shared/<br>
>> x64/kernel-source/scripts/<wbr>basic/Makefile:22: scripts/basic/x86_64-nilrt-<wbr>linux-fixdep]<br>
>> Error 1<br>
>><br>
><br>
> This just means that we are missing a dependency. Everything that<br>
> merge_config<br>
> needs should be already in place before it runs, i.e. do_kernel_metadata<br>
> should<br>
> have already run and built any host tools that it needs.<br>
<br>
</span>This is not a missing dependency. The problem is the make command called<br>
in merge_configs fails silently because of a misconfigured sysroot. The<br>
correct sysroot is in the TOOLCHAIN_OPTIONS variable and it does not get<br>
passed to the make call in merge_configs.<br></blockquote><div><br></div><div>That's my definition of a missing dependency. The host tools should already exist before<br></div><div>merge_config ever runs. It shouldn't need to build anything.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
><br>
> How are you managing to trigger this error ? I've done plenty of builds,<br>
> and haven't<br>
> seen this one before.<br>
<br>
</span>Every one of my builds error out in that make call from merge_config<br>
without this change because make does not search in the correct sysroot.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>So there's something drastically different. I've done hundreds of builds before<br></div><div>and after my changes to the kern tools. <br><br></div><div>I need to understand what is different.<br><br></div><div>What's your configuration ? Are you building linux-yocto, or something else ? <br>(so I can run the same build here.)<br><br></div><div>Bruce<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
><br>
> Bruce<br>
><br>
><br>
>><br>
>> This issue is hard to debug because merge_config.sh does NOT check the<br>
>> error output of its make call (this is added in the second patch) and<br>
>> even though make errors out, the build continues as if nothing happened<br>
>> and compiles a kernel with garbage configs (the .config generated by<br>
>> do_kernel_configme is empty and gets filled later) which doesn't boot.<br>
>><br>
>> Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh<br>
>> fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make<br>
>> uses it to correctly compile & fill all missing kernel config options.<br>
>><br>
>> [1] <a href="http://lists.openembedded.org/pipermail/openembedded-core/" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>pipermail/openembedded-core/</a><br>
>> 2014-October/098253.html<br>
>><br>
>> Signed-off-by: Ioan-Adrian Ratiu <<a href="mailto:adrian.ratiu@ni.com">adrian.ratiu@ni.com</a>><br>
>> ---<br>
>> meta/classes/kernel-yocto.<wbr>bbclass | 2 +-<br>
>> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
>><br>
>> diff --git a/meta/classes/kernel-yocto.<wbr>bbclass<br>
>> b/meta/classes/kernel-yocto.<wbr>bbclass<br>
>> index 8650e55..4397a9d 100644<br>
>> --- a/meta/classes/kernel-yocto.<wbr>bbclass<br>
>> +++ b/meta/classes/kernel-yocto.<wbr>bbclass<br>
>> @@ -249,7 +249,7 @@ do_kernel_configme() {<br>
>> bbfatal_log "Could not find configuration queue<br>
>> (${meta_dir}/config.queue)"<br>
>> fi<br>
>><br>
>> - ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} ><br>
>> ${meta_dir}/cfg/merge_config_<wbr>build.log 2>&1<br>
>> + CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" ARCH=${ARCH}<br>
>> merge_config.sh -O ${B} ${config_flags} ${configs} ><br>
>> ${meta_dir}/cfg/merge_config_<wbr>build.log 2>&1<br>
>> if [ $? -ne 0 ]; then<br>
>> bbfatal_log "Could not configure<br>
>> ${KMACHINE}-${LINUX_KERNEL_<wbr>TYPE}"<br>
>> fi<br>
>> --<br>
>> 2.9.3<br>
>><br>
>><br>
><br>
><br>
> --<br>
> "Thou shalt not follow the NULL pointer, for chaos and madness await thee<br>
> at its end"<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"</div>
</div></div>