- qemu-arm running compiled binary
- 2 Answers 2
- Saved searches
- Use saved searches to filter your results more quickly
- yocto: /lib/ld-linux-armhf.so.3: No such file or directory #28284
- yocto: /lib/ld-linux-armhf.so.3: No such file or directory #28284
- Comments
- «No such file or directory» when invoking java
- «No such file or directory» error when running a dynamically-linked ARM executable
qemu-arm running compiled binary
Trying to run a compiled binary I’ve extracted from a firmware on qemu, however I encounter this error:
root@ubuntu14:~# qemu-arm -L /usr/arm-linux-gnueabi ~/x /system/bin/linker: No such file or directory root@ubuntu14:~# file ./x ./x: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), stripped
I’m using the «-L» flag, as suggested in: qemu-arm can’t run arm compiled binary However, this flag doesn’t seem to make a different for me, neither does setting QEMU_LD_PREFIX Could it be some missing dependencies?
by the way, it seems to work when I’m compiling a simple «Hello World» without the «-static» flag: arm-linux-gnueabi-gcc -ohello-nostatic hello.c
2 Answers 2
It looks like the system is not able to find the dynamic linker (which in your case appears to be /system/bin/linker , rather than the the normal /lib/ld-linux-armhf.so.3 or similar.
Since I don’t have access to your code, I’ve tried to reproduce this by mounting a Raspberry Pi «Raspbian» image on /mnt on my system. If I try to run /mnt/bin/echo hello , like this:
/lib/ld-linux-armhf.so.3: No such file or directory
I can provide an explicit path to the dynamic linker like this:
qemu-arm /mnt/lib/ld-linux-armhf.so.3 /mnt/bin/echo hello
Now I get a different error:
/mnt/bin/echo: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
That’s actually great, because that is a normal «I can’t find my shared libraries» error, and the solution is to use LD_LIBRARY_PATH . Rather than setting this in our environment, we can set this in the environment created by qemu-arm with the -E flag:
qemu-arm -E LD_LIBRARY_PATH=/mnt/lib/arm-linux-gnueabihf/ /mnt/lib/ld-linux-armhf.so.3 /mnt/bin/echo hello
I suspect that these same two techniques — providing an explicit path to the linker, and providing an explicit library search path in LD_LIBRARY_PATH — may help you out. Let me know how it works!
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yocto: /lib/ld-linux-armhf.so.3: No such file or directory #28284
yocto: /lib/ld-linux-armhf.so.3: No such file or directory #28284
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI.
Comments
I’m trying to add nodejs 10.16.0 recipe in my yocto setup. Currently i have nodejs v6.10.0 which is building properly but i’m trying to upgrade my nodejs.
I’m getting error in do_compile.
DESCRIPTION = "Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine" HOMEPAGE = "https://nodejs.org" LICENSE = "MIT" SRC_URI = "https://github.com/nodejs/node/archive/v$.tar.gz" LIC_FILES_CHKSUM = "file://LICENSE;md5=be980eb7ccafe287cb438076a65e888c" SRC_URI[md5sum] = "5451fe3bfe8d33a502a1be8934609436" SRC_URI[sha256sum] = "ad36913d44e32e97178750bc8b6c2cb754c1a381413cd5117325a669200c5bff" S = "$/node-$" inherit nodejs-arch python-dir DEPENDS = "openssl" RDEPENDS_$ += "bash $" PACKAGECONFIG[zlib] = "--shared-zlib,,zlib," PACKAGECONFIG[openssl] = "--shared-openssl,,openssl," PACKAGECONFIG[v8-inspector] = ",--without-inspector,," do_configure() < ./configure --prefix="$" \ --dest-os=linux \ --without-snapshot \ --with-intl=none \ --shared-openssl \ $ > do_compile() < echo $EXTRA_OECONF oe_runmake BUILDTYPE=Release >do_install() < oe_runmake install DESTDIR="$" > FILES_$ =+ "$/lib/node_modules $npm" BBCLASSEXTEND = "native nativesdk"
Log data follows: | DEBUG: Executing shell function do_compile | | NOTE: make -j 20 BUILDTYPE=Release | make -C out BUILDTYPE=Release V=1 | touch 428352f9b01a52ce3e280363b474e8a6772400e0.intermediate | touch 6431e84bdaf100c98eb1b6213050e0d147abf8eb.intermediate | LD_LIBRARY_PATH=/targetsdk/poky/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/nodejs/10.16.0-r0/node-10.16.0/out/Release/lib.host:/targetsdk/poky/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/nodejs/10.16.0-r0/node-10.16.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/gypfiles; mkdir -p /targetsdk/poky/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/nodejs/10.16.0-r0/node-10.16.0/out/Release/obj/gen/src/inspector/protocol /targetsdk/poky/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/nodejs/10.16.0-r0/node-10.16.0/out/Release/obj/gen/include/inspector; python ../third_party/inspector_protocol/CodeGenerator.py --jinja_dir ../third_party --output_base "/targetsdk/poky/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/nodejs/10.16.0-r0/node-10.16.0/out/Release/obj/gen/src/inspector" --config ../src/inspector/inspector_protocol_config.json | LD_LIBRARY_PATH=/targetsdk/poky/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/nodejs/10.16.0-r0/node-10.16.0/out/Release/lib.host:/targetsdk/poky/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/nodejs/10.16.0-r0/node-10.16.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/gypfiles; mkdir -p /targetsdk/poky/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/nodejs/10.16.0-r0/node-10.16.0/out/Release/obj/gen/torque-generated; "/targetsdk/poky/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/nodejs/10.16.0-r0/node-10.16.0/out/Release/torque" ../src/builtins/base.tq ../src/builtins/array.tq ../src/builtins/typed-array.tq -o "/targetsdk/poky/build/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/nodejs/10.16.0-r0/node-10.16.0/out/Release/obj/gen/torque-generated" | /lib/ld-linux-armhf.so.3: No such file or directory | deps/v8/gypfiles/v8_torque.host.mk:16: recipe for target '428352f9b01a52ce3e280363b474e8a6772400e0.intermediate' failed
The text was updated successfully, but these errors were encountered:
«No such file or directory» when invoking java
This message is shown because some 32 bit libraries are absent in Ubuntu 64 bit. Run:
I was helping a friend with their RiotBoard running Linaro-Ubuntu to set it up as a minecraft server. We got the same error. The problem I found was that Java was referencing /lib/ld-linux-armhf.so.3 which does not exist on the system. When you look at /lib the only load file is /lib/ld-linux.so.3 so I just soft link them and it works. Below is how I worked it out and what I did to fix it.
root@linaro-ubuntu-desktop:/opt/java/jdk1.8.0_06/bin# java -su: /usr/bin/java: No such file or directory root@linaro-ubuntu-desktop:/opt/java/jdk1.8.0_06/bin# strings java /lib/ld-linux-armhf.so.3 qwwBI libpthread.so.0 _Jv_RegisterClasses libjli.so _ITM_deregisterTMCloneTable JLI_Launch __gmon_start__ _ITM_registerTMCloneTable libdl.so.2 libc.so.6 abort __libc_start_main lib.so $ORIGIN/../lib/arm/jli:$ORIGIN/../lib/arm SUNWprivate_1.1 GLIBC_2.4 1.8.0_06-b23 java root@linaro-ubuntu-desktop:/opt/java/jdk1.8.0_06/bin# ls /lib/ld* /lib/ld-linux.so.3 root@linaro-ubuntu-desktop:/opt/java/jdk1.8.0_06/bin# ln -s /lib/ld-linux.so.3 /lib/ld-linux-armhf.so.3 root@linaro-ubuntu-desktop:/opt/java/jdk1.8.0_06/bin# ls /lib/ld* /lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3 root@linaro-ubuntu-desktop:/opt/java/jdk1.8.0_06/bin# java -version java version "1.8.0_06" Java(TM) SE Runtime Environment (build 1.8.0_06-b23) Java HotSpot(TM) Client VM (build 25.6-b23, mixed mode) root@linaro-ubuntu-desktop:/opt/java/jdk1.8.0_06/bin#
«No such file or directory» error when running a dynamically-linked ARM executable
I am cross-compiling for an ARM embedded Linux platform running Ubuntu 15.04. Previous, statically-linked, versions of this program have run just fine. Recently I needed to link in libproprietary (lib name changed for this question), which is only available as an .so. libproprietary.so works; I am able to run a different program that depends on it.
$ uname -a Linux 3.10.92-71 #1 SMP PREEMPT Fri Dec 18 00:38:54 BRST 2015 armv7l armv7l armv7l GNU/Linux
$ ./myprogram -bash: ./myprogram: No such file or directory
$ ldd ./myprogram libproprietary.so.2 => /usr/lib/libproprietary.so.2 (0xb6bbc000) librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6ba6000) libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6b92000) libusb-1.0.so.0 => /lib/arm-linux-gnueabihf/libusb-1.0.so.0 (0xb6b72000) libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6ab8000) libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6a43000) libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6955000) /usr/lib/ld.so.1 => /lib/ld-linux-armhf.so.3 (0xb6f28000) libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb692c000) libudev.so.1 => /lib/arm-linux-gnueabihf/libudev.so.1 (0xb690f000) $ file ./myprogram ./myprogram: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=881d76b2ce20f32aef95796b4fee9f01e492a7d2, not stripped $ file /bin/ls /bin/ls: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=a687c2baf9963c62c6abd209863d360dd0863686, stripped $ readelf -l myprogram| grep interpreter [Requesting program interpreter: /usr/lib/ld.so.1] $ strace ./myprogram execve("./myprogram", ["./myprogram". ], [/* 21 vars */]) = -1 ENOENT (No such file or directory) write(2, "strace: exec: No such file or di". 40strace: exec: No such file or directory ) = 40 exit_group(1) = ? +++ exited with 1 +++ $ ls -l myprogram -rwxrwxr-x [details snipped] $ file /usr/lib/libproprietary.so. /usr/lib/libproprietary.so.: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=d9b4ba3b9ec03779792984bc8a89ceede5737455, stripped
It appears that the interpreter, /usr/lib/ld.so.1, does not exist. I’m going to guess that it should be similar to what /bin/ls is using:
$ readelf -l /bin/ls | grep interpreter [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
ccache arm-linux-gnueabihf-g++ -o myprogram -static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -Wl,-no-undefined -pthread -Wl,-Bdynamic -lproprietary -Wl,-rpath-link=result/debug/lib -Wl,-rpath=\$ORIGIN/../../../../result/debug/lib variant-dir/debug/core-.o -Lresult/debug/lib -Wl,-Bstatic -l
I did try moving -Wl,-Bdynamic -lproprietary after the core-.o word, but that didn’t change anything.