本文介绍了yocto构建了工具链搜索路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用两种不同的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 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

两个版本的工具链树结构yocto update @



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

  #include  int main(void)
{
return 0;
}

但是使用yocto version 2构建的工具链会产生以下错误。

  test.c:1:19:致命错误:stdio.h:没有这样的文件或目录
#include ^
编译终止。

使用yocto version 1构建的工具链搜索
下的头文件build / tmp / sysroots / imx6qsabresd / usr / include,但使用yocto version 2构建的工具链不会搜索build / tmp / sysroots / imx6qsabresd / usr / include



你能帮忙吗,为什么使用yocto version 2构建的工具链不能搜索build / tmp下的头文件/ sysroots / imx6qsabresd的/ usr /包括即可。



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

在较新的版本中,基于OpenEmbedded的构建系统毒化了生成的交叉编译器中内置的sysroot定义。原因是我们希望检测不符合交叉编译环境的应用程序。



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

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.

解决方案

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.

这篇关于yocto构建了工具链搜索路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-17 00:24