This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55800] Link failure with thread_local in unnamed namespace
- From: "linedot at xcpp dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 30 Jan 2014 15:42:12 +0000
- Subject: [Bug c++/55800] Link failure with thread_local in unnamed namespace
- Auto-submitted: auto-generated
- References: <bug-55800-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55800
--- Comment #4 from linedot at xcpp dot org ---
The code from comment 2 still doesn't work with GCC 4.8.2
=========================================================================
gcc -v:
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include/g++-v4
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 4.8.2 p1.3, pie-0.5.8' --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj
--enable-libgomp --enable-libmudflap --disable-libssp --enable-lto --with-cloog
--disable-isl-version-check
Thread model: posix
gcc version 4.8.2 (Gentoo 4.8.2 p1.3, pie-0.5.8)
=========================================================================
output of compiling code from Comment 2:
g++ -std=c++11 main.cpp xyz.cpp
/tmp/cccXvzux.o: In function `TLS wrapper function for xyz::bla':
main.cpp:(.text._ZTWN3xyz3blaE[_ZTWN3xyz3blaE]+0x5): undefined reference to
`TLS init function for xyz::bla'
collect2: error: ld returned 1 exit status
=========================================================================