This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

Re: undefined reference in gnu cross-compiler


On Fri, 11 Jun 1999, Langerholc, Larry wrote:

> I am having problems with my egcs cross-compiler (HP-UX to SCO 3.2). Here's
> the output.
> 
> The old gcc 2.7.2 worked.

[ ... ]
> /var/tmp/ccPHNZj6.o(.text+0x222):llsimtoolmain.cpp: undefined reference to
> `__eprintf'

The problem is that the default cross-compilation inhibits building of
eprintf in (and a few others) in libgcc2.c. The old Cygnus tree used
to pass (or not) inhibit_libc from top-level configure, but that seems
to be gone these days. The usual fix I do is to make sure inhibit_libc 
is NOT defined when cross-compiling for targets that are not really 
embedded; just edit libgcc2.c and fix it:

  #if defined(CROSS_COMPILE) && !defined(inhibit_libc) 
  #define inhibit_libc
  #endif

to, using the appropriate target name.

  #if defined(CROSS_COMPILE) && !defined(inhibit_libc)  && !defined(TARGET_NAME)
  #define inhibit_libc
  #endif

The other solution is put __eprintf elsewhere and link against that.

Regards,
Mumit




_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

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