<div dir="ltr">hi there,<div><br></div><div>first of all, we are building dylan branch with oe-core + meta-linaro-toolchain, not using external toolchain, hence the cross post on OE and linaro lists.</div><div><br></div><div>

we&#39;ve been debugging some nasty build issues over the last few days on our Jenkins server. and i&#39;d like to bring our findings up to the list... i suspect there could be a bug in OE gcc-cross, but i&#39;d like to hear from you about that.</div>

<div><br></div><div>our bug appeared because we were &#39;wrongly&#39; unsetting the CFLAGS from OE in one of our recipe, so we would loose the following from our compilation command line</div><div><br></div><div><div>-march=armv7-a</div>

<div>-marm</div><div>-mthumb-interwork</div><div>-mfloat-abi=hard</div><div>-mfpu=neon</div><div>--sysroot=/work/rdk/build-genericarmv7a/tmp/sysroots/genericarmv7a</div></div><div><br></div><div>The compilation error was that stdlib.h was not found. </div>

<div><br></div><div>as a matter of fact, we build for several different machines (.conf file), *but* we share the same sstate and downloads for all machines. We don&#39;t do parallel builds, each machine is built sequentially in its own build folder (.../workspace/machines/&lt;MACHINE&gt;/build), and all build folder are deleted before each build (of course sstate and downloads aren&#39;t deleted).</div>

<div><br></div><div>What we noticed is that we end up pulling the compiler (gcc-cross) from sstate as expected. However we pull the same &#39;blob&#39; from sstate for gcc-cross for *all* machines we build. It does seem that the compiler does not use $MACHINE for the sstate checksum. </div>

<div><br></div><div>When the gcc-cross package was built and pushed in sstate, it was being built for a specific machine (let&#39;s say MACHINE-A), hence the compiler has the &#39;builtin&#39; sysroot set to &#39;tmp/sysroots/MACHINE-A&#39;. </div>

<div><br></div><div>Now when building our image for MACHINE-B, we pull gcc-cross from sstate, and we get the default builtin sysroot for MACHINE-A!! That&#39;s why our build failed, because we tried to build MACHINE-B before MACHINE-A, so stdlib.h wasn&#39;t there yet on Jenkins..</div>

<div><br></div><div>To me the problem is that gcc-cross &#39;embedds&#39; some $MACHINE data in its package, but it is not marked as &#39;machine specific, but arch specific.  So several machines will end up sharing the same gcc-cross package.</div>

<div><br></div><div>So, of course we shouldn&#39;t ignore the CFLAGS from OE, and the CFLAGS would set the right sysroot, and of course we fixed our software so that we don&#39;t ignore CFLAGS anymore... but that still looks like a bug to me.</div>

<div><br></div><div><br></div><div>cheers</div><div><br></div><div>nico</div></div>