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
Message-Id: 982AD371-2A92-4F59-9DA3-8527BAA121B3@goodship.net
In Reply to: [gentoo-alt] [PREFIX] dynamic linking: moving the locations by Fabian Groffen
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4
5 On Apr 11, 2007, at 3:10 PM, Fabian Groffen wrote:
6 > Yes we can!
7 > This was Solaris, Linux works the same. Now let's check Darwin.
8 >
9 > Same test program.
10 <snip />
11 > Ok, prefix paths. Darwin is MACH-O, which stores the full filename to
12 > the library in this case, so no rpath is there. chrpath doesn't work
13 > here for that reason, but on Darwin, there is the install_name_tool
14 > tool.
15 <snip />
16 > So, install_name_tool does it a bit different than chrpath, but with
17 > some scripting both can do the same: change the location libraries are
18 > looked for. What does this mean? Well, let's look at this:
19 >
20 > [tefnut:/var/tmp] % install_name_tool -change /Library/Gentoo/usr/
21 > lib/libssl.0.9.8.dylib /var/tmp/libssl.0.9.8.dylib test
22 > [tefnut:/var/tmp] % cp /Library/Gentoo/usr/lib/libssl.0.9.8.dylib .
23 > [tefnut:/var/tmp] % ./test
24 > OpenSSL 0.9.8e 23 Feb 2007
25 > [tefnut:/var/tmp] % otool -L test
26 > test:
27 > /var/tmp/libssl.0.9.8.dylib (compatibility version 0.9.8,
28 > current version 0.9.8)
29 > /Library/Gentoo/usr/lib/libcrypto.0.9.8.dylib
30 > (compatibility version 0.9.8, current version 0.9.8)
31 <snip />
32
33 We use this feature, on Darwin, at lot at my company. It's important
34 to note that most binaries, on Darwin, may need to be compiled with "-
35 headerpad_max_install_names" -- which is actually now antiquated / 32-
36 bit only -- or, better "-headerpad [value]".
37
38 This option is needed for the cases where it's not /Y/Z -> /A/B but /
39 Y/Z -> /A...A/B...B .
40
41 The fun starts with -headerpad_max_install_names when some apps think
42 you're monkeying too much with the linkage options, and start to make
43 only static versions.
44
45 Just, fyi.
46 __armando
47 aka fafhrd
48
49 -----BEGIN PGP SIGNATURE-----
50 Version: GnuPG v1.4.6 (Darwin)
51
52 iD8DBQFGHTWB1uuRqaoClwIRAkpyAJ42YObYOFs3Xuo/UhaDYUTYooBzPgCfSh4B
53 HXk4ba7wefDzyftHKDqGfE0=
54 =7NkY
55 -----END PGP SIGNATURE-----
56 --
57 gentoo-alt@g.o mailing list

Replies

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