Gentoo Archives: gentoo-dev

From: Greg Turner <gmt@×××××××.net>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] impending c++11 clusterfuck?
Date: Mon, 30 Nov 2015 10:43:22
Message-Id: CA+VB3NSTdjq21BDWRLk07qt267dxDV2j6KTzLfvyGryArsvHPw@mail.gmail.com
In Reply to: Re: [gentoo-dev] impending c++11 clusterfuck? by Greg Turner
1 Actually, come to think of it, there's an even dumber, easier
2 approach: just have some "is it c++" heuristics like, does it
3 dynamically link to a libstdc++? Did it inhert qt.eclass? etc. So
4 we have a boolean "is it probably a c++ package" heuristic boolean (or
5 maybe a vector of per-compiler maybe booleans). It'd be ok to have
6 some false positives, and pretty bad to have false negatives.
7
8 Now for each "probably c++" package merged, just store away the global
9 (per-compiler?) c++abi value (for false positives this would be
10 meaningless noise).
11
12 Now when we eselect c++abi set some-new-value, we could just take all
13 those maybe meaningless -- but presumptively not
14 meaningful-but-incorrect -- values in the vdb, and queue up rebuild
15 nags for all the ones that don't match.
16 -gmt
17
18 Greg Turner
19 gmt@×××××××.net
20
21
22 On Mon, Nov 30, 2015 at 2:16 AM, Greg Turner <gmt@×××××××.net> wrote:
23 > On Mon, Nov 30, 2015 at 12:07 AM, Anthony G. Basile <blueness@g.o> wrote:
24 >> If we record enough information at build time (eg. gcc version or
25 >> libcxx/clang) then we can build tools that intelligently predict if
26 >> there's an abi incompatibility.
27 >
28 > Yes, exactly the type of thing I'm thinking of. As you go on to note,
29 >
30 >> Unfortunately gcc doesn't bump soname
31 >> and/or version-info when it changes c++11 abi.
32 >
33 > So, maybe kludge #1 we require is some kind of made-up section header
34 > injected into object files... let's say, hypothetically, a tuple from
35 > the cartesian cross-product of something vaguely like:
36 >
37 > <
38 > compiler={gcc34,gcc47,gcc49,gcc52,clang}
39 > arch={$(< profiles/arch.list)} or maybe {(gnu target triplets)}
40 > abi={c++03,c++11,gnu++11,plain-ol'-c}
41 >>
42 >
43 > i.e.: gcc52-amd64-gnu++11. Probably the arch is redundant -- hell,
44 > maybe the compiler too -- and could be dropped... but you get the
45 > idea.
46 >
47 > So then, some agent digs this out from executables, and, like you say,
48 > caches it in the vdb somewhere.
49 >
50 > Meanwhile, suppose there's a global eselect c++abi setting. Once it's
51 > changed, we could just zip through the vdb and, say, "maybe some of
52 > these are false positives, but, to be safe, here's a nag to rebuild
53 > these so-and-so packages, which seem to have been built against some
54 > c++ abi other than the current one."
55 >
56 > No depgraph required, easy to implement magically-fix-it.sh. Might
57 > spin its wheels a bit but how often would you change this setting?
58 > Almost never...
59 >
60 > Well just thinking out loud, I probably have horrible thinkos above,
61 > but ya gotta start somewhere...
62 >
63 > -gmt
64 >
65 > Greg Turner
66 > gmt@×××××××.net