Yocto Bitbake Glibc构建失败

时间:2018-11-22 08:32:18

标签: 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库显然非常重要,那么如何解决编译错误?

2 个答案:

答案 0 :(得分:2)

获取软件包。

 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版本。这可能是根本原因。请分享结果。

答案 1 :(得分:0)

我将meta-atmel的摇滚版本克隆到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,开放式嵌入式和poky或任何依赖的meta。