I have built OpenGL acceleration libraries (libGL and libGLU) which I keep in a specific directory, /usr/lib/mali. I also have a software implementation of OpenGL which is installed in /usr/lib/arm-linux-gnueabihf. Both directories are added to /etc/ld.so.conf with /usr/lib/mali coming first, so that the programs prefer libraries from it.

ldconfig finds all the libraries:

$ sudo ldconfig -v
libGLU.so.1 -> libGLU.so.1
libGL.so.1.2.0 -> libGL.so.1
libGL.so.1 -> libGL.so.1.5.08005
libGLU.so.1 -> libGLU.so.1.3.08005

The weird part is that ldconfig creates a symlink libGL.so.1.2.0, but does nothing for libGLU. The ldd output is even weirder:

ldd `which glxgears`
libGLU.so.1 => /usr/lib/mali/libGLU.so.1 (0xb6e4a000)
libGL.so.1 => /usr/lib/arm-linux-gnueabihf/libGL.so.1 (0xb6bb5000)
libGL.so.1.2.0 => /usr/lib/mali/libGL.so.1.2.0 (0xb67f1000)

The output suggests that the libGLU is taken from the hardware-accelerated directory, while libGL sticks to the software implementation. libGL.so.1.2.0 is also loaded for some reason. In the end, the software implementation is used when I run glxgears.

Can anyone explain me what's going on? What can I do to make my hardware-accelerated libraries load by default, without removing or overwriting the software libraries from /usr/lib/arm-linux-gnueabihf/ (they are in fact a package dependency)?

PS: the hardware-accelerated libraries do work when I add /usr/lib/mali/ to LD_LIBRARY_PATH.

1 Answer 1


The problem was indeed in my Makefile settings. Inspecting the library with objdump revealed the root cause:

$ objdump -p libGL.so.1 |grep SONAME
SONAME               libGL.so.1.2.0

ldd showed both libGL.so.1 and libGL.so.1.2.0, because the first one was imported by glxgears and the second one was imported by my implementation of libGLU which was build against hardware-accelerated version of libGL and thus knew its soname, libGL.so.1.2.0.

The fix was to change the soname with -soname,libGL.so.1.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .