【问题标题】:Yocto Bitbake Glibc build failsYocto Bitbake Glibc 构建失败
【发布时间】:2018-11-22 08:32:17
【问题描述】:

我正在尝试构建 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 库显然很重要,那我该如何解决编译错误呢?

【问题讨论】:

    标签: linux glibc yocto bitbake microchip


    【解决方案1】:

    获取包。

     MACHINE=at91sam9rlek bitbake glibc
    

    清洁

      MACHINE=at91sam9rlek bitbake -c clean glibc
    

    编译配方

      MACHINE=at91sam9rlek bitbake -f -c compile glibc
    

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

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

    【讨论】:

    • 机器设置为 sama5d27-som1-ek-sd 在 local.conf 中,我尝试使用上面的强制编译:MACHINE=sama5d27-som1-ek-sd bitbake -f -c compile glibc 但这仍然产生相同的结果错误。版本似乎相同,我在这里按照教程进行操作:github.com/linux4sam/meta-atmel
    【解决方案2】:

    我将 meta-atmel 的 rocko 版本克隆到 yocto 文件夹,我刚刚使用以下命令成功编译了 glibc 配方。

    MACHINE=sama5d27-som1-ek-sd bitbake -f -c compile glibc
    Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:01:17
    Parsing of 2430 .bb files complete (0 cached, 2430 parsed). 3275 targets, 372 skipped, 37 masked, 0 errors.
    NOTE: Resolving any missing task queue dependencies
    
    Build Configuration:
    BB_VERSION           = "1.36.0"
    BUILD_SYS            = "x86_64-linux"
    NATIVELSBSTRING      = "universal"
    TARGET_SYS           = "arm-poky-linux-gnueabi"
    MACHINE              = "sama5d27-som1-ek-sd"
    DISTRO               = "poky"
    DISTRO_VERSION       = "2.4.3"
    TUNE_FEATURES        = "arm armv7a vfp thumb neon callconvention-hard cortexa5"
    TARGET_FPU           = "hard"
    meta                 
    meta-poky            
    meta-yocto-bsp       = "rocko:05711ba18587aaaf4a9c465a1dd4537f27ceda93"
    meta-oe              
    meta-multimedia      
    meta-networking      
    meta-python          = "rocko:eae996301d9c097bcbeb8046f08041dc82bb62f8"
    meta-raspberrypi     = "rocko:8e4c537d84fdde8e3b4642d0dda2c0f4af76d52f"
    meta-ti              = "rocko:8ba46625b0630b738724e6697fd3520116b082ef"
    meta-freescale       = "rocko:61ab34ac6d664a229847b796ec20fd9f7c8ecbf4"
    meta-qt5             = "rocko:682ad61c071a9710e9f9d8a32ab1b5f3c14953d1"
    meta-solidrun-arm-imx6 = "rocko:d567d75be8984bd868df9af6108f12fecb049c2d"
    meta-atmel           = "rocko:f71ed8ade26b4f26f00b624bf1b6fdc6e6c4aaf0"
    
    NOTE: Tainting hash to force rebuild of task /home/eren/poky-rocko/meta/recipes-core/glibc/glibc_2.26.bb, do_compile                                                                         | ETA:  0:00:00
    WARNING: /home/eren/poky-rocko/meta/recipes-core/glibc/glibc_2.26.bb.do_compile is tainted from a forced run                                                                                 | ETA:  0:00:00
    Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:00
    NOTE: Executing SetScene Tasks
    NOTE: Executing RunQueue Tasks
    NOTE: Tasks Summary: Attempted 219 tasks of which 187 didn't need to be rerun and all succeeded.
    
    Summary: There was 1 WARNING message shown
    

    我认为你的问题是,你的构建环境不干净,或者你没有使用相同版本的 meta-atmel、open-embedded 和 poky 或任何依赖的 meta。

    【讨论】:

    • 我认为你是对的,因为我已经在虚拟机上成功完成了这项工作,我刚刚获得了一台新安装的 Ubuntu 笔记本电脑,我已经将开发转移到了该笔记本电脑上。有没有与上述相关的可以检查或重新安装的东西?
    • 您只需要注意使用相同的yocto-meta版本并使用yocto社区支持级别的stable。
    • 我再次尝试构建,但这次使用的是 rocko 版本而不是 sumo,并且一切正常。似乎这可能是 Microchip 的兼容性问题。感谢您的帮助,使用 rocko 可以满足我的需要。
    • 欢迎您。我总是尝试使用社区版的 yocto,或者至少是最接近的稳定版 yocto。遇到麻烦的可能性越小
    猜你喜欢
    • 2021-07-08
    • 2020-12-27
    • 1970-01-01
    • 2022-08-05
    • 2021-06-27
    • 2019-09-21
    • 1970-01-01
    • 1970-01-01
    • 2021-12-12
    相关资源
    最近更新 更多