This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/52590] std::thread Segmentation fault static linking
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Mar 2012 07:46:27 +0000
- Subject: [Bug libstdc++/52590] std::thread Segmentation fault static linking
- Auto-submitted: auto-generated
- References: <bug-52590-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52590
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-15 07:46:27 UTC ---
The weakref attributes are of course correct, the bug is that you aren't
linking the whole libpthread.a into the app. On some Linux distributions
libpthread.a
has all the objects linked together with ld -r and therefore this will just
work there, on others you need -Wl,--whole-archive -lpthread
-Wl,--no-whole-archive.
Better yet don't link statically, there are many reasons why it is a bad idea.
http://www.akkadia.org/drepper/no_static_linking.html