[Bug 2089] errno not threadsafe

bugzilla at busybox.net bugzilla at busybox.net
Mon Jul 5 21:02:37 UTC 2010


https://bugs.busybox.net/show_bug.cgi?id=2089

--- Comment #7 from Khem Raj <raj.khem at gmail.com>  ---
(In reply to comment #6)
> (In reply to comment #5)
> > For this problem I found a fix here:
> > 
> > http://github.com/mat-c/uClibc/commits/master_fixes
> > 
> > Look for "don't hide __errno_location and __h_errno_location".
> > 
> > I'm not sure if the fix is correct but actually it works for 0.9.31 on ARM.
> 
> It works as well here, thanks.
> 
> It does seem correct to me, as we WANT __errno_location / __h_errno_location to
> be weak and overridable, so the linuxthread version is used instead when using
> -pthread.

the problem is that we should not genetate __GI__* symbols when generating non
PIC
.a file currently there are refrences to these __GI symbols in libc so when you
link
statically then the references in libc get resolved to libc's __GI_ errno
symbols

unhiding these symbols as patch does may not be the right solution. think of
shared
objects it will have undefined behavior when both libc and libpthread are
loaded.
it will depend on load order which one is chosen

I think there is need to clean up the build for pic and non pic build of libc.a
look into this area

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the uClibc-cvs mailing list