From owner-freebsd-hackers Sat Jan 24 15:59:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA24372 for hackers-outgoing; Sat, 24 Jan 1998 15:59:29 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA24366 for ; Sat, 24 Jan 1998 15:59:26 -0800 (PST) (envelope-from tlambert@usr04.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.8.8/8.8.8) id QAA17572; Sat, 24 Jan 1998 16:59:23 -0700 (MST) Received: from usr04.primenet.com(206.165.6.204) via SMTP by smtp01.primenet.com, id smtpd017557; Sat Jan 24 16:59:18 1998 Received: (from tlambert@localhost) by usr04.primenet.com (8.8.5/8.8.5) id QAA12224; Sat, 24 Jan 1998 16:59:16 -0700 (MST) From: Terry Lambert Message-Id: <199801242359.QAA12224@usr04.primenet.com> Subject: Re: egcs and exceptions To: jfieber@indiana.edu (John Fieber) Date: Sat, 24 Jan 1998 23:59:16 +0000 (GMT) Cc: jdp@polstra.com, hackers@FreeBSD.ORG In-Reply-To: from "John Fieber" at Jan 24, 98 01:19:41 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk > > > Do you also have a magic command line option to make some form of > > > automatic template instantiation work? :) > > > > Have you tried "-frepo"? It is supposedly implemented in egcs, though > > I haven't tried it. > > It sort of works, but some of the more complex STL classes don't > end up with all their pieces. I have not completely eliminated > the possibility of pilot error though... Which STL implementation are you using? I have just completed changes to the HP/SGI/Moscow version for draft 4 and better pthreads support (draft 4 and later requires that you not statically initialize nutexes anymore, a problem for the ropeimpl.h, stl_alloc.h, stl_pthread_alloc.h, and stl_lock.h). The correct way to do this would be to override new/delete, and do the pthread_init() call to callback there. Unfortunately, being a template, that would generate a garbage-scow load of these functions -- one for each template class. I'm currently calling the __THROW_BAD_ALLOC (if you don't have exceptions, it does a "fprintf(stderr,...); exit(1);" instead, so it's portable). I haven't sent them in because I'm not sure that everything is happy. I'm trying to build the CMU acapd from the Cyrus project sources, and I'm running into: /var/tmp/cc011990.s: Assembler messages: /var/tmp/cc011990.s:53679: Error: Local symbol L23795 never defined. /var/tmp/cc011990.s:53679: Fatal error:1 error, 0 warnings, no object file generated. ... The .S file is: L23970: L23796: leal -28(%ebp),%eax pushl $2 pushl %eax call __$_6String addl $8,%esp jmp L23968 .align 2,0x90 L23963: nop movl 4(%ebp),%edx decl %edx movl %edx,___eh_pc movl $L23969,4(%ebp) jmp L23968 .align 2,0x90 L23969: call ___throw movl $L23963,___eh_pc call ___throw L23968: movl $L23795,___eh_pc call ___throw ...I haven't been able to tell if this is a complier bug in FreeBSD g++ 2.7.2.1, or something I introduced. 8-(. Have you (or anyone else) ever seen this before? My suspicion is that it's coming from a static member function for which g++ is failing to generate a pseudo-symbol -- like when you do the following in gcc: main() { char *p = "Hello World!\n" + 6; printf( "p = '%s'\n", p); printf( "p - 6 = '%s'\n", p - 6); } If you want to reproduce the acapd compilation, let me know, I have a FreeBSD version of configure.in for autoconf, and a Makefile.in that has been corrected for BSD's make. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.