[uClinux-dev] compiler issue?

David McCullough davidm at snapgear.com
Thu Nov 15 20:41:53 EST 2001


Jivin Jon Mandrell lays it down ...
> I have downloaded the latest m68k-elf tools from the www.uclinux.org web
> site (m68k-elf-tools-20010716.tar.gz) and have been trying to build an
> executable for the Coldfire M5272C3 eval board.  I am running Mandrake
> 8.1 as my host environment.
> 
> After installing the compiler file into the /usr/local tree, I created
> the standard "hello world" app, and attempt to compile with the command
> line:
> 
> m68k-elf-gcc -m5200 -Wl,-elf2flt -o hello hello.c
> 
> and I get the following error messages:
> 
> hello.elf2flt: In function `_start':
> hello.elf2flt(.text+0x8): undefined reference to `__uClibc_main'
> hello.elf2flt: In function `main':
> hello.elf2flt(.text+0x2a): undefined reference to `printf'
> collect2: ld returned 1 exit status
> 
> I can solve this by simply giving '-lc' on the command line.  I looked
> in the file /usr/local/lib/gcc-lib/m68k-elf/2.95.3/specs and it appears
> there is no specification for -lc.  If I make this change things appear
> to work correctly:
> 
> *** specs.old   Thu Nov 15 08:08:35 2001
> --- specs       Thu Nov 15 08:15:45 2001
> ***************
> *** 20,25 ****
> --- 20,26 ----
> 
> 
>   *lib:
> + -lc
> 
>   *libgcc:
>   -lgcc
> 
> Is this something that should be in the compiler specs file, or did I
> just miss something?  I have successfully built the uClinux distribution
> (uClinux-dist-20011112.tar.gz).

The m68k-elf target is a generic embedded target,  thus it doesn't
automatically include any libraries.  The old 'if it ain't broke' rule
might apply here ;-)

Cheers,
Davidm

-- 
David McCullough:    Ph: +61 7 3435 2815  http://www.SnapGear.com
davidm at snapgear.com  Fx: +61 7 3891 3630  825 Stanley St., W'gabba QLD 4102, Oz
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/



More information about the uClinux-dev mailing list