bison and m4 with uclibs linuxthreads (new): error: field '_sp' has incomplete type

Khem Raj raj.khem at gmail.com
Tue Oct 26 06:51:29 UTC 2010


On (23/10/10 14:57), Rob Landley wrote:
> On Tuesday 30 March 2010 06:11:44 Michael Deutschmann wrote:
> > On Tue, 30 Mar 2010, Natanael Copa wrote:
> > > and with m4-1.4.14 i get this:
> > >
> > > In file included from pipe.c:48:
> > > ./spawn.h:112: error: field '_sp' has incomplete type
> > > make[3]: *** [pipe.o] Error 1
> >
> > This sounds like a problem I've had on my own system, which is
> > threadless.  So linuxthreads has nothing to do with it.
> >
> > My local patch to m4, supressing the bug, is appended.  The comment next
> > to the conditional I've spiked makes it clear what is going on.
> > Apparently, glibc's headers expose the full definition of "struct
> > sched_param" in cases not required by the standard, and gnulib attempts to
> > optimize based on this. uClibc does not share glibc's behavior in this one
> > case, but since it defines __GLIBC__, gnulib sees no need for caution.
> 
> That's not actually the problem, although your workaround does work.  (So does 
> using struct __sched_param instead of struct sched_param for the _sp definition 
> in the struct.)
> 
> But the actual problem is that uClibc hasn't got posix_spawn(), thus no 
> /usr/include/spawn.h.  In m4's lib/spawn.in.h:
> 
> >#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@
> >typedef struct
> >{
> >  short int _flags;
> >  pid_t _pgrp;
> >  sigset_t _sd;
> >  sigset_t _ss;
> >  struct sched_param _sp;
> >  int _policy;
> >  int __pad[16];
> >} posix_spawnattr_t;
> >#endif
> 
> ./configure sets HAVE_POSIX_SPAWNATTR_T to 1 for glibc, 0 for uClibc.  So this 
> chunk of code doesn't get sucked in for glibc (#if 0 || !1) because because 
> the struct is defined in /usr/include/spawn.h.  For uClibc (#if 0 || !0) it 
> gets sucked in, but never gets triggered due to the if # __GLIBC__ (making it 
> work for BSD).
> 
> So the fix is either:
> 
> 1) Don't claim to be glibc.
> 2) Provide posix_spawn() so it doesn't try to replace it.
> 3) Patch multiple upstream packages that have copied code from each other.
> 4) export CFLAGS=-Dsched_param=__sched_param
> 5) Tweak our bits/sched.h to always provide sched_param when it provides 
> __sched_param, which is what the upstream packages seem to expect.
> 
> I went with #5, using the attached patch to uClibc.

you should investigate why __need_schedparam is not defined in this case.

-Khem


More information about the uClibc mailing list