[PATCH 09/12] Finish move of clock_* functions to libc.

Florian Weimer fweimer@redhat.com
Tue Aug 20 15:21:00 GMT 2019


* Joseph Myers:

> On Tue, 20 Aug 2019, Zack Weinberg wrote:
>
>> In glibc 2.17, the functions clock_getcpuclockid, clock_getres,
>> clock_gettime, clock_nanosleep, and clock_settime were moved from
>> librt.so to libc.so, leaving compatibility stubs behind.  Now that the
>> dynamic linker no longer insists on finding versioned symbols in the
>> same library that originally defined them, we do not need the stubs
>> anymore, and this means we don’t need GLIBC_PRIVATE __-prefix aliases for
>> most of the functions anymore either.  (clock_gettime is still called
>> all over the place internally and therefore still needs one.)
>
> But my understanding is that moving a function to libc like that only 
> works if libc has the symbol *at the same version* as it had in the 
> library from which it was removed.

Correct.  We also need to add a new symbol version (at the next glibc
release) for the symbols, so that applications which use the functions
from libc directly are correctly depending on a glibc version which
actually has these symbols in libc.  My understanding is that this part
already happened in glibc 2.17, so the new symbol versions are not
required in this particularly instance, but the compatibility symbols
are definitely needed.

The pthread cleanup patches I posted replace existing forwarders, which
were added at the same time to libc and libpthread, so these
requirements are not apparent in these patches.

Thanks,
Florian



More information about the Libc-alpha mailing list