svn commit: trunk/uClibc/include

Mike Frysinger vapier at gentoo.org
Mon Nov 28 06:37:55 UTC 2005


On Sun, Nov 27, 2005 at 11:50:05PM +0100, Peter S. Mazinger wrote:
> On Sun, 27 Nov 2005, Mike Frysinger wrote:
> 
> > On Sat, Nov 26, 2005 at 05:35:53PM -0800, psm at uclibc.org wrote:
> > > Log:
> > > headers patched w/ sed -i 's:extern int errno:#include <errno.h>' linux/unistd.h fail here
> > > 
> > > --- trunk/uClibc/include/ssp-internal.h	2005-11-27 01:20:58 UTC (rev 12542)
> > > +++ trunk/uClibc/include/ssp-internal.h	2005-11-27 01:35:52 UTC (rev 12543)
> > > @@ -21,6 +21,10 @@
> > >  #include <signal.h>
> > >  #include <linux/unistd.h>
> > >  
> > > +#ifndef errno
> > > +extern int errno;
> > > +#endif
> > > +
> > 
> > uhh, what ?  doing 'extern int errno' will never work with TLS
> 
> can't tell you what TLS will do, but the gentoo unistd.h patch to 
> linux-headers (2.4.26-r1) killed the uClibc build.
> Probably it will fail everywhere, when kernel syscalls are used.

why dont you try being more specific, ive never had a problem building
uClibc with our patched headers.

you cannot assume that errno is an external int because when you start
using Thread Local Storage of errno, it loses all meaning (and will in
glibc certainly cause your program to abort running if you can link it
at all in the first place)

the errno.h header takes care of the errno details, end of story.  you
should never pollute the headers with things like 'extern int errno'.
-mike



More information about the uClibc mailing list