Gentoo Archives: gentoo-alt

From: Armando Di Cianno <armando@××××××××.net>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] [PREFIX] dynamic linking: moving the locations
Date: Wed, 11 Apr 2007 19:24:10
In Reply to: [gentoo-alt] [PREFIX] dynamic linking: moving the locations by Fabian Groffen
Hash: SHA1

On Apr 11, 2007, at 3:10 PM, Fabian Groffen wrote:
> Yes we can! > This was Solaris, Linux works the same. Now let's check Darwin. > > Same test program.
<snip />
> Ok, prefix paths. Darwin is MACH-O, which stores the full filename to > the library in this case, so no rpath is there. chrpath doesn't work > here for that reason, but on Darwin, there is the install_name_tool > tool.
<snip />
> So, install_name_tool does it a bit different than chrpath, but with > some scripting both can do the same: change the location libraries are > looked for. What does this mean? Well, let's look at this: > > [tefnut:/var/tmp] % install_name_tool -change /Library/Gentoo/usr/ > lib/libssl.0.9.8.dylib /var/tmp/libssl.0.9.8.dylib test > [tefnut:/var/tmp] % cp /Library/Gentoo/usr/lib/libssl.0.9.8.dylib . > [tefnut:/var/tmp] % ./test > OpenSSL 0.9.8e 23 Feb 2007 > [tefnut:/var/tmp] % otool -L test > test: > /var/tmp/libssl.0.9.8.dylib (compatibility version 0.9.8, > current version 0.9.8) > /Library/Gentoo/usr/lib/libcrypto.0.9.8.dylib > (compatibility version 0.9.8, current version 0.9.8)
<snip /> We use this feature, on Darwin, at lot at my company. It's important to note that most binaries, on Darwin, may need to be compiled with "- headerpad_max_install_names" -- which is actually now antiquated / 32- bit only -- or, better "-headerpad [value]". This option is needed for the cases where it's not /Y/Z -> /A/B but / Y/Z -> /A...A/B...B . The fun starts with -headerpad_max_install_names when some apps think you're monkeying too much with the linkage options, and start to make only static versions. Just, fyi. __armando aka fafhrd -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (Darwin) iD8DBQFGHTWB1uuRqaoClwIRAkpyAJ42YObYOFs3Xuo/UhaDYUTYooBzPgCfSh4B HXk4ba7wefDzyftHKDqGfE0= =7NkY -----END PGP SIGNATURE----- -- gentoo-alt@g.o mailing list


Subject Author
Re: [gentoo-alt] [PREFIX] dynamic linking: moving the locations Fabian Groffen <grobian@g.o>