[Bug 2089] errno not threadsafe

bugzilla at busybox.net bugzilla at busybox.net
Mon Jul 5 23:38:44 UTC 2010


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

--- Comment #9 from Khem Raj <raj.khem at gmail.com>  ---
(In reply to comment #8)
> (In reply to comment #7)
> 
> > 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
> 
> Hmm, isn't this exactly like how we do it for malloc/free? 

yes but lpthread and lc are also controlled by gcc compiler driver and
gcc -pthread will break. Essentially it should not depend on the link order
when doing shared linking thats why weak symbols.

I don't see any
> references to __GI_malloc or __GI__errno_location when I like statically?
> 

yeah because they are not declared with hidden_proto and hidden_def

> > 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
> 
> Also when the libc version is marked as weak? I haven't seen that issue. Libc
> gets added very early to the linker, so the libpthread version seems to always
> override it.
> 
> > I think there is need to clean up the build for pic and non pic build of libc.a
> > look into this area
> 
> So what exactly do you suggest?

We need to say that when compiling static libc.a then dont use this
hidden_proto and hidden_def because it does not matter in that case.

but when compiling PIC version then we use it.

-- 
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