| Summary: | Failed to extract rootfs by using runqemu-extract-sdk | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Yi Zhao <yi.zhao> |
| Component: | Scripts and Tools | Assignee: | Ed Bartosh <eduard.bartosh> |
| Status: | VERIFIED FIXED | QA Contact: | Yi Zhao <yi.zhao> |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | jose.perez.carranza, ke.zou, randy.macleod, richard.purdie, ross.burton, seebs, yi.zhao |
| Version: | 2.2 | ||
| Target Milestone: | 2.2 M1 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | Regression (Used to work) |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
Yi Zhao
2016-06-13 07:04:23 UTC
my findings so far: 1. It can be easily reproduced by running pseudo: $ /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/pseudo -P /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr /bin/bash: relocation error: /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/pseudo/lib64/../../../../lib/libpthread.so.0: symbol __libc_vfork, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference 2. __libc_vfork exists in libc from the toolchain: $ objdump -T /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/pseudo/lib64/../../../../lib/libc.so.6 | grep __libc_vfork 00000000000b7a70 g DF .text 000000000000004b GLIBC_PRIVATE __libc_vfork 3. __libc_vfork doesn't exist in the host libc: $ objdump -T /lib64/libc.so.6 | grep __libc_vfork There is a mismatch in linux loader versions:
$ ldd /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/pseudo
linux-vdso.so.1 (0x00007ffd6aff8000)
libpthread.so.0 => /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/../../lib/libpthread.so.0 (0x00007f9804fe7000)
libdl.so.2 => /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/../../lib/libdl.so.2 (0x00007f9804de2000)
libc.so.6 => /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/../../lib/libc.so.6 (0x00007f9804a40000)
/opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007f9805206000)
$ readlink /opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2
ld-2.23.90.so
$ readlink /lib64/ld-linux-x86-64.so.2
ld-2.19.so
What i don't understand is why toolchain loader refers to the host one:
/opt/poky/2.1+snapshot/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007f9805206000)
The problem here is there are two libc versions involved, the one in the SDK which is newer and the host system libc which is older. When you run something like "pseudo bash", its loading both versions of libc and they have conflicting symbols, for example vfork() is an IFUNC in recent libc. This is where the mismatched syymbols come from. Ed found the problem was introduced by: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=01cbd46ac5b215bd8b8b1378881ef0bdf61ba177 which adds LDFLAGS. These include rpath entries in the nativesdk case. If we run "chrpath -d libpseudo.so" and remove the RPATH entry things then work as expected since it no longer finds two different libcs. This is likely the best solution for now. The rpath entries are old and may not be needed with our modern libc/libdl approach so we could look at removing them as a future optimisation in M2. Adding seebs so he's at least aware of the issues you can run into with pseudo here. Sent patch for review: http://lists.openembedded.org/pipermail/openembedded-core/2016-June/122971.html The fix has been merged into poky master: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8f7f8f7cfa80dc2e1af721388946a28cfdaca1dc Verified with 2.2 M2 rc1 build git rev: master/36feb38045b7a2af86ece147fec54b0db3bf491f |