This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libgcc patch committed: Change __real_pthread_create ref to be non-weak
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Mon, 14 Jan 2013 11:42:29 -0800
- Subject: Re: libgcc patch committed: Change __real_pthread_create ref to be non-weak
- References: <mcrr4lnimq3.fsf@google.com>
On Mon, Jan 14, 2013 at 11:33 AM, Ian Lance Taylor <iant@google.com> wrote:
> The declaration of __real_pthread_create in generic-morestack-thread.c
> had attribute weak. Note that this code is linked with --wrap
> pthread_create, so the reference to __real_pthread_create is really to
> pthread_create. Using weak was incorrect, because the reference really
> is a strong one. There is no support for __real_pthread_create aka
> pthread_create to not be defined. It caused some Go programs to fail
> when linking statically, because a weak reference does not cause a
> symbol definition to be included from an archive. If there was no other
> reason to include pthread_create, then pthread_create would never be
> defined, so the call to __real_pthread_create would crash at runtime.
>
> This fixes a regression, as static linking of Go programs used to work.
>
> Bootstrapped and ran Go testsuite and split-stack tests on
> x86_64-unknown-linux-gnu. Committed to mainline.
>
> Ian
>
>
> 2013-01-14 Ian Lance Taylor <iant@google.com>
>
> * generic-morestack-thread.c: Change declaration of
> __real_pthread_create to not be weak.
>
I think you run into:
http://sourceware.org/bugzilla/show_bug.cgi?id=14556
--
H.J.