Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does gcc linker choose /usr/lib versus /usr/lib64 for library resolution?

My link line to gcc includes the following two entries in succession:

-lrt
-lpam

And this appears expanded as:

/usr/lib64/librt.so /usr/lib/libpam.so

Why is rt resolved to lib64 whereas pam is resolved to lib and consequently fails:

/usr/lib/libpam.so: could not read symbols: File in wrong format

Since it is only 32 bit ELF. There is a /usr/lib64/libpam.so with is 64 bit ELF, why isn't it taken?

like image 935
WilliamKF Avatar asked Nov 14 '22 06:11

WilliamKF


1 Answers

Try using -m32 to force 32-bits. Also inspect any environment vatiables that are being set by your .bashrc or .bash_profile that you are compiling under to determine if anything is cross-wired.

like image 123
I_Am_Nomad Avatar answered Dec 09 '22 14:12

I_Am_Nomad