This is the mail archive of the
newlib@sourceware.cygnus.com
mailing list for the newlib project.
Re: How to use newlib
- To: newlib at sourceware dot cygnus dot com
- Subject: Re: How to use newlib
- From: Sascha Ziemann <szi at aibon dot ping dot de>
- Date: 27 Apr 2000 20:07:21 +0200
- Cc: "Robert McNulty Junior" <sherlock_abc at netzero dot net>, mkelwood at qsicorp dot com
- References: <7uln1zwm8c.fsf@olivia.aibon.ping.de> <39087085.15FA82FB@qsicorp.com> <000f01bfb066$1c343700$be933004@default>
"Michael K. Elwood" <mkelwood@qsicorp.com> writes:
| It doesn't look like you are linking libnosys.a correctly (which should
| contain the OS routines that gcc is complaining about).
|
| Try using -lnosys instead of libnosys.a on your link command.
"Robert McNulty Junior" <sherlock_abc@netzero.net> writes:
| The right way to use the newlibs are as folllows.
|
| For libc: -lc
| for libm: -lm
|
| Note, that is small L, not one (1)
Now I link with -lc and -lnosys, but there is still an error:
gcc -L. -static hello.o -lc -lnosys -o hello
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0xe): undefined reference to `__libc_init_first'
/usr/lib/crt1.o(.text+0x18): undefined reference to `_environ'
./libc.a(exit.o): In function `exit':
/home/olivia/szi/software/smbproxy/1.1.1/bootdisk/newlib-1.8.2/newlib.build/libc/stdlib/../../../newlib/libc/stdlib/exit.c:70: undefined reference to `_exit'
collect2: ld returned 1 exit status
make: *** [hello] Error 1
make: Target `all' not remade because of errors.
Isn't it wrong that gcc tries to link with /usr/lib/crt1.o, which does
not belong to newlib, but to the glibc of my system? I tried to link
with -nostartfiles, but newlib seams to have no crt file and I get
this error:
gcc -L. -static -nostartfiles hello.o -lc -lnosys -o hello
/usr/local/i686-pc-linux-gnu/bin/ld: warning: cannot find entry symbol _start; defaulting to 08048080
My newlib tgz contains no documentation at all. Is there somewhere
an additional tgz with documentation?
Sascha