1 |
On 02/25/15 14:51, Anthony G. Basile wrote: |
2 |
> On 02/22/15 01:30, Zac Medico wrote: |
3 |
>> On 02/21/2015 10:22 PM, Zac Medico wrote: |
4 |
>>> If we put the real/canonical libstdc++.so path in the DT_NEEDED section, |
5 |
>>> then it will automatically work with existing soname dependency support. |
6 |
>> |
7 |
>> Actually, we'd also have to add a way for you to put the full path of |
8 |
>> the libstdc++.so in PROVIDES. For example: |
9 |
>> |
10 |
>> PROVIDES_ABSOLUTE="/usr/lib/gcc/*/*/libstdc++.so.6" |
11 |
>> |
12 |
> |
13 |
> I guess I don't understand how this would work exactly. What if someone |
14 |
> has gcc-4.8.3. Builds library libfoo.so which uses c++. Then upgrades |
15 |
> to gcc-4.9, removes 4.8 and then tries to build bar which is also |
16 |
> written in c++ and links against libfoo.so. We would have mismatching |
17 |
> abis. How would this catch it and trigger the correct rebuilds? |
18 |
> |
19 |
> Unless I'm misunderstanding your *'s in that line. Are you using |
20 |
> PROVIDES_ABSOLUTE as a way of recording what version of the compiler |
21 |
> libfoo.so was build with? So that you'd have a line that says libfoo.so |
22 |
> links against /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libstdc++.so, so |
23 |
> that parsing that line gives 4.8.3? |
24 |
> |
25 |
> Also if you had the absolute path in VDB somewhere, like in PROVIDES, |
26 |
> then you don't need it in the elf's rpath which would make me feel better. |
27 |
> |
28 |
|
29 |
Actually no, you'd still need rpath for the elf itslef otherwise you can |
30 |
still link against the wrong version of libstdc++.so. Note in my |
31 |
following example that even though I build test.cpp with 4.7.3 I still |
32 |
wind up linking aginast 4.8.3. |
33 |
|
34 |
|
35 |
yellow tmp # cat test.cpp |
36 |
#include <iostream> |
37 |
using namespace std; |
38 |
int main() { cout << "hello owrld" << endl ; } |
39 |
|
40 |
yellow tmp # gcc-config -l |
41 |
[1] x86_64-pc-linux-gnu-4.7.3 * |
42 |
[2] x86_64-pc-linux-gnu-4.7.3-hardenednopie |
43 |
[3] x86_64-pc-linux-gnu-4.7.3-hardenednopiessp |
44 |
[4] x86_64-pc-linux-gnu-4.7.3-hardenednossp |
45 |
[5] x86_64-pc-linux-gnu-4.7.3-vanilla |
46 |
[6] x86_64-pc-linux-gnu-4.8.3 |
47 |
[7] x86_64-pc-linux-gnu-4.8.3-hardenednopie |
48 |
[8] x86_64-pc-linux-gnu-4.8.3-hardenednopiessp |
49 |
[9] x86_64-pc-linux-gnu-4.8.3-hardenednossp |
50 |
[10] x86_64-pc-linux-gnu-4.8.3-vanilla |
51 |
|
52 |
yellow tmp # g++ -o go test.cpp |
53 |
|
54 |
yellow tmp # ldd go |
55 |
linux-vdso.so.1 (0x0000033f63717000) |
56 |
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libstdc++.so.6 |
57 |
(0x0000033f631cf000) |
58 |
libm.so.6 => /lib64/libm.so.6 (0x0000033f62ecb000) |
59 |
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libgcc_s.so.1 |
60 |
(0x0000033f62cb4000) |
61 |
libc.so.6 => /lib64/libc.so.6 (0x0000033f628f8000) |
62 |
/lib64/ld-linux-x86-64.so.2 (0x0000033f634f6000) |
63 |
|
64 |
yellow tmp # g++ -Wl,-rpath,/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/ -o |
65 |
go test.cpp |
66 |
|
67 |
yellow tmp # ldd go |
68 |
|
69 |
linux-vdso.so.1 (0x0000036035212000) |
70 |
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libstdc++.so.6 |
71 |
(0x0000036034ccf000) |
72 |
libm.so.6 => /lib64/libm.so.6 (0x00000360349cb000) |
73 |
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libgcc_s.so.1 |
74 |
(0x00000360347b4000) |
75 |
libc.so.6 => /lib64/libc.so.6 (0x00000360343f8000) |
76 |
/lib64/ld-linux-x86-64.so.2 (0x0000036034ff1000) |
77 |
|
78 |
|
79 |
-- |
80 |
Anthony G. Basile, Ph. D. |
81 |
Chair of Information Technology |
82 |
D'Youville College |
83 |
Buffalo, NY 14201 |
84 |
(716) 829-8197 |