Re: [Fink-devel] lifetime of static variables

2004-12-23 Thread Peter O'Gorman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin Costabel wrote: | Dave Vasilevsky wrote: | [] | |> There are two ways this can be done. The simple way is to not use |> libraries where possible--just link all your .o files into an |> executable and pass gcc -Wl,-bind_at_load . The more complica

Re: [Fink-devel] lifetime of static variables

2004-12-22 Thread "D. Höhn"
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Dave Vasilevsky wrote: | On Dec 22, 2004, at 2:24 AM, Martin Costabel wrote: | |> Is this different from using the "-single-module" linker flag? The |> latter is often recommended for problems with static initializers. | | | According to Apple, it'

Re: [Fink-devel] lifetime of static variables

2004-12-22 Thread Dave Vasilevsky
On Dec 22, 2004, at 2:24 AM, Martin Costabel wrote: Is this different from using the "-single-module" linker flag? The latter is often recommended for problems with static initializers. According to Apple, it's exactly the same thing: http://developer.apple.com/releasenotes/DeveloperTools/ Com

Re: [Fink-devel] lifetime of static variables

2004-12-22 Thread Martin Costabel
Mark Treiber wrote: Thanks everyone for the tips. I'm suprised this hasn't been brought up on this list yet (or at least I havn't been able to find it).. Well, it is brought up when it bites someone. There is a rather long thread on fink-devel from summer 2003 about how I hunted a bus error in

Re: [Fink-devel] lifetime of static variables

2004-12-21 Thread Martin Costabel
Dave Vasilevsky wrote: [] There are two ways this can be done. The simple way is to not use libraries where possible--just link all your .o files into an executable and pass gcc -Wl,-bind_at_load . The more complicated way--which works for libs too--is to use an intermediate .o file. Here's a mo

Re: [Fink-devel] lifetime of static variables

2004-12-21 Thread Dave Vasilevsky
On Dec 21, 2004, at 11:25 AM, David Fang wrote: I've been using patterns like the code above in my own traits classes with static members. I've found that linking all the object files into one (via libtool convenience library) wasn't sufficient to force the linker to link in the modules' static

Re: [Fink-devel] lifetime of static variables

2004-12-21 Thread Mark Treiber
Thanks everyone for the tips. I'm suprised this hasn't been brought up on this list yet (or at least I havn't been able to find it).. I'll post any progress that I make.. Mark. On Tue, 21 Dec 2004 11:41:35 -0500, Benjamin Reed <[EMAIL PROTECTED]> wrote: > David Fang wrote: > > > I'd mu

Re: [Fink-devel] lifetime of static variables

2004-12-21 Thread Benjamin Reed
David Fang wrote: I'd much rather learn about the internals of the linker to understand where and why the ball is dropped... The way I've heard it explained, it's not really "dropped", it's undefined behavior in the C++ standard, and everyone just assumes it works that way because it work

Re: [Fink-devel] lifetime of static variables

2004-12-21 Thread David Fang
Hi, I've also encountered the same problems with static initializers not being called on Mac OS X, where the same code on compiles and runes fine on every other platform. > > I'm in the middle of updating my quantlib package and the test suite > > is producing a failure that doesn't occur

Re: [Fink-devel] lifetime of static variables

2004-12-21 Thread Dave Vasilevsky
On Dec 16, 2004, at 9:17 PM, Mark Treiber wrote: I'm in the middle of updating my quantlib package and the test suite is producing a failure that doesn't occur on any other platform. Basically are there any known issues with the lifetime of static variables with the november gcc update? Mac OS X ha

[Fink-devel] lifetime of static variables

2004-12-16 Thread Mark Treiber
Hi All. I'm in the middle of updating my quantlib package and the test suite is producing a failure that doesn't occur on any other platform. Basically are there any known issues with the lifetime of static variables with the november gcc update? Mark. -