<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 29, 2016 at 9:51 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 9:14 AM, Ioan-Adrian Ratiu <<a href="mailto:adrian.ratiu@ni.com">adrian.ratiu@ni.com</a>><br>
> wrote:<br>
><br>
>> 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>
>> Can you please explain in a simple sentence what it does?<br>
>><br>
><br>
> It concatenates/merges configuration fragments.<br>
><br>
> The need to run make, or fill in any additional symbols is the optional<br>
> behaviour<br>
> of the script and isn't the essential service of what it provides. Since<br>
> for the<br>
> most part, it does very little if well specified configs and defconfigs are<br>
> passed.<br>
<br>
</span>Even if it is an optional behaviour, this is exactly what make does, so<br>
I don't know how I mistated what it does (it fills in missing symbols).<br>
This is exactly what I said.<br></blockquote><div><br></div><div>I've been working with merge_config for a long time (it is based on parts of scripts<br></div><div>that I wrote/developed), so lets just say that I have a more precise definition of<br></div><div>what it does. The extra filling in of symbols is peripheral functionality.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The important issue is that it can fail and if it can fail then we need<br>
to check its return code. Isn't this true?<br></blockquote><div><br></div><div>I didn't say it wasn't, but I'm not in the habit of merging patches for errors that<br></div><div>I can't reproduce when I run hundreds/thousands of builds with the tools and<br></div><div>have never seen it. I need to understand the root cause, and see it myself.<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>
<br>
<br>
><br>
><br>
>><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:<br>
>> 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>
>> 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>
>><br>
><br>
> That's my definition of a missing dependency. The host tools should already<br>
> exist before<br>
> merge_config ever runs. It shouldn't need to build anything.<br>
><br>
><br>
>><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>
>> 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>
>><br>
>><br>
> So there's something drastically different. I've done hundreds of builds<br>
> before<br>
> and after my changes to the kern tools.<br>
><br>
> I need to understand what is different.<br>
><br>
> What's your configuration ? Are you building linux-yocto, or something else<br>
> ?<br>
> (so I can run the same build here.)<br>
><br>
> Bruce<br>
><br>
><br>
>> ><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>
>> ><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>
>><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>