Gentoo Archives: gentoo-dev

From: Alec Warner <antarus@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: --as-needed to default LDFLAGS (Was: RFC: Should preserve-libs be enabled by default?)
Date: Sat, 31 May 2008 11:26:42
Message-Id: b41005390805310426r6f5a8827xf316bcd78a34d87c@mail.gmail.com
In Reply to: Re: [gentoo-dev] RFC: --as-needed to default LDFLAGS (Was: RFC: Should preserve-libs be enabled by default?) by Luca Barbato
1 On 5/31/08, Luca Barbato <lu_zero@g.o> wrote:
2 > Peter Volkov wrote:
3 >
4 > > ÷ ðÔÎ, 30/05/2008 × 20:28 -0700, Brian Harring ÐÉÛÅÔ:
5 > >
6 > > > Either way, basically it's coming down to if gentoo wants to follow the
7 > definition of 'academic' right, or 'pragmatic' right. Exempting ciaran, vote
8 > seems to be pragmatic.
9 > > >
10 > >
11 > > Well, although I've asked about problems with having --as-needed by
12 > > default, I'd better go with academic. C++ is quite common language to
13 > > ignore its design problems and in the end it's not hard to define
14 > > LDFLAGS in make.conf.
15 > >
16 > >
17 >
18
19 Just to jump in quickly; this thread is about adding --as-needed to
20 the default CFLAGS. To get this accomplished you need to:
21
22 A. Convince the portage developers to put it in make.conf/make.defaults.
23 B. Convince the profile maintainers to put it in their profile.
24 C. Do A or B yourself and hope no one gets pissed.
25 D. Convince the council at the next meeting that either A or B is a good idea.
26
27 Personally I think D is the best choice here. Your point should not
28 to be to convince random people such at Ciaran. I'm pretty sure his
29 mind is made up and I kind of agree on his position. The point being
30 regardless of what the 'tehcnically correct' decision with regards to
31 the standard is, the Gentoo community needs to make its own choice as
32 to whether the risks of breaking code is worth the gains of making
33 --as-needed the default.
34
35 Presently community decisions regarding technical issues are made via
36 the council; so maybe you should start convincing them.
37
38 -Alec
39
40 > To clarify:
41 >
42 > - static initializers (as in __attribute__((constructor), so no, it isn't a
43 > C++ only feature) have nothing wrong with --as-needed.
44 >
45 > - ugly code that refers to undefined symbols that are resolved to ones from
46 > the main binary and written in the constructor is broken already in systems
47 > not allowing undefined refs.
48 >
49 > - you don't have guarantees about the order in witch the .init sections are
50 > parsed and constructor function are called, they can be called in parallel
51 > and you have no means to have a predictable behavior, all you know is that
52 > everything will be called right before main() or as the first thing in
53 > dlopen().
54 >
55 > - doing such stuff is uncommon since it isn't the simplest thing to do,
56 > doesn't work in every place, you have to be particular perverse and
57 > convoluted even to think about this.
58 >
59 > - making such thing go away is good for security, maintainability and
60 > sanity.
61 >
62 > lu
63 >
64 > --
65 >
66 > Luca Barbato
67 > Gentoo Council Member
68 > Gentoo/linux Gentoo/PPC
69 > http://dev.gentoo.org/~lu_zero
70 >
71 > --
72 >
73 > gentoo-dev@l.g.o mailing list
74 >
75 >

Replies