首页 文章

使用YOCTO fido分支创建的工具链问题

提问于
浏览
2

... 13. repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b fido

  • repo sync

checkout这些特定的提交

  • cd / arm / fsl-community-bsp-fido / sources / meta-fsl-arm /

  • git checkout master

  • git fetch

  • git checkout 663a838d38dd9124805771637232df0af01efd7c

  • cd / arm / fsl-community-bsp-fido / sources / meta-fsl-arm-extra /

  • git checkout master

  • git fetch ch

  • git fetch

  • git checkout 12cc66a9b8c3788309cf0a72c001f27abc299271

  • cd / arm / fsl-community-bsp-fido / sources / poky /

  • git checkout master

  • git fetch

  • git checkout 5a51fb28dbdfcae8ceb503a5290532dd38aeb09f

  • source setup-environment wandboard

更改了MACHINE ='wandboard'

  • vi conf / local.conf

开始构建工具链

  • bitbake元工具链

运行脚本,即在构建步骤#30之后生成

  • source tmp / deploy / sdk / poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8 snapshot.sh

  • ./tmp/deploy/sdk/poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8 snapshot.sh

  • source environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

使用绝对路径创建工具链进行交叉编译

@debian:〜$ /opt/poky/1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / bin / arm-poky-linux-gnueabi / arm-poky-linux-gnueabi-gcc hello.c hello.c:1 :19:致命错误:stdio.h:没有这样的文件或目录编译终止 .

使用环境设置创建工具链进行交叉编译

@debian:〜$ arm-poky-linux-gnueabi-gcc hello.c hello.c:1:19:致命错误:stdio.h:没有这样的文件或目录编译终止 .

使用已创建的工具链与环境集进行交叉编译,并明确提供包含路径

@debian:〜$ arm-poky-linux-gnueabi-gcc -I /opt/poky/1.8 snapshot / sysroots / cortexa9hf-vfp-neon-poky-linux-gnueabi / usr / include / hello.c in file from / opt / poky / 1.8 snapshot / sysroots / cortexa9hf-vfp-neon-poky-linux-gnueabi / usr / include / features.h:389:0,来自/opt/poky/1.8 snapshot / sysroots / cortexa9hf-vfp-neon- poky-linux-gnueabi / usr / include / stdio.h:27,来自hello.c:1:/opt/poky/1.8 snapshot / sysroots / cortexa9hf-vfp-neon-poky-linux-gnueabi / usr / include / gnu /stubs.h:7:29:致命错误:gnu / stubs-soft.h:没有终止此类文件或目录编译 .

Cross compilation with -v option @debian:〜$ arm-poky-linux-gnueabi-gcc -v hello.c使用内置规范 . COLLECT_GCC = arm-poky-linux-gnueabi-gcc COLLECT_LTO_WRAPPER = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / libexec / arm-poky-linux-gnueabi / gcc / arm-poky-linux-gnueabi /5.2.0/lto-wrapper目标:arm-poky-linux-gnueabi配置:/arm/fsl-community-bsp-fido/build-sabre/tmp/work-shared/gcc-5.2.0-r0/gcc -5.2.0 / configure --build = x86_64-linux --host = x86_64-pokysdk-linux --target = arm-poky-linux-gnueabi --prefix = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk -linux / usr --exec_prefix = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr --bindir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / bin / arm -poky-linux-gnueabi --sbindir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / bin / arm-poky-linux-gnueabi --libexecdir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / libexec / arm-poky-linux-gnueabi -datadir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / share --sysconfdir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / etc --sharedstatedir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / com --localstatedir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / var --libdir = / opt / poky / 1.8 snapshot / sysroots / x86_64 -pokysdk-linux / usr / lib / arm-poky-linux-gnueabi --includedir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / include --oldincludedir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / include --infodir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / share / info --mandir = / opt / poky / 1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / share / man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot = / arm / fsl-community-bsp-fido / build-saber / tmp / sysroots / x86_64-nativesdk-pokysdk-linux --with-gnu-ld --enable-shared --enable-languages = c,c --enable-threads = posix --enable-multilib --enable-c99 - enable-long-long --enable-symvers = gnu --enable-libstdcxx-pch --program-prefix = arm-poky-linux-gnueabi- --without-local-prefix --enable-target-optspace --enable -lto --enable-libssp --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style = gnu --enable-linker-build-id --with-ppl = no --with-cloog = no --enable- checking = release --enable-cheaders = c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/5.2.0 --with-build-time-tools = / arm / fsl-community-bsp-fido / build-saber / tmp / sysroots / x86_64-linux / usr / arm-poky-linux-gnueabi / bin --with-sysroot=/not/exist --with-build-sysroot = / arm / fsl-community-bsp-fido / build-saber / tmp / sysroots / imx6qsabresd --enable-poison-system-directories - 与-MPFR = /臂/ FSL-社区BSP-汪汪/集结军刀/ TMP / sysroots / x86_64的-nativesdk-pokysdk Linux的--with-mpc = / arm / fsl-community-bsp-fido / build-saber / tmp / sysroots / x86_64-nativesdk-pokysdk-linux --enable-nls --with-arch = armv7-a线程模型:posix gcc版本5.2.0(GCC)COLLECT_GCC_OPTIONS = '-v' '-march=armv7-a' '-mtls-dialect=gnu' /opt/poky/1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / libexec / arm-poky-linux-gnueabi / gcc / arm-poky-linux-gnueabi /5.2.0/cc1 -quiet -v hello.c -quiet -dumpbase hello.c -march = armv7-a -mtls-dialect = gnu -auxbase hello -version -o /tmp/ccqXSLVK.s GNU C11(GCC)版本5.2.0(arm-poky-linux-gnueabi)由GNU C版本5.2.0编译,GMP版本6.0.0,MPFR版本3.1.3,MPC版本1.0.3 GGC启发式: - param ggc-min-expand = 100 --param ggc-min-heapsize = 131072忽略不存在的目录"/not/exist/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include"忽略不存在的目录"/not/exist/usr/local/include"忽略不存在的目录"/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/../../../../../arm-poky-linux-gnueabi/include"忽略不存在的目录"/not/exist/usr/include"

包括“...”搜索从这里开始:

include <...>搜索从这里开始:

/opt/poky/1.8 snapshot / sysroots / x86_64-pokysdk-linux / usr / lib / arm-poky-linux-gnueabi / gcc / arm-poky-linux-gnueabi / 5.2.0 / include /opt/poky/1.8 snapshot /sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/include-fixed搜索结果列表的结尾 . GNU C11(GCC)版本5.2.0(arm-poky-linux-gnueabi)由GNU C版本5.2.0编译,GMP版本6.0.0,MPFR版本3.1.3,MPC版本1.0.3 GGC启发式: - param ggc-min-expand = 100 --param ggc-min-heapsize = 131072编译器可执行校验和:4d79907806e372d157adce3e5c786751 hello.c:1:19:致命错误:stdio.h:没有这样的文件或目录

我需要一些帮助来使用这里创建的工具链来编译一个简单的hello世界 . 或者我错过了什么 .

即使我不确定为什么这些标志设置如下:

--with-gxx-include-dir = / not / exists / usr / include / c /5.2.0

--with-SYSROOT = /不/存在

2 回答

  • 1

    经过编译后,最终尝试了很多选项

    @debian:〜$ echo $ CC

    arm-poky-linux-gnueabi-gcc -march = armv7-a -marm -mthumb-interwork -mfloat-abi = hard -mfpu = neon -mtune = cortex-a9 - sysroot = / opt / poky / 1.8 / sysroots / cortexa9hf-VFP,霓虹灯狭小-Linux的gnueabi

    @debian:〜$ $ hello.c -o out

    @debian:〜$ echo $? 0

  • 2

    运行从SDK生成的"env"脚本文件后,默认情况下导出CC,CXX,LDFLAGS等变量标志,
    您需要在make文件中或手动使用这些变量 .

    运行sdk env

    @debian:~$  . envoiment file  
    @debian:~$ echo $CC
            arm-poky-linux-gnueabi-gcc -march=armv7ve -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/siva/imx7-images/sdk/meta-toolchain_sdk/sysroots/cortexa7hf-neon-poky-linux-gnueabi   
    
    @debian:~$ ${CC} hello.c -o hello
    

    如果您使用c文件,则需要使用 CXX

    @debian:~$ ${CXX} hello.cpp -o hello
    

    它会成功运行 . 所以对于每件事你只需要使用宏 .

相关问题