Fix weak handling with GCC 3.4+

Ulrich Drepper drepper@redhat.com
Fri Jan 3 22:35:00 GMT 2003


Andreas Jaeger wrote:
> As discussed yesterday, GCC 3.4 needs to be aware of weak symbols.
> I'm appending a patch that solves all problems I noticed.

The patch is partly OK and I've checked in the parts.  But the main part


> 	* include/libc-symbols.h (weak_extern): Use weak attribute instead
> 	of assembler so that GCC knows about it.

is broken.  The problem is this:

__thread int foo = 0;
extern __typeof (foo) foo __attribute ((weak));


__typeof() apparently does not include the __thread information.  I'd
call it a gcc bug.  This means:

a) we cannot use the new code unconditionally

b) gcc first has to be fixed before we can use a patch like this

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------



More information about the Libc-alpha mailing list