Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 120720 - gcc-4.1.0-beta20060127 undefined reference to `___tls_get_addr' on nptlonly system
Summary: gcc-4.1.0-beta20060127 undefined reference to `___tls_get_addr' on nptlonly s...
Status: VERIFIED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/bugzilla/show_bug....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-28 06:22 UTC by Hanno Zysik (geki)
Modified: 2006-01-29 11:23 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 Hanno Zysik (geki) 2006-01-28 06:22:00 UTC
On a Gentoo system where glibc is compiled with USE="nptl ntplonly" gcc should not use tls functions.

gcc tests binutils for tls support and then adds its tls functions (or not). I do not know why binutils got tls support if glibc was compiled with given useflags.

In that gcc bugreport they added a --enable-tls configure switch to gcc.

To solve this in Gentoo I would say to add a nptl or nptlonly useflag for gcc. Then in function gcc_do_configure of toolchain.eclass add a check for nptl to set --disable-tls.

Error:

Making: ../unxlngi6.pro/lib/libstore.so.3
g++ -Wl,-z,combreloc -Wl,-z,defs -Wl,-rpath,'$ORIGIN' "-Wl,-hlibstore.so.3" -shared -Wl,-O1 -Wl,--version-script ../unxlngi6.pro/misc/store_store.map -L../unxlngi6.pro/lib -L../lib -L/var/tmp/portage/openoffice-680.153.0/work/ooo-build/build/src680-m153/solenv/unxlngi6/lib -L/var/tmp/portage/openoffice-680.153.0/work/ooo-build/build/src680-m153/solver/680/unxlngi6.pro/lib -L/var/tmp/portage/openoffice-680.153.0/work/ooo-build/build/src680-m153/solenv/unxlngi6/lib -L/usr/lib -L/usr/jre/lib/i386 -L/usr/jre/lib/i386/client -L/usr/jre/lib/i386/native_threads -L/usr/lib -L/usr/X11R6/lib -L/usr/lib/mozilla-firefox ../unxlngi6.pro/slo/store_version.o ../unxlngi6.pro/slo/store_description.o -o ../unxlngi6.pro/lib/libstore.so.3 ../unxlngi6.pro/slo/object.o ../unxlngi6.pro/slo/memlckb.o ../unxlngi6.pro/slo/filelckb.o ../unxlngi6.pro/slo/storbase.o ../unxlngi6.pro/slo/storcach.o ../unxlngi6.pro/slo/stordata.o ../unxlngi6.pro/slo/storlckb.o ../unxlngi6.pro/slo/stortree.o ../unxlngi6.pro/slo/storpage.o ../unxlngi6.pro/slo/store.o -luno_sal -lsupc++ -lgcc_s -ldl -lpthread -lm
/usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20060127/libsupc++.a(eh_globals.o): In function `__gnu_internal::get_global()':eh_globals.cc:(.text._ZN14__gnu_internal10get_globalEv+0x17): undefined reference to `___tls_get_addr'
collect2: ld gab 1 als Ende-Status zur
Comment 1 Hanno Zysik (geki) 2006-01-28 06:22:00 UTC
On a Gentoo system where glibc is compiled with USE="nptl ntplonly" gcc should not use tls functions.

gcc tests binutils for tls support and then adds its tls functions (or not). I do not know why binutils got tls support if glibc was compiled with given useflags.

In that gcc bugreport they added a --enable-tls configure switch to gcc.

To solve this in Gentoo I would say to add a nptl or nptlonly useflag for gcc. Then in function gcc_do_configure of toolchain.eclass add a check for nptl to set --disable-tls.

Error:

Making: ../unxlngi6.pro/lib/libstore.so.3
g++ -Wl,-z,combreloc -Wl,-z,defs -Wl,-rpath,'$ORIGIN' "-Wl,-hlibstore.so.3" -shared -Wl,-O1 -Wl,--version-script ../unxlngi6.pro/misc/store_store.map -L../unxlngi6.pro/lib -L../lib -L/var/tmp/portage/openoffice-680.153.0/work/ooo-build/build/src680-m153/solenv/unxlngi6/lib -L/var/tmp/portage/openoffice-680.153.0/work/ooo-build/build/src680-m153/solver/680/unxlngi6.pro/lib -L/var/tmp/portage/openoffice-680.153.0/work/ooo-build/build/src680-m153/solenv/unxlngi6/lib -L/usr/lib -L/usr/jre/lib/i386 -L/usr/jre/lib/i386/client -L/usr/jre/lib/i386/native_threads -L/usr/lib -L/usr/X11R6/lib -L/usr/lib/mozilla-firefox ../unxlngi6.pro/slo/store_version.o ../unxlngi6.pro/slo/store_description.o -o ../unxlngi6.pro/lib/libstore.so.3 ../unxlngi6.pro/slo/object.o ../unxlngi6.pro/slo/memlckb.o ../unxlngi6.pro/slo/filelckb.o ../unxlngi6.pro/slo/storbase.o ../unxlngi6.pro/slo/storcach.o ../unxlngi6.pro/slo/stordata.o ../unxlngi6.pro/slo/storlckb.o ../unxlngi6.pro/slo/stortree.o ../unxlngi6.pro/slo/storpage.o ../unxlngi6.pro/slo/store.o -luno_sal -lsupc++ -lgcc_s -ldl -lpthread -lm
/usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20060127/libsupc++.a(eh_globals.o): In function `__gnu_internal::get_global()':eh_globals.cc:(.text._ZN14__gnu_internal10get_globalEv+0x17): undefined reference to `___tls_get_addr'
collect2: ld gab 1 als Ende-Status zurück
dmake:  Error code 1, while making '../unxlngi6.pro/lib/libstore.so.3'


nb ~ # emerge info
Portage 2.1_pre4 (default-linux/x86/2005.1, gcc-4.1.0-beta20060127, glibc-2.3.6-r2, 2.6.15-gentoo i686)
=================================================================
System uname: 2.6.15-gentoo i686 Intel(R) Pentium(R) M processor 1.60GHz
Gentoo Base System version 1.12.0_pre15
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.91.0.5
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r4
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://gentoo.inode.at/ ftp://gentoo.inode.at/source/"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LINGUAS="de ca"
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 acpi alsa berkdb cairo cdr cups dvd dvdr dvdread firefox gcj gif gnome gtk2 java jpeg mmx mmxext nls pam png readline sse sse2 ssl tiff unicode usb utf8 x86 xml2 zlib elibc_glibc input_devices_evdev input_devices_keyboard input_devices_mouse input_devices_synaptics kernel_linux linguas_de linguas_ca userland_GNU video_cards_ati"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LDFLAGS
Comment 2 SpanKY gentoo-dev 2006-01-28 23:40:59 UTC
nptl and tls may be related, but making tls support depend on the nptl USE flag is wrong
Comment 3 Hanno Zysik (geki) 2006-01-29 02:14:13 UTC
To depend on nptl useflag is wrong. I thought in that after commiting.

But sure you know a good way to disable tls feature for gcc-4.1 on nptlonly systems.
Comment 4 SpanKY gentoo-dev 2006-01-29 03:29:29 UTC
i dont think you understand tls ... tls is *required* in order for nptl to work

the gcc report says this error only comes up when you have a binutils which supports tls but a glibc which does not
Comment 5 Hanno Zysik (geki) 2006-01-29 04:18:15 UTC
That surely I do not understand.

I use plain sys-libs/glibc-2.3.6-r2.
It has --with-tls on configure.

How operates my system with a nptlonly glibc without tls then?
What should be there after merge to have tls support in glibc?
Do I need /usr/lib/tls/* files?
Comment 6 SpanKY gentoo-dev 2006-01-29 06:16:25 UTC
the tls subdir only exists when using both linuxthreads and nptl

libstdc++.so requires libc.so which requires ld-linux.so which provides the ___tls_get_addr symbol

$ readelf -s /lib/ld-linux.so.2 | grep tls_get_addr
    16: 0000dc80    13 FUNC    GLOBAL DEFAULT    9 __tls_get_addr@@GLIBC_2.3
    31: 0000e470   924 FUNC    GLOBAL DEFAULT    9 ___tls_get_addr@@GLIBC_2.3
   424: 0000e470   924 FUNC    LOCAL  HIDDEN    9 ___tls_get_addr_internal
   479: 0000dc80    13 FUNC    GLOBAL DEFAULT    9 __tls_get_addr
   494: 0000e470   924 FUNC    GLOBAL DEFAULT    9 ___tls_get_addr
Comment 7 Hanno Zysik (geki) 2006-01-29 11:23:14 UTC
Ok. I found issue in OOo.
Sorry for noise.
Comment 8 Hanno Zysik (geki) 2006-01-29 11:23:47 UTC
closing...