<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 29, 2016 at 11:34 AM, Ioan-Adrian Ratiu <span dir="ltr">&lt;<a href="mailto:adrian.ratiu@ni.com" target="_blank">adrian.ratiu@ni.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, 29 Aug 2016, Bruce Ashfield &lt;<a href="mailto:bruce.ashfield@gmail.com">bruce.ashfield@gmail.com</a>&gt; wrote:<br>
&gt; On Mon, Aug 29, 2016 at 10:05 AM, Ioan-Adrian Ratiu &lt;<a href="mailto:adrian.ratiu@ni.com">adrian.ratiu@ni.com</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt;&gt; On Mon, 29 Aug 2016, Bruce Ashfield &lt;<a href="mailto:bruce.ashfield@gmail.com">bruce.ashfield@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; On Mon, Aug 29, 2016 at 5:19 AM, Ioan-Adrian Ratiu &lt;<a href="mailto:adrian.ratiu@ni.com">adrian.ratiu@ni.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; do_kernel_configme calls merge_config.sh (installed in the sysroot by<br>
&gt;&gt; &gt;&gt; the kern-tools-native recipe) which calls make to fill in any missing<br>
&gt;&gt; &gt;&gt; symbols from the resulting merged config.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; That&#39;s not what it does ... but that isn&#39;t important.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; This errors out on my system because of sysroot poisoning [1]. Here is<br>
&gt;&gt; &gt;&gt; a partial output from my .kernel-meta/cfg/merge_config_<wbr>build.log (this<br>
&gt;&gt; &gt;&gt; file is created in do_kernel_configme() while callig merge_config.sh):<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; make[1]: Entering directory &#39;/media/adi/ssd/nilrt-master/<br>
&gt;&gt; &gt;&gt; build/tmp-glibc/work/x64-<wbr>nilrt-linux/linux-nilrt/4.1+<br>
&gt;&gt; &gt;&gt; gitAUTOINC+a7e53ecc27-r0/<wbr>linux-x64-standard-build&#39;<br>
&gt;&gt; &gt;&gt;   HOSTCC  scripts/basic/fixdep<br>
&gt;&gt; &gt;&gt; /media/adi/ssd/nilrt-master/<wbr>build/tmp-glibc/work-shared/<br>
&gt;&gt; &gt;&gt; x64/kernel-source/scripts/<wbr>basic/fixdep.c:106:23: fatal error:<br>
&gt;&gt; &gt;&gt; sys/types.h: No such file or directory<br>
&gt;&gt; &gt;&gt; compilation terminated.<br>
&gt;&gt; &gt;&gt; make[2]: *** [/media/adi/ssd/nilrt-master/<wbr>build/tmp-glibc/work-shared/<br>
&gt;&gt; &gt;&gt; x64/kernel-source/scripts/<wbr>basic/Makefile:22:<br>
&gt;&gt; scripts/basic/x86_64-nilrt-<wbr>linux-fixdep]<br>
&gt;&gt; &gt;&gt; Error 1<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This just means that we are missing a dependency. Everything that<br>
&gt;&gt; &gt; merge_config<br>
&gt;&gt; &gt; needs should be already in place before it runs, i.e. do_kernel_metadata<br>
&gt;&gt; &gt; should<br>
&gt;&gt; &gt; have already run and built any host tools that it needs.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; How are you managing to trigger this error ? I&#39;ve done plenty of builds,<br>
&gt;&gt; &gt; and haven&#39;t<br>
&gt;&gt; &gt; seen this one before.<br>
&gt;&gt;<br>
&gt;&gt; Maybe some context is in order for how I build the kernel. I&#39;m using a<br>
&gt;&gt; custom kernel recipe which inherits from linux-yocto.inc. My kernel<br>
&gt;&gt; tree contains a defconfig which is passed to OE in my kernel recipe<br>
&gt;&gt; using KBUILD_DEFCONFIG and KCONFIG_MODE=&quot;--alldefconfig&quot;.<br>
&gt;&gt;<br>
&gt;<br>
&gt; And that would be the difference, which is what I was looking for. The tools<br>
&gt; are always built for the linux-yocto path, hence why I can never reproduce<br>
&gt; the issue.<br>
&gt;<br>
&gt; I can take the kernel-yocto patch and queue it, but I&#39;m going to leave<br>
&gt; merge_config<br>
&gt; untouched, since that change can go via the kernel path.<br>
<br>
</div></div>Thank you.<br>
<br>
Can you please explain a little what you mean by &quot;go via the kernel path&quot;?<br></blockquote><div><br><br></div><div>I keep a copy of merge_config.sh in the kern-tools repo, because I don&#39;t want to<br></div><div>add a dependency on the full kernel source tree to get that single tool.<br><br></div><div>I also used to carry changes to the script in the kern-tools repo. But with my recent<br></div><div>updates, I&#39;m able to use it as-is.<br><br></div><div>So unless a bug is critical (and in this case, we can get by with me carrying the<br></div><div>toolchain definition patch to kernel-yocto), the right place to submit patches to <br></div><div>merge_config.sh is via the linux kernel mailing list. That way everyone gets to<br></div><div>take advantage of the changes.<br><br></div><div>Cheers,<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>
&gt;<br>
&gt; Bruce<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; I have no configuration fragments.<br>
&gt;&gt;<br>
&gt;&gt; As expected I need the merge_configs script to automatically fill in any<br>
&gt;&gt; missing CONFIG symbols before building the kernel and this is where it<br>
&gt;&gt; fails because the sysroot is poisoned since 2014.<br>
&gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Bruce<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; This issue is hard to debug because merge_config.sh does NOT check the<br>
&gt;&gt; &gt;&gt; error output of its make call (this is added in the second patch) and<br>
&gt;&gt; &gt;&gt; even though make errors out, the build continues as if nothing happened<br>
&gt;&gt; &gt;&gt; and compiles a kernel with garbage configs (the .config generated by<br>
&gt;&gt; &gt;&gt; do_kernel_configme is empty and gets filled later) which doesn&#39;t boot.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh<br>
&gt;&gt; &gt;&gt; fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make<br>
&gt;&gt; &gt;&gt; uses it to correctly compile &amp; fill all missing kernel config options.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; [1] <a href="http://lists.openembedded.org/pipermail/openembedded-core/" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>pipermail/openembedded-core/</a><br>
&gt;&gt; &gt;&gt; 2014-October/098253.html<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Signed-off-by: Ioan-Adrian Ratiu &lt;<a href="mailto:adrian.ratiu@ni.com">adrian.ratiu@ni.com</a>&gt;<br>
&gt;&gt; &gt;&gt; ---<br>
&gt;&gt; &gt;&gt;  meta/classes/kernel-yocto.<wbr>bbclass | 2 +-<br>
&gt;&gt; &gt;&gt;  1 file changed, 1 insertion(+), 1 deletion(-)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; diff --git a/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt;&gt; &gt;&gt; b/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt;&gt; &gt;&gt; index 8650e55..4397a9d 100644<br>
&gt;&gt; &gt;&gt; --- a/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt;&gt; &gt;&gt; +++ b/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt;&gt; &gt;&gt; @@ -249,7 +249,7 @@ do_kernel_configme() {<br>
&gt;&gt; &gt;&gt;                 bbfatal_log &quot;Could not find configuration queue<br>
&gt;&gt; &gt;&gt; (${meta_dir}/config.queue)&quot;<br>
&gt;&gt; &gt;&gt;         fi<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; -       ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs}<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; ${meta_dir}/cfg/merge_config_<wbr>build.log 2&gt;&amp;1<br>
&gt;&gt; &gt;&gt; +       CFLAGS=&quot;${CFLAGS} ${TOOLCHAIN_OPTIONS}&quot; ARCH=${ARCH}<br>
&gt;&gt; &gt;&gt; merge_config.sh -O ${B} ${config_flags} ${configs} &gt;<br>
&gt;&gt; &gt;&gt; ${meta_dir}/cfg/merge_config_<wbr>build.log 2&gt;&amp;1<br>
&gt;&gt; &gt;&gt;         if [ $? -ne 0 ]; then<br>
&gt;&gt; &gt;&gt;                 bbfatal_log &quot;Could not configure<br>
&gt;&gt; &gt;&gt; ${KMACHINE}-${LINUX_KERNEL_<wbr>TYPE}&quot;<br>
&gt;&gt; &gt;&gt;         fi<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; 2.9.3<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; &quot;Thou shalt not follow the NULL pointer, for chaos and madness await thee<br>
&gt;&gt; &gt; at its end&quot;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; &quot;Thou shalt not follow the NULL pointer, for chaos and madness await thee<br>
&gt; at its end&quot;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">&quot;Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end&quot;</div>
</div></div>