Position independent code and global destructor order (devel/ice)

Michael Gmelin freebsd at grem.de
Fri Dec 6 18:26:36 UTC 2013

On Fri, 6 Dec 2013 05:21:11 +0200
Konstantin Belousov <kostikbel at gmail.com> wrote:

> On Fri, Dec 06, 2013 at 03:25:52AM +0100, Michael Gmelin wrote:
> > I tested your patch on 10-BETA2 and 10-BETA3. I built our complete
> > production environment from scratch, ran a huge number of unit and
> > integration tests. Everything works as expected, including Ice's
> > "Schwarz Counter" implementation
> > (http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Nifty_Counter).
> > 
> > So as far as I can tell this fixes the problem, while still
> > accomplishing the goals of r211706.
> Great, thank you.
> I think that the patch can be further simplified.  From what I
> understand about __cxa_finalize(3) protocol, confirmed by LSB,
> __cxa_finalize(NULL) must only be called at the process exit, once.
> Than, libc can use the call as an indication of the final call to
> finalize, avoiding need for help from rtld.
> Please test the patch below.  It is enough to rebuild libc only.

Looks good and very clean.

I tested it on a build host using the same procedure as yesterday and
additionally by copying libc.so.7 to a fresh 10-BETA3 installation
and just checking the difference between "./runTests" (breaks) and
"LD_PRELOAD=/path/to/alternative/libc.so.7 ./runTests" (works).

Nice :)

Michael Gmelin

More information about the freebsd-ports mailing list