about summary refs log tree commit diff
path: root/sysdeps/mach
Commit message (Collapse)AuthorAgeFilesLines
* hurd: Add futimens supportSamuel Thibault2018-03-041-0/+50
| | | | * sysdeps/mach/hurd/futimens.c: New file.
* Separate out error_t definitionSamuel Thibault2018-03-043-16/+29
| | | | | | | | | | | | | | | | | | so interfaces needing it can get it. * stdlib/errno.h (error_t): Move definition to... * bits/types/error_t.h: ... new header. * stdlib/Makefile (headers): Add bits/types/error_t.h. * sysdeps/mach/hurd/bits/errno.h (error_t): Move definition to... * sysdeps/mach/hurd/bits/types/error_t.h: ... new header. * sysdeps/mach/hurd/errnos.awk (error_t): Likewise. * hurd/hurd.h: Include <bits/types/error_t.h> * hurd/hurd/fd.h: Include <bits/types/error_t.h> * hurd/hurd/id.h: Include <errno.h> and <bits/types/error_t.h> * hurd/hurd/lookup.h: Include <errno.h> and <bits/types/error_t.h> * hurd/hurd/resource.h: Include <bits/types/error_t.h> * hurd/hurd/signal.h: Include <bits/types/error_t.h> * hurd/hurd/sigpreempt.h: Include <bits/types/error_t.h>
* hurd: Add missing includeSamuel Thibault2018-03-041-0/+1
| | | | * sysdeps/mach/hurd/dl-sysdep.c: Include <mach/machine/vm_param.h>.
* hurd: Move mach/param.h to bits/mach/param.hSamuel Thibault2018-03-042-2/+2
| | | | | | | | * mach/Makefile (headers): Move mach/param.h to bits/mach/param.h. * sysdeps/mach/i386/mach/param.h: Move file to ... * sysdeps/mach/i386/bits/mach/param.h: ... here. Update path in #error. * sysdeps/mach/hurd/bits/param.h: Include <bits/mach/param.h> instead of <mach/param.h>.
* hurd: fix gai_misc buildSamuel Thibault2018-02-271-0/+67
| | | | * sysdeps/mach/hurd/gai_misc.h: New file.
* hurd: Add sysdep-cancel.hSamuel Thibault2018-02-211-0/+9
|
* hurd: fix buildSamuel Thibault2018-02-211-0/+2
| | | | * sysdeps/mach/hurd/dl-sysdep.c (_dl_random): New variable.
* hurd: Fix build on missing __ptsname_internal functionSamuel Thibault2018-02-171-4/+19
| | | | | | | * sysdeps/mach/hurd/ptsname.c: Include <sys/stat.h>. (__ptsname_r): Move implementation to... (__ptsname_internal): ... new function. Add filling the STP structure.
* hurd: Define EXEC_PAGESIZESamuel Thibault2018-02-172-0/+27
| | | | | | * mach/Makefile (headers): Add mach/param.h. * sysdeps/mach/hurd/bits/param.h: Include <mach/param.h>. * sysdeps/mach/i386/mach/param.h: New file, defines EXEC_PAGESIZE
* Add narrowing add functions.Joseph Myers2018-02-101-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the narrowing add functions from TS 18661-1 to glibc's libm: fadd, faddl, daddl, f32addf64, f32addf32x, f32xaddf64 for all configurations; f32addf64x, f32addf128, f64addf64x, f64addf128, f32xaddf64x, f32xaddf128, f64xaddf128 for configurations with _Float64x and _Float128; __nldbl_daddl for ldbl-opt. As discussed for the build infrastructure patch, tgmath.h support is deliberately deferred, and FP_FAST_* macros are not applicable without optimized function implementations. Function implementations are added for all relevant pairs of formats (including certain cases of a format and itself where more than one type has that format). The main implementations use round-to-odd, or a trivial computation in the case where both formats are the same or where the wider format is IBM long double (in which case we don't attempt to be correctly rounding). The sysdeps/ieee754/soft-fp implementations use soft-fp, and are used automatically for configurations without exceptions and rounding modes by virtue of existing Implies files. As previously discussed, optimized versions for particular architectures are possible, but not included. i386 gets a special version of f32xaddf64 to avoid problems with double rounding (similar to the existing fdim version), since this function must round just once without an intermediate rounding to long double. (No such special version is needed for any other function, because the nontrivial functions use round-to-odd, which does the intermediate computation with the rounding mode set to round-to-zero, and double rounding is OK except in round-to-nearest mode, so is OK for that intermediate round-to-zero computation.) mul and div will need slightly different special versions for i386 (using round-to-odd on long double instead of precision control) because of the possibility of inexact intermediate results in the subnormal range for double. To reduce duplication among the different function implementations, math-narrow.h gets macros CHECK_NARROW_ADD, NARROW_ADD_ROUND_TO_ODD and NARROW_ADD_TRIVIAL. In the trivial cases and for any architecture-specific optimized implementations, the overhead of the errno setting might be significant, but I think that's best handled through compiler built-in functions rather than providing separate no-errno versions in glibc (and likewise there are no __*_finite entry points for these function provided, __*_finite effectively being no-errno versions at present in most cases). Tested for x86_64 and x86, with both GCC 6 and GCC 7. Tested for mips64 (all three ABIs, both hard and soft float) and powerpc with GCC 7. Tested with build-many-glibcs.py with both GCC 6 and GCC 7. * math/Makefile (libm-narrow-fns): Add add. (libm-test-funcs-narrow): Likewise. * math/Versions (GLIBC_2.28): Add narrowing add functions. * math/bits/mathcalls-narrow.h (add): Use __MATHCALL_NARROW . * math/gen-auto-libm-tests.c (test_functions): Add add. * math/math-narrow.h (CHECK_NARROW_ADD): New macro. (NARROW_ADD_ROUND_TO_ODD): Likewise. (NARROW_ADD_TRIVIAL): Likewise. * sysdeps/ieee754/float128/float128_private.h (__faddl): New macro. (__daddl): Likewise. * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fadd and dadd. (CFLAGS-nldbl-dadd.c): New variable. (CFLAGS-nldbl-fadd.c): Likewise. * sysdeps/ieee754/ldbl-opt/Versions (GLIBC_2.28): Add __nldbl_daddl. * sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__nldbl_daddl): New prototype. * manual/arith.texi (Misc FP Arithmetic): Document fadd, faddl, daddl, fMaddfN, fMaddfNx, fMxaddfN and fMxaddfNx. * math/auto-libm-test-in: Add tests of add. * math/auto-libm-test-out-narrow-add: New generated file. * math/libm-test-narrow-add.inc: New file. * sysdeps/i386/fpu/s_f32xaddf64.c: Likewise. * sysdeps/ieee754/dbl-64/s_f32xaddf64.c: Likewise. * sysdeps/ieee754/dbl-64/s_fadd.c: Likewise. * sysdeps/ieee754/float128/s_f32addf128.c: Likewise. * sysdeps/ieee754/float128/s_f64addf128.c: Likewise. * sysdeps/ieee754/float128/s_f64xaddf128.c: Likewise. * sysdeps/ieee754/ldbl-128/s_daddl.c: Likewise. * sysdeps/ieee754/ldbl-128/s_f64xaddf128.c: Likewise. * sysdeps/ieee754/ldbl-128/s_faddl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_daddl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_faddl.c: Likewise. * sysdeps/ieee754/ldbl-96/s_daddl.c: Likewise. * sysdeps/ieee754/ldbl-96/s_faddl.c: Likewise. * sysdeps/ieee754/ldbl-opt/nldbl-dadd.c: Likewise. * sysdeps/ieee754/ldbl-opt/nldbl-fadd.c: Likewise. * sysdeps/ieee754/soft-fp/s_daddl.c: Likewise. * sysdeps/ieee754/soft-fp/s_fadd.c: Likewise. * sysdeps/ieee754/soft-fp/s_faddl.c: Likewise. * sysdeps/powerpc/fpu/libm-test-ulps: Update. * sysdeps/mach/hurd/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
* Fix -Os gnu_dev_* linknamespace, localplt issues (bug 15105, bug 19463).Joseph Myers2018-02-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Building with -Os produces linknamespace and localplt failures for, among other functions, gnu_dev_major, gnu_dev_minor and gnu_dev_makedev. The issue is that those functions are not inlined when building with -Os. While one could force them to be inlined in that case, it seems more natural to fix this issue similarly to other namespace issues. Thus, this patch makes gnu_dev_* into weak aliases for hidden symbols __gnu_dev_*; __gnu_dev_* are then defined as inlines in the internal include/sys/sysmacros.h, and uses of gnu_dev_* (often via the macros major, minor and makedev) for which there are namespace issues are changed to use __gnu_dev_*; where there are no namespace issues, use of libc_hidden_proto serves to avoid unnecessary local PLT entry use. Tested for x86_64, (a) without -Os, to verify the testsuite continues to pass without problems and that the functions called under their new names continue to be inlined as expected in that case; (b) with -Os, to verify that the linknamespace and localplt failures in question go away (but because of other such failures present, neither of the relevant bugs can yet be closed). [BZ #15105] [BZ #19463] * include/sys/sysmacros.h [!_ISOMAC] (__SYSMACROS_NEED_IMPLEMENTATION): Define macro. [!_SYS_SYSMACROS_H_WRAPPER && !_ISOMAC] (_SYS_SYSMACROS_H_WRAPPER): Likewise. [!_SYS_SYSMACROS_H_WRAPPER && !_ISOMAC] (gnu_dev_major): Use libc_hidden_proto. [!_SYS_SYSMACROS_H_WRAPPER && !_ISOMAC] (gnu_dev_minor): Likewise. [!_SYS_SYSMACROS_H_WRAPPER && !_ISOMAC] (gnu_dev_makedev): Likewise. [!_SYS_SYSMACROS_H_WRAPPER && !_ISOMAC] (__SYSMACROS_DECL_TEMPL): Undefine and redefine to add use __gnu_dev_ prefix. [!_SYS_SYSMACROS_H_WRAPPER && !_ISOMAC] (__SYSMACROS_IMPL_TEMPL): Likewise. [!_SYS_SYSMACROS_H_WRAPPER && !_ISOMAC] (__gnu_dev_major): Declare and define as hidden inline function. [!_SYS_SYSMACROS_H_WRAPPER && !_ISOMAC] (__gnu_dev_minor): Likewise. [!_SYS_SYSMACROS_H_WRAPPER && !_ISOMAC] (__gnu_dev_makedev): Likewise. * misc/makedev.c (OUT_OF_LINE_IMPL_TEMPL): Use __gnu_dev_ prefix. (gnu_dev_major): Use weak_alias and libc_hidden_weak. (gnu_dev_minor): Likewise. (gnu_dev_makedev): Likewise. * csu/check_fds.c (check_one_fd): Use __gnu_dev_makedev instead of makedev. * posix/wordexp.c (exec_comm_child): Likewise. * sysdeps/mach/hurd/xmknodat.c (__xmknodat): Use __gnu_dev_minor instead of minor and __gnu_dev_major instead of major. * sysdeps/unix/sysv/linux/device-nrs.h (DEV_TTY_P): Use __gnu_dev_major instead of major. * sysdeps/unix/sysv/linux/pathconf.c (distinguish_extX): Use __gnu_dev_major instead of gnu_dev_major and __gnu_dev_minor instead of gnu_dev_minor. * sysdeps/unix/sysv/linux/ptsname.c (MASTER_P): Likewise. (SLAVE_P): Likewise. (__ptsname_internal): Use __gnu_dev_minor instead of minor. * sysdeps/unix/sysv/linux/ttyname.h (is_pty): Use __gnu_dev_major instead of major.
* hurd: include generic's hp-timing.h instead of copying itSamuel Thibault2018-01-301-18/+1
| | | | | * sysdeps/mach/hurd/hp-timing.h: include <sysdeps/generic/hp-timing.h> instead of copying it.
* hurd: Add tlsdesc.symSamuel Thibault2018-01-301-0/+19
| | | | * sysdeps/mach/hurd/i386/tlsdesc.sym: New file.
* hurd: disable hp timingSamuel Thibault2018-01-301-0/+38
| | | | | | | | We don't have support for hp timing for now, even the i686 variant, which needs to know the CPU speed. Copied from sysdeps/generic/hp-timing.h * sysdeps/mach/hurd/hp-timing.h: New file.
* hurd: Fix comments for FREAD and FWRITESamuel Thibault2018-01-291-1/+1
| | | | | * bits/fcntl.h: Fix comment for FREAD and FWRITE. * sysdeps/mach/hurd/bits/fcntl.h: Likewise.
* hurd: Add expected ABI listsSamuel Thibault2018-01-2911-0/+3674
| | | | | | | | | | | | | | | | * hurd/Versions: Fix version when _hurd_exec_paths was added. * mach/Versions: Fix version when __mach_host_self_ was added. * sysdeps/mach/hurd/i386/ld.abilist: New file. * sysdeps/mach/hurd/i386/libBrokenLocale.abilist: New file. * sysdeps/mach/hurd/i386/libanl.abilist: New file. * sysdeps/mach/hurd/i386/libc.abilist: New file. * sysdeps/mach/hurd/i386/libcrypt.abilist: New file. * sysdeps/mach/hurd/i386/libdl.abilist: New file. * sysdeps/mach/hurd/i386/libm.abilist: New file. * sysdeps/mach/hurd/i386/libnsl.abilist: New file. * sysdeps/mach/hurd/i386/libresolv.abilist: New file. * sysdeps/mach/hurd/i386/librt.abilist: New file. * sysdeps/mach/hurd/i386/libutil.abilist: New file.
* hurd: Fix includesSamuel Thibault2018-01-293-1/+2
| | | | | | | * sysdeps/mach/hurd/net/ethernet.h: Include <stdint.h>. * sysdeps/mach/hurd/net/if_arp.h: Include <stdint.h>. * sysdeps/mach/hurd/net/if_ppp.h: Do not include non-existing <net/ppp_defs.h>.
* hurd: Fix _POSIX_VDISABLE valueSamuel Thibault2018-01-291-1/+1
| | | | | * sysdeps/mach/hurd/bits/posix_opt.h (_POSIX_VDISABLE): Set to '\0' instead of invalid -1.
* hurd: Build stubs for new gnumach.defsSamuel Thibault2018-01-282-2/+2
| | | | | | * mach/Makefile (user-interfaces): Add mach/gnumach. * sysdeps/mach/configure.ac (mach_interface_list): Add gnumach. * sysdeps/mach/configure (mach_interface_list): Regenerate.
* hurd: Fix posix optionsSamuel Thibault2018-01-281-2/+2
| | | | | | | _POSIX_CHOWN_RESTRICTED and _POSIX_NO_TRUNC should be always defined. * sysdeps/mach/hurd/bits/posix_opt.h (_POSIX_CHOWN_RESTRICTED, _POSIX_NO_TRUNC): Define to 0.
* hurd: Fix getifaddrs / freeifaddrs expositionSamuel Thibault2018-01-281-2/+0
| | | | | | | | | | | 400669754de4 ('hurd: Fix nscd build') had the side effect of making libc's freeaddrinfo expose freeifaddrs through __check_pf. We can just move the renames to gai.c itself, along others. * sysdeps/mach/hurd/check_pf.c (__getifaddrs, __freeifaddrs): Do not define macros. * nscd/gai.c (__getifaddrs): Define macro to getifaddrs. (__freeifaddrs): Define macro to freeifaddrs.
* hurd: take __USE_EXTERN_INLINES into account and restrict inlinesSamuel Thibault2018-01-281-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * hurd/hurd.h (__hurd_fail): Always declare function, and provide inline version only if __USE_EXTERN_INLINES is defined. * hurd/hurd/fd.h (_hurd_fd_error_signal, _hurd_fd_error, __hurd_dfail, __hurd_sockfail): Likewise. (_hurd_fd_get): Always declare functions, and provide inline versions only if __USE_EXTERN_INLINES and _LIBC are defined and IS_IN(libc). * hurd/hurd/port.h (_hurd_port_init, _hurd_port_locked_get, _hurd_port_get, _hurd_port_free, _hurd_port_locked_set, _hurd_port_set): Always declare functions, and provide inline versions only if __USE_EXTERN_INLINES and _LIBC are defined and IS_IN(libc). * hurd/hurd/signal.h (_hurd_self_sigstate, _hurd_critical_section_lock, _hurd_critical_section_unlock): Likewise. * hurd/hurd/threadvar.h (__hurd_threadvar_location_from_sp, * __hurd_threadvar_location): Likewise. * hurd/hurd/userlink.h (_hurd_userlink_link, _hurd_userlink_unlink, _hurd_userlink_clear): Likewise. * mach/lock-intern.h (__spin_lock_init, __spin_lock, __mutex_lock, __mutex_unlock, __mutex_trylock): Always declare functions, and provide inline versions only if __USE_EXTERN_INLINES and _LIBC are defined. * mach/mach/mig_support.h (__mig_strncpy): Likewise. * sysdeps/generic/machine-lock.h (__spin_unlock, __spin_try_lock, __spin_lock_locked): Likewise. * sysdeps/mach/i386/machine-lock.h (__spin_unlock, __spin_try_lock, __spin_lock_locked): Likewise. * mach/spin-lock.c (__USE_EXTERN_INLINES): Define to 1. * hurd/Versions (libc: GLIBC_2.27): Add _hurd_fd_error_signal, _hurd_fd_error, __hurd_dfail, __hurd_sockfail, _hurd_port_locked_set, __hurd_threadvar_location_from_sp, __hurd_threadvar_location, _hurd_userlink_link, _hurd_userlink_unlink, _hurd_userlink_clear.
* hurd: add base abilist filesSamuel Thibault2018-01-282-0/+0
| | | | | * sysdeps/mach/hurd/libhurduser.abilist: New file. * sysdeps/mach/libmachuser.abilist: New file.
* hurd: Fix nscd buildSamuel Thibault2018-01-282-0/+4
| | | | | | | nscd won't find check_* from inet/, it needs a sysdeps file. * sysdeps/mach/hurd/check_native.c: New file. * sysdeps/mach/hurd/check_pf.c: New file.
* hurd: Fix warningSamuel Thibault2018-01-281-1/+2
| | | | | * sysdeps/mach/hurd/spawni.c (__spawni): Make relpath and abspath const char * instead of char *.
* hurd: fix warningSamuel Thibault2018-01-272-22/+12
| | | | | | | * sysdeps/mach/hurd/getresgid.c (__getresgid): Set result from critical section to make code simpler and avoid warning. * sysdeps/mach/hurd/getresuid.c (__getresuid): Set result from critical section to make code simpler and avoid warning.
* hurd: Fix enabling vm_copySamuel Thibault2018-01-271-2/+2
| | | | | | | | Benchmarked on http://lists.gnu.org/archive/html/bug-hurd/2014-12/msg00081.html * sysdeps/mach/pagecopy.h (PAGE_THRESHOLD): Rename to PAGE_COPY_THRESHOLD and set to benchmarked 16384.
* hurd: fix warningSamuel Thibault2018-01-271-1/+2
| | | | | | | | | Making `special_profil_failure' both avoids warning "variable 'special_profil_failure' set but not used", and makes it easier to access with gdb. * sysdeps/mach/hurd/profil.c (special_profil_failure): Move variable to global scope.
* hurd: fix warningSamuel Thibault2018-01-271-0/+3
| | | | | * sysdeps/mach/hurd/dl-sysdep.c (_exit): Call LOSE and abort() if __task_terminate would ever return successfully.
* hurd: drop elder MACH_IPC_COMPAT handlingSamuel Thibault2018-01-271-32/+3
| | | | | | | | | This was dropped from GNU Mach in 2006. * mach/Machrules (MIGFLAGS): Do not set -DMACH_IPC_COMPAT=0. * mach/mach/mach_traps.h: Drop comment about MACH_IPC_COMPAT. * sysdeps/mach/hurd/fork.c (__fork): Drop special casing MACH_IPC_COMPAT.
* hurd: fix warningSamuel Thibault2018-01-271-0/+4
| | | | | * sysdeps/mach/hurd/Makefile [$(subdir)==nis]: Add -DUSE_BINDINGDIR=1 to CFLAGS-ypclnt.c.
* hurd: fix warningSamuel Thibault2018-01-271-1/+1
| | | | | * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): Cast vm_address_t * to ElfW(Addr) * for dl_main parameter.
* hurd: fix warningSamuel Thibault2018-01-271-3/+3
| | | | | * sysdeps/mach/hurd/profil.c: Reuse `a' variable instead of introducing a `c' variable.
* hurd: fix warningSamuel Thibault2018-01-271-0/+1
| | | | * sysdeps/mach/hurd/xmknodat.c: Include <sys/sysmacros.h>.
* hurd: Implement faccessat without AT_EACCESS flagSamuel Thibault2018-01-103-184/+169
| | | | | | | | | | | | | | | | | | | | | | * hurd/hurd/fd.h: Include <fcntl.h> (__hurd_at_flags): New function. * hurd/lookup-at.c (__file_name_lookup_at): Replace flag computation with call to __hurd_at_flags. * include/unistd.h (__faccessat, __faccessat_noerrno): Add declaration. * sysdeps/mach/hurd/access.c (access_common): Move implementation to __faccessat (hurd_fail_seterrno, hurd_fail_noerrno): Move to sysdeps/mach/hurd/faccessat.c. (__access_noerrno): Use __faccessat_common instead of access_common. (__access): Likewise. * sysdeps/mach/hurd/euidaccess.c (__euidaccess): Replace implementation with a call to __faccessat. * sysdeps/mach/hurd/faccessat.c (faccessat): Rename into... (__faccessat_common): ... this. Move implementation of __access into it when AT_FLAGS does not contain AT_EACCESS. Make it call __hurd_at_flags, add reauthenticate_cwdir_at helper to implement AT mechanism. (__faccessat_noerrno): New function, just calls __faccessat_common. (__faccessat): New function, just calls __faccessat_common. (faccessat): Define weak alias.
* hurd: Use the new file_exec_paths RPCSamuel Thibault2018-01-093-21/+94
| | | | | | | | | | | | | | | | | | | | | | From: Emilio Pozuelo Monfort <pochu27@gmail.com> From: Svante Signell <svante.signell@gmail.com> Pass the file paths of executable to the exec server, both relative and absolute, which exec needs to properly execute and avertise #!-scripts. Previously, the exec server tried to guess the name from argv[0] but argv[0] only contains the executable name by convention. * hurd/hurdexec.c (_hurd_exec): Deprecate function. (_hurd_exec_paths): New function. * hurd/hurd.h (_hurd_exec): Deprecate function. (_hurd_exec_paths): Declare function. * hurd/Versions: Export _hurd_exec_paths. * sysdeps/mach/hurd/execve.c: Include <stdlib.h> and <stdio.h> (__execve): Use __getcwd to build absolute path, and use _hurd_exec_paths instead of _hurd_exec. * sysdeps/mach/hurd/spawni.c: Likewise. * sysdeps/mach/hurd/fexecve.c: Use _hurd_exec_paths instead of _hurd_exec.
* hurd: Add jmp_buf-macros.hSamuel Thibault2018-01-061-0/+6
| | | | * sysdeps/mach/hurd/i386/jmp_buf-macros.h: New file.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-01286-286/+286
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Don't set errno in Hurd rtld's __access_noerrnoThomas Schwinge2017-12-151-1/+0
| | | | | | | | | * sysdeps/mach/hurd/dl-sysdep.c (__access_noerrno): Don't set errno. Fixes commit 819ea3347e3a30a611488ceeec53650baaeb7961. Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* Introduce NO_RTLD_HIDDEN, make hurd use it instead of NO_HIDDENSamuel Thibault2017-10-032-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the Hurd, the rtld needs to see its own dumb versions of a few functions (defined in sysdeps/mach/hurd/dl-sysdep.c) overridden by libc's versions once loaded. rtld should thus not have hidden attribute for these. To achieve this, the Hurd port used to just define NO_HIDDEN, which disables it completely. For now, this changes that to disabling it for all rtld functions, for simplicity. See Roland's comment on https://sourceware.org/bugzilla/show_bug.cgi?id=15605#c5 The ld.so numbers remain at 8 .rel.plt 000000c8 00000c24 00000c24 00000c24 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 9 .plt 000001a0 00000cf0 00000cf0 00000cf0 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE 10 .plt.got 00000010 00000e90 00000e90 00000e90 2**3 CONTENTS, ALLOC, LOAD, READONLY, CODE 18 .got.plt 00000070 0002d000 0002d000 0002c000 2**2 CONTENTS, ALLOC, LOAD, DATA which is about 3 times as much as on Linux. The libc.so numbers get divided by 3 (the remainings are mostly RPC stub calls) * include/libc-symbols.h [NO_RTLD_HIDDEN] (rtld_hidden_proto, rtld_hidden_tls_proto, rtld_hidden_def, rtld_hidden_weak, rtld_hidden_rtld_hidden_ver, data_def, rtld_hidden_data_weak, rtld_hidden_data_ver): Define to empty. * include/assert.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__assert_fail, __assert_perror_fail): Likewise. * include/dirent.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__rewinddir): Likewise. * include/libc-internal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__profile_frequency): Likewise. * include/setjmp.h (__sigsetjmp): Likewise. * include/signal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__sigaction, __libc_sigaction): Likewise. * include/stdlib.h [NO_RTLD_HIDDEN] (unsetenv, __strtoul_internal): Do not set hidden attribute. * include/string.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__stpcpy, __strdup, __strerror_t, __strsep_g, memchr, memcmp, memcpy, memmove, memset, rawmemchr, stpcpy, strchr, strcmp, strlen, strnlen, strsep): Likewise. * include/sys/stat.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__fxstat, __fxstat64, __lxstat, __lxstat64, __xstat, __xstat64, __fxstatat64): Likewise. * include/sys/utsname.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__uname): Likewise. * include/sysdeps/generic/_itoa.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (_itoa_upper_digits, _itoa_lower_digits): Likewise. * sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not set. (NO_RTLD_HIDDEN): Set. * sysdeps/mach/hurd/configure: Refresh. * config.h.in: Refresh.
* Hide internal __setrlimit function [BZ #18822]H.J. Lu2017-10-011-0/+1
| | | | | | | | | | | | Hide internal __setrlimit function to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * include/sys/resource.h (__setrlimit): Add libc_hidden_proto. * resource/setrlimit.c (__setrlimit): Add libc_hidden_def. * sysdeps/mach/hurd/setrlimit.c (__setrlimit): Likewise. * sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Likewise. * sysdeps/unix/sysv/linux/setrlimit64.c (__GI___setrlimit): New.
* Hide internal __ifreq function [BZ #18822]H.J. Lu2017-10-011-12/+0
| | | | | | | | | | | | Hide internal __ifreq function to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * include/ifreq.h: New file. * sysdeps/generic/ifreq.h (__if_nextreq): Removed. (__ifreq): Likewise. * sysdeps/mach/hurd/ifreq.h (__if_nextreq): Removed. (__ifreq): Likewise.
* Hide internal signal functions [BZ #18822]H.J. Lu2017-10-013-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hide internal signal functions to allow direct access within libc.so and libc.a without using GOT nor PLT. __GI___kill and __GI___sigaltstack are defined when syscalls.list is used to generate them. Otherwise libc_hidden_def is needed explicitly. [BZ #18822] * include/signal.h (__kill): Add libc_hidden_proto. (__sigblock): Likewise. (__sigprocmask): Likewise. (__sigaltstack): Likewise. * signal/kill.c (__kill): Add libc_hidden_def. * signal/sigblock.c (__sigblock): Likewise. * signal/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/mach/hurd/kill.c (__kill): Likewise. * sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise. * sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/posix/sigblock.c (__sigblock): Likewise. * sysdeps/unix/sysv/linux/alpha/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/ia64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/sigprocmask.c (__sigprocmask): Likewise. * /sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/x86_64/sigprocmask.c (__sigprocmask): Likewise.
* Hide internal __ioctl function [BZ #18822]H.J. Lu2017-10-011-0/+1
| | | | | | | | | | | | | | | | | | Hide internal __ioctl function to allow direct access within libc.so and libc.a without using GOT nor PLT. __GI___ioctl is defined when sysdeps/unix/syscalls.list is used to generate ioctl. Otherwise libc_hidden_def is needed explicitly. [BZ #18822] * include/sys/ioctl.h (__ioctl): Add libc_hidden_proto. * misc/ioctl.c (__ioctl): Add libc_hidden_def. * sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise. * sysdeps/unix/sysv/linux/aarch64/ioctl.S (__ioctl): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl): Likewise. * sysdeps/unix/sysv/linux/powerpc/ioctl.c (__ioctl): Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S (__ioctl): Likewise.
* Hide internal sysinfo functions [BZ #18822]H.J. Lu2017-10-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Hide internal sysinfo functions to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * include/sys/sysinfo.h (__get_nprocs_conf): Add libc_hidden_proto. (__get_nprocs): Likewise. (__get_phys_pages): Likewise. (__get_avphys_pages): Likewise. (__get_child_max): Add attribute_hidden. * misc/getsysstats.c (__get_nprocs_conf): Add libc_hidden_def. (__get_nprocs): Likewise. (__get_phys_pages): Likewise. (__get_avphys_pages): Likewise. * sysdeps/mach/getsysstats.c (__get_nprocs_conf): Add libc_hidden_def. (__get_nprocs): Likewise. (__get_phys_pages): Likewise. (__get_avphys_pages): Likewise. * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Add libc_hidden_def. (__get_nprocs_conf): Likewise. (__get_phys_pages): Likewise. (__get_avphys_pages): Likewise.
* Mark internal dirent functions with attribute_hidden [BZ #18822]H.J. Lu2017-10-011-0/+1
| | | | | | | | | | | | | | | | | | | Mark internal dirent functions with attribute_hidden to allow direct access within libc.so and libc.a without using GOT nor PLT. __readdir64 is hidden with libc_hidden_proto and libc_hidden_def since the exported readdir64 is an alias of __readdir64. [BZ #18822] * include/dirent.h (__opendir): Always add attribute_hidden. (__fdopendir): Likewise. (__closedir): Likewise. (__readdir): Likewise. (__readdir64): Add libc_hidden_proto. * sysdeps/mach/hurd/readdir64.c (__readdir64): Add libc_hidden_def. * sysdeps/unix/sysv/linux/i386/readdir64.c (__readdir64): Likewise. * sysdeps/unix/sysv/linux/readdir64.c (__readdir64): Likewise. * sysdeps/unix/sysv/linux/wordsize-64/readdir.c (__GI___readdir64): New alias.
* hurd: Fix `seekdir' symbol exposition from `rewinddir'Samuel Thibault2017-09-282-3/+4
| | | | | | | | | | | `seekdir' is MISC || XOPEN, it should not be exposed along `rewinddir' which is POSIX. * include/dirent.h (__seekdir): New declaration. * sysdeps/mach/hurd/seekdir.c (seekdir): Rename to __seekdir and redefine as weak alias. * sysdeps/mach/hurd/rewinddir.c (__rewinddir): Use __seekdir instead of seekdir.
* hurd: Fix `revoke' symbol exposition from `unlockpt'Samuel Thibault2017-09-281-1/+3
| | | | | | | | | | | | `revoke' is MISC only, it should not be exposed along `unlockpt' which is XOPEN. * include/unistd.h (__revoke): New declaration. * misc/revoke.c (revoke): Rename to __revoke, and redefine as weak alias. * sysdeps/mach/hurd/revoke.c (revoke): Likewise. * sysdeps/unix/bsd/unlockpt.c (unlockpt): Use __revoke instead of revoke.
* hurd: Fix dirfd symbol exposition from ftwSamuel Thibault2017-09-281-1/+3
| | | | | | | | | | | dirfd is XOPEN2K8 only, it should not be exposed along ftw which is earlier. * include/dirent.h (__dirfd): New declaration. * dirent/dirfd.c (dirfd): Rename to __dirfd, and redefine as weak alias. * sysdeps/posix/dirfd/dirfd.c (dirfd): Likewise. * sysdeps/mach/hurd/dirfd.c (dirfd): Likewise. * io/ftw.c (open_dir_stream, ftw_dir): Use __dirfd instead of dirfd.
* hurd: Fix bits/socket.h conformitySamuel Thibault2017-09-241-9/+16
| | | | | | | | | | | | | * sysdeps/mach/hurd/bits/socket.h: Include <bits/wordsize.h> instead of <limits.h> (__need_NULL): Do not define. (__ss_aligntype): Use __WORDSIZE instead of ULONG_MAX to determine alignment. [!__USE_MISC] (pseudo_AF_XTP, pseudo_AF_RTIP, pseudo_AF_PIP, CMGROUP_MAX, cmsgcred): Do not define. (CMSG_FIRSTHDR, __cmsg_nxthdr): Use (struct cmsghdr *) 0 instead of NULL. * bits/socket.h: Likewise.