busybox 1.4.0(with patches) crosscompile failed:

Wang, Baojun wangbj at lzu.edu.cn
Thu Feb 1 15:12:06 UTC 2007


On Thursday 01 February 2007 21:56, Wang, Baojun wrote:
> hi,
>
>
> the cross compiler are being built using the clfs embedded way which can be
> found at: http://cross-lfs.org/view/clfs-embedded/x86/
>
> after patching all patches,
>
> # make defconfig
> # make menuconfig # select ash as default shell
> # make CROSS_COMPILE=i686-pc-linux-uclibc- V=1
>
> encounter the fellowing error:
>
>
> i686-pc-linux-uclibc-gcc -Wp,-MD,miscutils/.taskset.o.d   -std=gnu99
> -Iinclude -Ilibbb  -I/mnt/clfs/sources/busybox-1.4.0/libbb -include
> include/autoconf.h -D_GNU_SOURCE -DNDEBUG -D_LARGEFILE_SOURCE
> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D"BB_VER=KBUILD_STR(1.4.0)"
> -DBB_BT=AUTOCONF_TIMESTAMP  -Wall -Wstrict-prototypes -Wshadow -Werror
> -Wundef -funsigned-char -fno-builtin-strlen -finline-limit=0 -static-libgcc
> -Os -falign-functions=1 -falign-jumps=1 -falign-loops=1
> -fomit-frame-pointer -ffunction-sections -fdata-sections -march=i386
> -mpreferred-stack-boundary=2 -Wdeclaration-after-statement
> -Wno-pointer-sign    -D"KBUILD_STR(s)=#s"
> -D"KBUILD_BASENAME=KBUILD_STR(taskset)" 
> -D"KBUILD_MODNAME=KBUILD_STR(taskset)" -c -o miscutils/taskset.o
> miscutils/taskset.c
> miscutils/taskset.c: In function '__from_cpuset':
> miscutils/taskset.c:22: error: 'CPU_SETSIZE' undeclared (first use in this
> function)
> miscutils/taskset.c:22: error: (Each undeclared identifier is reported only
> once
> miscutils/taskset.c:22: error: for each function it appears in.)
> cc1: warnings being treated as errors
> miscutils/taskset.c:26: warning: implicit declaration of function
> 'CPU_ISSET' miscutils/taskset.c: In function 'taskset_main':
> miscutils/taskset.c:67: warning: implicit declaration of function
> 'CPU_ZERO' miscutils/taskset.c:68: error: 'CPU_SETSIZE' undeclared (first
> use in this function)
> miscutils/taskset.c:70: warning: implicit declaration of function 'CPU_SET'
> miscutils/taskset.c:77: warning: implicit declaration of
> function 'sched_getaffinity'
> miscutils/taskset.c:85: warning: implicit declaration of
> function 'sched_setaffinity'
> make[1]: *** [miscutils/taskset.o] Error 1
> make: *** [miscutils] Error 2

ok: fix this by modifying the cross compiler usr/include/sched.h, 

diff -u /mnt/clfs/usr/include/sched.h /usr/include/sched.h
--- /mnt/clfs/usr/include/sched.h       2007-02-01 22:12:28.000000000 +0800
+++ /usr/include/sched.h        2005-09-11 04:51:07.000000000 +0800
@@ -63,8 +63,7 @@
 extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) 
__THROW;


-//#if 0 /*def __USE_GNU*/
-#ifdef __USE_GNU
+#ifdef __USE_GNU
 /* Access macros for `cpu_set'.  */
 #define CPU_SETSIZE __CPU_SETSIZE
 #define CPU_SET(cpu, cpusetp)  __CPU_SET (cpu, cpusetp

the related linux header version is 2.6.19.2, not sure why 2.6.19.2 use
  #if 0
instead of
  # ifdef __USE_GNU
...

my desktop with linux header version 2.6.19.2 also have this problem..


after fixing this, ether_wakup seems refuse to build with uClibc(snapshot 
version)

i686-pc-linux-uclibc-gcc -Wp,-MD,networking/.ether-wake.o.d   -std=gnu99 -Iinclude -Ilibbb  -I/mnt/clfs/sources/busybox-1.3.2/libbb -include 
include/autoconf.h -D_GNU_SOURCE -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D"BB_VER=KBUILD_STR(1.3.2)" -DBB_BT=AUTOCONF_TIMESTAMP  -Wall -Wstrict-prototypes -Wshadow -Werror -Wundef -funsigned-char -fno-builtin-strlen -finline-limit=0 -static-libgcc -Os -falign-functions=1 -falign-jumps=1 -falign-loops=1 -fomit-frame-pointer -ffunction-sections -fdata-sections -march=i386 -mpreferred-stack-boundary=2 -Wdeclaration-after-statement -Wno-pointer-sign -m32   -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(ether_wake)"  -D"KBUILD_MODNAME=KBUILD_STR(ether_wake)" -c -o 
networking/ether-wake.o networking/ether-wake.c
networking/ether-wake.c:227:3: error: #warning Need to implement 
ether_hostton() for uClibc
make[1]: *** [networking/ether-wake.o] Error 1
make: *** [networking] Error 2

I use `readelf -s' to find symbol `ether_hostton, it doesn't exist, however, 
it's availiable in glibc.

after I un-select CONFIG_ETHER_WAKEUP, I still get the following problem:

i686-pc-linux-uclibc-gcc -Wp,-MD,networking/libiproute/.iptunnel.o.d   -std=gnu99 -Iinclude -Ilibbb  -I/mnt/clfs/sources/busybox-1.4.0/libbb -include 
include/autoconf.h -D_GNU_SOURCE -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D"BB_VER=KBUILD_STR(1.4.0)" -DBB_BT=AUTOCONF_TIMESTAMP  -Wall -Wstrict-prototypes -Wshadow -Werror -Wundef -funsigned-char -fno-builtin-strlen -finline-limit=0 -static-libgcc -Os -falign-functions=1 -falign-jumps=1 -falign-loops=1 -fomit-frame-pointer -ffunction-sections -fdata-sections -march=i386 -mpreferred-stack-boundary=2 -Wdeclaration-after-statement -Wno-pointer-sign -m32   -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(iptunnel)"  -D"KBUILD_MODNAME=KBUILD_STR(iptunnel)" -c -o 
networking/libiproute/iptunnel.o networking/libiproute/iptunnel.c
In file included from /mnt/clfs/usr/include/linux/if_tunnel.h:4,
                 from networking/libiproute/iptunnel.c:33:
/mnt/clfs/usr/include/linux/if.h:119: error: redefinition of 'struct ifmap'
/mnt/clfs/usr/include/linux/if.h:155: error: redefinition of 'struct ifreq'
/mnt/clfs/usr/include/linux/if.h:205: error: redefinition of 'struct ifconf'
In file included from /mnt/clfs/usr/include/linux/if_tunnel.h:5,
                 from networking/libiproute/iptunnel.c:33:
/mnt/clfs/usr/include/linux/ip.h:84: error: redefinition of 'struct iphdr'
make[1]: *** [networking/libiproute/iptunnel.o] Error 1
make: *** [networking/libiproute] Error 2

and fixed (although straight) by:

--- busybox-1.4.0.orig/networking/libiproute/iptunnel.c 2007-01-20 
05:22:58.000000000 +0800
+++ busybox-1.4.0/networking/libiproute/iptunnel.c      2007-02-01 
22:41:34.000000000 +0800
@@ -21,15 +21,13 @@
 #include <string.h>
 #include <unistd.h>

-#include <netinet/ip.h>
-
-#include <net/if.h>
 #include <net/if_arp.h>

 #include <asm/types.h>
 #ifndef __constant_htons
 #define __constant_htons htons
 #endif
+#include <linux/if.h>
 #include <linux/if_tunnel.h>

 #include "rt_names.h"

I think maybe the 2.6.19.2 linux header is not a prefered version to build 
busybox.. any ideas? thanks!

-- 
Wang, Baojun                                        Lanzhou University
Distributed & Embedded System Lab              http://dslab.lzu.edu.cn
School of Information Science and Engeneering        wangbj at lzu.edu.cn
Tianshui South Road 222. Lanzhou 730000                     .P.R.China
Tel:+86-931-8912025                                Fax:+86-931-8912022
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070201/789809e8/attachment-0002.pgp 


More information about the busybox mailing list