Gentoo Archives: gentoo-dev

From: Luca Barbato <lu_zero@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 10:38:29
Message-Id: 484129F0.4080406@gentoo.org
In Reply to: Re: [gentoo-dev] RFC: --as-needed to default LDFLAGS (Was: RFC: Should preserve-libs be enabled by default?) by Peter Volkov
1 Peter Volkov wrote:
2 > В Птн, 30/05/2008 в 20:28 -0700, Brian Harring пишет:
3 >> Either way, basically it's coming down to if gentoo wants to follow
4 >> the definition of 'academic' right, or 'pragmatic' right. Exempting
5 >> ciaran, vote seems to be pragmatic.
6 >
7 > Well, although I've asked about problems with having --as-needed by
8 > default, I'd better go with academic. C++ is quite common language to
9 > ignore its design problems and in the end it's not hard to define
10 > LDFLAGS in make.conf.
11 >
12
13 To clarify:
14
15 - static initializers (as in __attribute__((constructor), so no, it
16 isn't a C++ only feature) have nothing wrong with --as-needed.
17
18 - ugly code that refers to undefined symbols that are resolved to ones
19 from the main binary and written in the constructor is broken already in
20 systems not allowing undefined refs.
21
22 - you don't have guarantees about the order in witch the .init sections
23 are parsed and constructor function are called, they can be called in
24 parallel and you have no means to have a predictable behavior, all you
25 know is that everything will be called right before main() or as the
26 first thing in dlopen().
27
28 - doing such stuff is uncommon since it isn't the simplest thing to do,
29 doesn't work in every place, you have to be particular perverse and
30 convoluted even to think about this.
31
32 - making such thing go away is good for security, maintainability and
33 sanity.
34
35 lu
36
37 --
38
39 Luca Barbato
40 Gentoo Council Member
41 Gentoo/linux Gentoo/PPC
42 http://dev.gentoo.org/~lu_zero
43
44 --
45 gentoo-dev@l.g.o mailing list

Replies