yocto built tool chain search path issue

北城余情 提交于 2019-12-12 04:14:36

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!