From owner-freebsd-current@FreeBSD.ORG Sun Aug 15 15:10:55 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA73F16A4CE; Sun, 15 Aug 2004 15:10:55 +0000 (GMT) Received: from itchy.rabson.org (mailgate.nlsystems.com [80.177.232.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 28E0143D2D; Sun, 15 Aug 2004 15:10:55 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from ns0.nlsystems.com (ns0.nlsystems.com [80.177.232.243]) by itchy.rabson.org (8.12.11/8.12.11) with ESMTP id i7FFApId072913; Sun, 15 Aug 2004 16:10:51 +0100 (BST) (envelope-from dfr@nlsystems.com) From: Doug Rabson To: "Justin T. Gibbs" Date: Sun, 15 Aug 2004 16:11:04 +0100 User-Agent: KMail/1.6.2 References: <200408151553.32463.dfr@nlsystems.com> <932D0AB64B5988A5BC8FFBAF@aslan.scsiguy.com> In-Reply-To: <932D0AB64B5988A5BC8FFBAF@aslan.scsiguy.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408151611.04764.dfr@nlsystems.com> X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on itchy.rabson.org X-Virus-Scanned: clamd / ClamAV version 0.75.1, clamav-milter version 0.75c on itchy.rabson.org X-Virus-Status: Clean cc: Daniel Eischen cc: Johan Pettersson cc: Stefan Ehmann cc: freebsd-current@freebsd.org Subject: Re: New nvidia drivers available X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2004 15:10:56 -0000 On Sunday 15 August 2004 16:00, Justin T. Gibbs wrote: > >> Is there something else we can do so that libpthread gets > >> initialized first? Use _init()? I'm not sure how to > >> not add that when building static libpthread though (let's > >> kill static libpthread!). > > > > There is no way other than putting a special case for pthread > > initialisation into rtld. The C++ constructor trick is implemented > > via _init anyway so that won't work either. > > I thought that static constructor invocation was deterministic based > on link order. Does the C++ spec really indicate that the order of > construction can be random? I don't think the spec places any restrictions on constructor ordering. The problem here is that you get different behaviour depending on whether you link with libGL first followed by libpthread (in that case libpthread initialises first) or if you link in the other order (in which case libGL initialises first). As far as I can see, rtld calls the _init sections of each shared library in reverse order with the last library linked against being initialised first.