This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] BZ #5784: Build libpthread.a with ld -r
On Thu, Sep 6, 2012 at 6:25 PM, Roland McGrath <roland@hack.frob.com> wrote:
> An alternative that's more different (and off hand seems vaguely
> worse to me), but perhaps is better in some way or other, is to make
> sure that libc defines redirector functions for every pthread_foo
> that libstdc++ calls. Then if -lpthread is missing, the strong
> references are resolved to the libc definitions, which normally do
> nothing. This alternative has the advantage that, if paired with a
> b. solution for #1, it also correctly handles "dynamic static
> threadedness".
>
That is one of the intentions of STB_SECONDARY. Libc
can define those pthread_foo functions as STB_SECONDARY.
If there is no -lpthread, they will be used. Otherwise,
those in -lpthread will be used.
--
H.J.