【问题标题】:Issue with tool chain created using YOCTO fido branch使用 YOCTO fido 分支创建的工具链出现问题
【发布时间】:2023-03-20 19:50:02
【问题描述】:

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

  1. 回购同步

检查这些特定的提交

  1. cd /arm/fsl-community-bsp-fido/sources/meta-fsl-arm/
  2. git checkout master
  3. git 获取
  4. git checkout 663a838d38dd9124805771637232df0af01efd7c
  5. cd /arm/fsl-community-bsp-fido/sources/meta-fsl-arm-extra/
  6. git checkout master
  7. git fetch ch
  8. git 获取
  9. git checkout 12cc66a9b8c3788309cf0a72c001f27abc299271
  10. cd /arm/fsl-community-bsp-fido/sources/poky/
  11. git checkout master
  12. git 获取
  13. git checkout 5a51fb28dbdfcae8ceb503a5290532dd38aeb09f
  14. 源设置-环境魔杖

已更改 MACHINE='wandboard'

  1. vi conf/local.conf

开始构建工具链

  1. bitbake 元工具链

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

  1. source tmp/deploy/sdk/poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8+snapshot.sh
  2. ./tmp/deploy/sdk/poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8+snapshot.sh
  3. 源环境-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 你好.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/你好.c 在 /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:没有文件或目录 编译终止。

使用 -v 选项进行交叉编译 @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 --inc ludedir=/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-sabre/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=发布 --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-sabre/tmp/sysroots/x86_64-linux /usr/arm-poky-linux-gnueabi/bin --with-sysroot=/not/exist --with-build-sysroot=/arm/fsl-community-bsp-fido/build- sabre/tmp/sysroots/imx6qsabresd --enable-poison-system-directories --with-mpfr=/arm/fsl-community-bsp-fido/build-sabre/tmp/sysroots/x86_64-nativesdk-pokysdk-linux -- with-mpc=/arm/fsl-community-bsp-fido/build-sabre/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 你好。 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 world。或者我错过了什么。

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

--with-gxx-include-dir=/not/exist/usr/include/c++/5.2.0

--with-sysroot=/not/exist

【问题讨论】:

    标签: c compilation toolchain yocto


    【解决方案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-neon-poky-linux-gnueabi

    @debian:~$ ${CC} hello.c -o out

    @debian:~$ echo $? 0

    【讨论】:

      【解决方案2】:

      运行SDK生成的“env”脚本文件后,默认导出CC、CXX、LDFLAGS等变量标志,
      您需要在 make 文件中或手动使用这些变量。

      运行 sdk 环境

      @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
      

      它将成功运行。所以对于每一件事,你只需要使用宏。

      【讨论】:

      • 是的,它可以工作,但为什么我们只需要使用宏。如果我使用 Linaro 工具链,我可以直接使用 arm-linaro-gcc 进行编译。为什么不给 yocto。
      猜你喜欢
      • 2020-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多