This is the mail archive of the
mailing list for the libstdc++ project.
RE: std thread,mutex,cv and static linking with GCC
- From: Damian Lezama <Damian dot Lezama at riverbed dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 22 Oct 2014 17:28:43 +0000
- Subject: RE: std thread,mutex,cv and static linking with GCC
- Authentication-results: sourceware.org; auth=none
- References: <CD78AB7CA98A4D429F16233047F72EA8A775F3 at sfo1exc-mbxp10 dot nbttech dot com> <CAH6eHdQyuE5GpcR+g4A7cTkZX5mrdm04OXYcw-swxT382QVFGA at mail dot gmail dot com> <CAH6eHdTkPiaz3iWk+7qP32qg5f86Z+yEemys2m_USUqT=n1xcw at mail dot gmail dot com>
Thanks. For other's future reference:
I've verified that replacing the -pthread (or -lpthread) option in the linker invocation with '-Wl,--whole-archive -lpthread -Wl,--no-whole-archive' solves the problem. Be aware that the -pthread option in the compiler invocation has to be kept there.
From: Jonathan Wakely [mailto:firstname.lastname@example.org]
Sent: Wednesday, October 22, 2014 10:13 AM
To: Damian Lezama
Subject: Re: std thread,mutex,cv and static linking with GCC
On 22 October 2014 18:10, Jonathan Wakely wrote:
> Oh I just noticed that you said:
> creating an std::thread also works, but the test crashes when using
> the cv
That means the change on trunk probably won't help.
But as Jakub says at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 you should be able to use --whole-archive