u-boot /lib/ld-linux-armhf.so.3: No such file or directory

Abhisit Sangjan picture Abhisit Sangjan · Dec 13, 2017 · Viewed 9.6k times · Source

My machine Ubuntu 16.04.3 LTS x86_64. I do compile u-boot-2017.11 and I got the error.

u-boot-2017.11$ export ARCH=arm

u-boot-2017.11$ export CROSS_COMPILE=/opt/toolchains/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

u-boot-2017.11$ make geekbox_defconfig
  HOSTCC  scripts/basic/fixdep
/lib/ld-linux-armhf.so.3: No such file or directory
scripts/Makefile.host:99: recipe for target 'scripts/basic/fixdep' failed
make[1]: *** [scripts/basic/fixdep] Error 255
Makefile:399: recipe for target 'scripts_basic' failed
make: *** [scripts_basic] Error 2

I try to find and install missing package, but it is all ready installed.

u-boot-2017.11$ dpkg -S ld-linux-armhf.so
libc6-armhf-cross: /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3

u-boot-2017.11$ sudo apt-get install libc6-armhf-cross
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libc6-armhf-cross is already the newest version (2.23-0ubuntu3cross1).
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.

How do I fix it? Please.

Answer

Emi Montoro picture Emi Montoro · Dec 10, 2020

The problem is that you don’t have the libraries of arm, a quick and useful solution will be compiling with -static. For example:

$ arm-linux-gnueabihf-gcc -static -o name program.s
$ qemu-arm name