【问题标题】:Yocto Jethro: How to choose a Yocto Default Compiler? glibc failed at do_compile when use gcc 4.9Yocto Jethro:如何选择 Yocto 默认编译器?使用 gcc 4.9 时 glibc 在 do_compile 失败
【发布时间】:2016-04-18 21:40:05
【问题描述】:

由于来自 HEAD 分支的旧 Das u-boot 还没有 gcc 5,我计划使用 gcc 4.8 或 4.9 作为默认编译器而不是 5.2。

GCC 需要 virtual/libc glibc-2.22。 glibc-2.22 与 5.2 成功兼容。不幸的是,它在 do_compile 失败并出现错误:ld: cannot find -lgcc with gcc 4.8 and 4.9

arm-poky-linux-gnueabi-gcc  -march=armv7-a -marm  -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=/yocto/hio-jethro/build-hio/tmp/sysroots/hio-imx6dl-board-tcbootstrap   -nostdlib -nostartfiles -r -o /yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/build-arm-poky-linux-gnueabi/elf/librtld.map.o '-Wl,-(' /yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/build-arm-poky-linux-gnueabi/elf/dl-allobjs.os /yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/build-arm-poky-linux-gnueabi/libc_pic.a -lgcc '-Wl,-)' -Wl,-Map,/yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/build-arm-poky-linux-gnueabi/elf/librtld.mapT
/yocto/hio-jethro/build-hio/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi.gcc-cross-initial-arm/../../libexec/arm-poky-linux-gnueabi.gcc-cross-initial-arm/gcc/arm-poky-linux-gnueabi/5.2.0/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
make[2]: *** [/yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/build-arm-poky-linux-gnueabi/elf/librtld.map] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/git/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/git'
make: *** [all] Error 2
ERROR: oe_runmake failed

我看到的是正确的错误吗?以及如何添加-lgcc

编辑: 我已经与 Fido Branch 核对过,一切正常。我可能只需要用 Fido 替换 gcc 和 glibc

【问题讨论】:

    标签: gcc embedded-linux yocto openembedded


    【解决方案1】:

    你是如何告诉它使用 GCC 4 的?路径仍然引用 5.2.0,这表明您没有正确更改它。更改GCC版本的正确方法是设置GCCVERSION,即GCCVERSION="4.%"

    jethro中的u-boot也支持gcc5就好了,那你为什么要使用旧版本呢?

    【讨论】:

    • 我添加了 'PREFERRED_VERSION_gcc ?= "4.9%" 及其与 local.conf 相关的所有内容。我使用旧的 u-boot 是因为我使用的是 2 年多,不支持 gcc5。仍然需要更新,但还没有时间。我不知道为什么它仍然在某些部分调用 5.2。
    • 您能在答案中添加 GCCVERSION = "4.9%" 吗?感谢您的帮助。
    猜你喜欢
    • 2021-11-18
    • 1970-01-01
    • 1970-01-01
    • 2021-04-06
    • 1970-01-01
    • 1970-01-01
    • 2021-07-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多