[patch] For BZ #17328, mark __errno_location with __attribute__((returns_nonnull)) for gcc >=4.9.0

Mike Frysinger vapier@gentoo.org
Tue Mar 3 05:07:00 GMT 2015


On 02 Mar 2015 17:39, Rich Felker wrote:
> On Mon, Mar 02, 2015 at 05:23:58PM -0500, Zack Weinberg wrote:
> > .... so I gotta wonder if it mightn't be a better use of people's time
> > to make errno a proper thread-local variable instead.  What's blocking
> > that?
> 
> I seem to recall there was some issue with buggy programs having
> conflicting symbol definitions of errno as a non-TLS symbol. But I
> don't see why something like the following wouldn't work:
> 
> extern __thread int __errno_tls;
> #define errno __errno_tls

this problem already came & went.  when glibc was rolling out tls support and 
started marking errno as such, there were packages that failed like so:

/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/../../../../i686-pc-linux-gnu/bin/ld: 
errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in libqemu.a(helper2.o)

and they've all been fixed since -- we migrated packages to errno.h instead of 
open coding their own extern.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150303/0c8979f6/attachment.sig>


More information about the Libc-alpha mailing list