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

AW: undefined reference to `__impure_ptr' during linking test


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


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