Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!motcsd!hpda!hpcuhb!hpcllla!hpclisp!hpclscu!shankar From: shankar@hpclscu.HP.COM (Shankar Unni) Newsgroups: comp.lang.c++ Subject: Re: problems building cfront 2.0 Message-ID: <1000035@hpclscu.HP.COM> Date: 11 Nov 89 00:12:26 GMT References: <995@mit-amt.MEDIA.MIT.EDU> Organization: Hewlett-Packard Calif. Language Lab Lines: 32 > exit( 0 ); // <- this line makes all the difference This is because of a peculiar implementation of the C startup code. /lib/crt0.o on the 800's jumps to a location called _start in /lib/libc.a, which is what calls "main()", and if main returns, it calls "exit()". The problem, as you can imagine, is that if exit is not explicitly referenced in the user code, it is not picked up from /usr/lib/libC.a (where the C++ exit resides), but instead, it is picked up from /lib/libc.a. The solution is to apply the following patch: *** CC Fri Jun 30 14:15:24 1989 --- CC.new Fri Nov 10 16:11:05 1989 *************** *** 73,78 **** --- 73,81 ---- APASS=0 defmem=D deflist= + # explicitly undefine exit for hp9000 s8xx + test -x /bin/hp9000s800 && hp9000s800 && Z='-Wl,-u,exit' + rm -fr $TEMPDIR mkdir $TEMPDIR E=$? ----- Shankar Unni E-Mail: Hewlett-Packard California Language Lab. Internet: shankar@hpda.hp.com Phone : (408) 447-5797 UUCP: ...!hplabs!hpda!shankar