This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Linking Libraries?
- From: Gre7g Luterman <gre7g dot luterman at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 7 May 2009 21:47:27 -0600
- Subject: Linking Libraries?
I totally realize that this is a stupid question and probably not
perfectly-suited for this list, but I'm really desperate and I just
know someone here can help me.
I've been using gcc under Linux for ages and I've cross-compiled with
avr-gcc under Cygwin, and it's just (almost) always worked. Now I'm
trying to cross-compile for m68k and I just can't get things rolling
here.
I installed this thing:
http://www.codesourcery.com/sgpp/lite/coldfire/portal/release616
I created a Makefile and a rudimentary .ld file (I'll perfect it as I
go, really!).
I compiled my source .c files to .o files, and now I'm stuck trying to
link them into an .elf file.
When I try to link, m68k-elf-ld.exe isn't finding all those stdlib goodies...
undefined reference to `strncpy'
undefined reference to `strlen'
undefined reference to `__floatunsidf'
undefined reference to `__muldf3'
etc.
I've got libraries... I've got a libc.a and a libgcc.a from the
CodeSourcery download, but I can't for the life of me get them to play
nice. I've tried including the libraries with "-l"; I've tried
including them on the command line with my object files; I've tried
putting links to them in my .ld file with a GROUP() statement. But no
matter what I do, these references are not happy.
The code is there!
$ m68k-elf-objdump.exe -t libc.a |grep " sprintf"
00000000 *UND* 00000000 sprintf
00000000 *UND* 00000000 sprintf
00000000 l df *ABS* 00000000 sprintf.c
00000000 g F .text 0000004e sprintf
00000000 *UND* 00000000 sprintf
00000000 *UND* 00000000 sprintf
So what the heck do I need to make m68k-elf-ld.exe happy? Please be gentle. :)
Gre7g