about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* 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 allocalim buildSamuel Thibault2018-01-281-2/+5
| | | | | * sysdeps/pthread/allocalim.h [!defined PTHREAD_STACK_MIN]: Do not check size against PTHREAD_STACK_MIN.
* 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-282-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-272-2/+2
| | | | | | | | | | | | | | | | timer_ptr2id and timer_id2ptr are used to convert between application-visible timer_t and struct timer_node *. timer_ptr2id was made to use void * instead of timer_t in 49b650430eb5 ('Update.') for no reason. It happens that on Linux timer_t is void *, so both that change and this commit are no-ops there, but not on systems where timer_t is not void *. Using timer_ptr2id for filling sival_ptr also does not make sense since that actually is a void *. * sysdeps/pthread/posix-timer.h (timer_ptr2id): Cast to timer_t instead of void *. * sysdeps/pthread/timer_create.c (timer_create): Do not use timer_ptr2id to cast struct timer_node * to void *.
* 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 warningsSamuel Thibault2018-01-271-6/+6
| | | | | | * sysdeps/generic/sigsetops.h (__sigemptyset, __sigfillset, __sigandset, __sigorset, __sigaddset, __sigdelset): Make them really return 0.
* hurd: fix warningSamuel Thibault2018-01-271-0/+2
| | | | * sysdeps/generic/sigset-cvt-mask.h: Include <sigsetops.h>.
* hurd: fix warningsSamuel Thibault2018-01-271-0/+11
| | | | | | * sysdeps/generic/not-cancel.h: Include <fcntl.h>, <unistd.h>, <sys/wait.h>, <time.h>, <sys/uio.h>. (NOT_CANCEL_H): Add inclusion guard.
* 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>.
* Update hppa libm-test-ulpsJames Clarke2018-01-271-26/+26
| | | | | | * sysdeps/hppa/fpu/libm-test-ulps: Update. Signed-off-by: James Clarke <jrtc27@jrtc27.com>
* Update Alpha libm-test-ulpsJames Clarke2018-01-271-26/+26
| | | | | | * sysdeps/alpha/fpu/libm-test-ulps: Update. Signed-off-by: James Clarke <jrtc27@jrtc27.com>
* Update sparc ULPs.Patrick McGehearty2018-01-261-26/+26
| | | | | * sysdeps/sparc/fpu/libm-test-ulps: Update cpow, ctan, ctanh, j0, j1, y0, yn ulps.
* Revert Intel CET changes to __jmp_buf_tag (Bug 22743)Carlos O'Donell2018-01-259-103/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit cba595c350e52194e10c0006732e1991e3d0803b and commit f81ddabffd76ac9dd600b02adbf3e1dac4bb10ec, ABI compatibility with applications was broken by increasing the size of the on-stack allocated __pthread_unwind_buf_t beyond the oringal size. Applications only have the origianl space available for __pthread_unwind_register, and __pthread_unwind_next to use, any increase in the size of __pthread_unwind_buf_t causes these functions to write beyond the original structure into other on-stack variables leading to segmentation faults in common applications like vlc. The only workaround is to version those functions which operate on the old sized objects, but this must happen in glibc 2.28. Thank you to Andrew Senkevich, H.J. Lu, and Aurelien Jarno, for submitting reports and tracking the issue down. The commit reverts the above mentioned commits and testing on x86_64 shows that the ABI compatibility is restored. A tst-cleanup1 regression test linked with an older glibc now passes when run with the newly built glibc. Previously a tst-cleanup1 linked with an older glibc would segfault when run with an affected glibc build. Tested on x86_64 with no regressions. Signed-off-by: Carlos O'Donell <carlos@redhat.com>
* Add support for the RISC-V-specific ELF flagsPalmer Dabbelt2018-01-251-0/+2
| | | | | | | | | | | | | | | | | | | | The RISC-V port defines ELF flags that enforce compatibility between various objects. This adds the shared support necessary for these flags. 2018-01-25 Palmer Dabbelt <palmer@sifive.com> * elf/cache.c (print_entry): Add FLAG_RISCV_FLOAT_ABI_SOFT and FLAG_RISCV_FLOAT_ABI_DOUBLE. * elf/elf.h (EF_RISCV_RVC): New define. (EF_RISCV_FLOAT_ABI): Likewise. (EF_RISCV_FLOAT_ABI_SOFT): Likewise. (EF_RISCV_FLOAT_ABI_SINGLE): Likewise. (EF_RISCV_FLOAT_ABI_DOUBLE): Likewise. (EF_RISCV_FLOAT_ABI_QUAD): Likewise. * sysdeps/generic/ldconfig.h (FLAG_RISCV_FLOAT_ABI_SOFT): New define. (FLAG_RISCV_FLOAT_ABI_DOUBLE): Likewise.
* LIBC_SLIBDIR_RTLDDIR: substitute arguments in single quotesAndreas Schwab2018-01-259-20/+20
| | | | | | | The arguments of the LIBC_SLIBDIR_RTLDDIR macro are used both in unquoted and single quoted context, so that neither shell nor makefile variable references work. Consistently put them in single quotes so that they can refer to makefile variables.
* Add localplt.data for ColdFire.Joseph Myers2018-01-242-0/+18
| | | | | | | | | | | | | | | The sole failure for ColdFire in the compilation part of the glibc testsuite is the localplt test. This patch adds a localplt baseline for ColdFire to eliminate that failure. The difference from the existing m68k baseline is that no PLT entry for _Unwind_Find_FDE is expected, because ColdFire does not set libc_cv_gcc_unwind_find_fde=yes. Tested with build-many-glibcs.py. * sysdeps/unix/sysv/linux/m68k/localplt.data: Move to .... * sysdeps/unix/sysv/linux/m68k/m680x0/localplt.data: ... here. * sysdeps/unix/sysv/linux/m68k/coldfire/localplt.data: New file.
* Add no-FPU ColdFire math_private.h.Joseph Myers2018-01-241-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | As with some other soft-float configurations, no-FPU ColdFire needs various fenv.h functions and glibc-internal macros overridden in math_private.h to avoid references to undefined FE_* macros when building glibc. This patch adds a suitable math_private.h, based on the MicroBlaze one (Nios II and Tile also have similar files). There's a case for having such a file in sysdeps/ieee754/soft-fp so this logic is applied more generally to configurations without exceptions and rounding modes, even when the relevant macros are defined in fenv.h - the only case where that might be inappropriate is ARM soft-float (where the fenv.h functions might or might not work at runtime, depending on whether the processor used at runtime supports VFP). There's also a case that soft-float configurations (on processors with both hard-float and soft-float) should more consistently avoid defining FE_* macros in bits/fenv.h when not actually supported. But both of those are separate potential cleanups. This allows the no-FPU ColdFire build to get further (another fix is needed to allow the build to complete). * sysdeps/m68k/coldfire/nofpu/math_private.h: New file. Based on MicroBlaze file.
* Add jmp_buf-macros.h for no-FPU ColdFire.Joseph Myers2018-01-242-0/+6
| | | | | | | | | | | | | | | Continuing the fixes for ColdFire glibc build with build-many-glibcs.py, given a GCC patch for the libgcc build failure, this patch adds jmp_buf-macros.h for no-FPU ColdFire. This allows the no-FPU build to progress further than without the patch (although other fixes are still needed for the build to complete). * sysdeps/unix/sysv/linux/m68k/coldfire/jmp_buf-macros.h: Move to .... * sysdeps/unix/sysv/linux/m68k/coldfire/fpu/jmp_buf-macros.h: ... here. * sysdeps/unix/sysv/linux/m68k/coldfire/nofpu/jmp_buf-macros.h: New file.
* Add jmp_buf-macros.h for ColdFire.Joseph Myers2018-01-242-0/+6
| | | | | | | | | | | | | | | | | | | | | | This patch adds a jmp_buf-macros.h for ColdFire. In conjunction with a GCC patch to fix the libgcc build failure for ColdFire <https://gcc.gnu.org/ml/gcc-patches/2018-01/msg02064.html> this suffices to restore the build (tested with build-many-glibcs.py). A further patch will be needed for soft-float ColdFire (while the function-calling ABI is the same for hard-float and soft-float ColdFire, it turns out the glibc ABI is not - so another ColdFire variant will be needed in build-many-glibcs.py), but I'll deal with that separately. Tested with build-many-glibcs.py (m68k-linux-gnu and m68k-linux-gnu-coldfire). (There's a localplt test failure for coldfire; that's the only failure in the compilation part of the testsuite.) * sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h: Move to .... * sysdeps/unix/sysv/linux/m68k/m680x0/jmp_buf-macros.h: ... here. * sysdeps/unix/sysv/linux/m68k/coldfire/jmp_buf-macros.h: New file.
* aarch64: Revert the change of the __reserved member of mcontext_tSzabolcs Nagy2018-01-242-2/+6
| | | | | | | | | | | | | | | | | | | | | | The uc_mcontext.__reserved member of ucontext_t is a user visible API, that should not be changed, because this is the only way to access cpu states of various extensions of linux asm/sigcontext.h, it does not violate namespace rules either, so revert this part of the commit commit 4fa9b3bfe6759c82beb4b043a54a3598ca467289 Commit: Joseph Myers <joseph@codesourcery.com> Fix mcontext_t sigcontext namespace (bug 21457). (In principle the user can type cast &uc_mcontext to struct sigcontext* to use the linux sigcontext fields, but that's not the existing practice since mcontext_t used to be a typedef of struct sigcontext.) [BZ #22742] * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h (__glibc_reserved1): Rename to __reserved and add comment. * sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym (__glibc_reserved1): Rename to __reserved.
* powerpc: Fix syscalls during early process initialization [BZ #22685]Tulio Magno Quites Machado Filho2018-01-193-4/+36
| | | | | | | | | | | | | | | | | | | | | | | | | The tunables framework needs to execute syscall early in process initialization, before the TCB is available for consumption. This behavior conflicts with powerpc{|64|64le}'s lock elision code, that checks the TCB before trying to abort transactions immediately before executing a syscall. This patch adds a powerpc-specific implementation of __access_noerrno that does not abort transactions before the executing syscall. Tested on powerpc{|64|64le}. [BZ #22685] * sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION_IMPL): Renamed from ABORT_TRANSACTION. (ABORT_TRANSACTION): Redirect to ABORT_TRANSACTION_IMPL. * sysdeps/powerpc/powerpc64/sysdep.h (ABORT_TRANSACTION, ABORT_TRANSACTION_IMPL): Likewise. * sysdeps/unix/sysv/linux/powerpc/not-errno.h: New file. Reuse Linux code, but remove the code that aborts transactions. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> Tested-by: Aurelien Jarno <aurelien@aurel32.net>
* generic if_ether.h: Fix buildSamuel Thibault2018-01-191-0/+1
| | | | * sysdeps/generic/netinet/if_ether.h: Include <stdint.h>.
* Fix backtrace for hppa (bug 22719).Joseph Myers2018-01-171-0/+1
| | | | | | | | | | | | | | | | | | | The only architecture in glibc that uses the generic debug/backtrace.c is hppa. The debug/tst-backtrace* tests fail for hppa, so in fact the generic debug/backtrace.c is not functional anywhere. Instead, the x86_64 version is a reasonably generic version that uses _Unwind_Backtrace from libgcc to backtrace using unwind info, and is used by several architectures. This patch adds hppa to the architectures using it (leaving open the possibility of a subsequent cleanup for 2.28 of moving the x86_64 version to debug/backtrace.c, and removing all the frame.h files that are now unused). Reported by Adhemerval in <https://sourceware.org/ml/libc-alpha/2018-01/msg00564.html> that this does fix the backtrace test failures for hppa. [BZ #22719] * sysdeps/hppa/backtrace.c: New file.
* x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]H.J. Lu2018-01-171-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | _dl_runtime_profile calls _dl_call_pltexit, passing a pointer to La_x86_64_retval which is allocated on stack. The lrv_vector0 field in La_x86_64_retval must be aligned to size of vector register. When allocating stack space for La_x86_64_retval, we need to make sure that the address of La_x86_64_retval + RV_VECTOR0_OFFSET is aligned to VEC_SIZE. This patch checks the alignment of the lrv_vector0 field and pads the stack space if needed. Tested with x32 and x86-64 on SSE4, AVX and AVX512 machines. It fixed FAIL: elf/tst-audit10 FAIL: elf/tst-audit4 FAIL: elf/tst-audit5 FAIL: elf/tst-audit6 FAIL: elf/tst-audit7 on x32 AVX512 machine. [BZ #22715] * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile): Properly align La_x86_64_retval to VEC_SIZE.
* Use LIBGCC_S_SO in x86_64 backtrace.Joseph Myers2018-01-161-1/+2
| | | | | | | | | | | | | | The x86_64 backtrace implementation is used as a generic implementation (unwinding via unwind info and _Unwind_Backtrace) by various other architectures. This patch makes it more generic by making it use LIBGCC_S_SO from gnu/lib-names.h instead of hardcoding the libgcc_s.so.1 name, so that it can also be used on hppa which uses libgcc_s.so.4. Tested for x86_64. * sysdeps/x86_64/backtrace.c: Include <gnu/lib-names.h>. (init): Use LIBGCC_S_SO not hardcoded "libgcc_s.so.1".
* aarch64: Update bits/hwcap.h for Linux 4.15.Szabolcs Nagy2018-01-162-2/+8
| | | | | | | | | | | | Define new HWCAP bits and add their name to dl-procinfo.c following the linux definitions. Synchronizing with v4.15-rc8 version of linux, these are not expected to change before the 4.15 release. * sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_SHA3): Define. (HWCAP_SM3, HWCAP_SM4, HWCAP_ASIMDDP, HWCAP_SHA512, HWCAP_SVE): Define. * sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c (_dl_aarch64_cap_flags): Update. (_DL_HWCAP_COUNT): Update.
* aarch64: make HWCAP updates less error proneSzabolcs Nagy2018-01-162-7/+4
| | | | | | | | | | | Remove unused _DL_HWCAP_LAST definition and move _DL_HWCAP_COUNT where it is needed (dl-procinfo.h always includes dl-procinfo.c). * sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h (_DL_HWCAP_LAST): Remove. (_DL_HWCAP_COUNT): Move to ... * sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c (_DL_HWCAP_COUNT): ... here.
* powerpc: Fix llround spurious inexact on 32-bit POWER4 [BZ #22697]Tulio Magno Quites Machado Filho2018-01-121-0/+5
| | | | | | | | | | This issue is similar to BZ #19235, where spurious exceptions are created from adding 0.5 then converting to an integer. The solution is based on Joseph's fix for BZ #19235. [BZ #22697] * sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S (__llround): Do not add 0.5 to integer or out-of-range arguments.
* aarch64: fix static pie enabled libc when main is in a shared librarySzabolcs Nagy2018-01-121-2/+11
| | | | | | | | | | | | | | | | | In the static pie enabled libc, crt1.o uses the same position independent code as rcrt1.o and crt1.o is used instead of Scrt1.o when -no-pie executables are linked. When main is not defined in the executable, but in a shared library crt1.o is currently broken, it assumes main is local. (glibc has a test for this but i missed it in my previous testing.) To make both rcrt1.o and crt1.o happy with the same code, a wrapper is introduced around main: with this crt1.o works with extern main symbol while rcrt1.o does not depend on GOT relocations. (The change only affects static pie enabled libc. Further simplification of start.S is possible in the future by using the same approach for Scrt1.o too.) * aarch64/start.S (_start): Use __wrap_main. (__wrap_main): New local symbol.
* linux: make getcwd(3) fail if it cannot obtain an absolute path [BZ #22679]Dmitry V. Levin2018-01-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Currently getcwd(3) can succeed without returning an absolute path because the underlying getcwd syscall, starting with linux commit v2.6.36-rc1~96^2~2, may succeed without returning an absolute path. This is a conformance issue because "The getcwd() function shall place an absolute pathname of the current working directory in the array pointed to by buf, and return buf". This is also a security issue because a non-absolute path returned by getcwd(3) causes a buffer underflow in realpath(3). Fix this by checking the path returned by getcwd syscall and falling back to generic_getcwd if the path is not absolute, effectively making getcwd(3) fail with ENOENT. The error code is chosen for consistency with the case when the current directory is unlinked. [BZ #22679] CVE-2018-1000001 * sysdeps/unix/sysv/linux/getcwd.c (__getcwd): Fall back to generic_getcwd if the path returned by getcwd syscall is not absolute. * io/tst-getcwd-abspath.c: New test. * io/Makefile (tests): Add tst-getcwd-abspath.
* Fix s390 linknamespace fallout of bug 22702 patch.Joseph Myers2018-01-121-1/+1
| | | | | | | | | | | | | | | My fix for bug 22702 introduced linknamespace test failures on s390x-linux-gnu and s390-linux-gnu because it made remainder call __feholdexcept, and the s390 __feholdexcept calls fegetenv, and remainder is in Unix98 and XPG4.2 but fegetenv isn't. This patch makes __feholdexcept call __fegetenv instead to avoid that namespace issue. Tested (compilation) with build-many-glibcs.py for s390x-linux-gnu, where it resolves the test failures. * sysdeps/s390/fpu/feholdexcpt.c (__feholdexcept): Call __fegetenv instead of fegetenv.
* Make default libc_feholdsetround_noex_ctx use __feholdexcept (bug 22702).Joseph Myers2018-01-111-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For soft-float powerpc, the math/test-nearbyint-except-2 test fails because nearbyintl traps when traps on "inexact" are enabled on entry (and an "inexact" exception is generated internally, though cleared for the final return). The problem is the default implementation of libc_feholdsetround_noex_ctx, which does not disable exception traps. There is some ambiguity about whether the *noex* interfaces are required to do so or only permitted to do so. But given that we support fe* interfaces to enable and disable traps (on architectures with that functionality), functions that must not raise an exception (must not leave the flag set on exit if not set on entry) should also not trap on it when traps on that exception are enabled. So it is appropriate to define these interfaces to have the feholdexcept effect of disabling exception traps; this patch updates the default implementation and comments accordingly. At least some architecture versions already disable traps; there are few uses of the *noex* interfaces at all, and while it's possible there are bugs on any architecture versions failing to disable traps that appear in the exp2 and remainder implementations, there are currently no tests, other than this one for nearbyintl (where only the ldbl-128ibm implementation uses SET_RESTORE_ROUND_NOEX), that would fail as a result of such a bug. (Hard-float powerpc does disable traps here, hence the nearbyintl failure not appearing there.) Tested for powerpc (soft-float). This brings that configuration to clean math/ test results, provided you build with GCC 8 to get the fix for GCC bug 64811. [BZ #22702] * sysdeps/generic/math_private.h (libc_feresetround_noex): Update comment to say exceptions are discarded. (libc_feholdsetround_noex_ctx): Use __feholdexcept instead of __fegetenv. (SET_RESTORE_ROUND_NOEX): Update comment to say non-stop mode must be enabled.
* csu: Update __libgcc_s_init commentFlorian Weimer2018-01-111-2/+6
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Fix ldbl-128ibm log1pl (-qNaN) spurious "invalid" exception (bug 22693).Joseph Myers2018-01-101-2/+2
| | | | | | | | | | | | | | | The ldbl-128ibm implementation of log1pl does ordered comparisons on a negative qNaN argument, so resulting in spurious "invalid" exceptions (for soft-float powerpc; hard-float only avoids this because of GCC bug 58684 meaning ordered comparison instructions never get generated). This patch fixes this by arranging for the test for NaN or infinity arguments to handle negative arguments as well. Tested for powerpc (soft float). [BZ #22693] * sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Handle negative arguments in test for NaN or infinity argument.
* nptl: Open libgcc.so with RTLD_NOW during pthread_cancel [BZ #22636]Florian Weimer2018-01-101-1/+1
| | | | | | | | | Disabling lazy binding reduces stack usage during unwinding. Note that RTLD_NOW only makes a difference if libgcc.so has not already been loaded, so this is only a partial fix. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* 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.