!(fun) with tls

Colin Paul Gloster Colin_Paul_Gloster@ACM.org
Fri Jun 2 16:49:00 GMT 2006


On Fri, 2 Jun 2006 10:36:29 -0500, NZG emailed:

"[..]

[..] attempt to link against it: with
gcc-3.4.3-glibc-2.3.2/i386-unknown-linux-gnu/bin/i386-unknown-linux-gnu-gcc
*.o -Wl -Llib/dynamic -o hello -lc-2.3.2

no dice:
lib/dynamic/libc-2.3.2.so: undefined reference to
`_dl_tls_symaddr@GLIBC_PRIVATE'

Shouldn't this work? I see a tls in there (hence the title of the email) 
do
I
need to build with tls?"

I do not know. Also, do you know for sure whether _dl_tls_symaddr is 
connected to thread-local storage or is a symbol for something completely 
different which might also be abbreviated as tls?

"[..]

[..]
More importantly, the cross compiler can't link against the pthreads 
library
of this version
libpthread-0.10.so

Attempting to do so yields:

gcc-3.4.3-glibc-2.3.2/i386-unknown-linux-gnu/bin/i386-unknown-linux-gnu-gcc
modreg.o -Wl -Llib/dynamic ../../lib/static/libmodbus.a -o
modreg -lpthread-0.10
lib/dynamic/libpthread-0.10.so: undefined reference to
`__libc_fork@GLIBC_2.1.2'"

Some things you could try are compiling the pthreads library or another 
version of GNU LibC.

"[..]

I thought, ok, maybe it's a tls thing, so I tried to build a tls
cross-compiler:
eval `cat i386.dat gcc-4.0.2-glibc-2.3.2-tls.dat` sh all.sh --notest

but the build crashes with [..] errors [..]"

Even when compiling a native GCC with a native GCC without crosstool, not 
all versions of GCC >= 2.95 work, no matter what is written in GCC's 
documentation so perhaps you might try one of the other 
gcc-.+-glibc-.+-tls.dat files.

If that does not work and nothing else does, and if you somehow determine 
for certain that _dl_tls_symaddr@GLIBC_PRIVATE is definitely unused -- 
which we have no good reason to suspect, but it is not uncommon for a few 
symbols which are linked in to be unused, e.g. a program which might only 
use a sine function is likely to have a cosine symbol and other 
mathematical symbols linked in anyway -- you could create a dummy symbol 
_dl_tls_symaddr@GLIBC_PRIVATE but I would not recommend this.

On Fri, 2 Jun 2006 11:04:12 -0500, NZG emailed:

"[..]

[..]
But how can I use other libraries, like pthreads and libm with this?"

You may unfortunately have to try a lot of approaches for compatibility. 
It could easily get to the stage that you may need to recompile almost 
everything installed on the target in which case it may be simpler to 
simply remove everything on the target and replace its operating system 
with one for which you do have a satisfactory cross development 
environment.


--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list