From owner-freebsd-ports@FreeBSD.ORG Fri Dec 6 18:26:36 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97F1349D for ; Fri, 6 Dec 2013 18:26:36 +0000 (UTC) Received: from mail.grem.de (outcast.grem.de [213.239.217.27]) by mx1.freebsd.org (Postfix) with SMTP id F008C14FF for ; Fri, 6 Dec 2013 18:26:35 +0000 (UTC) Received: (qmail 35144 invoked by uid 89); 6 Dec 2013 18:26:33 -0000 Received: from unknown (HELO bsd64.grem.de) (mg@grem.de@194.97.158.66) by mail.grem.de with ESMTPA; 6 Dec 2013 18:26:33 -0000 Date: Fri, 6 Dec 2013 19:26:35 +0100 From: Michael Gmelin To: Konstantin Belousov Subject: Re: Position independent code and global destructor order (devel/ice) Message-ID: <20131206192635.53ce70ae@bsd64.grem.de> In-Reply-To: <20131206032111.GH59496@kib.kiev.ua> References: <20130626231741.497f7a9b@bsd64.grem.de> <20130626212833.GB91021@kib.kiev.ua> <20130627015602.7a437aad@bsd64.grem.de> <51CC411C.4060105@FreeBSD.org> <20130627140428.GI91021@kib.kiev.ua> <20130827144507.385a552c@bsd64.grem.de> <20131130223427.3d95ae7c@bsd64.grem.de> <20131205170728.GF59496@kib.kiev.ua> <20131205182058.5479b1ff@bsd64.grem.de> <20131206032552.59672a5b@bsd64.grem.de> <20131206032111.GH59496@kib.kiev.ua> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.18; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: David Chisnall , Brooks Davis , Dimitry Andric , Matthias Andree , "freebsd-ports@freebsd.org Ports" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Dec 2013 18:26:36 -0000 On Fri, 6 Dec 2013 05:21:11 +0200 Konstantin Belousov 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