Argh, sorry to resent - bounced from my other alias again.

--- On Fri, 6/1/12, Denys Vlasenko <[email protected]> wrote:

> From: Denys Vlasenko <[email protected]>
> Subject: Re: small patch to fix android ndk build of busybox
> To: [email protected]
> Date: Friday, 6 January, 2012, 15:27
> On Thu, Jan 5, 2012 at 7:52 PM, Dan
> Fandrich <[email protected]>
> 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
> > @@ -35,7 +35,9 @@ 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?


_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to