Bug 14986 - Check libraries linked with qemu
Summary: Check libraries linked with qemu
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 6.99
Assignee: New Comer Bugs
QA Contact:
URL:
Whiteboard: NEWCOMER
Depends on:
Blocks:
 
Reported: 2022-12-12 17:41 UTC by Alexandre Belloni
Modified: 2026-08-20 15:24 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Belloni 2022-12-12 17:41:56 UTC
qemu may/will link with libraries from the host instead of the ones from the native sysroot. It is necessary to check it is allowed to do so else, it will later fail after sstate reuse on another worker with a cryptic error like:

/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/libzstd.so.1)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/libvirglrenderer.so.1)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/libvirglrenderer.so.1)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/libvirglrenderer.so.1)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/libasound.so.2)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/libasound.so.2)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/sysroots-uninative/x86_64-linux/lib/libdl.so.2)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/sysroots-uninative/x86_64-linux/lib/librt.so.1)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/sysroots-uninative/x86_64-linux/lib/libpthread.so.0)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/sysroots-uninative/x86_64-linux/lib/libresolv.so.2)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/sysroots-uninative/x86_64-linux/lib/libresolv.so.2)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/./libwayland-server.so.0)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/./libwayland-server.so.0)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/./libX11.so.6)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/./libX11.so.6)
/home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/pokybuild/yocto-worker/qemux86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/../lib/./././libXau.so.6)

This particular ocurrence was due to libpng and was fixed by:

https://git.yoctoproject.org/poky/commit/?id=9e2e0e73a4ca5ff5fbea80783e27bf31f133961e
Comment 1 Ross Burton 2023-05-17 10:46:56 UTC
I've a series that I need to actually submit that turns all of the 'auto' dependencies to forcibly on, which will stop these automatic dependencies happening.
Comment 2 Randy MacLeod 2023-07-26 21:29:35 UTC
Bulk move to 4.3 M3.
Comment 3 Trevor Gamblin 2023-09-14 16:56:33 UTC
Moved to 5.0 M1 since it's an enhancement.
Comment 4 Randy MacLeod 2024-04-25 01:08:13 UTC
Move to 5.99 since no one is actively working on this issue.
Comment 5 Adrian 2025-08-03 12:34:16 UTC
Probably I just run into this issue. Here are the details:

- The host is a (not yet supported) Fedora 42
- A build folder where qemu-native is built without sstate-cache (bitbake core-image-full-cmdline).
- Run oe-selftest in build-st: Some tests such as c_cpp.CMakeTests which use qemu usermode failed.
  The root cause seems to be that the qemu-x86_64 just segfaults.

From a clean shell, without oe-init-build-env sourced: qemu-x86_64 -h works:

   ~/projets/oss/poky/build/tmp/work/core2-64-poky-linux/meson-example/1.0/recipe-sysroot-native/usr/bin/qemu-x86_64 -h
   usage: qemu-x86_64 [options] program [arguments...]
   Linux CPU emulator (compiled for x86_64 emulation)
   ...

   ldd ~/projets/oss/poky/build/tmp/work/core2-64-poky-linux/meson-example/1.0/recipe-sysroot-native/usr/bin/qemu-x86_64
        linux-vdso.so.1 (0x00007fc199645000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fc199532000)
        libglib-2.0.so.0 => /home/adrian/projets/oss/poky/build/tmp/work/core2-64-poky-linux/meson-example/1.0/recipe-sysroot-native/usr/bin/../lib/libglib-2.0.so.0 (0x00007fc1990b2000)
        libgmodule-2.0.so.0 => /home/adrian/projets/oss/poky/build/tmp/work/core2-64-poky-linux/meson-example/1.0/recipe-sysroot-native/usr/bin/../lib/libgmodule-2.0.so.0 (0x00007fc19952c000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fc198ec0000)
        /home/adrian/projets/oss/poky/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007fc199647000)
        libpcre2-8.so.0 => /home/adrian/projets/oss/poky/build/tmp/work/core2-64-poky-linux/meson-example/1.0/recipe-sysroot-native/usr/bin/../lib/./libpcre2-8.so.0 (0x00007fc1994bf000)

However, from build-st qemu-x86_64 -h segfaults:

   ~/projets/oss/poky/build-st/tmp/work/core2-64-poky-linux/meson-example/1.0/recipe-sysroot-native/usr/bin/qemu-x86_64 -h
   Segmentation fault (core dumped)


   ldd ~/projets/oss/poky/build-st/tmp/work/core2-64-poky-linux/meson-example/1.0/recipe-sysroot-native/usr/bin/qemu-x86_64
        linux-vdso.so.1 (0x00007fee8cdcb000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fee8ccb8000)
        libglib-2.0.so.0 => /home/adrian/projets/oss/poky/build-st/tmp/work/core2-64-poky-linux/meson-example/1.0/recipe-sysroot-native/usr/bin/../lib/libglib-2.0.so.0 (0x00007fee8c8b2000)
        libgmodule-2.0.so.0 => /home/adrian/projets/oss/poky/build-st/tmp/work/core2-64-poky-linux/meson-example/1.0/recipe-sysroot-native/usr/bin/../lib/libgmodule-2.0.so.0 (0x00007fee8ccb2000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fee8c6c0000)
        /home/adrian/projets/oss/poky/build-st/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007fee8cdcd000)
        libpcre2-8.so.0 => /home/adrian/projets/oss/poky/build-st/tmp/work/core2-64-poky-linux/meson-example/1.0/recipe-sysroot-native/usr/bin/../lib/./libpcre2-8.so.0 (0x00007fee8c655000)
Comment 6 Richard Purdie 2025-08-14 09:56:28 UTC
Adrian: Did you try using the latest uninative from master? Also note that ldd is not accurate with our native binaries as it doesn't understand our uninative loader which changes the search path
Comment 7 Adrian 2025-08-14 13:31:00 UTC
It was built via oe-selftest from master branch commit from 2025-08-03. I also checked that the uninative glibc version is >= the version on Fedora 42. So yes, that should be the case.

Thanks for the hint with ldd.