yocto 构建工具链搜索路径问题

yocto built tool chain search path issue

我已经使用两个不同的 yocto 版本为 IMX6 构建了图像。以下是详情。

Yocto 版本 1:

    #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 版本 2:

    #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

两个版本的 yocto update @ http://pastebin.com/Jx7HtANR

的工具链树结构

我使用两个不同的 yocto 版本构建的两个工具链编译了以下示例程序。

#include <stdio.h>
int main(void)
{ 
    return 0; 
}

但是使用 yocto 版本 2 构建的工具链出现以下错误。

test.c:1:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
                ^
compilation terminated.

使用 yocto 版本 1 构建的工具链正在搜索下面的头文件 "build/tmp/sysroots/imx6qsabresd/usr/include",但是使用yocto version 2构建的工具链没有搜索"build/tmp/sysroots/imx6qsabresd/usr/include"下的头文件,所以是给出错误。

你能帮忙吗,为什么使用 yocto 版本 2 构建的工具链不搜索 "build/tmp/sysroots/imx6qsabresd/usr/include" 下的头文件。

在哪里更改 yocto 中的工具链配置以包含上述搜索路径。

在较新的版本中,基于 OpenEmbedded 的构建系统会破坏生成的交叉编译器中的内置 sysroot 定义。原因是我们想要检测不遵守交叉编译环境的应用程序。

解决方法是不直接使用${CROSS_COMPILE}-gcc,而是使用$CC$CC,当由生成的 SDK 的环境设置脚本设置时,将添加正确的 sysroot 参数。