Cannot run an armv5 file (generated with the Yocto SDK) on a x86_64 host because of wrong library paths search in qemu-arm branch master sha1:5fca4d286eec240ad57d90defa43cd0ff24f88ed host: Ubuntu 12.04 / Custom kernel 3.10 x86_64 target: default "qemuarm" Steps: default local.conf except: MACHINE ?= "qemuarm" IMAGE_FEATURES += "package-management ssh-server-openssh" Build SDK from core-image-minimal: bitbake core-image-minimal bitbake -c populate_sdk core-image-minimal "runqemu qemuarm" runs without any problem. With SDK: i wrote a very simple hello.c $echo $CC arm-poky-linux-gnueabi-gcc -march=armv5te -marm -mthumb-interwork --sysroot=/home/oguiter/Devel/Yocto/TestJCSDK/sysroots/armv5te-poky-linux-gnueabi $CC hello.c hello (i also did the test with "make hello", same result) file hello hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0xfef9c9a4f293ed3b2f346671d1c630b92de4aca5, not stripped The problem: $qemu-arm hello /lib/ld-linux.so.3: No such file or directory if i copy ld-linux.so.3 from sdk directory to host/lib directory, qemu-arm find the file...
Actually, you have to tell qemu-arm where your target sysroot is, like so: qemu-arm -L /home/oguiter/Devel/Yocto/TestJCSDK/sysroots/armv5te-poky-linux-gnueabi It should be enough. Otherwise it will look for libraries in the standard library paths: /lib:/usr/lib.
Thanks for the suggestion. It works with the -L option. Btw i would expect qemu-arm to "guess" the correct path...
Well, how can it guess it? The sysroot is not encoded into the final binary. So that you can move your app on the actual target and run it. The dynamic linker is the one who knows where to look for. So, the path to the dynamic linker is the one ending in the final binary in the INTERP section. For example: On target, when you issue ./hello command, the dynamic linker (/lib/ld-linux.so.3) is invoked and will start looking into /lib:/usr/lib for dependencies. On host, when you run qemu-arm ./hello, it will also invoke the target's dynamic linker because it gets it from the binary (/lib/ld-linux.so.3) but, in this case, you must "help" qemu and tell it where the target sysroot is. I believe this bug can be closed.
Not a bug. Closed