Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Pre RFC on RFC: Add compiler information to exported a Package Manger's Cached Information.
Date: Thu, 26 Feb 2015 00:07:57
Message-Id: 54EE63D1.1040708@gentoo.org
In Reply to: Re: [gentoo-portage-dev] Pre RFC on RFC: Add compiler information to exported a Package Manger's Cached Information. by "Anthony G. Basile"
1 On 02/25/2015 03:41 PM, Anthony G. Basile wrote:
2 > On 02/25/15 15:38, Zac Medico wrote:
3 >> On 02/25/2015 12:01 PM, Anthony G. Basile wrote:
4 >>> On 02/25/15 14:51, Anthony G. Basile wrote:
5 >>>> On 02/22/15 01:30, Zac Medico wrote:
6 >>>>> On 02/21/2015 10:22 PM, Zac Medico wrote:
7 >>>>>> If we put the real/canonical libstdc++.so path in the DT_NEEDED
8 >>>>>> section,
9 >>>>>> then it will automatically work with existing soname dependency
10 >>>>>> support.
11 >>>>>
12 >>>>> Actually, we'd also have to add a way for you to put the full path of
13 >>>>> the libstdc++.so in PROVIDES. For example:
14 >>>>>
15 >>>>> PROVIDES_ABSOLUTE="/usr/lib/gcc/*/*/libstdc++.so.6"
16 >>>>>
17 >>>>
18 >>>> I guess I don't understand how this would work exactly. What if
19 >>>> someone
20 >>>> has gcc-4.8.3. Builds library libfoo.so which uses c++. Then upgrades
21 >>>> to gcc-4.9, removes 4.8 and then tries to build bar which is also
22 >>>> written in c++ and links against libfoo.so. We would have mismatching
23 >>>> abis. How would this catch it and trigger the correct rebuilds?
24 >>>>
25 >>>> Unless I'm misunderstanding your *'s in that line. Are you using
26 >>>> PROVIDES_ABSOLUTE as a way of recording what version of the compiler
27 >>>> libfoo.so was build with? So that you'd have a line that says
28 >>>> libfoo.so
29 >>>> links against /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libstdc++.so, so
30 >>>> that parsing that line gives 4.8.3?
31 >>>>
32 >>>> Also if you had the absolute path in VDB somewhere, like in PROVIDES,
33 >>>> then you don't need it in the elf's rpath which would make me feel
34 >>>> better.
35 >>>>
36 >>>
37 >>> Actually no, you'd still need rpath for the elf itslef otherwise you can
38 >>> still link against the wrong version of libstdc++.so. Note in my
39 >>> following example that even though I build test.cpp with 4.7.3 I still
40 >>> wind up linking aginast 4.8.3.
41 >>
42 >> If DT_NEEDED contains the absolute libstdc++.so path, it's guaranteed to
43 >> link against the correct version, regardless of rpath.
44 >>
45 >
46 > How do you get DT_NEEDED to the absolute libstdc++.so path when building?
47
48 I'm not sure how we're going to accomplish that yet, but it should be
49 feasible. Ideally, the build system would support it. The worst case
50 would be that we would have to patch the DT_NEEDED sections after
51 src_install.
52 --
53 Thanks,
54 Zac

Replies