linux - Yocto Bitbake Glibc 构建失败

标签 linux glibc yocto bitbake microchip

我正在尝试构建 Yocto 镜像,但编译 glibc 时构建失败。

如果我只是运行

bitbake glibc -c compile

我收到如下编译错误:

/usr/src/debug/glibc/2.27-r0/git/nptl/pthread_atfork.c:51: undefined reference to `__dso_handle'
| /media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/glibc/2.27-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi.gcc-cross-initial-arm/../../libexec/arm-poky-linux-gnueabi.gcc-cross-initial-arm/gcc/arm-poky-linux-gnueabi/7.3.0/ld: /media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/glibc/2.27-r0/build-arm-poky-linux-gnueabi/rt/librt.so: hidden symbol `__dso_handle' isn't defined
| /media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/glibc/2.27-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi.gcc-cross-initial-arm/../../libexec/arm-poky-linux-gnueabi.gcc-cross-initial-arm/gcc/arm-poky-linux-gnueabi/7.3.0/ld: final link failed: Bad value
| collect2: error: ld returned 1 exit status
| ../Makerules:599: recipe for target '/media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/glibc/2.27-r0/build-arm-poky-linux-gnueabi/rt/librt.so' failed
| make[2]: *** [/media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/glibc/2.27-r0/build-arm-poky-linux-gnueabi/rt/librt.so] Error 1
| make[2]: Leaving directory '/media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/glibc/2.27-r0/git/rt'
| Makefile:235: recipe for target 'rt/others' failed
| make[1]: *** [rt/others] Error 2
| make[1]: Leaving directory '/media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/glibc/2.27-r0/git'
| Makefile:9: recipe for target 'all' failed
| make: *** [all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/glibc/2.27-r0/temp/log.do_compile.31096)
ERROR: Task (/media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/meta/recipes-core/glibc/glibc_2.27.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 227 tasks of which 226 didn't need to be rerun and 1 failed.

glibc库显然非常重要,那么如何解决编译错误呢?

最佳答案

获取软件包。

 MACHINE=at91sam9rlek bitbake glibc

干净

  MACHINE=at91sam9rlek bitbake -c clean glibc

编译配方

  MACHINE=at91sam9rlek bitbake -f -c compile glibc

您还可以指定MACHINE 定义。正如我所见,您使用meta-atmel。您可以根据您的主板设置MACHINE定义。

注意:确保您的 meta-atmel 版本与开放嵌入式和 yocto poky 版本匹配。这可能是根本原因。请分享结果。

关于linux - Yocto Bitbake Glibc 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53426734/

相关文章:

embedded-linux - linuxrc 的目的是什么,在 rootfs 中是否需要它?

yocto - 如何限制 yocto bitbake 中的内存使用?

c - 多线程数组的段错误

linux - 如何下载Hackspace云服务器中保存的图片?

c - 使用新名称复制函数

c - linux 机器中的哪个文件代表 gcc 标准 c 库?

docker - 我可以将 Docker 镜像构建为 "cache"yocto/bitbake 构建吗?

python - 如何编写适用于 Linux 管道的 Python 脚本?

linux - openssl 在命令行中设置私钥密码

android - 知道嵌入式系统是使用 glibc 还是 bionic?