From owner-freebsd-current@FreeBSD.ORG Sun Aug 15 15:16:07 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 62C4D16A4CE; Sun, 15 Aug 2004 15:16:07 +0000 (GMT) Received: from aslan.scsiguy.com (mail.scsiguy.com [63.229.232.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id E15EF43D1F; Sun, 15 Aug 2004 15:16:06 +0000 (GMT) (envelope-from gibbs@scsiguy.com) Received: from aslan.scsiguy.com (aslan.scsiguy.com [63.229.232.106]) by aslan.scsiguy.com (8.12.11/8.12.11) with ESMTP id i7FFG0fg056302; Sun, 15 Aug 2004 09:16:00 -0600 (MDT) (envelope-from gibbs@scsiguy.com) Date: Sun, 15 Aug 2004 09:16:00 -0600 From: "Justin T. Gibbs" To: Doug Rabson Message-ID: In-Reply-To: <200408151611.04764.dfr@nlsystems.com> References: <200408151553.32463.dfr@nlsystems.com> <200408151611.04764.dfr@nlsystems.com> X-Mailer: Mulberry/3.1.6 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 Reply-To: "Justin T. Gibbs" 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:16:07 -0000 >> 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. But such ordering restrictions also apply to things like weak symbols, so I don't think that imposing a link order restriction to solve this issue is really a problem. >From my Microsoft days, I know that at least PowerPoint took advantage of the known order of static constructor invocation. The splash screen was executed from a static constructor in the first .o linked into the executable. I'm just curious if this is something the C++ spec says anything about. I'd be surprised if it didn't. -- Justin