Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!mit-eddie!mit-amt!peter From: peter@mit-amt.MEDIA.MIT.EDU (Peter Schroeder) Newsgroups: comp.lang.c++ Subject: Re: hp exit c++ static destructors Message-ID: <1003@mit-amt.MEDIA.MIT.EDU> Date: 10 Nov 89 19:16:31 GMT References: <6422@cbnewsm.ATT.COM> Reply-To: peter@media-lab.media.mit.edu (Peter Schroeder) Organization: MIT Media Lab, Cambridge MA Lines: 31 In article <6422@cbnewsm.ATT.COM> stanl@cbnewsm.ATT.COM (stanley.b.lippman) writes: > the problem, in a nutshell (or kernel) is that cfront provides > its own instance of exit in libC.a. this instance insures the > execution of static destructors. > > the CC command presumes that the call > cc myFoo.c libC.a libc.a > > will link in the first encountered instance of exit. however, > unless the user's code has an explicit call of exit, the > binding of exit to the libc.a instance is done outside the > conventional binding rules. Indeed that is the problem and it turns out that there is a flag specifically for this purpose to be sent to the linker. Someone suggested the following fix: add the line LIBRARY=${LIBRARY-"-W l,-uexit -lC"} to CC in place of the existing line LIBRARY=${LIBRARY--l${LIB_ID}} That fixes the problem. I am rebuilding everything right now and will compile a list of things to do for other HP9000/800 users when building cfront 2.0. If you are interested, send me mail and I will mail it to you. If you went through this yourself already, let me know about the things you found, you needed to do and I will merge all those `tricks'. Thanks to everyone for their help! Peter