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: "jason at cornsyrup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Mar 2012 21:29:18 +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
--- Comment #2 from Jason Toffaletti <jason at cornsyrup dot org> 2012-03-14 21:29:18 UTC ---
(In reply to comment #1)
> > -static
>
> You need to make sure all of libpthread.a is included, right it does not get
> linked that way.
>
> This is not a GCC or glibc bug.
Your comment seems to suggest there is a way, but I can't find it.
g++ -Wl,--whole-archive -static -pthread -std=c++0x -o thread thread.cc
Gives pages of linker errors.
http://sourceware.org/bugzilla/show_bug.cgi?id=10652 suggests glibc and
pthreads just don't work with static linking.