about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* S390: Add arch13 memmem ifunc variant.Stefan Liebler2019-03-226-6/+201
| | | | | | | | | | | | | | | | | | | | This patch introduces the new arch13 ifunc variant for memmem. For needles longer than 9 bytes it is relying on the common-code implementation. For shorter needles it is using the new vstrs instruction which is able to search a substring within a vector register. ChangeLog: * sysdeps/s390/Makefile (sysdep_routines): Add memmem-arch13. * sysdeps/s390/ifunc-memmem.h (HAVE_MEMMEM_ARCH13, MEMMEM_ARCH13, MEMMEM_Z13_ONLY_USED_AS_FALLBACK, HAVE_MEMMEM_IFUNC_AND_ARCH13_SUPPORT): New defines. * sysdeps/s390/memmem-arch13.S: New file. * sysdeps/s390/memmem-vx.c: Omit GI symbol for z13 memmem ifunc variant if it is only used as fallback. * sysdeps/s390/memmem.c (memmem): Add arch13 variant in ifunc selector. * sysdeps/s390/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Add ifunc variant for arch13 memmem.
* S390: Add arch13 strstr ifunc variant.Stefan Liebler2019-03-226-6/+219
| | | | | | | | | | | | | | | | | | | | This patch introduces the new arch13 ifunc variant for strstr. For needles longer than 9 charachters it is relying on the common-code implementation. For shorter needles it is using the new vstrs instruction which is able to search a substring within a vector register. ChangeLog: * sysdeps/s390/Makefile (sysdep_routines): Add strstr-arch13. * sysdeps/s390/ifunc-strstr.h (HAVE_STRSTR_ARCH13, STRSTR_ARCH13, STRSTR_Z13_ONLY_USED_AS_FALLBACK, HAVE_STRSTR_IFUNC_AND_ARCH13_SUPPORT): New defines. * sysdeps/s390/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Add ifunc variant for arch13 strstr. * sysdeps/s390/strstr-arch13.S: New file. * sysdeps/s390/strstr-vx.c: Omit GI symbol for z13 strstr ifunc variant if it is only used as fallback. * sysdeps/s390/strstr.c (strstr): Add arch13 variant in ifunc selector.
* S390: Add arch13 memmove ifunc variant.Stefan Liebler2019-03-225-5/+99
| | | | | | | | | | | | | | | | | | | | | This patch introduces the new arch13 ifunc variant for memmove. For the forward or non-overlapping case it is just using memcpy. For the backward case it relies on the new instruction mvcrl. The instruction copies up to 256 bytes at once. In case of an overlap, it copies the bytes like copying them one by one starting from right to left. ChangeLog: * sysdeps/s390/ifunc-memcpy.h (HAVE_MEMMOVE_ARCH13, MEMMOVE_ARCH13 HAVE_MEMMOVE_IFUNC_AND_ARCH13_SUPPORT): New defines. * sysdeps/s390/memcpy-z900.S: Add arch13 memmove implementation. * sysdeps/s390/memmove.c (memmove): Add arch13 variant in ifunc selector. * sysdeps/s390/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Add ifunc variant for arch13 memmove. * sysdeps/s390/multiarch/ifunc-resolve.h (S390_STFLE_BITS_ARCH13_MIE3, S390_IS_ARCH13_MIE3): New defines.
* S390: Add configure check to detect support for arch13.Stefan Liebler2019-03-222-0/+120
| | | | | | | | | | | | | Add two configure checks which detect if arch13 is supported by the assembler at all - by explicitely setting the machine - and if it is supported with default settings. ChangeLog: * config.h.in (HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT, HAVE_S390_ARCH13_ASM_SUPPORT): New undefine. * sysdeps/s390/configure.ac: Add checks for arch13 support. * sysdeps/s390/configure: Regenerated.
* S390: Add new hwcap values for new cpu architecture arch13.Stefan Liebler2019-03-223-4/+13
| | | | | | | | | | | | | | | | | | | | | | The new hwcap values indicate support for: -"Vector-Enhancements Facility 2" (tag "vxe2", hwcap 2^15) -"Vector-Packed-Decimal-Enhancement Facility" (tag "vxp", hwcap 2^16) -"Enhanced-Sort Facility" (tag "sort", hwcap 2^17) -"Deflate-Conversion Facility" (tag "dflt", hwcap 2^18) The vxe2 hwcap is also marked as important hwcap. ChangeLog: * sysdeps/s390/dl-procinfo.c (_dl_s390_cap_flags): Add vxe2, vxp, dflt, sort flags. * sysdeps/s390/dl-procinfo.h: Add HWCAP_S390_VXRS_EXT2, HWCAP_S390_VXRS_PDE, HWCAP_S390_SORT, HWCAP_S390_DFLT capabilities. (HWCAP_IMPORTANT): Add HWCAP_S390_VXRS_EXT2. * sysdeps/unix/sysv/linux/s390/bits/hwcap.h (HWCAP_S390_VXRS_EXT2, HWCAP_S390_VXRS_PDE, HWCAP_S390_SORT, HWCAP_S390_DFLT): Define.
* S390: Mark vx and vxe as important hwcap.Stefan Liebler2019-03-211-1/+2
| | | | | | | | | | | This patch adds vx and vxe as important hwcaps which allows one to provide shared libraries tuned for platforms with non-vx/-vxe, vx or vxe. ChangeLog: * sysdeps/s390/dl-procinfo.h (HWCAP_IMPORTANT): Add HWCAP_S390_VX and HWCAP_S390_VXE.
* Add AArch64 HWCAPs from Linux 5.0.Joseph Myers2019-03-192-2/+6
| | | | | | | | | | | | | | | | This patch adds new AArch64 HWCAPs from Linux 5.0 to the AArch64 bits/hwcap.h and dl-procinfo.c. Tested (compilation only) with build-many-glibcs.py for aarch64-linux-gnu. * sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_SB): New macro. (HWCAP_PACA): Likewise. (HWCAP_PACG): Likewise. * sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c (_DL_HWCAP_COUNT): Increase to 32. (_dl_aarch64_cap_flags): Add new entries for new HWCAPs.
* Update syscall-names.list for Linux 5.0.Joseph Myers2019-03-151-2/+3
| | | | | | | | | | | | | | | | This patch updates sysdeps/unix/sysv/linux/syscall-names.list for Linux 5.0. Based on testing with build-many-glibcs.py, the only new entry needed is for old_getpagesize (a newly added __NR_* name for an old syscall on ia64). (Because 5.0 changes how syscall tables are handled in the kernel, checking diffs wasn't a useful way of looking for new syscalls in 5.0 as most of the syscall tables were moved to the new representation without actually adding any syscalls to them.) Tested with build-many-glibcs.py. * sysdeps/unix/sysv/linux/syscall-names.list: Update kernel version to 5.0. (old_getpagesize): New syscall.
* Remove obsolete, never-implemented XSI STREAMS declarationsFlorian Weimer2019-03-1414-179/+0
| | | | | | | | | | | | | | | | | | | The stub implementations are turned into compat symbols. Linux actually has two reserved system call numbers (for getpmsg and putpmsg), but these system calls have never been implemented, and there are no plans to implement them, so this patch replaces the wrappers with the generic stubs. According to <https://bugzilla.redhat.com/show_bug.cgi?id=436349>, the presence of the XSI STREAMS declarations is a minor portability hazard because they are not actually implemented. This commit does not change the TIRPC support code in sunrpc/rpc_svcout.c. It uses additional XTI functionality and therefore never worked with glibc. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* hurd: Add no-op version of __res_enable_icmp [BZ #24047]Florian Weimer2019-03-131-0/+27
| | | | | | | | | | Mach does not support IP_RECVERR, so replace this function with a stub in a sysdeps override for Hurd. This fixes commit 08504de71813ddbd447bfbca4a325cbe8ce8bcda ("resolv: Enable full ICMP errors for UDP DNS sockets [BZ #24047]"). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Move inttypes.h and stdint.h to stdlib.Zack Weinberg2019-03-132-753/+0
| | | | | | | | | | | | | | inttypes.h and stdint.h are in sysdeps/generic, but there are no other versions of these headers anywhere in the source tree, so they aren’t actually system-dependent. Move them to the subdirectory that installs them (stdlib). Reviewed-by: Joseph Myers <joseph@codesourcery.com> * sysdeps/generic/inttypes.h, sysdeps/generic/stdint.h: Move to stdlib. * include/inttypes.h: Adjust to match. * include/stdint.h: New wrapper.
* Fix output of LD_SHOW_AUXV=1.Stefan Liebler2019-03-135-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with commit 1616d034b61622836d3a36af53dcfca7624c844e the output was corrupted on some platforms as _dl_procinfo was called for every auxv entry and on some architectures like s390 all entries were represented as "AT_HWCAP". This patch is removing the condition and let _dl_procinfo decide if an entry is printed in a platform specific or generic way. This patch also adjusts all _dl_procinfo implementations which assumed that they are only called for AT_HWCAP or AT_HWCAP2. They are now just returning a non-zero-value for entries which are not handled platform specifc. ChangeLog: * elf/dl-sysdep.c (_dl_show_auxv): Remove condition and always call _dl_procinfo. * sysdeps/unix/sysv/linux/s390/dl-procinfo.h (_dl_procinfo): Ignore types other than AT_HWCAP. * sysdeps/sparc/dl-procinfo.h (_dl_procinfo): Likewise. * sysdeps/unix/sysv/linux/i386/dl-procinfo.h (_dl_procinfo): Likewise. * sysdeps/powerpc/dl-procinfo.h (_dl_procinfo): Adjust comment in the case of falling back to generic output mechanism. * sysdeps/unix/sysv/linux/arm/dl-procinfo.h (_dl_procinfo): Likewise.
* C-SKY: mark lr as undefined to stop unwindingMao Han2019-03-113-2/+11
| | | | | | | | | | Mark the lr register as undefined at the start of execution, so unwind will stop at this frame. run-backtrace-*.sh from elfutils testsuite will fail without this patch. * sysdeps/csky/abiv2/start.S: Mark lr as undefined. * sysdeps/unix/sysv/linux/csky/abiv2/clone.S: Likewise. * sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S: Likewise.
* C-SKY: remove user_regs definitionMao Han2019-03-112-46/+12
| | | | | | | | | | | | C-SKY GDB dose not use this file for ptrace and coredump. ptrace can use pt_regs definition from linux kernel directly. The old definition only got 34 regs instead of 38 regs from linux kernel, which will corrupted the memory after ptrace PTRACE_GETREGSET call. * sysdeps/unix/sysv/linux/csky/sys/procfs.h: Use linux definition directly. * sysdeps/unix/sysv/linux/csky/sys/user.h: Remove user_regs definition.
* C-SKY: fix sigcontext miss matchMao Han2019-03-112-66/+62
| | | | | | | | | | | | C-SKY defines SIGCONTEXT as siginfo_t *_si, struct ucontext_t * for __profil_counter. ucontext_t get an extra __mask field which is miss match with the struct sigcontext from linux kernel. The time value from gprof report will be always zero without this patch. This patch also fix the registers sequence in register-dump.h. * sysdeps/unix/sysv/linux/csky/register-dump.h: Adjust offset change. * sysdeps/unix/sysv/linux/csky/sys/ucontext.h: Remove __mask field in mcontext_t
* Break lines before not after operators, batch 4.Joseph Myers2019-03-0710-51/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes further coding style issues where code should have broken lines before operators in accordance with the GNU Coding Standards but instead was breaking lines after them. Tested for x86_64, and with build-many-glibcs.py. * stdio-common/vfscanf-internal.c (ARG): Break lines before rather than after operators. * sysdeps/mach/hurd/setitimer.c (timer_thread): Likewise. (setitimer_locked): Likewise. * sysdeps/mach/hurd/sigaction.c (__sigaction): Likewise. * sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise. * sysdeps/mach/pagecopy.h (PAGE_COPY_FWD): Likewise. * sysdeps/mach/thread_state.h (machine_get_basic_state): Likewise. * sysdeps/powerpc/powerpc64/tst-ucontext-ppc64-vscr.c (PPC_CPU_SUPPORTED): Likewise. * sysdeps/unix/sysv/linux/alpha/a.out.h (N_TXTOFF): Likewise. * sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h (stat_overflow): Likewise. (statfs_overflow): Likewise. * sysdeps/unix/sysv/linux/tst-personality.c (do_test): Likewise. * sysdeps/unix/sysv/linux/tst-ttyname.c (eq_ttyname): Likewise. (eq_ttyname_r): Likewise. (run_chroot_tests): Likewise.
* Fix location where math-vector-fortran.h is installed.marxin2019-03-071-0/+0
| | | | | | | | | | | | 2019-03-07 Martin Liska <mliska@suse.cz> * math/Makefile: Change location where math-vector-fortran.h is installed. * math/finclude/math-vector-fortran.h: Move from bits/math-vector-fortran.h. * sysdeps/x86/fpu/finclude/math-vector-fortran.h: Move from sysdeps/x86/fpu/bits/math-vector-fortran.h. * scripts/check-installed-headers.sh: Skip Fortran header files. * scripts/check-wrapper-headers.py: Likewise.
* nptl: Assume __ASSUME_FUTEX_CLOCK_REALTIME supportAdhemerval Zanella2019-03-054-220/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This patch assumes realtime clock support for nptl and thus removes all the associated code. For __pthread_mutex_timedlock the fallback usage for the case where lll_futex_timed_wait_bitset it not set define is also removed. The generic lowlevellock-futex.h always define it, so for NPTL code the check always yield true. Checked on x86_64-linux-gnu and i686-linux-gnu. * nptl/nptl-init.c (__have_futex_clock_realtime, __have_futex_clock_realtime): Remove definition. (__pthread_initialize_minimal_internal): Remove FUTEX_CLOCK_REALTIME check test for !__ASSUME_FUTEX_CLOCK_REALTIME. * nptl/pthread_mutex_timedlock.c (__pthread_mutex_timedlock): Assume __ASSUME_FUTEX_CLOCK_REALTIME support. * sysdeps/unix/sysv/linux/i386/lowlevellock.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_FUTEX_CLOCK_REALTIME): Remove. * sysdeps/nptl/lowlevellock-futex.h (lll_futex_timed_wait_bitset): Adjust comment.
* powerpc: Fix build of wcscpy with --disable-multi-archGabriel F. T. Gomes2019-03-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Since the commit commit 81a14439417552324ec6ca71f65ddf8e7cdd51c7 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Tue Feb 5 17:35:12 2019 -0200 wcsmbs: optimize wcscat powerpc64 and powerpc64le builds fail when configured with --disable-multi-arch and --with-cpu=power6 (or newer), due to an undefined reference to __GI___wcscpy. This patch fixes this on sysdeps/powerpc/powerpc64/power6/wcscpy.c, which is only used when multi-arch is disabled. This patch does nothing for the failures on 32-bits powerpc builds, because the file is under the powerpc64 subdirectory, however, powerpc builds were already failing with --disable-multi-arch, with multiple error messages, even before the aforementioned commit. Tested for powerpc, powerpc64, and powerpc64le with multi-arch enabled (all pass) and disabled (powerpc still fails as explained above).
* elf: Remove remnants of MAP_ANON emulationFlorian Weimer2019-03-041-4/+0
| | | | | | Most of the code was removed in commit 20739e5454c12acbc0479387fe795c5b19a4166f ("* elf/dl-load.c: Remove support for systems without MAP_ANON.").
* S390: Increase function alignment to 16 bytes.Stefan Liebler2019-03-042-2/+2
| | | | | | | | | | | | | Set the default function alignment to 16 bytes in order to get rid of some unwanted performance effects. Please see also GCC commit "S/390: Set default function alignment to 16." (Subversion revision 262817) ChangeLog: * sysdeps/s390/s390-64/sysdep.h(ENTRY): Use alignment of 16byte. * sysdeps/s390/s390-32/sysdep.h: Likewise.
* ldbl-opt: Reuse test cases from misc/ that check long doubleGabriel F. T. Gomes2019-03-011-0/+16
| | | | | | | | | This patch adds test cases for the compatibility versions of the functions: err, errx, verr, verrx, warn, warnx, vwarn, vwarnx (from err.h), error, and error_at_line (from error.h), when long double has the same format as double (-mlong-double-64). Tested for powerpc, powerpc64 and powerpc64le.
* ldbl-opt: Add error and error_at_line (bug 23984)Gabriel F. T. Gomes2019-03-0111-0/+42
| | | | | | | | | | On platforms where long double may have the same format as double (-mlong-double-64), error and error_at_line do not take that into account and might produce wrong output if a long double conversion is requested by the format string ('%Lf'). This patch adds compatibility functions for this situation and redirects calls via header magic. Tested for powerpc, powerpc64 and powerpc64le.
* ldbl-opt: Add err, errx, verr, verrx, warn, warnx, vwarn, and vwarnx (bug 23984)Gabriel F. T. Gomes2019-03-0111-0/+136
| | | | | | | | | | | | | | | When support for long double format with 128-bits (-mlong-double-128) was added for platforms where long double had the same format as double, such as powerpc, compatibility versions for the functions listed in the commit title were missed. Since the older format of long double can still be used (with -mlong-double-64), using these functions with a format string that requests the printing of long double variables will produce wrong outputs. This patch adds the missing compatibility functions and header magic to redirect calls to them when -mlong-double-64 is in use. Tested for powerpc, powerpc64 and powerpc64le.
* ldbl-opt: Reuse argp tests that print long doubleGabriel F. T. Gomes2019-03-011-0/+10
| | | | | | | | | The test case tst-ldbl-argp checks that the conversion specifier '%Lf' correctly prints long double values with the default long double format for a platform. This patch reuses the test case for long double with the same format as double (-mlong-double-64). Tested for powerpc, powerpc64 and powerpc64le.
* ldbl-opt: Add argp_error and argp_failure (bug 23983)Gabriel F. T. Gomes2019-03-0111-0/+43
| | | | | | | | | | The functions argp_error and argp_failure are missing support for printing long double values when long double has the same format as double. This patch adds the new functions __nldbl_argp_error and __nldbl_argp_failure, as well as header magic to redirect calls to them when -mlong-double-64 is in use. Tested for powerpc, powerpc64 and powerpc64le.
* S390: Fix introduction of __wcscpy and weak wcscpy symbols.Stefan Liebler2019-03-011-1/+5
| | | | | | | | | | | | The recent commit 81a14439417552324ec6ca71f65ddf8e7cdd51c7 has introduced __wcscpy, __GI___wcscpy and the weak alias wcscpy. This patch also introduces those symbols if glibc is build with CFLAGS="-march=z13" where the ifunc is omitted. ChangeLog: * sysdeps/s390/wcscpy-vx.S: Add strong aliases to __wcscpy, __GI___wcscpy and weak alias to wcscpy.
* __netlink_assert_response: Add more __libc_fatal newlines [BZ #20271]Florian Weimer2019-03-011-2/+2
| | | | | | Commit a6e8926f8d49a213a9abb1a61f6af964f612ab7f ("[BZ #20271] Add newlines in __libc_fatal calls.") missed two places that need changing.
* Add more spaces before '('.Joseph Myers2019-02-289-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes more places where a space should have been present before '(' in accordance with the GNU Coding Standards (as with the previous patch, mainly for calls to sizeof). Tested with build-many-glibcs.py. * sysdeps/powerpc/powerpc32/dl-machine.c (__elf_machine_fixup_plt): Use space before '('. (__process_machine_rela): Likewise. * sysdeps/powerpc/powerpc32/register-dump.h (register_dump): Likewise. * sysdeps/powerpc/powerpc64/le/fpu/sfp-machine.h (TI_BITS): Likewise. * sysdeps/powerpc/powerpc64/register-dump.h (register_dump): Likewise. * sysdeps/powerpc/test-arith.c (union_t): Likewise. (pattern): Likewise. (delta): Likewise. (check_result): Likewise. (check_excepts): Likewise. (check_op): Likewise. (fail_xr): Likewise. * sysdeps/unix/alpha/sysdep.h (syscall_promote): Likewise. * sysdeps/unix/sysv/linux/alpha/a.out.h (AOUTHSZ): Likewise. (SCNHSZ): Likewise. * sysdeps/unix/sysv/linux/hppa/makecontext.c (FRAME_SIZE_BYTES): Likewise. (ARGS): Likewise. (__makecontext): Likewise. * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h (ucontext_t): Likewise.
* powerpc: Fix linknamespace introduced by 4d8015639a75Adhemerval Zanella2019-02-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | This patch fixes the linknamespace issues add on wcscpy refactor for powerpc-linux-gnu-power4 as shown by the tests: FAIL: conform/POSIX/fnmatch.h/linknamespace FAIL: conform/POSIX/glob.h/linknamespace FAIL: conform/POSIX/wordexp.h/linknamespace FAIL: conform/XPG4/fnmatch.h/linknamespace FAIL: conform/XPG4/glob.h/linknamespace FAIL: conform/XPG4/wordexp.h/linknamespace FAIL: conform/XPG42/fnmatch.h/linknamespace FAIL: conform/XPG42/glob.h/linknamespace FAIL: conform/XPG42/wordexp.h/linknamespace [initial] wordexp -> [libc.a(wordexp.o)] fnmatch -> [libc.a(fnmatch.o)] __wcscat -> [libc.a(wcscat.o)] __wcscpy -> [libc.a(wcscpy.o)] wcscpy Checked on powerpc-linux-gnu-power4. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c: Define ifunc symbol as __wcspcy instead of wcscpy.
* hurd: Add renameat2 support for RENAME_NOREPLACESamuel Thibault2019-02-273-21/+60
| | | | | | | | | * include/stdio.h (__renameat2): New hidden prototype. * stdio-common/renameat2.c (__renameat2): Add hidden definition. * sysdeps/mach/hurd/renameat.c (__renameat): Move implementation to... * sysdeps/mach/hurd/renameat2.c (__renameat2): ... new function, and add support for RENAME_NOREPLACE. * sysdeps/unix/sysv/linux/renameat2.c (__renameat2): Add hidden definition.
* Add some spaces before '('.Joseph Myers2019-02-2719-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes various places where a space should have been present before '(' in accordance with the GNU Coding Standards. Most but not all of the fixes in this patch are for calls to sizeof (but it's not exhaustive regarding such calls that should be fixed). Tested for x86_64, and with build-many-glibcs.py. * benchtests/bench-strcpy.c (do_test): Use space before '('. * benchtests/bench-string.h (cmdline_process_function): Likewise. * benchtests/bench-strlen.c (do_test): Likewise. (test_main): Likewise. * catgets/gencat.c (read_old): Likewise. * elf/cache.c (load_aux_cache): Likewise. * iconvdata/bug-iconv8.c (do_test): Likewise. * math/test-tgmath-ret.c (do_test): Likewise. * nis/nis_call.c (rec_dirsearch): Likewise. * nis/nis_findserv.c (__nis_findfastest_with_timeout): Likewise. * nptl/tst-audit-threads.c (do_test): Likewise. * nptl/tst-cancel4-common.h (set_socket_buffer): Likewise. * nss/nss_test1.c (init): Likewise. * nss/test-netdb.c (test_hosts): Likewise. * posix/execvpe.c (maybe_script_execute): Likewise. * stdio-common/tst-fmemopen4.c (do_test): Likewise. * stdio-common/tst-printf.c (do_test): Likewise. * stdio-common/vfscanf-internal.c (__vfscanf_internal): Likewise. * stdlib/fmtmsg.c (NKEYWORDS): Likewise. * stdlib/qsort.c (STACK_SIZE): Likewise. * stdlib/test-canon.c (do_test): Likewise. * stdlib/tst-swapcontext1.c (do_test): Likewise. * string/memcmp.c (OPSIZ): Likewise. * string/test-strcpy.c (do_test): Likewise. (do_random_tests): Likewise. * string/test-strlen.c (do_test): Likewise. (test_main): Likewise. * string/test-strrchr.c (do_test): Likewise. (do_random_tests): Likewise. * string/tester.c (test_memrchr): Likewise. (test_memchr): Likewise. * sysdeps/generic/memcopy.h (OPSIZ): Likewise. * sysdeps/generic/unwind-dw2.c (execute_stack_op): Likewise. * sysdeps/generic/unwind-pe.h (read_sleb128): Likewise. (read_encoded_value_with_base): Likewise. * sysdeps/hppa/dl-machine.h (elf_machine_runtime_setup): Likewise. * sysdeps/hppa/fpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/ia64/fpu/sfp-machine.h (TI_BITS): Likewise. * sysdeps/mach/hurd/spawni.c (__spawni): Likewise. * sysdeps/posix/spawni.c (maybe_script_execute): Likewise. * sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (query_auxv): Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/arm/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/arm/ioperm.c (init_iosys): Likewise. * sysdeps/unix/sysv/linux/csky/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/m68k/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/nios2/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/spawni.c (maybe_script_execute): Likewise. * sysdeps/unix/sysv/linux/x86/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/x86/bits/sigcontext.h (FP_XSTATE_MAGIC2_SIZE): Likewise. * sysdeps/x86/fpu/sfp-machine.h (TI_BITS): Likewise. * time/test_time.c (main): Likewise.
* wcsmbs: optimize wcscatAdhemerval Zanella2019-02-276-35/+42
| | | | | | | | | | | | | | | | | | | | | | | | This patch rewrites wcscat using wcslen and wcscpy. This is similar to the optimization done on strcat by 6e46de42fe. The strcpy changes are mainly to add the internal alias to avoid PLT calls. Checked on x86_64-linux-gnu and a build against the affected architectures. * include/wchar.h (__wcscpy): New prototype. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c (__wcscpy): Route internal symbol to generic implementation. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c (wcscpy): Add internal __wcscpy alias. * sysdeps/powerpc/powerpc64/multiarch/wcscpy.c (wcscpy): Likewise. * sysdeps/s390/wcscpy.c (wcscpy): Likewise. * sysdeps/x86_64/multiarch/wcscpy.c (wcscpy): Likewise. * wcsmbs/wcscpy.c (wcscpy): Add * sysdeps/x86_64/multiarch/wcscpy-c.c (WCSCPY): Adjust macro to use generic implementation. * wcsmbs/wcscat.c (wcscat): Rewrite using wcslen and wcscpy.
* wcsmbs: optimize wcpcpyAdhemerval Zanella2019-02-271-36/+0
| | | | | | | | | | | This patch rewrites wcpcpy using wcslen and wmemcpy. This is similar to the optimizatio done on stpcpy by f559d8cf29. Checked on x86_64-linux-gnu and string tests on a simulated m68k-linux-gnu. * sysdeps/m68k/wcpcpy.c: Remove file. * wcsmbs/wcpcpy.c (__wcpcpy): Rewrite using wcslen and wmemcpy.
* Break further lines before not after operators.Joseph Myers2019-02-2626-146/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch continues the process of fixing coding style to break lines before not after operators in accordance with the GNU Coding Standards, fixing such issues in a non-exhaustive selection of sysdeps files that had them. Tested for x86_64, and with build-many-glibcs.py. * sysdeps/arm/sysdep.h (#if condition): Break lines before rather than after operators. * sysdeps/mach/hurd/fork.c (__fork): Likewise. * sysdeps/mach/hurd/getcwd.c (__hurd_canonicalize_directory_name_internal): Likewise. * sysdeps/mach/hurd/htl/pt-mutex-consistent.c (pthread_mutex_consistent): Likewise. * sysdeps/mach/hurd/htl/pt-mutex-init.c (_pthread_mutex_init): Likewise. * sysdeps/mach/hurd/htl/pt-mutex-transfer-np.c (__pthread_mutex_transfer_np): Likewise. * sysdeps/mach/hurd/htl/pt-mutex-unlock.c (__pthread_mutex_unlock): Likewise. * sysdeps/mach/hurd/htl/pt-mutex.h (ROBUST_LOCK): Likewise. (mtx_owned_p): Likewise. * sysdeps/mach/hurd/htl/pt-mutexattr-getrobust.c (pthread_mutexattr_getrobust): Likewise. * sysdeps/mach/hurd/i386/init-first.c (init1): Likewise. * sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler): Likewise. * sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise. * sysdeps/mach/hurd/jmp-unwind.c (_longjmp_unwind): Likewise. * sysdeps/mach/hurd/kill.c (__kill): Likewise. * sysdeps/mach/hurd/mig-reply.c (__mig_get_reply_port): Likewise. * sysdeps/mach/hurd/ptrace.c (ptrace): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/unix/sysv/linux/aarch64/sysdep.h (#if condition): Likewise. * sysdeps/unix/sysv/linux/alpha/ioperm.c (process_cpuinfo): Likewise. * sysdeps/unix/sysv/linux/bits/timex.h (STA_RONLY): Likewise. * sysdeps/unix/sysv/linux/csky/sysdep.h (#if condition): Likewise. * sysdeps/unix/sysv/linux/generic/____longjmp_chk.c (____longjmp_chk): Likewise. * sysdeps/unix/sysv/linux/generic/futimesat.c (futimesat): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c (__get_clockfreq_via_cpuinfo): Likewise.
* Add and move fall-through comments in system-specific code.Joseph Myers2019-02-268-2/+31
| | | | | | | | | | | | | | | | | | | | | | This patch fixes -Wimplicit-fallthrough warnings in system-specific code that show up building glibc with -Wextra, by adding fall-through comments, or moving existing such comments to the place required for them to work (immediately before the case label being fallen through). Tested with build-many-glibcs.py. * sysdeps/i386/dl-machine.h (elf_machine_rela): Add fall-through comments. * sysdeps/m68k/m680x0/fpu/s_cexp_template.c (s(__cexp)): Likewise. * sysdeps/m68k/memcopy.h (WORD_COPY_FWD): Likewise. (WORD_COPY_BWD): Likewise. * sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/s390/iso-8859-1_cp037_z900.c (TR_LOOP): Likewise. * sysdeps/mips/dl-machine.h (elf_machine_reloc): Move fall-through comment. * sysdeps/mips/dl-trampoline.c (__dl_runtime_resolve): Likewise.
* Break more lines before not after operators.Joseph Myers2019-02-2530-107/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes further coding style fixes where code was breaking lines after an operator, contrary to the GNU Coding Standards. As with the previous patch, it is limited to files following a reasonable approximation to GNU style already, and is not exhaustive; more such issues remain to be fixed. Tested for x86_64, and with build-many-glibcs.py. * dirent/dirent.h [!_DIRENT_HAVE_D_NAMLEN && _DIRENT_HAVE_D_RECLEN] (_D_ALLOC_NAMLEN): Break lines before rather than after operators. * elf/cache.c (print_cache): Likewise. * gshadow/fgetsgent_r.c (__fgetsgent_r): Likewise. * htl/pt-getattr.c (__pthread_getattr_np): Likewise. * hurd/hurdinit.c (_hurd_setproc): Likewise. * hurd/hurdkill.c (_hurd_sig_post): Likewise. * hurd/hurdlookup.c (__file_name_lookup_under): Likewise. * hurd/hurdsig.c (_hurd_internal_post_signal): Likewise. (reauth_proc): Likewise. * hurd/lookup-at.c (__file_name_lookup_at): Likewise. (__file_name_split_at): Likewise. (__directory_name_split_at): Likewise. * hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Likewise. * hurd/port2fd.c (_hurd_port2fd): Likewise. * iconv/gconv_dl.c (do_print): Likewise. * inet/netinet/in.h (struct sockaddr_in): Likewise. * libio/wstrops.c (_IO_wstr_seekoff): Likewise. * locale/setlocale.c (new_composite_name): Likewise. * malloc/memusagestat.c (main): Likewise. * misc/fstab.c (fstab_convert): Likewise. * nptl/pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise. * nss/nss_compat/compat-grp.c (getgrent_next_nss): Likewise. (getgrent_next_file): Likewise. (internal_getgrnam_r): Likewise. (internal_getgrgid_r): Likewise. * nss/nss_compat/compat-initgroups.c (getgrent_next_nss): Likewise. (internal_getgrent_r): Likewise. * nss/nss_compat/compat-pwd.c (getpwent_next_nss_netgr): Likewise. (getpwent_next_nss): Likewise. (getpwent_next_file): Likewise. (internal_getpwnam_r): Likewise. (internal_getpwuid_r): Likewise. * nss/nss_compat/compat-spwd.c (getspent_next_nss_netgr): Likewise. (getspent_next_nss): Likewise. (internal_getspnam_r): Likewise. * pwd/fgetpwent_r.c (__fgetpwent_r): Likewise. * shadow/fgetspent_r.c (__fgetspent_r): Likewise. * string/strchr.c (STRCHR): Likewise. * string/strchrnul.c (STRCHRNUL): Likewise. * sysdeps/aarch64/fpu/fpu_control.h (_FPU_FPCR_IEEE): Likewise. * sysdeps/aarch64/sfp-machine.h (_FP_CHOOSENAN): Likewise. * sysdeps/csky/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/generic/memcopy.h (PAGE_COPY_FWD_MAYBE): Likewise. * sysdeps/generic/symbol-hacks.h (__stack_chk_fail_local): Likewise. * sysdeps/gnu/netinet/ip_icmp.h (ICMP_INFOTYPE): Likewise. * sysdeps/gnu/updwtmp.c (TRANSFORM_UTMP_FILE_NAME): Likewise. * sysdeps/gnu/utmp_file.c (TRANSFORM_UTMP_FILE_NAME): Likewise. * sysdeps/hppa/jmpbuf-unwind.h (_JMPBUF_UNWINDS): Likewise. * sysdeps/mach/hurd/bits/stat.h (S_ISPARE): Likewise. * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): Likewise. (open_file): Likewise. * sysdeps/mach/hurd/htl/pt-mutexattr-setprotocol.c (pthread_mutexattr_setprotocol): Likewise. * sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise. * sysdeps/mach/hurd/mmap.c (__mmap): Likewise. * sysdeps/mach/hurd/ptrace.c (ptrace): Likewise. * sysdeps/mach/hurd/spawni.c (__spawni): Likewise. * sysdeps/microblaze/dl-machine.h (elf_machine_type_class): Likewise. (elf_machine_rela): Likewise. * sysdeps/mips/mips32/sfp-machine.h (_FP_CHOOSENAN): Likewise. * sysdeps/mips/mips64/sfp-machine.h (_FP_CHOOSENAN): Likewise. * sysdeps/mips/sys/asm.h (multiple #if conditionals): Likewise. * sysdeps/posix/rename.c (rename): Likewise. * sysdeps/powerpc/novmx-sigjmp.c (__novmx__sigjmp_save): Likewise. * sysdeps/powerpc/sigjmp.c (__vmx__sigjmp_save): Likewise. * sysdeps/s390/fpu/fenv_libc.h (FPC_VALID_MASK): Likewise. * sysdeps/s390/utf8-utf16-z9.c (gconv_end): Likewise. * sysdeps/unix/grantpt.c (grantpt): Likewise. * sysdeps/unix/sysv/linux/a.out.h (N_TXTOFF): Likewise. * sysdeps/unix/sysv/linux/updwtmp.c (TRANSFORM_UTMP_FILE_NAME): Likewise. * sysdeps/unix/sysv/linux/utmp_file.c (TRANSFORM_UTMP_FILE_NAME): Likewise. * sysdeps/x86/cpu-features.c (get_common_indices): Likewise. * time/tzfile.c (__tzfile_compute): Likewise.
* Add new Fortran vector math header file.marxin2019-02-201-0/+43
|
* powerpc64le: Remove test for GCC 6.2Gabriel F. T. Gomes2019-02-202-69/+1
| | | | | | | | | | | | | | | | | | | | | | The configure fragment for powerpc64le contains a test for the presence of several compiler builtins and of the __float128 type, which are provided by GCC 6.2 for powerpc64le. Since this configure test was added, the compiler version required to build glibc for powerpc64le was different than that required for the other architectures. Now that glibc requires GCC 6.2 globally (since commit ID 4dcbbc3b28aa), this patch removes the powerpc64le-specific test. Even tough the configure test checks for compiler features rather than compiler version, the intent of the test was to stop build attempts at early stages, if they had been configured with a too old compiler. It was not the intention of the test to detect compiler breakage (such as the removal of the required compiler features in future GCC versions), and glibc is not the place to test for compiler regressions, anyway. Tested for powerpc64le with GCC 6.2 (built with build-many-glibcs.py). Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* Fix SPARC64 handling of R_SPARC_H34 (bug 24231).Joseph Myers2019-02-181-0/+1
| | | | | | | | | | | | | | | | Building glibc with -Wextra shows a -Wimplicit-fallthrough warning for SPARC64 that appears to be a real bug in glibc. The dynamic linker handling of R_SPARC_H34 falls through to that of R_SPARC_H44, which in the case of this code is nonsensical (it means the value computed for R_SPARC_H34 gets overwritten by one computed with the different logic for R_SPARC_H44). Thus, this patch adds the missing break there. Note: I do not have a testcase to demonstrate this bug. Tested with build-many-glibcs.py. [BZ #24231] * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Add break after R_SPARC_H34 case.
* misc/tst-clone3: Fix waiting for exited thread.Stefan Liebler2019-02-181-8/+15
| | | | | | | | | | | | | | | | | | | | | | | From time to time the test misc/tst-clone3 fails with a timeout. Then futex_wait is blocking. Usually ctid should be set to zero due to CLONE_CHILD_CLEARTID and the futex should be waken up. But the fail occures if the thread has already exited before ctid is set to the return value of clone(). Then futex_wait() will block as there will be nobody who wakes the futex up again. This patch initializes ctid to a known value before calling clone and the kernel is the only one who updates the value to zero after clone. If futex_wait is called then it is either waked up due to the exited thread or the futex syscall fails as *ctid_ptr is already zero instead of the specified value 1. ChangeLog: * sysdeps/unix/sysv/linux/tst-clone3.c (do_test): Initialize ctid with a known value and remove update of ctid after clone. (wait_tid): Adjust arguments and call futex_wait with ctid_val as assumed current value of ctid_ptr.
* Move remaining nptl_db headers to sysdeps/nptlFlorian Weimer2019-02-162-0/+553
| | | | | | | sys/procfs.h was already using this sysdeps directory. This avoids the need for nptl-specific wrapper headers under include/, a generic location in the source tree.
* io: Consolidate lockf implementationAdhemerval Zanella2019-02-159-78/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With internal fcntl64 internal (commit 06ab719d), it is possible to consolidate lockf implementation by using the LFS fcntl interface instead of using arch and system-specific implementations. For Linux, the i386 implementation is used as generic implementation by replacing the direct syscall with fcntl64 call. The LFS symbol alias for default LFS ABI (__OFF_T_MATCHES_OFF64_T) is used to avoid the duplicate symbol (instead of overriding the implementation with an empty file). For Hurd lockf64 semantic is changed: previous generic lockf64 implementation returned EOVERFLOW if LEN input is larger than 32-bit off_t. However, Hurd fcntl64 implementation for F_GETLK64, F_SETLK64, and F_SETLKW64 do accept off64_t inputs (__f_setlk accepts only off64_t inputs). Checked on i686-linux-gnu and x86_64-linux-gnu along with a i686-gnu build. * io/Makefile (tests): Add tst-lockf. * io/lockf.c (lockf): Use __fcntl and only define for !__OFF_T_MATCHES_OFF64_T. * io/lockf64.c (__lockf64): Call __fcntl64 and alias to lockf for __OFF_T_MATCHES_OFF64_T case. * io/tst-lockf.c: New file. * sysdeps/unix/sysv/linux/i386/lockf64.c: Remove file. * sysdeps/unix/sysv/linux/arm/lockf64.c: Likewise. * sysdeps/unix/sysv/linux/m68k/lockf64.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/lockf64.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/lockf64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/lockf64.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/lockf64.c: Likewise. * sysdeps/unix/sysv/linux/sh/lockf64.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/lockf64.c: Likewise.
* nptl: Reinstate pthread_timedjoin_np as a cancellation point (BZ#24215)Adhemerval Zanella2019-02-1412-293/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch ce7eb0e90315 ("nptl: Cleanup cancellation macros") changed the join sequence for internal common __pthread_timedjoin_ex to use the new macro lll_wait_tid. The idea was this macro would issue the cancellable futex operation depending whether the timeout is used or not. However if a timeout is used, __lll_timedwait_tid is called and it is not a cancellable entrypoint. This patch fixes it by simplifying the code in various ways: - Instead of adding the cancellation handling on __lll_timedwait_tid, it moves the generic implementation to pthread_join_common.c (called now timedwait_tid with some fixes to use the correct type for pid). - The llvm_wait_tid macro is removed, along with its replication on x86_64, i686, and sparc arch-specific lowlevellock.h. - sparc32 __lll_timedwait_tid is also removed, since the code is similar to generic one. - x86_64 and i386 provides arch-specific __lll_timedwait_tid which is also removed since they are similar in functionality to generic C code and there is no indication it is better than compiler generated code. New tests, tst-join8 and tst-join9, are provided to check if pthread_timedjoin_np acts as a cancellation point. Checked on x86_64-linux-gnu, i686-linux-gnu, sparcv9-linux-gnu, and aarch64-linux-gnu. [BZ #24215] * nptl/Makefile (lpthread-routines): Remove lll_timedwait_tid. (tests): Add tst-join8 tst-join9. * nptl/lll_timedwait_tid.c: Remove file. * sysdeps/sparc/sparc32/lll_timedwait_tid.c: Likewise. * sysdeps/unix/sysv/linux/i386/lll_timedwait_tid.c: Likewise. * sysdeps/sysv/linux/x86_64/lll_timedwait_tid.c: Likewise. * nptl/pthread_join_common.c (timedwait_tid): New function. (__pthread_timedjoin_ex): Act as cancellation entrypoint is block is set. * nptl/tst-join5.c (thread_join): New function. (tf1, tf2, do_test): Use libsupport and add pthread_timedjoin_np check. * nptl/tst-join8.c: New file. * nptl/tst-join9.c: Likewise. * sysdeps/nptl/lowlevellock-futex.h (lll_futex_wait_cancel, lll_futex_timed_wait_cancel): Add generic macros. * sysdeps/nptl/lowlevellock.h (__lll_timedwait_tid, lll_wait_tid): Remove definitions. * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise. * sysdeps/sparc/sparc32/lowlevellock.c (__lll_timedwait_tid): Remove function. * sysdeps/unix/sysv/linux/i386/lowlevellock.S (__lll_timedwait_tid): Likewise. * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise. * sysdeps/unix/sysv/linux/lowlevellock-futex.h (lll_futex_timed_wait_cancel): New macro.
* RISC-V: Fix elfutils testsuite unwind failures.Jim Wilson2019-02-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clone.S patch fixes 2 elfutils testsuite unwind failures, where the backtrace gets stuck repeating __thread_start until we hit the backtrace limit. This was confirmed by building and installing a patched glibc and then building elfutils and running its testsuite. Unfortunately, the testcase isn't working as expected and I don't know why. The testcase passes even when my clone.S patch is not installed. The testcase looks logically similarly to the elfutils testcases that are failing. Maybe there is a subtle difference in how the glibc unwinding works versus the elfutils unwinding? I don't have good gdb pthread support yet, so I haven't found a way to debug this. Anyways, I don't know if the testcase is useful or not. If the testcase isn't useful then maybe the clone.S patch is OK without a testcase? Jim [BZ #24040] * elf/Makefile (CFLAGS-tst-unwind-main.c): Add -DUSE_PTHREADS=0. * elf/tst-unwind-main.c: If USE_PTHEADS, include pthread.h and error.h (func): New. (main): If USE_PTHREADS, call pthread_create to run func. Otherwise call func directly. * nptl/Makefile (tests): Add tst-unwind-thread. (CFLAGS-tst-unwind-thread.c): Define. * nptl/tst-unwind-thread.c: New file. * sysdeps/unix/sysv/linux/riscv/clone.S (__thread_start): Mark ra as undefined.
* Add fall-through comments.Joseph Myers2019-02-122-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds fall-through comments in some cases where -Wextra produces implicit-fallthrough warnings. The patch is non-exhaustive. Apart from architecture-specific code for non-x86_64 architectures, it does not change sunrpc/xdr.c (legacy code, probably should have such changes, but left to be dealt with separately), or places that already had comments about the fall-through but not matching the form expected by -Wimplicit-fallthrough=3 (the default level with -Wextra; my inclination is to adjust those comments to match rather than downgrading to -Wimplicit-fallthrough=1 to allow any comment), or one place where I thought the implicit fallthrough was not correct and so should be handled separately as a bug fix. I think the key thing to consider in review of this patch is whether the fall-through is indeed intended and correct in each place where such a comment is added. Tested for x86_64. * elf/dl-exception.c (_dl_exception_create_format): Add fall-through comments. * elf/ldconfig.c (parse_conf_include): Likewise. * elf/rtld.c (print_statistics): Likewise. * locale/programs/charmap.c (parse_charmap): Likewise. * misc/mntent_r.c (__getmntent_r): Likewise. * posix/wordexp.c (parse_arith): Likewise. (parse_backtick): Likewise. * resolv/ns_ttl.c (ns_parse_ttl): Likewise. * sysdeps/x86/cpu-features.c (init_cpu_features): Likewise. * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
* Use float in e_sqrt.cPaul Clarke2019-02-111-1/+1
| | | | | | | | | | | | | | | | The type used within e_sqrt.c(__slow_ieee754_sqrtf) was, unnecessarily and likely inadvertently, double. float is not only appropriate, but also more efficient, avoiding the need for the compiler to emit a round-to-single-precision instruction. This is the difference in compiled code: 0000000000000000 <__ieee754_sqrtf>: 0: 2c 08 20 ec fsqrts f1,f1 - 4: 18 08 20 fc frsp f1,f1 - 8: 20 00 80 4e blr + 4: 20 00 80 4e blr (Found by Anton Blanchard.)
* Remove powerpc bits/mathinline.h.Joseph Myers2019-02-081-58/+0
| | | | | | | | | | | | | | Continuing the process of moving away from having bits/mathinline.h headers in glibc, leaving the compiler to inline functions as appropriate depending on the options passed to it, this patch removes the header for powerpc. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88558> is the corresponding GCC bug for adding replacements for these powerpc (32-bit-only) lrint / lrintf inlines. Tested with build-many-glibcs.py for its powerpc configurations. * sysdeps/powerpc/bits/mathinline.h: Remove.
* Move generic <bits/unistd_ext.h> to a more regular locationFlorian Weimer2019-02-081-21/+0
| | | | | | | | | | No functional change; the previous path worked as well, but it re-added the obsolete sysdeps/generic/bits directory, which was removed (for the first time) in commit c72565e5f1124c2dc72573e83406fe999e56091f. Fixes commit e47d82c99a6db060419b421768aced76bea92997 ("Provide <bits/unistd_ext.h> as a sysdeps header exclusively").
* Provide <bits/unistd_ext.h> as a sysdeps header exclusivelyFlorian Weimer2019-02-081-0/+21
| | | | | | | | | | | | | Non-sysdeps headers cannot be overriden by sysdeps headers across the entire build, so it is necessary to turn such extension headers into sysdeps headers themselves. The approach here follows the existing <bits/shm.h> header (although it uses sysdeps/gnu instead of sysdeps/generic). Fixes commit 1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92 ("Linux: Add gettid system call wrapper [BZ #6399]") and commit 8f89ab216f205c2ffd90d1fc8454efdfc0b01dee ("posix: Fix missing wrapper header for <bits/unistd_ext.h>").