Gentoo Archives: gentoo-dev

From: David Leverton <levertond@××××××××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: RFC: Should preserve-libs be enabled by default?
Date: Fri, 30 May 2008 15:58:01
Message-Id: 200805301657.46861.levertond@googlemail.com
In Reply to: [gentoo-dev] Re: RFC: Should preserve-libs be enabled by default? by flameeyes@gmail.com (Diego 'Flameeyes' =?utf-8?Q?Petten=C3=B2?=)
1 On Friday 30 May 2008 13:22:15 Diego 'Flameeyes' Pettenò wrote:
2 > The only thing that can be broken by using --as-needed is code that
3 > assumes the order in calling the .init sections of a set of shared
4 > objects. Such an order is not only changed by --as-needed usage but by
5 > any other change in the loading mechanism. It is strictly related to
6 > glibc at this point as far as I can tell.
7
8 It's not just the order, it also breaks things that rely on the .init section
9 being called at all to register themselves with the core application
10 (with --as-needed, the .so doesn't get loaded in the first place, so it
11 doesn't get a chance to run anything).
12
13 > It's interesting to note that Microsoft _did_ think of this problem when
14 > designing the .NET framework, and they answer is ensuring just that the
15 > static constructor will be called (right) before any static method or
16 > attribute is referenced and (right) before any object of the given class
17 > is istantiated. They don't get otherwise an absolute order in which
18 > static constructors are called.
19
20 That's /an/ answer, but it doesn't provide all the functionality that static
21 objects in C++ have.
22 --
23 gentoo-dev@l.g.o mailing list

Replies

Subject Author
[gentoo-dev] Re: RFC: Should preserve-libs be enabled by default? flameeyes@gmail.com (Diego 'Flameeyes' =?utf-8?Q?Petten=C3=B2?=)