From owner-freebsd-hackers Thu Mar 11 0:23:14 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from citadel.cdsec.com (citadel.cdsec.com [192.96.22.18]) by hub.freebsd.org (Postfix) with ESMTP id A31E7151F8 for ; Thu, 11 Mar 1999 00:23:00 -0800 (PST) (envelope-from gram@cdsec.com) Received: (from nobody@localhost) by citadel.cdsec.com (8.8.8/8.6.9) id KAA29023; Thu, 11 Mar 1999 10:22:01 +0200 (SAST) Received: by citadel via recvmail id 29020; Thu Mar 11 10:21:39 1999 Message-ID: <36E77D39.7A2F779D@cdsec.com> Date: Thu, 11 Mar 1999 10:22:17 +0200 From: Graham Wheeler X-Mailer: Mozilla 4.08 [en] (X11; I; FreeBSD 2.2.8-RELEASE i386) MIME-Version: 1.0 To: Niall Smart , hackers@freebsd.org Subject: Re: C++ global constructors and shared libraries References: <36E6AB40.742D64BB@cdsec.com> <36E6BFE4.951172E3@kira.team400.ie> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Niall Smart wrote: > > Graham Wheeler wrote: > > > > Hi folks > > > > I have just changed some C++ code libraries from static to shared. > > I now find that some global objects declared in these libraries > > are no longer having their constructors called. If I move the object > > niall% g++ -v > cc -v > gcc version 2.7.2.1 This is the same version I am using. > niall% g++ -c -fpic libfoo.cc > niall% g++ -shared libfoo.o -o libfoo.so I am using the bsd.lib.mk and related include files for the Make; certainly I don't think that there is anything strange in these. > niall% g++ main.cc -Wl,-R,. -L. -lfoo I don't have the -Wl,-R,. options; would these make any difference at all? -- Dr Graham Wheeler E-mail: gram@cdsec.com Citadel Data Security Phone: +27(21)423-6065/6/7 Firewalls/Virtual Private Networks Fax: +27(21)24-3656 Internet/Intranet Network Specialists Data Security Products WWW: http://www.cdsec.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message