qemu-x86_64 uses host libraries instead of emulated system libraries
Host environment
- Operating system: Debian Bullseye
- OS/kernel version: Linux TRS-NightlyBuild 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux
- Architecture: x86_64
- QEMU flavor: qemu-x86_64
- QEMU version: 6.1.0, 6.2.0, git master (8f3e5ce7)
- QEMU command line: qemu-x86_64 -r 5.15 -strace -L ./output/host/x86_64-trs-linux-gnu/sysroot/ bytecode_builtins_list_generator
Emulated/Virtualized environment
- Operating system: Linux 5.15.19 x86_64 (Buildroot Cross Build)
- Architecture: x86_64
Description of problem
I'm using Buildroot to build a cross-compiled embedded Linux system. During the build process there is a little hack to create some header file using a cross-compiled application. For this hack they use qemu to run this application. Building this embedded system for aarch64 work fine, but for x86_64 I get the following messages:
bytecode_builtins_list_generator: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.29' not found (required by bytecode_builtins_list_generator) bytecode_builtins_list_generator: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.33' not found (required by bytecode_builtins_list_generator)
bytecode_builtins_list_generator: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by bytecode_builtins_list_generator) bytecode_builtins_list_generator: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.34' not found (required by bytecode_builtins_list_generator)
The path of the libraries in this error message is from my host system. The embedded system uses /lib64 or /usr/lib64. It seems to me that the linker search for the libraries at first on the host system and later uses the path from the command line. So you have a mixed up of host and embedded system libraries (as you can see in the attached strace log).