problem of compiling busybox1.4.2

Denis Vlasenko vda.linux at googlemail.com
Sat Mar 24 14:19:23 UTC 2007


On Friday 23 March 2007 13:20, 卢荣军 wrote:
>    compile toolchains:
>    target: ARM
>    binutils-2.17 gcc-4.1.1-c-c++ newlib-1.14.0 (from GNU ARM,www.gnuarm.org)
>    host runs FEDORA 6
> PROBLEM:
> $ make ARCH=arm CROSS_COMPILE=arm-elf-
>   HOSTCC  scripts/basic/fixdep
>   HOSTCC  scripts/basic/split-include
>   HOSTCC  scripts/basic/docproc
>   SPLIT   include/autoconf.h -> include/config/*
>   GEN     include/bbconfigopts.h
>   HOSTCC  applets/usage
> In file included from applets/../include/libbb.h:53,
>                  from applets/../include/busybox.h:10,
>                  from applets/usage.c:5:
> applets/../include/grp_.h:44: error: conflicting types for 'setgroups'
> /usr/include/sys/unistd.h:129: error: previous declaration of 'setgroups' was here
> applets/../include/grp_.h:44: error: conflicting types for 'setgroups'
> /usr/include/sys/unistd.h:129: error: previous declaration of 'setgroups' was here
> In file included from applets/../include/busybox.h:10,
>                  from applets/usage.c:5:
> applets/../include/libbb.h:298: error: field `sin6' has incomplete type
> make[1]: *** [applets/usage] Error 1
> make: *** [applets] Error 2
>  
> Can anyone give some suggestion? Thanks.

newlib's <unistd.h> apparently pulls in setgroups(), whereas in glibc
<grp.h> is doing this.

Therefore this code:

#if !ENABLE_USE_BB_PWD_GRP
#include <grp.h>
#else
...
extern int setgroups(size_t __n, __const gid_t *__groups);

works with glibc but fails with newlib.

Can you find out what is the difference between newlib's and our setgroups()
prototypes? (probably newlib doesn't have "const"...)
--
vda



More information about the busybox mailing list