Yocto Bitbake Glibc build fails

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Yocto Bitbake Glibc build fails

Jump to solution
8,787 Views
Tooght
Contributor III

Hi,

I'm trying to build a Yocto image but the build fails when compiling glibc.
I ran this command:

bitbake lite-image

I get a compilation error as follows:

 

 

| /media/ubu/LocalDisk/yocto-test/maaxboard/build/tmp/work/aarch64-poky-linux/glibc/2.27-r0/build-aarch64-poky-linux/nptl/libpthread_nonshared.a(pthread_atfork.oS): In function `__pthread_atfork':
| /usr/src/debug/glibc/2.27-r0/git/nptl/pthread_atfork.c:51: undefined reference to `__dso_handle'
| /usr/src/debug/glibc/2.27-r0/git/nptl/pthread_atfork.c:51: undefined reference to `__dso_handle'
| /media/ubu/LocalDisk/yocto-test/maaxboard/build/tmp/work/aarch64-poky-linux/glibc/2.27-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux.gcc-cross-initial-aarch64/../../libexec/aarch64-poky-linux.gcc-cross-initial-aarch64/gcc/aarch64-poky-linux/7.3.0/ld: /media/ubu/LocalDisk/yocto-test/maaxboard/build/tmp/work/aarch64-poky-linux/glibc/2.27-r0/build-aarch64-poky-linux/rt/librt.so: hidden symbol `__dso_handle' isn't defined
| /media/ubu/LocalDisk/yocto-test/maaxboard/build/tmp/work/aarch64-poky-linux/glibc/2.27-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux.gcc-cross-initial-aarch64/../../libexec/aarch64-poky-linux.gcc-cross-initial-aarch64/gcc/aarch64-poky-linux/7.3.0/ld: final link failed: Bad value
| collect2: error: ld returned 1 exit status
| ../Makerules:599: recipe for target '/media/ubu/LocalDisk/yocto-test/maaxboard/build/tmp/work/aarch64-poky-linux/glibc/2.27-r0/build-aarch64-poky-linux/rt/librt.so' failed
| make[2]: *** [/media/ubu/LocalDisk/yocto-test/maaxboard/build/tmp/work/aarch64-poky-linux/glibc/2.27-r0/build-aarch64-poky-linux/rt/librt.so] Error 1
| make[2]: Leaving directory '/media/ubu/LocalDisk/yocto-test/maaxboard/build/tmp/work/aarch64-poky-linux/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/ubu/LocalDisk/yocto-test/maaxboard/build/tmp/work/aarch64-poky-linux/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/ubu/LocalDisk/yocto-test/maaxboard/build/tmp/work/aarch64-poky-linux/glibc/2.27-r0/temp/log.do_compile.9024)
ERROR: Task (/media/ubu/LocalDisk/yocto-test/sources/poky/meta/recipes-core/glibc/glibc_2.27.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 431 tasks of which 428 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /media/ubu/LocalDisk/yocto-test/sources/poky/meta/recipes-core/glibc/glibc_2.27.bb:do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

 

Build Configuration:

 

 

 

BB_VERSION           = "1.38.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-18.04"
TARGET_SYS           = "aarch64-poky-linux"
MACHINE              = "maaxboard-ddr4-2g-sdcard"
DISTRO               = "fsl-imx-wayland-lite"
DISTRO_VERSION       = "4.14-sumo"
TUNE_FEATURES        = "aarch64"
TARGET_FPU           = ""
meta                 
meta-poky            = "HEAD:5ddf7fff992b065ee512878d2fe65f3e35d818cf"
meta-oe              
meta-multimedia      = "HEAD:8760facba1bceb299b3613b8955621ddaa3d4c3f"
meta-freescale       = "HEAD:86772601e7f6ea188dfaf64097edafc05e15aef3"
meta-freescale-3rdparty = "HEAD:82037216280a39957fb4272581637abec734ad50"
meta-freescale-distro = "HEAD:f7e2216e93aff14ac32728a13637a48df436b7f4"
meta-maaxboard       = "sumo:c3e7f70181888748ded4c20d3bda6a947d639fe7"
meta-bsp             
meta-sdk             = "HEAD:1cbae2bed5b31eedcc96aec462fd3c66f42aeef6"
meta-browser         = "HEAD:75640e14e325479c076b6272b646be7a239c18aa"
meta-networking      
meta-python          
meta-filesystems     = "HEAD:8760facba1bceb299b3613b8955621ddaa3d4c3f"
meta-qt5             = "HEAD:d4e7f73d04e8448d326b6f89908701e304e37d65"

 

 

 

Do you have any suggestions?

I have already carried out some solutions as follows:

clean

bitbake -c clean glibc


Compile the recipe

bitbake -f -c compile glibc


but this still produced the same error.

 

Tags (2)
0 Kudos
1 Solution
8,606 Views
dfujita
Contributor II

Hello Tooght,

I have the same problem. I solved the problem by running the build on an ext4 filesystemI don't know why, but building glibc on an NTFS filesystem seems to cause the problem.

View solution in original post

0 Kudos
8 Replies
7,019 Views
umarFarooq-emb
Contributor I

Hello @Bio_TICFSL  i am working on imx8mguf arm a53 core, when I try making the build there comes a glibc compilation error. No matter what I do , I have tried cleaning the glibc. And Ultimately I tried a classic yocto clean. but in vain..

do you have any idea what might be the reason? My build is in ext4 partition and I cannot switch PCs. not a chance. 

 

Stay Blessed.

0 Kudos
8,607 Views
dfujita
Contributor II

Hello Tooght,

I have the same problem. I solved the problem by running the build on an ext4 filesystemI don't know why, but building glibc on an NTFS filesystem seems to cause the problem.

0 Kudos
8,566 Views
Tooght
Contributor III

Thanks for your great and helpful advice, yes it worked, I used to keep this project oe-source and sstate-cache files on the external hdd disk and its filesystem was ntfs, so firstly I changed its filesystem format from ntfs to ext4 and then run but it didn't work. After that, I changed the main yocto project location and built it on ext4 filesystem and worked,

Thanks a lot again. have a great day.

 

0 Kudos
8,559 Views
dfujita
Contributor II

Thank you for the result. Honestly I'm not sure what solved the problem. I'm sorry I couldn't be helpful for you.

P.S. Glad to hear the problem is now solved.

0 Kudos
8,585 Views
Tooght
Contributor III

Hi, that's great advice. I'll try it asap and reply you with results

0 Kudos
8,766 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Tooght,

 

Looks like you have to fix the gibc in your host, since if you are making bitbake with libgc it takes the 64bit form toolchain, so lets fix it from the host.

 

Regards

0 Kudos
8,714 Views
Tooght
Contributor III

I tried compiling glibc on another host computer. there was no error. It was compiled. Both host systems have the same version glibc package. Do you have any other recommendations?

 

ubu@ubu-UC5:~/imx-yocto-bsp/maaxboard/build$ ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1.4) 2.27
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
ubu@ubu-UC5:~/imx-yocto-bsp/maaxboard/build$ ldd `which ls` | grep libc
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4dc7c38000)
ubu@ubu-UC5:~/imx-yocto-bsp/maaxboard/build$ /lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1.4) stable release version 2.27.
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 7.5.0.
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.

 

0 Kudos
8,756 Views
Tooght
Contributor III

Hi @Bio_TICFSL,  thanks for your quick reply. I still haven't caught what is the problem? Do you have any instructions or suggestions to fix it? What point should I focus on exactly?

I have installed the host yocto env. on my host comp. as the official board distributor described.

Warm Regards.

0 Kudos