Problems building with uClibc

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
 I'm having problems building against uClibc.. It seems that it always
wants to link in gcc-lib too. How can I stop it ? Here are some examples

 Starting with Busybox, I get a lot of duplicate definitions

$ make
gcc -s -Wl,-warn-common --static -o busybox ash.o basename.o cat.o
chgrp.o chmod
.o chown.o chroot.o chvt.o clear.o cmdedit.o cp.o cut.o date.o dd.o df.o
dirname
.o dmesg.o du.o echo.o env.o find.o free.o grep.o gunzip.o gzip.o halt.o
head.o
id.o init.o kill.o klogd.o ln.o logger.o ls.o lsmod.o mkdir.o mknod.o
mkswap.o m
odprobe.o more.o mount.o mv.o pidof.o poweroff.o ps.o pwd.o reboot.o
reset.o rm.
o rmdir.o sed.o sleep.o sort.o swaponoff.o sync.o syslogd.o tail.o tar.o
test.o
touch.o true_false.o tty.o umount.o uname.o uniq.o uptime.o wc.o which.o
whoami.
o xargs.o yes.o  busybox.o usage.o applets.o libbb.a
/usr/src/uClibc-0.9.26/lib/libc.a
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libc.a(open.o): In
function `__libc_open':
__libc_open(.text+0x0): multiple definition of `__libc_open'
/usr/src/uClibc-0.9.26/lib/libc.a(__syscall_open.o)(.text+0x0): first
defined here
/usr/bin/ld: Warning: size of symbol `__libc_open' changed from 61 to 33
in open
.o
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libc.a(close.o): In
function `__libc_close':
__libc_close(.text+0x0): multiple definition of `__libc_close'
/usr/src/uClibc-0.9.26/lib/libc.a(__libc_close.o)(.text+0x0): first
defined here
/usr/bin/ld: Warning: size of symbol `__libc_close' changed from 45 to
27 in close.o
.
.
and so on.

 If I try to build the classis printf("hello, world") it builds OK, but
it doesn't seem to have used uClibc at all

$ gcc -Wall hello.c -L/usr/src/uClibc-0.9.26/lib/libc.a -o hello
$ ldd hello
        libc.so.6 => /lib/libc.so.6 (0x40020000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Where am I going wrong ?





Re: Problems building with uClibc
Hello noreply,
Quoted text here. Click to load it
You probabaly need -nostdlib and -nostdinc options to gcc

Quoted text here. Click to load it
gcc -Wall -nostdlib -nostdinc -I/usr/src/uClibc-0.9.26/include hello.c
-L/usr/src/uClibc-0.9.26/lib/libc.a -o hello

or something similar.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Damion de Soto - Software Engineer  email:     snipped-for-privacy@snapgear.com
We've slightly trimmed the long signature. Click to see the full one.
Re: Problems building with uClibc

    Thanks for the reply.

    As hinted in your reply, my include path was also wrong.

    Problems now fixed.. Many thanks.



Damion de Soto wrote:

Quoted text here. Click to load it


Re: Problems building with uClibc

Quoted text here. Click to load it

Did you use the uclibc toolchain? This is a whole set of compiler, linker
etc that is patched to use the uclibc rather than the glibc.
see http://www.uclibc.org/toolchains.html

For some reason my system is incompatible with gcc3.3 . So I had to
refrain to the special gcc2.95 toolchain build script available at
 http://www.uclibc.org/cgi-bin/cvsweb/toolchain /

   Hope that helps,
                      ---<(kaimartin)>---
--
Kai-Martin Knaak
kmkn@tem-messtechnik.de
We've slightly trimmed the long signature. Click to see the full one.
Re: Problems building with uClibc
.    I did not use 'toolchain'. I already had a development system here. I'm
cross
building on a AMD Athlon running 2.2.16-22 kernel to run on a i386 biscuit PC
running a 2.4.18 kernel

kai-martin knaak wrote:

Quoted text here. Click to load it
http://pgp.mit.edu:11371/pks/lookup?search=kai-martin&op=index&exact=on


Re: Problems building with uClibc
[ Please don't post your reply before the text you're replying to,
  and delete irrelevant bits of the text you're replying to. ]


Quoted text here. Click to load it

cross
Quoted text here. Click to load it

You used a toolchain.  The word "toolchain", in an embedded context,
means a compiler, linker, debugger, and library set used to generate
executable programs.

Based on the error message you're getting, you used the wrong toolchain,
or one that isn't configured to use uclibc.
--
Steve Watt KD6GGD  PP-ASEL-IA          ICBM: 121W 56' 57.8" / 37N 20' 14.9"
 Internet: steve @ Watt.COM                         Whois: SW32
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline