Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jan 1998 23:59:16 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        jfieber@indiana.edu (John Fieber)
Cc:        jdp@polstra.com, hackers@FreeBSD.ORG
Subject:   Re: egcs and exceptions
Message-ID:  <199801242359.QAA12224@usr04.primenet.com>
In-Reply-To: <Pine.BSF.3.96.980124011506.9195D-100000@fallout.campusview.indiana.edu> from "John Fieber" at Jan 24, 98 01:19:41 am

next in thread | previous in thread | raw e-mail | index | archive | help
> > > 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801242359.QAA12224>