This is the mail archive of the ecos-discuss@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]

Re: How to handle lack of builtin operator new for newer GCCs?


Richard Chan wrote:
> 
> I would like to ask what the plans or workarounds for the use
> of operator new in the eCos libraries for GCCs without builtin_new.
> 
> Some source files like fopen.cxx use 'operator new' which gcc 2.95.* will
> convert
> to __builtin_new.
> 
> Newer GCCs (3.0.1 for example) don't seem to have __builtin_new anymore and
> expect operator new to come from libstdc++. In particular if I try
> to build a binary using fopen and GCC3 it complains about the lack of
> operator new.

Link with libsupc++, i.e. add -lsupc++ to your command line.

However to do this, you must have built libstdc++ in your gcc build (which
wouldn't happen if you follow the current instructions on the eCos web site
which are for 2.95). I've been working on this, but for now the safest (and
easiest to describe) option is to build gcc with newlib. You can do this by
getting newlib from http://sources.redhat.com/newlib, unpacking it, and
putting symlinks to the newlib and libgloss directories in your gcc source
tree at the same level as "libstdc++-v3".

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


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