[BusyBox] [BB-1.0pre5][Diet-CVS] Busybox vs. diet: multiple build failures

Samium Gromoff deepfire at sic-elvis.zel.ru
Thu Jan 15 14:23:10 UTC 2004


compiling the whole thing with glibc-2.3 headers/dietlibc using gcc-3.2.2:

diet /opt/elcore/bin/mipsel-linux-gcc -I./include -Wall -Wstrict-prototypes -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG     -c -o networking/hostname.o networking/hostname.c
diet /opt/elcore/bin/mipsel-linux-gcc -I./include -Wall -Wstrict-prototypes -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG     -c -o networking/ifconfig.o networking/ifconfig.c
networking/ifconfig.c: In function `ifconfig_main':
networking/ifconfig.c:494: `caddr_t' undeclared (first use in this function)
networking/ifconfig.c:494: (Each undeclared identifier is reported only once
networking/ifconfig.c:494: for each function it appears in.)
networking/ifconfig.c:494: parse error before ')' token
networking/ifconfig.c:494: parse error before "i"
make: *** [networking/ifconfig.o] Error 1
deepfire at canopus:~/runtime/busybox-1.00-pre5$  

ok, looking at glibc headers and defining caddr_t to char * in ifconfig.c...

diet /opt/elcore/bin/mipsel-linux-gcc -I./include -Wall -Wstrict-prototypes -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG     -c -o networking/nslookup.o networking/nslookup.c
networking/nslookup.c: In function `addr_fprint':
networking/nslookup.c:49: warning: `u_int8_t' is deprecated (declared at /opt/diet/include/sys/types.h:144)
networking/nslookup.c:50: warning: `u_int32_t' is deprecated (declared at /opt/diet/include/sys/types.h:146)
networking/nslookup.c:51: warning: `u_int32_t' is deprecated (declared at /opt/diet/include/sys/types.h:146)
networking/nslookup.c:51: warning: `u_int32_t' is deprecated (declared at /opt/diet/include/sys/types.h:146)
networking/nslookup.c: At top level:
networking/nslookup.c:108: warning: `u_int32_t' is deprecated (declared at /opt/diet/include/sys/types.h:146)
networking/nslookup.c: In function `str_to_addr':
networking/nslookup.c:109: warning: `u_int32_t' is deprecated (declared at /opt/diet/include/sys/types.h:146)
networking/nslookup.c:110: warning: `u_int32_t' is deprecated (declared at /opt/diet/include/sys/types.h:146)
networking/nslookup.c: In function `server_print':
networking/nslookup.c:134: invalid initializer
make: *** [networking/nslookup.o] Error 1
deepfire at canopus:~/runtime/busybox-1.00-pre5$

hmm... the function in question just prints some potentially useful info, commenting out
its body...

diet /opt/elcore/bin/mipsel-linux-gcc -I./include -Wall -Wstrict-prototypes -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG     -c -o networking/ping.o networking/ping.c
networking/ping.c: In function `sendping':
networking/ping.c:223: dereferencing pointer to incomplete type
networking/ping.c:224: dereferencing pointer to incomplete type
networking/ping.c:225: dereferencing pointer to incomplete type
networking/ping.c:226: dereferencing pointer to incomplete type
networking/ping.c:227: dereferencing pointer to incomplete type
networking/ping.c:228: dereferencing pointer to incomplete type
networking/ping.c:228: dereferencing pointer to incomplete type
networking/ping.c:231: dereferencing pointer to incomplete type
networking/ping.c: In function `unpack':
networking/ping.c:292: dereferencing pointer to incomplete type
networking/ping.c:295: dereferencing pointer to incomplete type
networking/ping.c:297: dereferencing pointer to incomplete type
networking/ping.c:312: dereferencing pointer to incomplete type
networking/ping.c:312: dereferencing pointer to incomplete type
networking/ping.c:317: dereferencing pointer to incomplete type
networking/ping.c:317: dereferencing pointer to incomplete type
networking/ping.c:326: dereferencing pointer to incomplete type
networking/ping.c:333: dereferencing pointer to incomplete type
networking/ping.c:335: dereferencing pointer to incomplete type
networking/ping.c:335: dereferencing pointer to incomplete type
make: *** [networking/ping.o] Error 1
deepfire at canopus:~/runtime/busybox-1.00-pre5$  

apparently the definition is in /usr/include/netinet/ip_icmp.h, but...

#define __USE_BSD
#undef __NETINET_IP_ICMP_H

...doesn`t help. So what`s the problem? Nevermind, cut`n`paste...
(additionally defining u_char and icmp_ra_addr).


diet /opt/elcore/bin/mipsel-linux-gcc -I./include -Wall -Wstrict-prototypes -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG     -c -o shell/ash.o shell/ash.c
In file included from include/busybox.h:49,
                 from shell/ash.c:95:
include/libbb.h:299: warning: `struct sockaddr_in' declared inside parameter list
include/libbb.h:299: warning: its scope is only this definition or declaration, which is probably not what you want
include/libbb.h:301: warning: `struct sockaddr_in' declared inside parameter list
shell/ash.c: In function `onint':
shell/ash.c:2536: warning: implicit declaration of function `sigsetmask'
shell/ash.c: In function `evalcommand':
shell/ash.c:3266: warning: implicit declaration of function `dprintf'
shell/ash.c: In function `_rmescapes':
shell/ash.c:5844: warning: implicit declaration of function `mempcpy'
shell/ash.c:5844: warning: assignment makes pointer from integer without a cast
shell/ash.c: In function `stnputs':
shell/ash.c:8402: warning: assignment makes pointer from integer without a cast
shell/ash.c: In function `single_quote':
shell/ash.c:8481: warning: implicit declaration of function `strchrnul'
shell/ash.c:8481: invalid operands to binary -
shell/ash.c:8486: warning: assignment makes pointer from integer without a cast
shell/ash.c:8499: warning: assignment makes pointer from integer without a cast
shell/ash.c: In function `setvar':
shell/ash.c:11950: warning: assignment makes pointer from integer without a cast
shell/ash.c:11961: warning: assignment makes pointer from integer without a cast
shell/ash.c:11965: warning: assignment makes pointer from integer without a cast
shell/ash.c: In function `setvareq':
shell/ash.c:11993: invalid operands to binary -
shell/ash.c:12000: warning: passing arg 1 of pointer to function makes pointer from integer without a cast
shell/ash.c: In function `lookupvar':
shell/ash.c:12051: warning: return makes pointer from integer without a cast
shell/ash.c: In function `bltinlookup':
shell/ash.c:12068: warning: return makes pointer from integer without a cast
shell/ash.c: In function `showvars':
shell/ash.c:12129: warning: assignment makes pointer from integer without a cast
shell/ash.c: In function `poplocalvars':
shell/ash.c:12264: warning: passing arg 1 of pointer to function makes pointer from integer without a cast
make: *** [shell/ash.o] Error 1
deepfire at canopus:~/runtime/busybox-1.00-pre5$  

casting the offenders to char *...


diet /opt/elcore/bin/mipsel-linux-gcc -I./include -Wall -Wstrict-prototypes -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG     -c -o libbb/dump.o libbb/dump.c
In file included from libbb/dump.c:28:
include/libbb.h:299: warning: `struct sockaddr_in' declared inside parameter list
include/libbb.h:299: warning: its scope is only this definition or declaration, which is probably not what you want
include/libbb.h:301: warning: `struct sockaddr_in' declared inside parameter list
libbb/dump.c:366: parse error before '*' token
libbb/dump.c:367: warning: return type defaults to `int'
libbb/dump.c: In function `get':
libbb/dump.c:369: syntax error before '*' token
libbb/dump.c:372: `u_char' undeclared (first use in this function)
libbb/dump.c:372: (Each undeclared identifier is reported only once
libbb/dump.c:372: for each function it appears in.)
libbb/dump.c:372: `tmpp' undeclared (first use in this function)
libbb/dump.c:374: `curp' undeclared (first use in this function)
libbb/dump.c:376: parse error before ')' token
libbb/dump.c:377: `savp' undeclared (first use in this function)
libbb/dump.c:377: parse error before ')' token
libbb/dump.c:392: parse error before ')' token
libbb/dump.c:394: warning: implicit declaration of function `bcmp'
libbb/dump.c:398: parse error before ')' token
libbb/dump.c:400: warning: implicit declaration of function `bzero'
libbb/dump.c: At top level:
libbb/dump.c:465: parse error before "u_char"
libbb/dump.c:466: warning: function declaration isn't a prototype
libbb/dump.c: In function `conv_c':
libbb/dump.c:471: `p' undeclared (first use in this function)
libbb/dump.c:479: `pr' undeclared (first use in this function)
libbb/dump.c: At top level:
libbb/dump.c:490: parse error before "u_char"
libbb/dump.c:491: warning: function declaration isn't a prototype
libbb/dump.c: In function `conv_u':
libbb/dump.c:499: `p' undeclared (first use in this function)
libbb/dump.c:500: `pr' undeclared (first use in this function)
libbb/dump.c: In function `display':
libbb/dump.c:521: syntax error before '*' token
libbb/dump.c:524: `u_char' undeclared (first use in this function)
libbb/dump.c:524: parse error before "savech"
libbb/dump.c:526: `bp' undeclared (first use in this function)
libbb/dump.c:527: `savebp' undeclared (first use in this function)
libbb/dump.c:527: warning: left-hand operand of comma expression has no effect
libbb/dump.c:528: warning: left-hand operand of comma expression has no effect
libbb/dump.c:535: warning: left-hand operand of comma expression has no effect
libbb/dump.c:541: `savech' undeclared (first use in this function)
libbb/dump.c:564: warning: implicit declaration of function `bcopy'
libbb/dump.c:610: `u_int' undeclared (first use in this function)
libbb/dump.c:610: parse error before "ival"
libbb/dump.c:611: `u_short' undeclared (first use in this function)
libbb/dump.c:618: `sval' undeclared (first use in this function)
libbb/dump.c:620: parse error before "sval"
libbb/dump.c:623: `ival' undeclared (first use in this function)
make: *** [libbb/dump.o] Error 1
deepfire at canopus:~/runtime/busybox-1.00-pre5$  

defining u_{char.short,int} to u_int{8,16,32}_t...


diet /opt/elcore/bin/mipsel-linux-gcc -I../include -Wall -Wstrict-prototypes -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG     -DL_bb_vfprintf -c ../libbb/printf.c -o ../libbb/bb_vfprintf.o
In file included from ../libbb/printf.c:47:
../include/libbb.h:299: warning: `struct sockaddr_in' declared inside parameter list
../include/libbb.h:299: warning: its scope is only this definition or declaration, which is probably not what you want
../include/libbb.h:301: warning: `struct sockaddr_in' declared inside parameter list
../libbb/printf.c:119:2: #error dietlibc is currently not supported. Please see the commented source.
../libbb/printf.c: In function `bb_vfprintf':
../libbb/printf.c:136: warning: implicit declaration of function `SET_FERROR_UNLOCKED'
make: *** [../libbb/bb_vfprintf.o] Error 1

Nice. Killing the #error...

That led me to th final linking stage.

The missing symbols are:

daemon
dprintf
mempcpy
sigsetmask
stpcpy
strchrnul
syscall

_and_ i was unable to find a useful __stdio_file definition to form a
meaningful SET_FERROR_UNLOCKED() macro for busybox.

regards, Samium Gromoff





More information about the busybox mailing list