2

I have a program that compiled fine on Ubuntu ARM (12.04) but it cannot run due to linking errrs. e.g. libX11.so.6 cannot be found, however it is clearly in

/usr/lib/arm-linux-gnueabihf

ldconfig -v shows it as well

What's weird is when I pass LD_LIBRARY_PATH=/usr/lib/arm-gnueabihf/ to ldd (after the shared library), I get the message

ldd: LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf/: No such file or directory

While the directory clearly exists. What could be going wrong? I ran sudo ldconfig.

RobbR
  • 121

1 Answers1

1

You may have mixed ABIs. There are currently several ABIs for ARM processors in common use, due to the variety in ARM CPUs. Check that you have a gnueabihf binary, and not a gnueabi binary. You can install both kinds of binaries on the same system, but you can't link both kinds of libraries inside a single executable. It's like 32-bit and 64-bit executables on x86 systems.

With LD_LIBRARY_PATH, the right command to add the variable in the environment for the duration of the ldd command is

LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf/ ldd /path/to/binary

You wrote ldd LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf/ /path/to/binary which tells ldd to act on a file called LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf/.

  • I think you're right, it has something to do with mixed ABI's. I added -mfloat-abi=softfp to gcc, it won't compile without it. But now it won't link. I suppose my system libs are hardfp. Can I install the softfp versions or do I need to switch to a softfp distro? – RobbR Feb 01 '13 at 23:29
  • @RobbR You can install both on the same system. I think it's supposed to work on Ubuntu now (apt-get install packagename:armel), but I have no experience (I do arm and I do Ubuntu but I don't do Ubuntu on arm). – Gilles 'SO- stop being evil' Feb 01 '13 at 23:38