This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] libstdc++/61841 odr-use pthread_create in std::thread constructor
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, Matthias Klose <doko at ubuntu dot com>
- Date: Wed, 13 Aug 2014 20:47:59 +0200
- Subject: Re: [patch] libstdc++/61841 odr-use pthread_create in std::thread constructor
- Authentication-results: sourceware.org; auth=none
- References: <20140813184057 dot GF6927 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Aug 13, 2014 at 07:40:57PM +0100, Jonathan Wakely wrote:
> This should fix the Hurd bug in PR61841 as well as the problem
> described in https://gcc.gnu.org/ml/gcc/2013-09/msg00196.html
>
> Tested x86_64-linux, committed to trunk.
>
> This is not suitable for the branches as it requires a new exported
> symbol. We could maybe just add some other odr-use of pthread_create,
> but it would probably be optimized away anyway.
E.g. __asm ("" : : "r" (&pthread_create)); would not be optimized away.
> commit 79c721b72b7f9288256cc4bf388cf6b60b65e838
> Author: Jonathan Wakely <jwakely@redhat.com>
> Date: Fri Jul 18 15:35:49 2014 +0100
>
> PR libstdc++/61841
> * include/std/thread (thread::_M_start_thread): Declare new overload.
> (thread::thread<_Callable, _Args...>): Call new overload with an
> explicit reference to pthread_create.
> * src/c++11/thread.cc (thread::_M_start_thread): Add new overload.
> * config/abi/pre/gnu.ver: Export new function.
Jakub