[uClibc] How to use uClibc for MCF5272C3 board.

kamal kumar kamal at brothom.nl
Mon Oct 20 10:28:57 UTC 2003

Hello, my name is Kamal and i want to compile "Hello World" C program for the
Motorola Coldfire 5272.
I use the m68k-elf-tools, but when i type in the command-prompt :
	m68k-elf-gcc hello.c
I get a error message:
	/usr/local/m68k-elf/bin/ld.real: cannot open crt0.o: Unknown file or map
	collect2: ld returned 1 exit status
So i thought that i needed a libray to compile this correctly. The uClibc 
library i found was in the cvs repository of the uClinux.org site.
in the install notes was written that i should first configure a file. I did
that, but when i typed MAKE i got an error message:

	Using kernel headers from 2.4.22-uc0 for architecture 'm68k'
        provided in directory /root/uClinux-2.4.x/

+ CC=m68k-elf-gcc
+ /bin/sh extra/scripts/gen_bits_syscall_h.sh
+ cmp include/bits/sysnum.h include/bits/sysnum.h.new
+ rm -f include/bits/sysnum.h.new
make -C libc/sysdeps/linux/m68k headers
make[1]: Entering directory `/root/uClibc/libc/sysdeps/linux/m68k'
make[1]: Nothing to be done for `headers'.
make[1]: Leaving directory `/root/uClibc/libc/sysdeps/linux/m68k'
make -C  extra
make[1]: Entering directory `/root/uClibc/extra'
make -C  gcc-uClibc
make[2]: Entering directory `/root/uClibc/extra/gcc-uClibc'
gcc -O2 -Wall -s gcc-uClibc.c -o m68k-uclibc-gcc
gcc-uClibc.c: In function `main':
gcc-uClibc.c:199: warning: unused variable `crtbegin_path'
gcc-uClibc.c:200: warning: unused variable `crtend_path'
chmod a+x m68k-uclibc-ld
make[2]: Leaving directory `/root/uClibc/extra/gcc-uClibc'
make[1]: Leaving directory `/root/uClibc/extra'
make -C  ldso
make[1]: Entering directory `/root/uClibc/ldso'
ln -fs ../../include/elf.h include/
ln -fs ../ldso/m68k/boot1_arch.h include/
ln -fs ../ldso/m68k/ld_syscalls.h include/
ln -fs ../ldso/m68k/ld_sysdep.h include/
make -C ldso;
make[2]: Entering directory `/root/uClibc/ldso/ldso'
m68k-elf-gcc  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing  
-Os  -Wa,--bitwise-or -I/root/uClinux-2.4.x//include   -fPIC 
-DUCLIBC_BUILD_DIR=\"/root/uClibc\" -fno-builtin -nostdinc 
-I../../ldso/include -I. -I../../include 
-I/usr/local/lib/gcc-lib/m68k-elf/2.95.3/include -I../libdl -c ldso.c -o 
In file included from ../../ldso/include/ldso.h:9,
                 from ldso.c:108:
../../ldso/include/ld_syscall.h: In function `_dl_getpid':
../../ldso/include/ld_syscall.h:132: `__NR_getpid' undeclared (first use in 
this function)
../../ldso/include/ld_syscall.h:132: (Each undeclared identifier is reported 
only once
../../ldso/include/ld_syscall.h:132: for each function it appears in.)
In file included from _dl_progname.h:2,
                 from ldso.c:156:
m68k/elfinterp.c: In function `_dl_linux_resolver':
m68k/elfinterp.c:72: warning: assignment makes pointer from integer without a 
ldso.c: In function `_dl_boot':
ldso.c:219: warning: assignment from incompatible pointer type
make[2]: *** [ldso.o] Error 1
make[2]: Leaving directory `/root/uClibc/ldso/ldso'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/uClibc/ldso'
make: *** [_dir_ldso] Error 2 

So if someone can help me with these problems or give me advice to use another 
tool or to configure the uClibc differently.
Oh, yes i forgot to tell that i also downloaded the uClinux-2.4.22 kernel. 
Maybe i should configure that to.

So if someone can help me with these problems or tell me if there is another 
way to compile a C program. 
Thank you.

More information about the uClibc mailing list