[ECOS] RE: any experiences with arm gcc 3.4.1 and ecos ?

Tom Lynn tom.lynn@hypertag.com
Mon Aug 9 15:43:00 GMT 2004


Hi,

(Apologies if this doesn't thread properly, I read it from the web 
archive of the mailing list.)

On 2 Aug 2004, Richard Raunch wrote:
 > I download now eCos with following command:
 > cvs.exe -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -P ecos
 >
 > problem with multiple definitions is solved, but I get following error:
 >
 > 
/opt/ecos/gnutools/arm-elf/bin/../lib/gcc/arm-elf/3.4.1/../../../../arm-elf/
 > 
lib/libsupc++.a(vterminate.o)(.text+0x22c):../../../../gcc-3.4.1/libstdc++-v
 > 3/libsupc++/vterminate.cc:94: undefined reference to `_impure_ptr'
 >
 > richard

Alexander Neundorf has the same problem with gnuarm.org's 3.4.1
<http://sources.redhat.com/ml/ecos-discuss/2004-08/msg00112.html>
and I'm getting this problem too, with (a slightly hacked version of)
gnuarm.org's 3.4.2.

I'm afraid I haven't got an example commandline as simple as Alex's, but
I suppose it might help someone debug it:

$ cat purevirt.cpp
struct Base { virtual void foo() =0; };
struct X : public Base { void foo() {} };

int main()
{
    Base* b = new X;
}
$ arm-elf-g++ purevirt.cpp 
-L/ecos-c/ecos-dev/thl_ecoscvs_dbgbase_install/lib -Wl,--gc-sections 
-Ttarget.ld -nostdlib -lstdc++ -o purevirt.elf
/ecos-c/Program 
Files/GNUARM/bin/../lib/gcc/arm-elf/3.4.1/../../../../arm-elf/lib/libstdc++.a(pure.o)(.text+0x18): 
In function `__cxa_pure_virtual':
../../../../gcc-3.4.1/libstdc++-v3/libsupc++/pure.cc:49: undefined 
reference to `write'
/ecos-c/Program 
Files/GNUARM/bin/../lib/gcc/arm-elf/3.4.1/../../../../arm-elf/lib/libstdc++.a(vterminate.o)(.text+0x22c):../../../../gcc-3.4.1/libstdc++-v3/libsupc++/vterminate.cc:94: 
undefined reference to `_impure_ptr'
collect2: ld returned 1 exit status

I understand that the __cxa_pure_virtual is considered to be "not ecos's 
problem" (to paraphrase),
that is, a nasty interaction of some sort between the GCC build options 
and the C++ standard library
build options.  The upshot seems to be that I can't get away with using 
the GNUARM binaries?
As you can probably tell, my understanding of this point is still far 
from perfect.

I also understand that the first problem with pure virtual functions can 
be made to go away by
simply linking in an empty "extern "C" void _cxa_pure_virtual(void)" to 
keep it happy.  The
impure_ptr thing seems to be impossible to vanish in this way though.  
As I understand it so far,
it's the pointer to the data-structure which the C standard library uses 
for quasi-re-entrant
functions such as fread, storing such things as errno.  As such, it 
seems a bit hard to replace.

So anyway, I'm stuck, has anyone else got anywhere on it?

Related links I've found so far:
    http://sources.redhat.com/ml/ecos-discuss/2003-03/msg00570.html
    http://www.objsw.com/docs/libc_127.html
    http://billgatliff.com/articles/newlib/newlib/x27.html#AEN98

Tom

-- 
Tom Lynn, Software Engineer, Hypertag Ltd.
William Gates Building, JJ Thomson Avenue, Cambridge CB3 0FD

Tel: 01223 763710   Fax: 08714 335288   Web: www.hypertag.com



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list