问题
I have built images for IMX6 using two different yocto versions. Following are the details.
Yocto Version1:
#curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
#repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-3.10.53-1.1.0_ga
#repo sync
#bitbake core-image-minimal
Yocto Version2:
#curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
#repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-3.14.52-1.1.0_ga
#repo sync
#bitbake core-image-minimal
Tool chain tree structure for both versions of yocto update @ http://pastebin.com/Jx7HtANR
I have compiled following sample program using both tool chains built using two different yocto versions.
#include <stdio.h>
int main(void)
{
return 0;
}
But tool chain built using yocto version 2 is giving following error.
test.c:1:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
Tool chain built using yocto version 1 is searching for header files under "build/tmp/sysroots/imx6qsabresd/usr/include", but tool chain built using yocto version 2 is not searching for header files under "build/tmp/sysroots/imx6qsabresd/usr/include", so it is giving error.
Can you help, why tool chain built using yocto version 2 is not searching for header files under "build/tmp/sysroots/imx6qsabresd/usr/include".
Where to change the tool chain configuration in yocto to include the above mentioned search path.
回答1:
In newer versions, OpenEmbedded based build systems, poisons the built in sysroot definition in the generated cross-compiler. The reason is that we'd like to detect applications that aren't respecting the the cross-compiling environment.
The solution is to not use ${CROSS_COMPILE}-gcc
directly, but instead use $CC
. $CC
, when set by the environment setup script from the generated SDK, will add the correct sysroot argument.
来源:https://stackoverflow.com/questions/38673910/yocto-built-tool-chain-search-path-issue