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

See the CrossGCC FAQ for lots more information.


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

RE: arm-elf-ld


>-----Original Message-----
>From: ananda.motte@philips.com [mailto:ananda.motte@philips.com]
>Sent: 30 October 2001 13:02
>To: crossgcc@sourceware.cygnus.com
>Subject: arm-elf-ld
>
>
>hi David (or anyone else)
>as you might recall I built an arm-elf cross compiler some 
>days back. The tool chain works fine (I can debug stuff on the 
>arm-elf-gdb connected to a simulator for example)
>Why is that when I do a simple (link with )
>arm-elf-ld -Map mapfile -o <output> /tools/arm-elf/lib/crt0.o <objfile>
>
>I get undefined references to __eqdf2 __nedf2 _ltdf2 and the 
>ilk (from vprintf.c and dtoa.c).
>Thanks for any help on the matter.
>
>Am I forgetting some library here ?????

  Basically, that's what is happening.  Normally, the gcc driver adds a few
libraries that get linked to any application by default; if you want to
call the linker manually, you'll have to add them yourself.  Generally, the
driver adds '-lgcc -lc -lgcc' to the end of each command line.  If you use
the -nostdlib option, it doesn't do so, and you'd see the same error 
messages appear from an ordinary gcc build.  So you need to add the same
options to the end of your linker ccommand line.  In this case, since you've
got dtoa and vfprintf, your C library must be OK, so you probably just need
to add -lgcc in order to link with libgcc.a.  (libgcc.a usually lives in
$prefix/lib/gcc-lib/$target/$gccversion/)

  If you only want to pass one or two options (such as a -Map or -T option
or
two), you can still use the main gcc driver to build your programs: use the
form  "-Wl,<option for linker>" to pass an option right through to the 
linker.  Beware, you may have to use quotes if the option has a space in it.

  cheers,
       DaveK

-- 
Burn your ID card!  http://www.optional-identity.org.uk/
Help support the campaign, copy this into your .sig!



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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