Why does adding /usr/lib32 to LD_LIBRARY_PATH break 64-bit binaries?

Alexander Kabaev kabaev at gmail.com
Thu Oct 23 19:35:37 PDT 2008

On Thu, 23 Oct 2008 21:48:47 -0400
"Alexander Sack" <pisymbol at gmail.com> wrote:

> Thanks, comments most appreciated.  Damn, I was looking for someone to
> go "a ha, you can't do this because...."  Alright, let me see why rtld
> on 6.1-amd64 is picking up /usr/lib32 stuff for a native 64-bit binary
> via debugging techniques. This seems very very wrong to me.  I mean if
> /usr/lib is in my LD_LIBRARY_PATH and it comes before /usr/lib the
> /usr/lib32 *should* be innocuous, right?
> Feel free to use that last statement on my epitaph!  :D
LD_LIBRARY_PATH is for native 64bit rtld. If you want a specific path
added for use by 32-bit ld-elf.so.1 only, use LD_32_LIBRARY_PATH.

Said that, your problem is likely caused by the fact that there is
no /lib32, only /usr/lib32. So if 64-bit library lives in /lib,
your LD_LIBRARY_PATH will cause loader to find its 32-bit equivalent
in /usr/lib32 first.

Try LD_LIBRARY_PATH=/lib:/usr/lib:/usr/lib32:/usr/lib64 for better
Alexander Kabaev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20081024/dafd6909/signature.pgp

More information about the freebsd-questions mailing list