This is the mail archive of the
crossgcc@cygnus.com
mailing list for the crossgcc project.
Re: undefined reference in gnu cross-compiler
- To: larry.langerholc@icn.siemens.com
- Subject: Re: undefined reference in gnu cross-compiler
- From: khan@xraylith.wisc.edu
- Date: Sat, 12 Jun 1999 17:45:05 -0500 (CDT)
- cc: crossgcc@cygnus.com
- Reply-To: crossgcc@cygnus.com
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.