[BusyBox] compile problem in usleep.c

Simon Byrnand simon at igrin.co.nz
Fri Jan 21 21:24:04 UTC 2005


>> -----Original Message-----
>> From: busybox-bounces at mail.busybox.net
>> [mailto:busybox-bounces at mail.busybox.net] On Behalf Of Simon Byrnand
>> Sent: Friday, January 21, 2005 03:32
>> To: busybox at mail.codepoet.org
>> Subject: [BusyBox] compile problem in usleep.c
>>
>> Hi All,
>>
>> When I try to compile busybox 1.00 I'm getting the following
>> error part way through:
>>
>> gcc -I/root/busybox-1.00/include -I/root/busybox-1.00/include
>> -I/root/busybox-1.00/libbb -Wall -Wstrict-prototypes -Wshadow -Os
>> -march=i386 -mpreferred-stack-boundary=2  -malign-functions=0
>> -malign-jumps=0 -malign-loops=0 -fomit-frame-pointer -D_GNU_SOURCE
>> -DNDEBUG     -c -o /root/busybox-1.00/coreutils/usleep.o
>> /root/busybox-1.00/coreutils/usleep.c
>> /root/busybox-1.00/coreutils/usleep.c: In function `usleep_main':
>> /root/busybox-1.00/coreutils/usleep.c:36: void value not
>> ignored as it ought to be
>> make: *** [/root/busybox-1.00/coreutils/usleep.o] Error 1
>>
>> I have no idea what to try from here. A search of the mailing
>> list archives didn't turn up anything either. Anyone know what
>> this is, or know what other details I might need to provide ?
>> (Such as .config etc)

Hi Peter,

Thanks for the reply!

> Looking at the error above, it seems the compiler thinks the
> usleep() function does not return a value, while the code
> assumes that it does. Looking at the manual page for usleep(),
> one can see that usleep() as defined by BSD 4.3 does not indeed
> return a value whereas the version defined by SUSv2 does.
> However, both glibc and uClibc implement usleep() as defined by
> SUSv2, which is why this error is somewhat puzzling.
>
> So, here are some missing details:
> * compiler version

gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.95.4/specs
gcc version 2.95.4 20010319 (prerelease/franzo/20011204)

> * architecture (I assume some ix86 version from the compiler options
> above)

Yes, ix86, on a Pentium Pro 200, Kernel 2.4.27

> * operating system and distribution

Redhat 6.2, although a lot of things have been upgraded on it..

> * the C library you use (glibc, uClibc etc) and its version

Using glibc 2.1.3

> * any arguments given to make

No extra arguments given to make.

I've found that disabling support for the usleep function allowed me to
compile a bit further until I got to this error:

gcc -s -Wl,-warn-common -o busybox -Wl,--start-group
/root/busybox-1.00/applets/applets.a
/root/busybox-1.00/archival/archival.a
/root/busybox-1.00/archival/libunarchive/libunarchive.a
/root/busybox-1.00/coreutils/coreutils.a
/root/busybox-1.00/console-tools/console-tools.a
/root/busybox-1.00/debianutils/debianutils.a
/root/busybox-1.00/editors/editors.a
/root/busybox-1.00/findutils/findutils.a /root/busybox-1.00/init/init.a
/root/busybox-1.00/miscutils/miscutils.a
/root/busybox-1.00/modutils/modutils.a
/root/busybox-1.00/networking/networking.a
/root/busybox-1.00/networking/libiproute/libiproute.a
/root/busybox-1.00/networking/udhcp/udhcp.a
/root/busybox-1.00/procps/procps.a
/root/busybox-1.00/loginutils/loginutils.a
/root/busybox-1.00/shell/shell.a /root/busybox-1.00/sysklogd/sysklogd.a
/root/busybox-1.00/util-linux/util-linux.a
/root/busybox-1.00/libpwdgrp/libpwdgrp.a
/root/busybox-1.00/coreutils/libcoreutils/libcoreutils.a
/root/busybox-1.00/libbb/libbb.a -lm -lcrypt -Wl,--end-group
/root/busybox-1.00/debianutils/debianutils.a(mktemp.o): In function
`mktemp_main':
mktemp.o(.text+0x59): undefined reference to `mkdtemp'
collect2: ld returned 1 exit status
make: *** [busybox] Error 1

If I disable support for both usleep and mkdtemp, I get a successful
compile and a working binary.

I realised I had another box running debian that I was able to try
compiling on, and the compile was successful with both usleep and mkdtemp
enabled. The interesting thing is that the debian box is running an almost
identical gcc:

gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)

And the kernel is also 2.4.27. The main difference seems to be that the
GLIBC is 2.2.3 instead of 2.1.3, and possibly some (unknown) difference in
header files.

One other question which should perhaps be a seperate thread, but I'll
mention it briefly here, is that I have an existing single floppy disk
router system I developed a couple of years ago using busybox 0.48 which
has been working nicely which I'm trying to upgrade to using 1.00 (the
whole point of this exercise) but I've noticed that the new busybox seems
to link to an additional library that 0.48 didn't need - libm.so.6.

I don't have this on my single floppy system, and there isn't room to add
it either. What is this library and is it strictly necessary ? On the
redhat box this library is nearly half a megabyte in size, even on the
debian box it is 130KB, so any space savings from going to the new busybox
(such as not needing tinylogin, seperate traceroute, telnetd etc) will be
negated and then some by the additional library needed.

Is there any way to avoid linking to that library ? (By disabling certain
commands for instance) I can't seem to find out much about this library,
it's not one I've come across before on programs I've compiled...

Regards,
Simon





More information about the busybox mailing list