public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/54513] New: "undefined reference to `___tls_get_addr'" when linking .so with libstdc++.a
@ 2012-09-07  7:16 d.v.a at ngs dot ru
  2012-09-07  7:19 ` [Bug libstdc++/54513] " d.v.a at ngs dot ru
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: d.v.a at ngs dot ru @ 2012-09-07  7:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54513

             Bug #: 54513
           Summary: "undefined reference to `___tls_get_addr'" when
                    linking .so with libstdc++.a
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: d.v.a@ngs.ru
            Target: i686-pc-linux-gnu


Program:

#include<iostream>
void f() {}

Build command:

$ g++ -shared -static-libstdc++ -static-libgcc -Wl,-s -Wl,--no-undefined 1.cpp
/opt/gcc-4.7.1/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../libstdc++.a(future.o)(.gnu.linkonce.t._ZSt16__once_call_implISt12_Bind_simpleIFSt7_Mem_fnIMSt6threadFvvEESt17reference_wrapperIS2_EEEEvv+0x17):
In function `void std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void
(std::thread::*)()> ()(std::reference_wrapper<std::thread>)> >()':
/home/vdyachenko/work/gcc-4.7.1/i686-pc-linux-gnu/libstdc++-v3/include/mutex:787:
undefined reference to `___tls_get_addr'
/opt/gcc-4.7.1/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../libstdc++.a(future.o)(.gnu.linkonce.t._ZSt9call_onceIMSt6threadFvvEISt17reference_wrapperIS0_EEEvRSt9once_flagOT_DpOT0_+0x34):
In function
`_ZSt9call_onceIMSt6threadFvvEJSt17reference_wrapperIS0_EEEvRSt9once_flagOT_DpOT0_':
/home/vdyachenko/work/gcc-4.7.1/i686-pc-linux-gnu/libstdc++-v3/include/mutex:809:
undefined reference to `___tls_get_addr'
/opt/gcc-4.7.1/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../libstdc++.a(future.o)(.gnu.linkonce.t._ZSt9call_onceIMSt6threadFvvEISt17reference_wrapperIS0_EEEvRSt9once_flagOT_DpOT0_+0x45):/home/vdyachenko/work/gcc-4.7.1/i686-pc-linux-gnu/libstdc++-v3/include/mutex:810:
undefined reference to `___tls_get_addr'
/opt/gcc-4.7.1/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../libstdc++.a(mutex.o)(.text.__once_proxy+0x17):
In function `__once_proxy':
../../../.././libstdc++-v3/src/c++11/mutex.cc:90: undefined reference to
`___tls_get_addr'
/opt/gcc-4.7.1/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../libstdc++.a(eh_globals.o)(.text.__cxa_get_globals_fast+0x14):
In function `__cxa_get_globals_fast':
../../.././libstdc++-v3/libsupc++/eh_globals.cc:59: undefined reference to
`___tls_get_addr'
/opt/gcc-4.7.1/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../libstdc++.a(eh_globals.o)(.text.__cxa_get_globals+0x14):../../.././libstdc++-v3/libsupc++/eh_globals.cc:63:
more undefined references to `___tls_get_addr' follow
collect2: error: ld returned 1 exit status
make: *** [a.out] Error 1


OS: CentOS 4
$ uname -a
Linux jansmb 2.6.9-103.ELsmp #1 SMP Fri Dec 9 04:31:51 EST 2011 i686 i686 i386
GNU/Linux


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/54513] "undefined reference to `___tls_get_addr'" when linking .so with libstdc++.a
  2012-09-07  7:16 [Bug libstdc++/54513] New: "undefined reference to `___tls_get_addr'" when linking .so with libstdc++.a d.v.a at ngs dot ru
@ 2012-09-07  7:19 ` d.v.a at ngs dot ru
  2012-09-07  7:34 ` jakub at gcc dot gnu.org
  2012-09-07  8:58 ` d.v.a at ngs dot ru
  2 siblings, 0 replies; 4+ messages in thread
From: d.v.a at ngs dot ru @ 2012-09-07  7:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54513

--- Comment #1 from __vic <d.v.a at ngs dot ru> 2012-09-07 07:19:43 UTC ---
Note: compiler with stdlib was built manually from sources


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/54513] "undefined reference to `___tls_get_addr'" when linking .so with libstdc++.a
  2012-09-07  7:16 [Bug libstdc++/54513] New: "undefined reference to `___tls_get_addr'" when linking .so with libstdc++.a d.v.a at ngs dot ru
  2012-09-07  7:19 ` [Bug libstdc++/54513] " d.v.a at ngs dot ru
@ 2012-09-07  7:34 ` jakub at gcc dot gnu.org
  2012-09-07  8:58 ` d.v.a at ngs dot ru
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-09-07  7:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54513

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|                            |INVALID

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-09-07 07:33:46 UTC ---
Don't use -Wl,--no-undefined on CentOS 4, it is too old for that.
In particular, AS_NEEDED ( /lib/ld-linux.so.2 ) is missing in /usr/lib/libc.so,
so for TLS using programs which use ___tls_get_addr or other symbols provided
by ld.so you need to specify ld.so on the command line explicitly when using
-Wl,-z,defs.  On newer OSes that is not needed.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/54513] "undefined reference to `___tls_get_addr'" when linking .so with libstdc++.a
  2012-09-07  7:16 [Bug libstdc++/54513] New: "undefined reference to `___tls_get_addr'" when linking .so with libstdc++.a d.v.a at ngs dot ru
  2012-09-07  7:19 ` [Bug libstdc++/54513] " d.v.a at ngs dot ru
  2012-09-07  7:34 ` jakub at gcc dot gnu.org
@ 2012-09-07  8:58 ` d.v.a at ngs dot ru
  2 siblings, 0 replies; 4+ messages in thread
From: d.v.a at ngs dot ru @ 2012-09-07  8:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54513

--- Comment #3 from __vic <d.v.a at ngs dot ru> 2012-09-07 08:58:39 UTC ---
$ g++ -shared -static-libstdc++ -static-libgcc -Wl,-s -Wl,--no-undefined 1.cpp
/lib/ld-linux.so.2

works fine. Thanks


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-07  8:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-07  7:16 [Bug libstdc++/54513] New: "undefined reference to `___tls_get_addr'" when linking .so with libstdc++.a d.v.a at ngs dot ru
2012-09-07  7:19 ` [Bug libstdc++/54513] " d.v.a at ngs dot ru
2012-09-07  7:34 ` jakub at gcc dot gnu.org
2012-09-07  8:58 ` d.v.a at ngs dot ru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).