libtool insistence upon -fno-rtti -fno-exceptions in libsupc++?

Ned Konz ned@bike-nomad.com
Tue May 2 15:37:00 GMT 2006


On May 2, 2006, at 6:57 AM, Dan Kegel wrote:

> On 5/2/06, Ned Konz <ned@bike-nomad.com> wrote:
>> I'm attempting to build libstdc++ for the Atmel AVR family, which is
>> an 8-bit microcontroller.
>> This is in a freestanding environment that's got somewhat limited
>> memory space
>> (the biggest part has 4K of RAM, and the smallest supported by gcc
>> has 64 bytes of RAM).
>
> I just about spit my coffee when I read that.
> Will libstdc++ really fitl on such a small target?
> I bet it burps 4K of overhead before breakfast...
>
>

We'll see.

My experience with C++, templates, and the AVR so far is that -- with  
carefully crafted templates and the optimizer always on -- I can  
produce code that's every bit as small as good C code for small apps.

For larger apps, I get the advantage of not having to suck in an  
entire library member at once (though I know there are ways to avoid  
linking in bits one doesn't need).

I haven't used libstdc++ yet, though, and I'm just getting back into C 
++ after having been away for a while (the last time I used C++  
heavily, the STL wasn't too well supported by the compiler I used). I  
worked for Alan Kay for a couple of years, and was of course using  
Smalltalk during that time.

I've been having some fun with template metaprogramming, partial  
specialization, and the resultant compile-time optimizations and  
frustrations that can come with these. I've also managed to come up  
with not-so-carefully-crafted templates that do things like  
duplicating their code identically because of slightly different  
template parameters.

But my guess is that the use of libstdc++ -- with some restraint and  
always looking at the generated assembly language code and/or map  
file -- would be appropriate for certain kinds of programs.

What's been your experience with the generated code?

-- 
Ned Konz
MetaMagix embedded consulting
MetaMagix@gmail.com




More information about the Libstdc++ mailing list