[PATCH] nptl: Move pthread_attr_getdetachstate implementation into libc

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Aug 16 20:07:00 GMT 2019



On 16/08/2019 16:02, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> Why do we need this on libc? Can't we just remove the FORWARD and make
>> it only on libpthread?
> 
> That would be a hard ABI break.

Right, we uses to export such definitions for libc.so.

> 
>> My understanding is we need to move pthread_* implementation to libc only
>> when they are actually used in libc.so, otherwise we can just cleanup the
>> fowards instead.
> 
> I'm sorry, but that's not possible.  For example, pthread_mutex_lock is
> used by many programs which do not link against libpthread.
> 
> My eventual goal is to make libpthread completely empty except for the
> odd compatibility symbol, and advise programmers to use
> __libc_single_threaded for atomics optmizations.  Using the presence of
> libpthread hasn't worked well for quite a while because libpthread is
> loaded pervasively, even by single-threaded programs.
> 
> Once pthread_create is in libc, we can move timer_create into libc as
> well, greatly reducing the risk of underlinking and its hard-to-diagnose
> error.

That what I would suggest and I agree that moving the libpthread implementation
to libc does simplify things a lot.



More information about the Libc-alpha mailing list