Re: [PATCH 5/6] ld.so.8: document $PLATFORM and $LIB expansion

Mike Frysinger
2011-12-11T03:16:32Z

[-- Attachment #1: Type: Text/Plain, Size: 1551 bytes --]

On Friday 21 October 2011 01:25:28 Jonathan Nieder wrote:
> - what is $LIB for a non-native ABI?

whatever it's been configured for. it isn't an env var that is the same across
all ABIs. you could configure every ABI to use /lib, but that'd be dumb.

if we look at the 3 ABI's we have on the x86 system and their standard install
paths:
- 32bit: lives in /lib and has ldso at /lib/ld-linux.so.2
- 64bit: lives in /lib64 and has ldso at /lib64/ld-linux-x86-64.so.2
- x32: lives in /libx32 and has ldso at /libx32/ld-linux-x32.so.2

you don't `./configure && make` once to get multiple ABIs. you have to
manually run that per ABI. so the 32bit ABI gets configured so $LIB is set to
/lib, then the 64bit ABI gets configured for /lib64, etc...

the ldso at runtime will replace $LIB with whatever it was configured for

> - does anyone customize this to point somewhere else and make their
> machine non-FHS-compliant? Maybe NixOS and Gentoo Prefix do.

you can't really consider Gentoo Prefix as a being the domain of FHS rule. it
is not a distro you boot ... it's a set of packages you build/install into
your $HOME because your host system is old/broken/whatever.

> What would a person typically use ${LIB} in an rpath for?

it's useful when you want to preload a library for multiple process types.
why this would get used in an RPATH tag, i can't really guess since the ELF
itself is already configured for a specific ABI. maybe someone more inventive
can come up with something ;).
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]