public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
* AW: undefined reference to `__impure_ptr' during linking test
@ 2005-06-01  8:33 Neundorf, Alexander
  2005-06-01 10:05 ` Marc Michalewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Neundorf, Alexander @ 2005-06-01  8:33 UTC (permalink / raw)
  To: Marc Michalewicz, ecos-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: AW: undefined reference to `__impure_ptr' during linking test
  2005-06-01  8:33 AW: undefined reference to `__impure_ptr' during linking test Neundorf, Alexander
@ 2005-06-01 10:05 ` Marc Michalewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Michalewicz @ 2005-06-01 10:05 UTC (permalink / raw)
  To: Neundorf, Alexander; +Cc: ecos-devel

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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-01 10:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-01  8:33 AW: undefined reference to `__impure_ptr' during linking test Neundorf, Alexander
2005-06-01 10:05 ` Marc Michalewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).