This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
Re: AW: undefined reference to `__impure_ptr' during linking test
- From: Marc Michalewicz <marc dot michalewicz at pixy dot ch>
- To: "Neundorf, Alexander" <Alexander dot Neundorf at jenoptik dot com>
- Cc: ecos-devel <ecos-devel at sources dot redhat dot com>
- Date: Wed, 01 Jun 2005 12:05:14 +0200
- Subject: Re: AW: undefined reference to `__impure_ptr' during linking test
- References: <5A8A17126B73AC4C83968F6C4505E3C5022BAA5F@JO-EX01.JENOPTIK.NET>
Thanks a lot,
this helped; i can build all tests now !
Next question is addressed to ecos-discuss - I just saw that this is the
right list for things like that.
Cheers,
Marc
Am Mittwoch, den 01.06.2005, 10:33 +0200 schrieb Neundorf, Alexander:
> Hi,
>
> > Von: ecos-devel-owner@sources.redhat.com
> >
> > Hello again !
> >
> > puhh, I am getting closer to my first kernel - i think and hope.
> > So, now I succees in building a library, but when trying to link tests
> > I am getting now strange messages about undefined refernence:
> >
> > "
> > /usr/share/gnuh8300_v0501_elf-1/lib/gcc/h8300-elf/3.4-GNUH8_v0
> > 501/../../../../h8300-elf/lib/h8300s/int32/libsupc++.a(vtermin
> > ate.o)(.text+0xca): In function `.L2':
> > : undefined reference to `__impure_ptr'
> > "
> >
> > It is only this "impure_ptr", and only in "vterminate.o" nothing else
> > which is not found.
> >
> > Did anybody experience this before and has a solution ?
>
> I'm using gcc 3.4.1 and I think I had the same problem. Since then I compile and link the following reent.c, taken from newlib:
>
> ---------8<-----------8<---------------8<----------------
>
> #if (__GNUC__ == 3) && (__GNUC_MINOR__ == 4)
>
>
> #include <reent.h>
>
> /* Note that there is a copy of this in sys/reent.h. */
> #ifndef __ATTRIBUTE_IMPURE_PTR__
> #define __ATTRIBUTE_IMPURE_PTR__
> #endif
>
> #ifndef __ATTRIBUTE_IMPURE_DATA__
> #define __ATTRIBUTE_IMPURE_DATA__
> #endif
>
> static struct _reent __ATTRIBUTE_IMPURE_DATA__ impure_data = _REENT_INIT (impure_data);
> struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &impure_data;
>
> #endif
>
> ---------8<-----------8<---------------8<----------------
>
> Seems to work.
>
> Alex
>