Using a custom lib path

Posted on

Problem :

I’m trying to build Android on a remote trough ssh. However, I was presented with the problem:

prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc: /lib32/ version `GLIBC_2.11′ not found (required by prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc)

After looking at the I saw that it was actually 2.9.

I don’t however have administrative privileges on the server. So I tried copying my to a folder in my home dir, say /home/users/myuser/lib/, made a symbolic link so that /home/users/myuser/lib/ would point to the actual so and added the lib folder to my PATH.

However it didn’t make any difference.

Doing ldd on the mentioned elf file: =>  (0xf77a6000) => /lib32/ (0xf762d000)
/lib/ (0xf77a7000)

So it looks like the required library has a fixed path.

Does anyone know how I could make it link to /home/users/myusers/lib/ instead of `/lib32/


Solution :

Found it:

export LD_LIBRARY_PATH=~/lib/

Just in case one might also add:

export LD_PATH=~/lib/
export LIBPATH=~/lib/