Bug#309193: at runtime, TLS does not work, but at compile time, __thread does not give an error
> "Jeroen N. Witmond" <jnw@xs4all.nl> writes:
>
>> Oops, my bad. In simplifying the testcase I removed an essential
>> part. In the new testcase (attached), the address of variable
>> 'local' is taken in the thread. Unfortunately, this does not remove
>> the problem. The testcase still exits with 2 instead of zero.
>
> It exits with 0 for me with binutils 2.15-5, gcc-3.3 3.3.5-13, and
> libc6 2.3.2.ds1-22. Can you try these versions?
$ dpkg -s [stripped]
Package: binutils
Version: 2.15-6 <== Note that mine is newer than yours.
Package: gcc-3.3
Version: 1:3.3.5-13
Package: libc6
Version: 2.3.2.ds1-22
$ uname -a
Linux DoornRoosje 2.4.26-1-386 #1 Tue Aug 24 13:31:19 JST 2004 i686 GNU/Linux
To make sure the test environment is correct I have created a Makefile
(attached). This gives the following output:
$ make clean&&make
rm tls-test tls-test.out
cc -lpthread tls-test.c -o tls-test
PATH=/usr/bin:/bin
LD_LIBRARY_PATH=
./tls-test;echo $? | tee tls-test.out
2
Jeroen.
#
PATH=/usr/bin:/bin
LD_LIBRARY_PATH=
LDFLAGS=-lpthread
all: tls-test.out
tls-test.out: tls-test
@echo "PATH=${PATH}"
@echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
./$<;echo $$? | tee $@
.PHONY: clean
clean:
-rm tls-test tls-test.out
Reply to: