errno definition broken in non-threaded code

Jim Blandy jimb at codesourcery.com
Thu Sep 28 18:28:35 UTC 2006


Mike Frysinger <vapier at gentoo.org> writes:
> On Tuesday 26 September 2006 14:49, Jim Blandy wrote:
>> At the moment, in non-threaded configurations, uClibc's own <errno.h>
>> says "extern int errno;"
>
> i guess i missed this part ... when i did my testing, it was against my 
> standard configs which means threading was enabled ...
>
> so you're building uClibc with pthread support completely disabled eh ?  
> wonder if it'd be useful to not even export the errno symbol when pthreads 
> are disabled ...

Yes; we've been testing against non-threaded, linuxthreads.old, and
NPTL configurations.

As I understand it, if you're going to refer to errno via a hidden
symbol within libc itself, you definitely should not provide a symbol
for the variable visible outside the library as well.  If user code
ever refers to the non-hidden symbol, the linker will make a copy of
the variable in the executable, and then emit a COPY reloc that won't
work.  So it can't do anything but lose.



More information about the uClibc mailing list