You are not logged in.

#1 2010-12-02 10:17:44

velusip
Member
Registered: 2010-12-01
Posts: 18

How 32-bit binaries are told to access the proper multilibs (lib32-*)

Hello,

I'm curious -- how is Arch prepared/configured to automatically direct a closed/static binary to the appropriate 32-bit library in an x86_64 system?  I would guess there are some automatic changes when a 32-bit binary is invoked.  Maybe some temporary binds are put in place, but where is this defined and how does it work?  Perhaps we can use some content and discussion in this thread to spruce up the related wiki page:  https://wiki.archlinux.org/index.php/Multilib_Project [+]


Background and some related reading I was looking through:
https://wiki.archlinux.org/index.php/Ar … _Arch64.3F [+]
https://wiki.archlinux.org/index.php/Ar … nvironment [+]

-velu

Offline

#2 2010-12-02 11:00:42

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,390
Website

Re: How 32-bit binaries are told to access the proper multilibs (lib32-*)

velusip wrote:

I'm curious -- how is Arch prepared/configured to automatically direct a closed/static binary to the appropriate 32-bit library in an x86_64 system?

Well, static binaries do not need pointed anywhere....     The others are all dealt with by the linker which knows where to look.

Offline

#3 2010-12-02 11:47:07

velusip
Member
Registered: 2010-12-01
Posts: 18

Re: How 32-bit binaries are told to access the proper multilibs (lib32-*)

Well, yes, but what I mean is that the 32-bit static bins are all linked to libraries under /usr/lib.  However, that's where the 64-bit libs are according to the simplest interpretation of the FHS.  What component/trickery in Arch provides a /usr/lib that becomes mapped to /usr/lib32 for only the 32-bit bins?

Offline

#4 2010-12-02 11:48:55

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,390
Website

Re: How 32-bit binaries are told to access the proper multilibs (lib32-*)

Static binaries are not linked to libraries anywhere but in themselves.

Offline

#5 2010-12-02 12:46:50

velusip
Member
Registered: 2010-12-01
Posts: 18

Re: How 32-bit binaries are told to access the proper multilibs (lib32-*)

Hnm, that's not what I meant.  Those bins that are linked to shared libraries in /usr/lib, not static.  Is any of this making sense now?

Offline

#6 2010-12-02 12:57:06

velusip
Member
Registered: 2010-12-01
Posts: 18

Re: How 32-bit binaries are told to access the proper multilibs (lib32-*)

I'm just interested in knowing how a loaded binary is provided the appropriate binds or mounts (again, not sure the terms) to the path of 32-bit libraries instead of what would normally be 64-bit.   I guess you're laughing at me now, but it's something I've never really thought about until I started running into problems with mixed libraries today... I'm just not sure what exactly the kernel is doing to determine the need of the 32-bit lib and then how it makes use of ldconf's knowledge of where the different libraries are and then prepares the paths for that particular binary...

Offline

#7 2010-12-02 13:43:20

velusip
Member
Registered: 2010-12-01
Posts: 18

Re: How 32-bit binaries are told to access the proper multilibs (lib32-*)

Just dumping additional related material for review.  Feel free to dump more!  Trying to learn here, but have no mentor or reliable sources.  Possibly generate some interest in other newbies.

(This is all just unverified stuff, not strictly compatible with how 32-bit has been prepared on 64-bit Arch.)

basics
http://en.wikipedia.org/wiki/X86-64#Linux [+]
example on a debian system
http://www.debian-administration.org/ar … _GNU/Linux [+]
gentoo's chroot guide
http://www.gentoo.org/proj/en/base/amd6 … t=1&chap=2 [+]
arch's chroot info, no directly related to linking libs
https://wiki.archlinux.org/index.php/Chroot [+]
general info on libraries, nothing about switching between long-mode and 32-bit
http://tldp.org/HOWTO/Program-Library-H … aries.html [+]
and of course man ldconfig, ldd, ld.so, and elf

Offline

#8 2010-12-02 15:06:46

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: How 32-bit binaries are told to access the proper multilibs (lib32-*)

velusip wrote:

Hnm, that's not what I meant.  Those bins that are linked to shared libraries in /usr/lib, not static.  Is any of this making sense now?

[oh@Alice][~/tmp]%</etc/ld.so.conf.d/lib32-glibc.conf 
/usr/lib32

Last edited by Mr.Elendig (2010-12-02 15:07:16)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB