Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 42400 - Cannot load shared libraries with thread local data
Summary: Cannot load shared libraries with thread local data
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-21 12:20 UTC by Bruno Fernandez-Ruiz
Modified: 2004-04-23 09:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Fernandez-Ruiz 2004-02-21 12:20:25 UTC
With gcc (GCC) 3.3.3 20040217 (Gentoo Linux 3.3.3, propolice-3.3-7), and kernel 2.6.3-gentoo-r1 it is not possible to load a shared library with TLS data.

Reproducible: Always
Steps to Reproduce:
1. Compile test.c (gcc test.c -shared -o libtest.so
int test() {
static __thread char *p;
;
return 0;
}
2. Save test.h
extern int test();
3. Compile testmain.c (gcc test.c testmain.c -o test)
#include "test.h"
int main ()
{
        test ();
}
4. Execute a.out (./a.out)
Actual Results:  
./a.out: error while loading shared libraries: libtest.so: cannot handle TLS data


Expected Results:  
No output and no error

Gentoo Base System version 1.4.3.13
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0,
2.6.3-gentoo-r1)
=================================================================
System uname: 2.6.3-gentoo-r1 i686 Intel(R) Pentium(R) 4 CPU 2.66GHz
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config
/usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://trumpetti.atm.tut.fi/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X apm arts avi berkdb bonobo cdr crypt cups encode esd foomaticdb gdbm gif
gnome gpm gtk gtk2 guile imlib java jpeg ldap libg++ libwww mad mikmod motif
mozilla mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png python
quicktime readline sdl slang spell ssl svga tcpd tetex truetype
video_cards_radeon x86 xml2 xmms xv zlib"
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-23 11:45:06 UTC
Hmm, tried to compile library with -fPIC?

Else try to remove '--without-__thread' from these lines, and remerge glibc:

--  484-485  --
        myconf="${myconf} --without-__thread \
                          --enable-add-ons=linuxthreads"
--
Comment 2 Bruno Fernandez-Ruiz 2004-04-23 09:19:14 UTC
Adding nptl to USE removes this problem after re-emerging glibc.