aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd
AgeCommit message (Collapse)Author
2020-06-14hurd: Make recv* cancellation pointsSamuel Thibault
* sysdeps/mach/hurd/recv.c (__recv): Make the __socket_recv call cancellable. * sysdeps/mach/hurd/recvfrom.c (__recvfrom): Make the __socket_recv and __socket_whatis_address calls cancellable. * sysdeps/mach/hurd/recvmsg.c (__libc_recvmsg): Make the __socket_recv, __socket_whatis_address, __io_reauthenticate, and __auth_user_authenticate calls cancellable.
2020-06-08hurd: document that gcc&gdb look at the trampoline codeSamuel Thibault
* sysdeps/mach/hurd/i386/trampoline.c (rpc_wait_trampoline): Document which gcc and gdb files look at the code of the trampoline.
2020-06-07htl: Fix tls initialization for already-created threadsSamuel Thibault
* sysdeps/htl/pthreadP.h: Include <link.h> (__pthread_init_static_tls): New prototype. * htl/pt-alloc.c (__pthread_init_static_tls): New function. * sysdeps/mach/hurd/htl/pt-sysdep.c (_init_routine): Initialize tcb field of initial thread. Set GL(dl_init_static_tls) to &__pthread_init_static_tls.
2020-06-07hurd: Make read and pread64 cancellableSamuel Thibault
and add _nocancel variants. * sysdeps/mach/hurd/pread64.c (__libc_pread64): Call __pread64_nocancel surrounded by enabling async cancel, to replace implementation moved to... * sysdeps/mach/hurd/pread64_nocancel.c (__pread64_nocancel): ... here. * sysdeps/mach/hurd/read.c (__libc_read): Call __read_nocancel surrounded by enabling async cancel, to replace implementation moved to... * sysdeps/mach/hurd/read_nocancel.c (__read_nocancel): ... here. * sysdeps/mach/hurd/Makefile (sysdep_routines): Add read_nocancel and pread64_nocancel. * sysdeps/mach/hurd/not-cancel.h (__read_nocancel, __pread64_nocancel): Replace macros with prototypes with a hidden proto on libc. * sysdeps/mach/hurd/dl-sysdep.c: Include <not-cancel.h>. (__pread64_nocancel): New alias, check that it is not hidden. (__read_nocancel): New alias, check that it is not hidden. * sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE): Add __read_nocancel and __pread64_nocancel. (ld.GLIBC_2.1): Add __pread64. (ld.GLIBC_PRIVATE): Add __read_nocancel and __pread64_nocancel. * sysdeps/mach/hurd/i386/ld.abilist (__pread64): Add symbol. * sysdeps/mach/hurd/i386/localplt.data (__read_nocancel, __pread64, __pread64_nocancel): Add references.
2020-06-07hurd: Fix unwinding over interruptible RPCSamuel Thibault
* sysdeps/mach/hurd/i386/intr-msg.h (INTR_MSG_TRAP): Set CFA register to %ecx while %esp is altered.
2020-06-07htl: Enable but XFAIL tst-flock2, tst-signal1, tst-signal2Samuel Thibault
They need setpshared support. * nptl/tst-flock2.c, tst-signal1.c, tst-signal2.c: Move to... * sysdeps/pthread: ... here. * nptl/Makefile: Move corresponding tests references to... * sysdeps/pthread/Makefile: ... here. * sysdeps/mach/hurd/i386/Makefile (test-xfail-tst-flock2, test-xfail-tst-signal1, test-xfail-tst-signal2): Add.
2020-06-07hurd: XFAIL more tests that require setpshared supportSamuel Thibault
* sysdeps/mach/hurd/i386/Makefile (test-xfail-tst-pututxline-cache, test-xfail-tst-pututxline-lockfail, test-xfail-tst-mallocfork2): Add.
2020-06-07hurd: Briefly document in xfails the topics of the bugzilla entriesSamuel Thibault
* sysdeps/mach/hurd/i386/Makefile: Add comments.
2020-06-07htl: Add sem_clockwait supportSamuel Thibault
* sysdeps/htl/sem-timedwait.c (__sem_timedwait_internal): Add clock_id parameter instead of hardcoding CLOCK_REALTIME. (__sem_clockwait): New function. (sem_clockwait): New weak alias. * sysdeps/htl/sem-wait.c (__sem_timedwait_internal): Update declaration. (__sem_wait): Update call to __sem_timedwait_internal. * htl/Versions (GLIBC_2.32): Add sem_clockwait. * sysdeps/mach/hurd/i386/libpthread.abilist (sem_clockwait): Add symbol. * nptl/Makefile (tests): Move tst-sem5 to... * sysdeps/pthread/Makefile (tests): ... here.
2020-06-06hurd: fix clearing SS_ONSTACK when longjmp-ing from sighandlerSamuel Thibault
* sysdeps/i386/htl/Makefile: New file. * sysdeps/i386/htl/tcb-offsets.sym: New file. * sysdeps/mach/hurd/i386/Makefile [setjmp] (gen-as-const-headers): Add signal-defines.sym. * sysdeps/mach/hurd/i386/____longjmp_chk.S: Include tcb-offsets.h. (____longjmp_chk): Harmonize with i386's __longjmp. Clear SS_ONSTACK when jumping off the alternate stack. * sysdeps/mach/hurd/i386/__longjmp.S: New file.
2020-06-06hurd: Add pointer guard supportSamuel Thibault
* sysdeps/mach/hurd/i386/tls.h (THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): New macros.
2020-06-06hurd: Add stack guard supportSamuel Thibault
* sysdeps/mach/hurd/i386/tls.h (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): New macros * sysdeps/mach/hurd/i386/ld.abilist (__stack_chk_guard): Remove symbol.
2020-06-01htl: Make pthread_cond_destroy wait for threads to be wokenSamuel Thibault
This allows to reuse the storage after calling pthread_cond_destroy. * sysdeps/htl/bits/types/struct___pthread_cond.h (__pthread_cond): Replace unused struct __pthread_condimpl *__impl field with unsigned int __wrefs. (__PTHREAD_COND_INITIALIZER): Update accordingly. * sysdeps/htl/pt-cond-timedwait.c (__pthread_cond_timedwait_internal): Register as waiter in __wrefs field. On unregistering, wake any pending pthread_cond_destroy. * sysdeps/htl/pt-cond-destroy.c (__pthread_cond_destroy): Register wake request in __wrefs. * nptl/Makefile (tests): Move tst-cond20 tst-cond21 to... * sysdeps/pthread/Makefile (tests): ... here. * nptl/tst-cond20.c nptl/tst-cond21.c: Move to... * sysdeps/pthread/tst-cond20.c sysdeps/pthread/tst-cond21.c: ... here.
2020-05-28hurd: Fix fexecveSamuel Thibault
* sysdeps/mach/hurd/fexecve.c (fexecve): Re-lookup fd with O_EXEC before calling _hurd_exec_paths.
2020-05-28hurd: fix ptsname error when called on a non-ttySamuel Thibault
* sysdeps/mach/hurd/ptsname.c (__ptsname_internal): Replace not-supported errors from __term_get_peername with ENOTTY.
2020-05-28hurd: Fix fdopendir checking for directory typeSamuel Thibault
* sysdeps/mach/hurd/fdopendir.c (__fdopendir): Lookup "./" instead of "/" that would designate the root of the filesystem.
2020-05-26htl: Add clock variantsSamuel Thibault
* htl/pt-join.c (__pthread_join): Move implementation to... (__pthread_join_common): ... new function. Add try, timed and clock support. (__pthread_join): Reimplement on top of __pthread_join_common. (__pthread_tryjoin_np, __pthread_timedjoin_np, __pthread_clockjoin_np): Implement on top of __pthread_join_common. (pthread_tryjoin_np, pthread_timedjoin_np, pthread_clockjoin_np): New aliases. * hurd/hurdlock.c (__lll_abstimed_wait, __lll_abstimed_xwait, __lll_abstimed_lock): Check for supported clock. * sysdeps/htl/pt-cond-timedwait.c (__pthread_cond_timedwait_internal): Add clockid parameter and support it. (__pthread_cond_timedwait): Pass -1 as clockid. (__pthread_cond_clockwait): New function. (pthread_cond_clockwait): New alias. * sysdeps/htl/pt-cond-wait.c (__pthread_cond_timedwait_internal): Update prototype. (__pthread_cond_wait): Pass -1 as clockid. * sysdeps/htl/pt-rwlock-timedrdlock.c (__pthread_rwlock_timedrdlock_internal): Add clockid parameter, and support id. (__pthread_rwlock_clockrdlock): New function. (pthread_rwlock_clockrdlock): New alias. * sysdeps/htl/pt-rwlock-rdlock.c (__pthread_rwlock_timedrdlock_internal): Update prototype. (__pthread_rwlock_rdlock): Pass -1 as clockid. * sysdeps/htl/pt-rwlock-timedwrlock.c (__pthread_rwlock_timedwrlock_internal): Add clockid parameter, and support id. (__pthread_rwlock_clockwrlock): New function. (pthread_rwlock_clockwrlock): New alias. * sysdeps/htl/pt-rwlock-wrlock.c (__pthread_rwlock_timedwrlock_internal): Update prototype. (__pthread_rwlock_wrlock): Pass -1 as clockid. * sysdeps/mach/hurd/htl/pt-mutex-timedlock.c (__pthread_mutex_timedlock): Move implementation to (__pthread_mutex_clocklock): New function with additional clockid parameter and support it. (pthread_mutex_clocklock): New alias. (__pthread_mutex_timedlock): Reimplement on top of __pthread_mutex_clocklock. * sysdeps/htl/pthread.h (pthread_tryjoin_np, pthread_timedjoin_np, pthread_clockjoin_np, pthread_mutex_clocklock, pthread_cond_clockwait, pthread_rwlock_clockrdlock, pthread_rwlock_clockwrlock): New prototypes. * sysdeps/htl/pthreadP.h (__pthread_cond_clockwait): New prototype. * htl/Versions (GLIBC_2.32): Add pthread_cond_clockwait, pthread_mutex_clocklock, pthread_rwlock_clockrdlock, pthread_rwlock_clockwrlock, pthread_tryjoin_np, pthread_timedjoin_np, pthread_clockjoin_np. * sysdeps/mach/hurd/i386/libpthread.abilist (pthread_clockjoin_np, pthread_cond_clockwait, pthread_mutex_clocklock, pthread_rwlock_clockrdlock, pthread_rwlock_clockwrlock, pthread_timedjoin_np, pthread_tryjoin_np): New functions. * nptl/tst-abstime.c, nptl/tst-join10.c, nptl/tst-join11.c, nptl/tst-join12.c, nptl/tst-join13.c, nptl/tst-join14.c, nptl/tst-join2.c, nptl/tst-join3.c, nptl/tst-join8.c, nptl/tst-join9.c, nptl/tst-mutex-errorcheck.c, nptl/tst-pthread-mutexattr.c, nptl/tst-mutex11.c, nptl/tst-mutex5.c, nptl/tst-mutex7.c, nptl/tst-mutex7robus.c, nptl/tst-mutex9.c, nptl/tst-rwlock12.c, nptl/tst-rwlock14.c: Move to sysdeps/pthread. * sysdeps/pthread/tst-mutex8.c: Move back to nptl. * nptl/Makefile (tests): Move tst-mutex5, tst-mutex7, tst-mutex7robust, tst-mutex9, tst-mutex11, tst-rwlock12, tst-rwlock14, tst-join2, tst-join3, tst-join8, tst-join9 tst-join10, tst-join11, tst-join12, tst-join13, tst-join14, tst-abstime, tst-mutex-errorcheck, tst-pthread-mutexattr to ... * sysdeps/pthread/Makefile (tests): ... here.
2020-05-25elf: Turn _dl_printf, _dl_error_printf, _dl_fatal_printf into functionsFlorian Weimer
This change makes it easier to set a breakpoint on these calls. This also addresses the issue that including <ldsodefs.h> without <unistd.h> does not result usable _dl_*printf macros because of the use of the STD*_FILENO macros there. (The private symbol for _dl_fatal_printf will go away again once the exception handling implementation is unified between libc and ld.so.) Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-05-18Remove NO_CTORS_DTORS_SECTIONS macroFlorian Weimer
This was originally added to support binutils older than version 2.22: <https://sourceware.org/ml/libc-alpha/2010-12/msg00051.html> Since 2.22 is older than the minimum required binutils version for building glibc, we no longer need this. (The changes do not impact the statically linked startup code.)
2020-04-24elf: Implement __libc_early_initFlorian Weimer
This function is defined in libc.so, and the dynamic loader calls right after relocation has been finished, before any ELF constructors or the preinit function is invoked. It is also used in the static build for initializing parts of the static libc. To locate __libc_early_init, a direct symbol lookup function is used, _dl_lookup_direct. It does not search the entire symbol scope and consults merely a single link map. This function could also be used to implement lookups in the vDSO (as an optimization). A per-namespace variable (libc_map) is added for locating libc.so, to avoid repeated traversals of the search scope. It is similar to GL(dl_initfirst). An alternative would have been to thread a context argument from _dl_open down to _dl_map_object_from_fd (where libc.so is identified). This could have avoided the global variable, but the change would be larger as a result. It would not have been possible to use this to replace GL(dl_initfirst) because that global variable is used to pass the function pointer past the stack switch from dl_main to the main program. Replacing that requires adding a new argument to _dl_init, which in turn needs changes to the architecture-specific libc.so startup code written in assembler. __libc_early_init should not be used to replace _dl_var_init (as it exists today on some architectures). Instead, _dl_lookup_direct should be used to look up a new variable symbol in libc.so, and that should then be initialized from the dynamic loader, immediately after the object has been loaded in _dl_map_object_from_fd (before relocation is run). This way, more IFUNC resolvers which depend on these variables will work. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2020-04-14hurd: add mach_print functionSamuel Thibault
* mach/Versions (GLIBC_2.32): Add mach_print. * sysdeps/mach/hurd/i386/libc.abilist (GLIBC_2.32): Add mach_print.
2020-02-27posix: Remove posix waitidAdhemerval Zanella
The POSIX waitid implementation is problematic in some ways: - It emulates using waitpid, which default implementation calls wait4 and wait4 returns ENOSYS as default. - Also by using waitpid it does not allod support the WNOWAIT, WEXITED, WSTOPPED, or WCONTINUED flag. With current POSIX specification the flags are no longer marked as optional. Also due BZ#23091 Hurd still uses the implementation, so it is moved to as a Hurd arch-specific folder (with some minor cleanups). Checked against a i686-gnu (run-built-tests=no)
2020-02-18<fd_to_filename.h>: Add type safety and port to HurdFlorian Weimer
The new type struct fd_to_filename makes the allocation of the backing storage explicit. Hurd uses /dev/fd, not /proc/self/fd. Co-Authored-By: Paul Eggert <eggert@cs.ucla.edu>
2020-02-17x86: Avoid single-argument _Static_assert in <tls.h>Florian Weimer
Older GCC versions do not support this extension. Fixes commit f1bdee61797 ("x86 tls: Use _Static_assert for TLS access size assertion").
2020-02-17x86 tls: Use _Static_assert for TLS access size assertionSamuel Thibault
2020-02-16pthread: Move robust mutex tests from nptl to sysdeps/pthreadSamuel Thibault
tst-robust8.c prints some mutex internals for nptl debugging, this needed to be made conditioned by getting built with nptl.
2020-02-16htl: Remove stub warning for pthread_mutexattr_setpsharedSamuel Thibault
It actually is implemented.
2020-02-16htl: Add missing functions and defines for robust mutexesSamuel Thibault
2020-02-15htl: Only check pthread_self coherency when DEBUG is setSamuel Thibault
htl has been widely tested for a long time now with this coherency checked successfully.
2020-02-15hurd: Add THREAD_GET/SETMEM/_NCSamuel Thibault
Store them in the TCB, and use them for accessing _hurd_sigstate.
2020-02-15hurd tls: update comment about fields at the end of tcbheadSamuel Thibault
2020-02-15ld.so: Do not export free/calloc/malloc/realloc functions [BZ #25486]Florian Weimer
Exporting functions and relying on symbol interposition from libc.so makes the choice of implementation dependent on DT_NEEDED order, which is not what some compiler drivers expect. This commit replaces one magic mechanism (symbol interposition) with another one (preprocessor-/compiler-based redirection). This makes the hand-over from the minimal malloc to the full malloc more explicit. Removing the ABI symbols is backwards-compatible because libc.so is always in scope, and the dynamic loader will find the malloc-related symbols there since commit f0b2132b35248c1f4a80f62a2c38cddcc802aa8c ("ld.so: Support moving versioned symbols between sonames [BZ #24741]"). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2020-02-12io: Implement lchmod using fchmodat [BZ #14578]Florian Weimer
2020-02-10htl C11 threads: Avoid pthread_ symbols visibility in static librarySamuel Thibault
2020-02-11hurd: Add __pthread_spin_wait and use itSamuel Thibault
900778283ac3 ("htl: make pthread_spin_lock really spin") made pthread_spin_lock really spin and not block, but the current users of __pthread_spin_lock were assuming that it blocks, i.e. they use it as a lightweight mutex fitting in just one int. __pthread_spin_wait provides that support back.
2020-02-10pthread: Move most barrier tests from nptl to sysdeps/pthreadSamuel Thibault
So they can be checked with htl too.
2020-02-10pthread: Move most sem tests from nptl to sysdeps/pthreadSamuel Thibault
So they can be checked with htl too.
2020-02-10htl: Add support for semaphore maximum valueSamuel Thibault
2020-02-10htl: Add support for libc cancellation pointsSamuel Thibault
2020-02-09htl: XFAIL rwlock tests which need pshared supportSamuel Thibault
2020-02-09pthread: Move most cond tests from nptl to sysdeps/pthreadSamuel Thibault
So they can be checked with htl too.
2020-02-09htl: Report missing mutex lock on pthread_cond_*waitSamuel Thibault
2020-02-09htl: Fix default guard sizeSamuel Thibault
When it is not hardcoded by the architecture with PAGESIZE, we need to use the dynamic values from __vm_page_size.
2020-02-09pthread: Move most mutex tests from nptl to sysdeps/pthreadSamuel Thibault
So they can be checked with htl too. XFAIL tst-mutex4, for which support is still missing in htl.
2020-02-09htl: Fix calling pthread_exit in the child of a forkSamuel Thibault
We need to reset the threads counter, otherwise pthread_exit() would not call exit(0).
2020-02-09C11 threads: Move implementation to sysdeps/pthreadSamuel Thibault
so it gets shared by nptl and htl. Also add htl versions of thrd_current and thrd_yield. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-02-09htl: Rename _pthread_mutex_init/destroy to __pthread_mutex_init/destroySamuel Thibault
2020-02-09htl: Move internal mutex/rwlock symbols to GLIBC_PRIVATESamuel Thibault
Their prototypes have never been made public, and they are not used outside libc (checked on the whole Debian archive)
2020-02-09htl: Remove duplicate filesSamuel Thibault
The generic versions have the same content.
2020-02-09htl: Remove unused filesSamuel Thibault
These have never been used.