In this case, TLS stands for Thread Local Storage. Not to be confused with
Transport Layer Security

Welcome to the joy of overloaded acronyms :-P

Using "int errno;" will not work in any multithreaded executable.

You need to use errno via errno.h because errno isn't a simple int, but a
dereferenced pointer to a per-thread instance (in thread local storage) of
an int. That's there so that each thread gets its own private errno variable
for error reporting. Otherwise, errno would be the value of the last system
call on any thread, not necessarily the one that's trying to check errno.

The error is indicating (albeit badly) that the program's definition of
errno clashes with the TLS definition of errno.

dcm

On 11/16/06, Alan McKinnon <[EMAIL PROTECTED]> wrote:

On Thursday 16 November 2006 22:03, Kevin O'Gorman wrote:
> I'm trying to compile a program that works on Solaris with gcc, but
> won't complile
> under Linux (either FC5 or Gentoo).  It seems to be because writing
>     int errno;
> works under Solaris gcc-3.4.3 (well, it passes the compiler anyway),
> but under Linux
> gcc-3.4.6 or -4.1.0 one has to
>     #include <errno.h>
> which makes more sense.  I would just make the change, but I'm
> baffled by the error message Linux gcc gives to the first
> declaration.  It reads:
>
> /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/bi
>n/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches
> non-TLS reference in /tmp/cc6urgct.o
> /lib/libc.so.6: could not read symbols: Bad value
>
> But when I try to look up TLS, all I get is a bunch of stuff about a
> server-to-server
> email security protocol.  What is it talking about here, and where
> can I find out about it?

It would appear to be a an issue between linuxthreads and nptl. How are
your nptl and nptlonly USE flasg set?

This post that I find on google may start to give you more answers. It's
for a completely different package but the problem and solution seesmto
be the same as yours:

http://www.rockbox.org/mail/archive/rockbox-dev-archive-2006-01/0020.shtml

alan
--
gentoo-user@gentoo.org mailing list


Reply via email to