[BusyBox] uClinux and busybox compilation error: toolchain's problem?

Shawn shawnxjin at gmail.com
Thu Dec 9 20:15:11 UTC 2004


Hi,

FIrst please forgive me for the post across multiple mailing lists.
The questions ARE related to both topics.

Used the toolchain (arm-uclinux-tools-base-gcc3.4.0-20040610.sh) from
Bernardo Innocenti
http://www.uclinux.org/pub/uClinux/arm-elf-tools/gcc-3/, I
successfully compiled the kernel linux-2.6.7-hsc0 and the kernel works
fine. However when compiling busybox-1.0.0 (official release) using
the same tools, I encountered such errors as below

arm-uclinux-gcc -Ibusybox-1.00/include -Ibusybox-1.00/include
-Ibusybox-1.00/libbb -Wall -Wstrict-prototypes -Wshadow -Os
-fstrict-aliasing -fomit-frame-pointer-D_GNU_SOURCE -DNDEBUG     -c -o
busybox-1.00/libbb/loop.o /u/xjin/code/busybox-1.00/libbb/loop.c
busybox-1.00/libbb/loop.c:52: error: parse error before "__kernel_old_dev_t"
busybox-1.00/libbb/loop.c:52: warning: no semicolon at end of struct or union
busybox-1.00/libbb/loop.c:54: error: parse error before "lo_rdevice"
busybox-1.00/libbb/loop.c:54: warning: type defaults to `int' in
declaration of `lo_rdevice'

Simon Keimer already reported this error before
(http://www.busybox.net/lists/busybox/2004-June/011800.html). Although
a solution was proposed by Rob Landley here
(http://www.busybox.net/lists/busybox/2004-June/011806.html), I do
think that may not be a proper way to fix the bug. Instead the
explanation here by Glenn McGrath
(http://www.busybox.net/lists/busybox/2004-June/011916.html) may find
the real root cause. I do find the definition of __kernel_old_dev_t in
/usr/local/arm-uclinux-tools/arm-uclinux/include/asm/posix_types.h.
Could it be a toolchain's problem? How to check which header files are
really included in gcc?

If I chang __kernel_old_dev_t to __kernel_dev_t, the loop.c is
compiled but later I have the following error, complaining __NR_sysfs
is not defined. However I do find the definition in
/user/local/arm-uclinux-tools/arm-uclinux/include/asm/unistd.h. This
again makes me suspect the correctness of the toolchain.

arm-uclinux-gcc -Ibusybox-1.00/include -Ibusybox-1.00/include
-Ibusybox-1.00/libbb -Wall -Wstrict-prototypes -Wshadow -Os
-fstrict-aliasing -fomit-frame-pointer-D_GNU_SOURCE -DNDEBUG     -c -o
busybox-1.00/libbb/syscalls.o
/u/xjin/code/busybox-1.00/libbb/syscalls.c
busybox-1.00/libbb/syscalls.c: In function `sysfs':
busybox-1.00/libbb/syscalls.c:34: error: `__NR_sysfs' undeclared
(first use in this function)

How can we check what header files are included when gcc cross compile
code? Shed some light on this.

Thank you,
-Shawn.



More information about the busybox mailing list