* [gentoo-user] Gcc complains about TLS and errno; I baffled
@ 2006-11-16 20:03 Kevin O'Gorman
2006-11-16 20:19 ` Alan McKinnon
0 siblings, 1 reply; 3+ messages in thread
From: Kevin O'Gorman @ 2006-11-16 20:03 UTC (permalink / raw
To: gentoo-user
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/bin/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?
++ kevin
--
Kevin O'Gorman, PhD
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-user] Gcc complains about TLS and errno; I baffled
2006-11-16 20:03 [gentoo-user] Gcc complains about TLS and errno; I baffled Kevin O'Gorman
@ 2006-11-16 20:19 ` Alan McKinnon
2006-11-16 23:26 ` Devon Miller
0 siblings, 1 reply; 3+ messages in thread
From: Alan McKinnon @ 2006-11-16 20:19 UTC (permalink / raw
To: gentoo-user
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-user] Gcc complains about TLS and errno; I baffled
2006-11-16 20:19 ` Alan McKinnon
@ 2006-11-16 23:26 ` Devon Miller
0 siblings, 0 replies; 3+ messages in thread
From: Devon Miller @ 2006-11-16 23:26 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2206 bytes --]
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 <alan@linuxholdings.co.za> 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
>
>
[-- Attachment #2: Type: text/html, Size: 2857 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-11-16 23:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-16 20:03 [gentoo-user] Gcc complains about TLS and errno; I baffled Kevin O'Gorman
2006-11-16 20:19 ` Alan McKinnon
2006-11-16 23:26 ` Devon Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox