This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Provide pthread_atfork in libc_nonshared.a and libc.a.


On Wed, Oct 02, 2013 at 05:31:13PM -0400, Carlos O'Donell wrote:
> Community,
> 
> The standard design pattern for making it optional to link against
> libpthread is to mark the function weak, test if the function
> address is non-zero and call the function, otherwise use a fallback.

This idiom is completely wrong; it does not work with static linking.
Programs which are using this approach need to be fixed. We've also
run into it (much more heavily) with musl libc, where unlike in glibc,
the pthread .o files in libc.a are well-factored so that only the
code the program needs gets linked. The offender that comes to mind
right off is libxml2.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]