Commit graph

65 commits

Author SHA1 Message Date
Florian Weimer 27a448223c nptl: Move core mutex functions into libc
This is complicated because of a second compilation of
nptl/pthread_mutex_lock.c via nptl/pthread_mutex_cond_lock.c.
PTHREAD_MUTEX_VERSIONS is introduced to suppress symbol versions
in that case.

The symbols __pthread_mutex_lock, __pthread_mutex_unlock,
__pthread_mutex_init, __pthread_mutex_destroy, pthread_mutex_lock,
pthread_mutex_unlock, pthread_mutex_init, pthread_mutex_destroy
have been moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:51 +02:00
Florian Weimer eb29dcde31 nptl: Move rwlock functions with forwarders into libc
The forwarders were only used internally, so new symbol versions
are needed.  All symbols are moved at once because the forwarders
are no-ops if libpthread is not loaded, leading to inconsistencies
in case of a partial migration.

The symbols __pthread_rwlock_rdlock, __pthread_rwlock_unlock,
__pthread_rwlock_wrlock, pthread_rwlock_rdlock,
pthread_rwlock_unlock, pthread_rwlock_wrlock have been moved using
scripts/move-symbol-to-libc.py.

The __ symbol variants are turned into compat symbols, which is why they
do not receive a GLIBC_2.34 version.
2021-04-21 19:49:51 +02:00
Florian Weimer 9ce44f4675 nptl: Move pthread_key_delete into libc.
The symbol was moved using scripts/move-symbol-to-libc.py.

tss_delete (still in libpthread) uses the __pthread_key_create
alias, so that is now exported under GLIBC_PRIVATE.
2021-04-21 19:49:51 +02:00
Florian Weimer 64a8990bdc nptl: Move pthread_setspecific, __pthread_setspecific into libc
The symbols have been moved using scripts/move-symbol-to-libc.py.
2021-04-21 19:49:51 +02:00
Florian Weimer aae43acfd1 nptl: Move pthread_getspecific, __pthread_getspecific into libc
The symbols have been moved using scripts/move-symbol-to-libc.py.
2021-04-21 19:49:51 +02:00
Florian Weimer 6f009ea984 nptl: Move pthread_key_create, __pthread_key_create into libc
The symbols have been moved using scripts/move-symbol-to-libc.py.
2021-04-21 19:49:51 +02:00
Florian Weimer 75376a3fb8 nptl: Move pthread_setcanceltype into libc
No new symbol version is required because there was a forwarder.

The symbol has been moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer 93d78ec1cb nptl: Move pthread_setcancelstate into libc
No new symbol version is required because there was a forwarder.

The symbol has been moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer c62cef023c nptl: Move pthread_exit into libc
The pthread_exit symbol was moved using
scripts/move-symbol-to-libc.py.  No new symbol version is needed
because there was a forwarder.

The new tests nptl/tst-pthread_exit-nothreads and
nptl/tst-pthread_exit-nothreads-static exercise the scenario
that pthread_exit is called without libpthread having been linked in.
This is not possible for the generic code, so these tests do not
live in sysdeps/pthread for now.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer 1d95b035c7 nptl: Move __pthread_unwind_next into libc
It's necessary to stub out __libc_disable_asynccancel and
__libc_enable_asynccancel via rtld-stubbed-symbols because the new
direct references to the unwinder result in symbol conflicts when the
rtld exception handling from libc is linked in during the construction
of librtld.map.

unwind-forcedunwind.c is merged into unwind-resume.c.  libc now needs
the functions that were previously only used in libpthread.

The GLIBC_PRIVATE exports of __libc_longjmp and __libc_siglongjmp are
no longer needed, so switch them to hidden symbols.

The symbol __pthread_unwind_next has been moved using
scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerva Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer 3fec7f18bf nptl: Move pthread_once and __pthread_once into libc
And also the fork generation counter, __fork_generation.  This
eliminates the need for __fork_generation_pointer.

call_once remains in libpthread and calls the exported __pthread_once
symbol.

pthread_once and __pthread_once have been moved using
scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer 81dfc6694c nptl: Remove longjmp, siglongjmp from libpthread
The definitions in libc are sufficient, the forwarders are no longer
needed.

The symbols have been moved using scripts/move-symbol-to-libc.py.
s390-linux-gnu and s390x-linux-gnu need a new version placeholder
to keep the GLIBC_2.19 symbol version in libpthread.

Tested on i386-linux-gnu, powerpc64le-linux-gnu, s390x-linux-gnu,
x86_64-linux-gnu.  Built with build-many-glibcs.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer 1f2e5bfe48 nptl: Move legacy cancelation handling into libc as compat symbols
This affects _pthread_cleanup_pop, _pthread_cleanup_pop_restore,
_pthread_cleanup_push, _pthread_cleanup_push_defer.  The symbols
have been moved using scripts/move-symbol-to-libc.py.

No new symbol versions are added because the symbols are turned into
compatibility symbols at the same time.

__pthread_cleanup_pop and __pthread_cleanup_push are added as
GLIBC_PRIVATE symbols because they are also used internally, for
glibc's own cancellation handling.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer 5715c29e91 nptl: Move __pthread_cleanup_routine into libc
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer f03b78fae4 nptl: Move pthread_mutex_consistent into libc
And deprecated pthread_mutex_consistent_np, its old name.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Adhemerval Zanella 09ce31eddf nptl: Remove __libc_allocate_rtsig, __libc_current_sigrtmax, and __libc_current_sigrtmin
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-26 13:37:18 -03:00
Adhemerval Zanella 70a1e36cbe nptl: Move sigaction to libc
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-26 13:37:18 -03:00
Adhemerval Zanella ff1e342cd1 nptl: Remove pthread raise implementation
The Linux version already target the current thread by using tgkill
along with getpid and gettid.

For arm, libpthread does not do a intra PLT since it will call the
raise from libc.

Checked on x86_64-linux-gnu.
2021-03-26 13:37:18 -03:00
Adhemerval Zanella b76658451c nptl: Move pthread_kill to libc
A new 2.34 version is also provided.

Checked on x86_64-linux-gnu.
2021-03-26 13:37:18 -03:00
Adhemerval Zanella 4c8cb283ec nptl: Remove pwrite from libpthread
The libc version is identical and built with same flags, it is also
uses as the default version.

Checked on x86_64-linux-gnu.
2021-03-26 13:37:18 -03:00
Adhemerval Zanella dd795c6c24 nptl: Remove pread from libpthread
The libc version is identical and built with same flags, it is also
uses as the default version.

Checked on x86_64-linux-gnu.
2021-03-26 13:37:18 -03:00
Adhemerval Zanella 40873cdd38 nptl: Remove open from libpthread
The libc version is identical and built with same flags.  The libc
version is set as the default version.

Checked on x86_64-linux-gnu.
2021-03-26 13:37:14 -03:00
Adhemerval Zanella c5c3588475 nptl: Remove lseek from libpthread
The libc version is identical and built with same flags.  The libc
version is set as the default version.

The libpthread compat symbol requires to mask it when building the
loader object otherwise ld might complain about a missing
versioned symbol (as for alpha).

Checked on x86_64-linux-gnu.
2021-03-26 13:36:17 -03:00
Adhemerval Zanella 78d1724d53 nptl: Remove send from libpthread
The libc version is identical and built with same flags.  Both aarch64
and nios2 also requires to export __send and tt was done previously with
the HAVE_INTERNAL_SEND_SYMBOL (which forced the symbol creation).

All __send callers are internal to libc and the original issue that
required the symbol export was due a missing libc_hidden_def.  So
a compat symbol is added for __send and the libc_hidden_def is
defined regardless.

Checked on x86_64-linux-gnu and i686-linux-gnu.
2021-03-26 13:36:17 -03:00
Adhemerval Zanella d5ddd583da nptl: Move system to libc
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella 9cf242997d nptl: Move fcntl from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella 729cb5a2a7 nptl: Remove sendmsg from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella 0cf67de816 nptl: Remove recvmsg from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella 2d6f4ebd65 nptl: Remove sigwait from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella 1e157b9cb4 nptl: Remove tcdrain from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella c29386fd50 nptl: Remove pause from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella 0c9d4925fe nptl: Remove msync from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella fc495dc4e9 nptl: Remove fsync from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella 6f2e00cac5 nptl: Remove sendto from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella 643a88a9c1 nptl: Remove recvfrom from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella 494c3beec9 nptl: Remove recv from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella 3ddf9bc185 nptl: Remove connect from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella c59f716993 nptl: Remove accept from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:38 -03:00
Adhemerval Zanella bdfed2e2cd nptl: Remove close from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:24 -03:00
Adhemerval Zanella baab50cfb9 nptl: Remove read from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 08:21:29 -03:00
Adhemerval Zanella 173e0ab081 nptl: Remove write from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 08:20:43 -03:00
Adhemerval Zanella 7384193b71 nptl: Move fork into libc
This is part of the libpthread removal project:

   <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Checked on x86_64-linux-gnu.
2021-03-12 10:19:58 -03:00
Florian Weimer 07a73d5219 nptl: Move pthread_gettattr_np into libc
This is part of the libpthread removal project:

    <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Use __getline instead of __getdelim to avoid a localplt failure.
Likewise for __getrlimit/getrlimit.

The abilist updates were performed by:

git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \
  | while read x ; do
    echo "GLIBC_2.32 pthread_getattr_np F" >> $x
done
python3 scripts/move-symbol-to-libc.py --only-linux pthread_getattr_np

The private export of __pthread_getaffinity_np is no longer needed, but
the hidden alias still necessary so that the symbol can be exported with
versioned_symbol.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2020-05-20 20:27:49 +02:00
Florian Weimer 52302bc298 nptl: Move pthread_getaffinity_np into libc
This is part of the libpthread removal project:

    <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

The abilist updates were performed by:

git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \
  | while read x ; do
    echo "GLIBC_2.32 pthread_getaffinity_np F" >> $x
done
python3 scripts/move-symbol-to-libc.py pthread_getaffinity_np

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2020-05-20 20:23:20 +02:00
Florian Weimer 1979819d68 nptl: Move pthread_attr_setaffinity_np into libc
This is part of the libpthread removal project:

    <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

The symbol did not previously exist in libc, so a new GLIBC_2.32
symbol is needed, to get correct dependency for binaries which
use the symbol but no longer link against libpthread.

The abilist updates were performed by:

git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \
  | while read x ; do
    echo "GLIBC_2.32 pthread_attr_setaffinity_np F" >> $x
done
python3 scripts/move-symbol-to-libc.py pthread_attr_setaffinity_np

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2020-05-20 20:22:59 +02:00
Adhemerval Zanella c6663fee43 nptl: Move pthread_sigmask implementation to libc
This is part of the libpthread removal project:

  <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

A new symbol version is added on libc to force loading failure
instead of lazy binding one for newly binaries with old loaders.

Checked with a build against all affected ABIs.
2020-04-21 14:01:58 -03:00
Florian Weimer f2323817dd nptl: Move pthread_setschedparam implementation into libc
This is part of the libpthread removal project:

  <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-02-20 08:57:01 +01:00
Florian Weimer d5074b30fe nptl: Move pthread_getschedparam implementation into libc
This is part of the libpthread removal project:

  <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-02-20 08:57:01 +01:00
Florian Weimer ad96df2cd9 nptl: Move pthread_cond_init implementation into libc
It is necessary to export __pthread_cond_init from libc because
the C11 condition variable needs it and is still left in libpthread.

This is part of the libpthread removal project:

  <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-02-20 08:57:01 +01:00
Florian Weimer dc6cfdc934 nptl: Move pthread_cond_destroy implementation into libc
It is necessary to export __pthread_cond_destroy from libc because
the C11 condition variable needs it and is still left in libpthread.

This is part of the libpthread removal project:

  <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-02-20 08:57:01 +01:00