<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 29, 2016 at 10:05 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"><span class="">On Mon, 29 Aug 2016, Bruce Ashfield &lt;<a href="mailto:bruce.ashfield@gmail.com">bruce.ashfield@gmail.com</a>&gt; wrote:<br>
</span><span class="">&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; wrote:<br>
&gt;<br>
&gt;&gt; do_kernel_configme calls merge_config.sh (installed in the sysroot by<br>
&gt;&gt; the kern-tools-native recipe) which calls make to fill in any missing<br>
&gt;&gt; symbols from the resulting merged config.<br>
&gt;<br>
&gt;<br>
&gt; That&#39;s not what it does ... but that isn&#39;t important.<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; This errors out on my system because of sysroot poisoning [1]. Here is<br>
&gt;&gt; a partial output from my .kernel-meta/cfg/merge_config_<wbr>build.log (this<br>
&gt;&gt; file is created in do_kernel_configme() while callig merge_config.sh):<br>
&gt;&gt;<br>
</span><span class="">&gt;&gt; make[1]: Entering directory &#39;/media/adi/ssd/nilrt-master/<br>
&gt;&gt; build/tmp-glibc/work/x64-<wbr>nilrt-linux/linux-nilrt/4.1+<br>
&gt;&gt; gitAUTOINC+a7e53ecc27-r0/<wbr>linux-x64-standard-build&#39;<br>
&gt;&gt;   HOSTCC  scripts/basic/fixdep<br>
&gt;&gt; /media/adi/ssd/nilrt-master/<wbr>build/tmp-glibc/work-shared/<br>
</span><span class="">&gt;&gt; x64/kernel-source/scripts/<wbr>basic/fixdep.c:106:23: fatal error:<br>
&gt;&gt; sys/types.h: No such file or directory<br>
&gt;&gt; compilation terminated.<br>
&gt;&gt; make[2]: *** [/media/adi/ssd/nilrt-master/<wbr>build/tmp-glibc/work-shared/<br>
&gt;&gt; x64/kernel-source/scripts/<wbr>basic/Makefile:22: scripts/basic/x86_64-nilrt-<wbr>linux-fixdep]<br>
&gt;&gt; Error 1<br>
&gt;&gt;<br>
&gt;<br>
&gt; This just means that we are missing a dependency. Everything that<br>
&gt; merge_config<br>
&gt; needs should be already in place before it runs, i.e. do_kernel_metadata<br>
&gt; should<br>
&gt; have already run and built any host tools that it needs.<br>
&gt;<br>
&gt; How are you managing to trigger this error ? I&#39;ve done plenty of builds,<br>
&gt; and haven&#39;t<br>
&gt; seen this one before.<br>
<br>
</span>Maybe some context is in order for how I build the kernel. I&#39;m using a<br>
custom kernel recipe which inherits from linux-yocto.inc. My kernel<br>
tree contains a defconfig which is passed to OE in my kernel recipe<br>
using KBUILD_DEFCONFIG and KCONFIG_MODE=&quot;--alldefconfig&quot;.<br></blockquote><div><br></div><div>And that would be the difference, which is what I was looking for. The tools<br></div><div>are always built for the linux-yocto path, hence why I can never reproduce<br></div><div>the issue.<br><br></div><div>I can take the kernel-yocto patch and queue it, but I&#39;m going to leave merge_config<br></div><div>untouched, since that change can go via the kernel path.<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">
<br>
I have no configuration fragments.<br>
<br>
As expected I need the merge_configs script to automatically fill in any<br>
missing CONFIG symbols before building the kernel and this is where it<br>
fails because the sysroot is poisoned since 2014.<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; Bruce<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; This issue is hard to debug because merge_config.sh does NOT check the<br>
&gt;&gt; error output of its make call (this is added in the second patch) and<br>
&gt;&gt; even though make errors out, the build continues as if nothing happened<br>
&gt;&gt; and compiles a kernel with garbage configs (the .config generated by<br>
&gt;&gt; do_kernel_configme is empty and gets filled later) which doesn&#39;t boot.<br>
&gt;&gt;<br>
&gt;&gt; Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh<br>
&gt;&gt; fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make<br>
&gt;&gt; uses it to correctly compile &amp; fill all missing kernel config options.<br>
&gt;&gt;<br>
&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; 2014-October/098253.html<br>
&gt;&gt;<br>
&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; ---<br>
&gt;&gt;  meta/classes/kernel-yocto.<wbr>bbclass | 2 +-<br>
&gt;&gt;  1 file changed, 1 insertion(+), 1 deletion(-)<br>
&gt;&gt;<br>
&gt;&gt; diff --git a/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt;&gt; b/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt;&gt; index 8650e55..4397a9d 100644<br>
&gt;&gt; --- a/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt;&gt; +++ b/meta/classes/kernel-yocto.<wbr>bbclass<br>
&gt;&gt; @@ -249,7 +249,7 @@ do_kernel_configme() {<br>
&gt;&gt;                 bbfatal_log &quot;Could not find configuration queue<br>
&gt;&gt; (${meta_dir}/config.queue)&quot;<br>
&gt;&gt;         fi<br>
&gt;&gt;<br>
&gt;&gt; -       ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} &gt;<br>
&gt;&gt; ${meta_dir}/cfg/merge_config_<wbr>build.log 2&gt;&amp;1<br>
&gt;&gt; +       CFLAGS=&quot;${CFLAGS} ${TOOLCHAIN_OPTIONS}&quot; ARCH=${ARCH}<br>
&gt;&gt; merge_config.sh -O ${B} ${config_flags} ${configs} &gt;<br>
&gt;&gt; ${meta_dir}/cfg/merge_config_<wbr>build.log 2&gt;&amp;1<br>
&gt;&gt;         if [ $? -ne 0 ]; then<br>
&gt;&gt;                 bbfatal_log &quot;Could not configure<br>
&gt;&gt; ${KMACHINE}-${LINUX_KERNEL_<wbr>TYPE}&quot;<br>
&gt;&gt;         fi<br>
&gt;&gt; --<br>
&gt;&gt; 2.9.3<br>
&gt;&gt;<br>
&gt;&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>