7 Jan 2012 17:59
Re: small patch to fix android ndk build of busybox
Hin-Tak Leung <htl10 <at> users.sourceforge.net>
2012-01-07 16:59:57 GMT
2012-01-07 16:59:57 GMT
Argh, sorry to resent - bounced from my other alias again.
--- On Fri, 6/1/12, Denys Vlasenko <vda.linux <at> googlemail.com> wrote:
> From: Denys Vlasenko <vda.linux <at> googlemail.com>
> Subject: Re: small patch to fix android ndk build of busybox
> To: busybox <at> busybox.net
> Date: Friday, 6 January, 2012, 15:27
> On Thu, Jan 5, 2012 at 7:52 PM, Dan
> Fandrich <dan <at> coneharvesters.com>
> wrote:
> > On Thu, Jan 05, 2012 at 03:06:06PM +0000, Hin-Tak
> Leung wrote:
> >> The error message was in the change-log, included
> in the patch:
> >>
> >> ---------
> >> libbb/lib.a(change_identity.o): In function
> `change_identity':
> >>
> change_identity.c:(.text.change_identity+0x28): undefined
> reference to `endgrent'
> >> collect2: ld returned 1 exit status
> >> make: *** [busybox_unstripped] Error 1
> >> ---------
> >>
> >> Maybe the problem is in libbb/change_identity.c ?
> >
> > I've been getting the same problem lately. I worked
> around it locally with
> > this patch:
> >
> > --- a/libbb/change_identity.c
> > +++ b/libbb/change_identity.c
> > <at> <at> -35,7 +35,9 <at> <at> void FAST_FUNC change_identity(const
> struct passwd *pw)
> > {
> > if (initgroups(pw->pw_name,
> pw->pw_gid) == -1)
> > bb_perror_msg_and_die("can't
> set groups");
> > +#ifndef __ANDROID__
> > endgrent(); /* helps to close a fd used
> internally by libc */
> > +#endif
> > xsetgid(pw->pw_gid);
> > xsetuid(pw->pw_uid);
> > }
> >
> > but it seemed a bit inelegant to me. But, that that
> line seems to have been
> > added to work around a specific libc issue, maybe it's
> not to ugly to
> > remove it on libcs that don't have that issue.
>
> How about this fix?
>
> http://git.busybox.net/busybox/commit/?id=6b64a269766ace40c56826738de446537add37de
No, cannot be a macro. Probably need a proper no-op function?
====================================
$ make
SPLIT include/autoconf.h -> include/config/*
GEN include/bbconfigopts.h
HOSTCC applets/usage
GEN include/usage_compressed.h
HOSTCC applets/applet_tables
GEN include/applet_tables.h
CC applets/applets.o
In file included from include/libbb.h:83,
from include/busybox.h:8,
from applets/applets.c:9:
../sysroot/usr/include/pwd.h:116:19: error: macro "endpwent" passed 1 arguments, but takes just 0
==========================
The android system header prototypes it as
"void endpwent(void);"
That seems to suggest that endpwent() exists in bionic. The same header has
"setpwent(void);" defined out and removed with a comment "#if 0 /* MISSING FROM BIONIC */".
So either it is a bug with android's header, or it needs to be a proper no-op function?
RSS Feed