This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: libsupc++.a


Martin Buck wrote:
> 
> Correct me if I'm wrong, but isn't libsupc++.a something like libgcc.a
> for C++ code? So like libgcc.a, it shouldn't be provided by 
> eCos, but by
> the compiler.
> 
> Incidentally, exactly this happens if you compile & install 
> libstdc++ at
> the same time you compile & install the compiler. As an additional
> feature, you'll also get all the other standard C++ features 
> it provides
> like "operator new/delete", typeinfo, exception handling (although the
> latter one might not work with eCos).
> 
> Martin
>

You can only build a cross gcc for ecos by doing a 'make all-gcc'. This
does not build libsupc++.a, a 'make all' would be required to achieve
this, which is impossible to do as there is no target C library at this
point. And then, functions in libsupc++.a should use the mechanisms
provided by the target system directly for efficiency. Take as an example
the one function I implemented, __cxa_pure_virtual(). Its purpose is to
abort a program if it happens to call a pure virtual function. The version
that comes with gcc (or, more precisely, with libstdc++) does this by
calling
std::terminate(), so it requires the standard C++ library. For an embedded
system it is clearly preferable to map this simple funtionality directly to
the ecos-provided mechanisms, CYG_FAIL() in this case.

Providing ecos-specific implementations for these functions also has the
additional benefit of being able to add ecos-style asertions, tracing and
so on.

tk
----------------------------------------------- 
Thomas Koeller, Software Development 

Basler Vision Technologies 
An der Strusbek 60-62 
22926 Ahrensburg 
Germany 

Tel +49 (4102) 463-390 
Fax +49 (4102) 463-46390

mailto:Thomas.Koeller@baslerweb.com 
http://www.baslerweb.com 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]