openbmc / openbmc-build-scripts

Apache License 2.0
19 stars 50 forks source link

Use of sysroots-uninative for ld-linux-x86-64.so.2 breaks running qemu within docker #11

Closed geissonator closed 8 years ago

geissonator commented 8 years ago

The new uninative "feature" in yocto has broken a few different things. See https://github.com/openbmc/openbmc/issues/500 for some commentary.

I've been working on getting QEMU to run within it's own docker container for ease of use / portability. It's working well when I build without the uninative feature, but when we do build with it, we get an error with the QEMU binary. I think it's related to the ldd output showing a required library with a full path, that's not valid within the docker session.

My understanding is the uninative feature should have minimal (if any) impact to us so my plan for now is to just disable it build-setup.sh.

Here's the error output and other debug: 17:48:24 ldd

17:48:24 linux-vdso.so.1 => (0x00007fff9af2b000)

17:48:24 libz.so.1 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/libz.so.1 (0x00007ff5c02c9000)

17:48:24 libbz2.so.1 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/libbz2.so.1 (0x00007ff5c00b8000)

17:48:24 libpixman-1.so.0 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/libpixman-1.so.0 (0x00007ff5bfe0d000)

17:48:24 libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007ff5bfbff000)

17:48:24 libasound.so.2 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/libasound.so.2 (0x00007ff5bf8fa000)

17:48:24 libuuid.so.1 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/libuuid.so.1 (0x00007ff5bf6f5000)

17:48:24 libSDL-1.2.so.0 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/libSDL-1.2.so.0 (0x00007ff5bf495000)

17:48:24 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff5bf277000)

17:48:24 libX11.so.6 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/libX11.so.6 (0x00007ff5bef3c000)

17:48:24 libfdt.so.1 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/libfdt.so.1 (0x00007ff5bed35000)

17:48:24 libglib-2.0.so.0 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/libglib-2.0.so.0 (0x00007ff5bea28000)

17:48:24 librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff5be820000)

17:48:24 libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff5be49e000)

17:48:24 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff5be194000)

17:48:24 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff5bdf7e000)

17:48:24 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff5bdbb5000)

17:48:24 /var/lib/jenkins/workspace/openbmc-build-gerrit-trigger-multi/distro/ubuntu/target/qemu/openbmc/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x0000556d24c1c000)

17:48:24 libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff5bd9b0000)

17:48:24 libXrandr.so.2 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/./libXrandr.so.2 (0x00007ff5bd7a5000)

17:48:24 libXext.so.6 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/./libXext.so.6 (0x00007ff5bd592000)

17:48:24 libxcb.so.1 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/./libxcb.so.1 (0x00007ff5bd372000)

17:48:24 libpcre.so.1 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/./libpcre.so.1 (0x00007ff5bd12e000)

17:48:24 libXrender.so.1 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/././libXrender.so.1 (0x00007ff5bcf24000)

17:48:24 libXau.so.6 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/././libXau.so.6 (0x00007ff5bcd1f000)

17:48:24 libXdmcp.so.6 => /home/openbmc/./tmp/sysroots/x86_64-linux/usr/bin/../lib/././libXdmcp.so.6 (0x00007ff5bcb19000)

ls -al ./tmp/sysroots/x86_64-linux/usr/bin/qemu-system-arm 17:48:24 -rwxr-xr-x 1 1003 1003 15364880 Aug 11 04:25 ./tmp/sysroots/x86_64-linux/usr/bin/qemu-system-arm

17:48:24 /home/openbmc/boot-qemu.sh: line 17: ./tmp/sysroots/x86_64-linux/usr/bin/qemu-system-arm: No such file or directory

17:48:24 17:48:24 Failure, got EOF'

williamspatrick commented 8 years ago

Unless you are inside the 'bitbake' environment, how are you expecting qemu to work inside docker? You can't just copy content out of the bitbake directory tree and expect some of it to work. The environment needs to line up.

The 'uninative' support is a way to build a complete distro-independent tool chain. I believe this builds libc and everything. But if you don't have the environment set up exactly like the way bitbake has it set up then none of the tools will work.

What you might want to do would be to generate the sdk and run qemu from within the sdk? Or to make sure you can reuse your bitbake environment within the test environment.

geissonator commented 8 years ago

We run QEMU via the raw command line (see https://gerrit.openbmc-project.xyz/#/c/166/13/scripts/boot-qemu.sh for an example) so as long as the required libraries are all available, we're good.