about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* ChangeLog: Convert leading spaces to tabsTAMUKI Shoichi2019-04-161-45/+45
|
* nss_dns: Do not replace root domain with empty stringFlorian Weimer2019-04-113-6/+6
| | | | | | The purpose of the bp[0] == '.' check is unclear. Only the root domain starts with '.'. The empty string is accepted as a domain name in many places, denoting the root, but using it implicitly is confusing.
* alloc_buffer: Return unqualified pointer type in alloc_buffer_nextFlorian Weimer2019-04-112-5/+33
| | | | | | | | alloc_buffer_next is useful for peeking to the remaining part of the buffer and update it, with subsequent allocation (once the length is known) using alloc_buffer_alloc_bytes. This is not as robust as the other interfaces, but it allows using alloc_buffer with string-writing interfaces such as snprintf and ns_name_ntop.
* Add missing ChangeLog entry for commit 10dd69e9a00Florian Weimer2019-04-111-0/+5
|
* Add more bug numbers to historic ChangeLog entriesFlorian Weimer2019-04-111-0/+2
|
* Add missing percent sign to conversion specifierTAMUKI Shoichi2019-04-111-3/+3
|
* Add bug number to historic ChangeLog entryFlorian Weimer2019-04-101-0/+1
|
* malloc: Set and reset all hooks for tracing (Bug 16573)Carlos O'Donell2019-04-092-26/+61
| | | | | | | | | | | | | | | | | | | | If an error occurs during the tracing operation, particularly during a call to lock_and_info() which calls _dl_addr, we may end up calling back into the malloc-subsystem and relock the loader lock and deadlock. For all intents and purposes the call to _dl_addr can call any of the malloc family API functions and so we should disable all tracing before calling such loader functions. This is similar to the strategy that the new malloc tracer takes when calling the real malloc, namely that all tracing ceases at the boundary to the real function and any faults at that point are the purvue of the library (though the new tracer does this on a per-thread basis in an MT-safe fashion). Since the new tracer and the hook deprecation are not yet complete we must fix these issues where we can. Tested on x86_64 with no regressions. Co-authored-by: Kwok Cheung Yeung <kcy@codesourcery.com> Reviewed-by: DJ Delorie <dj@redhat.com>
* Improve string benchtestsWilco Dijkstra2019-04-0910-141/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | Replace slow byte-oriented tests in several string benchmarks with the generic implementations from the string/ directory so the comparisons are more realistic and useful. * benchtests/bench-stpcpy.c (SIMPLE_STPCPY): Remove function. (generic_stpcpy): New function. * benchtests/bench-stpncpy.c (SIMPLE_STPNCPY): Remove function. (generic_stpncpy): New function. * benchtests/bench-strcat.c (SIMPLE_STRCAT): Remove function. (generic_strcat): New function. * benchtests/bench-strcpy.c (SIMPLE_STRCPY): Remove function. (generic_strcpy): New function. * benchtests/bench-strncat.c (SIMPLE_STRNCAT): Remove function. (STUPID_STRNCAT): Remove function. (generic_strncat): New function. * benchtests/bench-strncpy.c (SIMPLE_STRNCPY): Remove function. (STUPID_STRNCPY): Remove function. (generic_strncpy): New function. * benchtests/bench-strnlen.c (SIMPLE_STRNLEN): Remove function. (generic_strnlen): New function. (memchr_strnlen): New function. * benchtests/bench-strlen.c (generic_strlen): Define for WIDE. (memchr_strlen): Likewise.
* Improve bench-strstrWilco Dijkstra2019-04-092-83/+147
| | | | | | | | | | | | | | | | | | | | | Improve bench-strstr by using an extract from the manual as the input to make the test more realistic. Use the same input for both found and fail cases rather than using a memset of '0' for most of the string, which measures performance of strchr rather than strstr. Add result checking to catch potential errors. Remove the repeated tests at slightly different alignments and add more large needle and haystack testcases. Replace stupid_strstr with an efficient basic implementation. Add the Two-way implementation to simplify comparisons with much faster generic implementations. * benchtests/bench-strstr.c (input): Add realistic input text. (stupid_strstr): Remove function. (basic_strstr): Add function. (twoway_strstr): Add function. (do_one_test): Add result checking. (do_test): Use new input text. Remove accidental early matches. (test_main): Improve range of tests, reduce unaligned cases.
* Improve bench-memmemWilco Dijkstra2019-04-092-17/+68
| | | | | | | | | | Improve bench-memmem by replacing simple_memmem with a more efficient implementation. Add the Two-way implementation to enable direct comparison with the optimized memmem. * benchtests/bench-memmem.c (simple_memmem): Remove function. (basic_memmem): Add function. (twoway_memmem): Add function.
* Remove TIMING_INITWilco Dijkstra2019-04-096-17/+9
| | | | | | | | | | Remove TIMING_INIT since it's no longer used. * benchtests/bench-malloc-simple.c: Remove TIMING_INIT. * benchtests/bench-malloc-thread.c: Likewise. * benchtests/bench-skeleton.c: Likewise. * benchtests/bench-strtod.c: Likewise. * benchtests/bench-timing.h: Likewise.
* resolv: Remove RES_INSECURE1, RES_INSECURE2Florian Weimer2019-04-085-23/+25
| | | | Always perform the associated security checks.
* resolv: Remove support for RES_USE_INET6 and the inet6 optionFlorian Weimer2019-04-0815-680/+61
| | | | | | | | | This functionality was deprecated in glibc 2.25. This commit only includes the core changes to remove the functionality. It does not remove the RES_USE_INET6 handling in the individual NSS service modules and the res_use_inet6 function. These changes will happen in future commits.
* aarch64: thunderx2 memcpy implementation cleanup and streamliningAnton Youdkevitch2019-04-052-21/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here is the updated patch for improving the long unaligned code path (the one using "ext" instruction). 1. Always taken conditional branch at the beginning is removed. 2. Epilogue code is placed after the end of the loop to reduce the number of branches. 3. The redundant "mov" instructions inside the loop are gone due to the changed order of the registers in the "ext" instructions inside the loop, the prologue has additional "ext" instruction. 4.Updating count in the prologue was hoisted out as it is the same update for each prologue. 5. Invariant code of the loop epilogue was hoisted out. 6. As the current size of the ext chunk is exactly 16 instructions long "nop" was added at the beginning of the code sequence so that the loop entry for all the chunks be aligned. * sysdeps/aarch64/multiarch/memcpy_thunderx2.S: Cleanup branching and remove redundant code.
* powerpc: Use generic wcsrchr optimizationAdhemerval Zanella2019-04-0416-320/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the power6 wcsrchr optimization and uses generic implementation instead. Currently, both power6 and power7 IFUNC variant resulting binary are essentially the same and the generic implementation with unrolling loop set to 8 also results in similar performance. Checked on powerpc64-linux-gnu. * sysdeps/powerpc/Makefile [$(subdir) == wcsmbs] (CFLAGS-wcsrchr.c): New rule. * sysdeps/powerpc/power6/wcsrchr.c: Remove file. * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power6.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-power7.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power6.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcsrchr-power7.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcsrchr-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c: Likewise. * sysdeps/powerpc/powerpc64/power6/wcsrchr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/Makefile [$(subdir) == wcsmbs] (sysdeps_routines): Remove wcsrchr-power6 and wcsrchr-power7. (CFLAGS-wcsrchr-power7.c, CFLAGS-wcsrchr-power6.c): Remove rule. * sysdeps/powerpc/powerpc64/multiarch/Makefile: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c: Remove wcsrchr optimizations. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Likewise.
* wcsmbs: Use loop_unroll on wcsrchrAdhemerval Zanella2019-04-042-6/+19
| | | | | | | | | This allows an architecture to set explicit loop unrolling. Checked on aarch64-linux-gnu. * wcsmbs/wcsrchr.c (WCSRCHR): Use loop_unroll.h to parametrize the loop unroll.
* powerpc: Use generic wcschr optimizationAdhemerval Zanella2019-04-0416-362/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the power6 wcschr optimization and uses generic implementation instead. Currently, both power6 and power7 IFUNC variant resulting binary are essentially the same and the generic implementation with unrolling loop set to 8 also results in similar performance. Checked on powerpc64-linux-gnu. * sysdeps/powerpc/Makefile [$(subdir) == wcsmbs] (CFLAGS-wcschr.c): New rule. * sysdeps/powerpc/power6/wcschr.c: Remove file. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power6.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-power7.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr-power6.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr-power7.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr.c: Likewise. * sysdeps/powerpc/powerpc64/power6/wcschr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/Makefile [$(subdir) == wcsmbs] (sysdeps_routines): Remove wcschr-power6 and wcschr-power7. (CFLAGS-wcschr-power7.c, CFLAGS-wcschr-power6.c): Remove rule. * sysdeps/powerpc/powerpc64/multiarch/Makefile: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c: Remove wcschr optimizations. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Likewise.
* wcsmbs: Use loop_unroll on wcschrAdhemerval Zanella2019-04-042-5/+20
| | | | | | | | | This allows an architecture to set explicit loop unrolling. Checked on aarch64-linux-gnu. * wcsmbs/wcschr.c (WCSCHR): Use loop_unroll.h to parametrize the loop unroll.
* powerpc: Use generic wcscpy optimizationAdhemerval Zanella2019-04-0416-337/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the power6 wcscpy optimization and uses generic implementation instead. Currently, both power6 and power7 IFUNC variant resulting binary are essentially the same and the generic implementation with unrolling loop set to 8 also results in similar performance. Checked on powerpc64-linux-gnu. * sysdeps/powerpc/Makefile [$(subdir) == wcsmbs] (CFLAGS-wcscpy.c): New rule. * sysdeps/powerpc/power6/wcscpy.c: Remove file. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power6.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-power7.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcscpy-power6.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcscpy-power7.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcscpy-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcscpy.c: Likewise. * sysdeps/powerpc/powerpc64/power6/wcscpy.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/Makefile [$(subdir) == wcsmbs] (sysdeps_routines): Remove wcscpy-power6 and wcscpy-power7. (CFLAGS-wcscpy-power7.c, CFLAGS-wcscpy-power6.c): Remove rule. * sysdeps/powerpc/powerpc64/multiarch/Makefile: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c: Remove wcscpy optimizations. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Likewise.
* wcsmbs: Add wcscpy loop unroll optionAdhemerval Zanella2019-04-043-0/+103
| | | | | | | | | | | This allows an architecture to use the old generic implementation and also set explicit loop unrolling. Checked on aarch64-linux-gnu. * include/loop_unroll.h: New file. * wcsmbs/wcscpy (__wcscpy): Add option to use loop unrolling besides generic implementation.
* time/tst-strftime3.c: Disable snprintf warning.DJ Delorie2019-04-032-0/+15
| | | | | | | snprintf will only truncate the output if the data its given is corrupted, but a truncated buffer will not match the "pristine" data's buffer, which is all we need. So just disable the warning via the DIAG macros.
* Add Reiwa era tests to time/tst-strftime3.cDJ Delorie2019-04-022-1/+62
| | | | Also fix printf warning
* ja_JP locale: Add entry for the new Japanese era [BZ #22964]TAMUKI Shoichi2019-04-024-7/+22
| | | | | | | | | | | | | | | | | | | | The Japanese era name will be changed on May 1, 2019. The Japanese government made a preliminary announcement on April 1, 2019. The glibc ja_JP locale must be updated to include the new era name for strftime's alternative year format support. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com> ChangeLog: [BZ #22964] * localedata/locales/ja_JP (LC_TIME): Add entry for the new Japanese era. * time/tst-strftime2.c (dates): Add 2019-04-30 and 2019-05-01. (mkreftable): Add rules for the new Japanese era and the new dates.
* time: Add tests for Minguo calendar [BZ #24293]TAMUKI Shoichi2019-04-023-8/+45
| | | | | | | | | | | | | | | Co-authored-by: Rafal Luzynski <digitalfreak@lingonborough.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com> ChangeLog: [BZ #24293] * time/Makefile (LOCALES): Add zh_TW.UTF-8, cmn_TW.UTF-8, hak_TW.UTF-8, nan_TW.UTF-8, and lzh_TW.UTF-8. * time/tst-strftime2.c (locales): Likewise. (dates): Add 1910-04-01, 1911-12-31, 1912-01-01, 1913-04-01, 2010-04-01, and 2011-04-01. (mkreftable): Add rules for the new locales and the new dates.
* time/tst-strftime2.c: Make the file easier to maintainTAMUKI Shoichi2019-04-022-40/+82
| | | | | | | | | | | | | | | | | | | | | | Express the years as full Gregorian years (e.g., 1988 instead of 88) and months with natural numbers (1-12 rather than 0-11). Compare actual dates rather than indexes when selecting the era name. Declare the local variable era as a string character pointer rather than an array of chars where the actual string is copied which might lead to potential buffer overflows in future. Co-authored-by: Rafal Luzynski <digitalfreak@lingonborough.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com> ChangeLog: * time/tst-strftime2.c (date_t): Explicitly define the type. (dates): Use natural month and year numbers to express a date. (is_before): New function to compare dates. (mkreftable): Minor improvements to simplify maintenance. (do_test): Reflect the changes in dates array.
* NEWS: Mention Minguo calendar support added [BZ #24293]TAMUKI Shoichi2019-04-021-0/+4
| | | | | Co-authored-by: Rafal Luzynski <digitalfreak@lingonborough.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Add verbose comments to 'era' in ja_JP locale.Carlos O'Donell2019-04-012-0/+22
| | | | | Reviewed-by: Rafal Luzynski <digitalfreak@lingonborough.com> Reviewed-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
* Fix strptime era handling, add more strftime tests [BZ #24394]DJ Delorie2019-04-014-3/+473
| | | | | | | | | | | | | | | Test the transition points between all the currently listed Japanese era name changes. This includes testing the transition between the first year date and the second year date. This test will help test the upcoming Japanese era name change. Also fixes a fencepost error where the era name isn't properly parsed by strptime in the last (partial) year of the era. Example: if an era change happens in Feb 1990, and again in Aug 1995, that's 5.5 years long, but the 0.5 year wasn't accounted for. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* alpha: Improve sysdeps/alpha/divqu.S and sysdeps/alpha/remqu.SUros Bizjak2019-04-013-8/+20
| | | | | | | | | | | * sysdeps/alpha/divqu.S (__divqu): Move save of $f0 and excb after conditional branch to DIVBYZERO. Fix unwind info. * sysdeps/alpha/remqu.S (__remqu): Move saves of $f0, $f1, $f2 and excb after conditional branch to $powerof2. Add missing unop instructions and .align directives and reorder instructions to match __divqu. Signed-off-by: Uroš Bizjak <ubizjak@gmail.com>
* alpha: Do not redefine __NR_shmat or __NR_osf_shmatRichard Henderson2019-04-013-3/+14
| | | | | | | | | | | | | | Fixes build using v5.1-rc1 headers. The kernel has cleaned up how these are defined. Previous behavior was to define __NR_osf_shmat as 209 and not define __NR_shmat. Current behavior is to define __NR_shmat as 209 and then define __NR_osf_shmat as __NR_shmat. * sysdeps/unix/sysv/linux/alpha/kernel-features.h (__NR_shmat): Do not redefine. * sysdeps/unix/sysv/linux/alpha/sysdep.h (__NR_osf_shmat): Do not redefine.
* RISC-V: Fix `test' operand error with soft-float ABI being configuredMaciej W. Rozycki2019-03-303-2/+8
| | | | | | | | | | | | | | Fix a: .../sysdeps/unix/sysv/linux/riscv/configure: line 181: test: =: unary operator expected message produced by the RISC-V configure fragment with the soft-float ABI selected, caused by $libc_cv_riscv_float_abi evaluating to nil in the invocation of `test $libc_cv_riscv_float_abi = no'. * sysdeps/unix/sysv/linux/riscv/configure.ac: Quote $libc_cv_riscv_float_abi in `test' invocation. * sysdeps/unix/sysv/linux/riscv/configure: Regenerate.
* [powerpc] Use __builtin_{mffs,mtfsf}Paul A. Clarke2019-03-294-12/+16
| | | | | | | | | | | | | | | | | | | Replace inline asm uses of the "mffs" and "mtfsf" instructions with the analogous GCC builtins. __builtin_mffs and __builtin_mtfsf are both available in GCC 5 and above. Given the minimum GCC level for GLibC is now GCC 6.2, it is safe to use these builtins without restriction. 2019-03-29 Paul A. Clarke <pc@us.ibm.com> * sysdeps/powerpc/fpu/fenv_libc.h (fegetenv_register): Replace inline asm with builtin. * sysdeps/powerpc/powerpc64/le/fpu/sfp-machine.h (FP_INIT_ROUNDMODE): Likewise. * sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (_GET_DI_FPSCR): Likewise. (_GET_SI_FPSCR): Likewise. (_SET_SI_FPSCR): Likewise.
* ChangeLog: Correct more dates.Rafal Luzynski2019-03-281-4/+4
|
* ChangeLog: Correct two dates.Rafal Luzynski2019-03-281-2/+2
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* math: Enable some math builtins for clangAdhemerval Zanella2019-03-262-6/+18
| | | | | | | | | | | | | | | This patch enable the builtin usage for clang for the C99 functions fpclassify, isfinite, isnormal, isnan, isinf, and sigbit. This allows clang optimize the calls on frontend instead of call the appropriate glibc symbols. Checked on aarch64-linux-gnu and x86_64-linux-gnu. I checked the supported version for each builtin based on released version from clang/llvm. * math/math.h (fpclassify, isfinite, isnormal, isnan): Use builtin for clang 2.8. (signbit): Use builtin for clang 3.3. (isinf): Use builtin for clang 3.7.
* powerpc: Remove ununsed s_float_bitwise.hAdhemerval Zanella2019-03-252-115/+4
| | | | | | | | | | | This file is not used anywhere since removal of {k,e}_rem_pio2f.c (commit ca3aac57efa89). Checked with a build for powerpc-linux-gnu (with --with-cpu=power4 and --with-cpu=power7), powerpc64-linux-gnu (with --with-cpu=power4 and --with-cpu=power7), and powerpc64le-linux (with --with-cpu=power8). * sysdeps/powerpc/fpu/s_float_bitwise.h: Remove file.
* nss/tst-nss-files-alias-leak: add missing opening quote in printfAndreas K. Hüttel2019-03-252-1/+6
|
* nptl/tst-rwlock14: Test pthread_rwlock_timedwrlock correctlyMike Crowe2019-03-252-6/+11
|
* nptl: Convert tst-sem5 & tst-sem13 to use libsupportMike Crowe2019-03-253-79/+32
| | | | | | | | | | | | | | Checked on x86_64-linux-gnu and i686-linux-gnu. * nptl/tst-sem5.c: Remove unused headers. Add <support/check.h>. (do_test) Use libsupport test macros rather than hand-coded conditionals and error messages. Ensure that sem_init returns zero rather than not -1. Use <support/test-driver.c> rather than test-skeleton.c. * nptl/tst-sem13.c: Add <support/check.h>. (do_test) Use libsupport test macros rather than hand-coded conditionals and error messages. Use <support/test-driver.c> rather than test-skeleton.c.
* Add UDP_GRO from Linux 5.0 to netinet/udp.h.Joseph Myers2019-03-252-0/+3
| | | | | | | | This patch adds the new constant UDP_GRO from Linux 5.0 to glibc. Tested for x86_64. * sysdeps/gnu/netinet/udp.h (UDP_GRO): New macro.
* Add NT_ARM_PAC_MASK and NT_MIPS_MSA from Linux 5.0 to elf.h.Joseph Myers2019-03-252-0/+8
| | | | | | | | | This patch adds two new NT_* macros from Linux 5.0 to elf.h. Tested for x86_64. * elf/elf.h (NT_ARM_PAC_MASK): New macro. (NT_MIPS_MSA): Likewise.
* Add generic hp-timing supportWilco Dijkstra2019-03-225-57/+33
| | | | | | | | | | | | | | | | | Add missing generic hp_timing support. It uses clock_gettime (CLOCK_MONOTONIC) which has unspecified starting time, nano-second accuracy, and should faster on architectures that implementes the symbol as vDSO. Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu. I also checked the builds for all afected ABIs. * benchtests/Makefile (USE_CLOCK_GETTIME) Remove. * benchtests/README: Update description. * benchtests/bench-timing.h: Default to hp-timing. * sysdeps/generic/hp-timing.h (HP_TIMING_DIFF, HP_TIMING_ACCUM_NT, HP_TIMING_PRINT): Remove. (HP_TIMING_NOW): Add generic implementation. (hp_timing_t): Change to uint64_t.
* Refactor hp-timing rtld usageAdhemerval Zanella2019-03-2213-192/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactor how hp-timing is used on loader code for statistics report. The HP_TIMING_AVAIL and HP_SMALL_TIMING_AVAIL are removed and HP_TIMING_INLINE is used instead to check for hp-timing avaliability. For alpha, which only defines HP_SMALL_TIMING_AVAIL, the HP_TIMING_INLINE is set iff for IS_IN(rtld). Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu. I also checked the builds for all afected ABIs. * benchtests/bench-timing.h: Replace HP_TIMING_AVAIL with HP_TIMING_INLINE. * nptl/descr.h: Likewise. * elf/rtld.c (RLTD_TIMING_DECLARE, RTLD_TIMING_NOW, RTLD_TIMING_DIFF, RTLD_TIMING_ACCUM_NT, RTLD_TIMING_SET): Define. (dl_start_final_info, _dl_start_final, dl_main, print_statistics): Abstract hp-timing usage with RTLD_* macros. * sysdeps/alpha/hp-timing.h (HP_TIMING_INLINE): Define iff IS_IN(rtld). (HP_TIMING_AVAIL, HP_SMALL_TIMING_AVAIL): Remove. * sysdeps/generic/hp-timing.h (HP_TIMING_AVAIL, HP_SMALL_TIMING_AVAIL, HP_TIMING_NONAVAIL): Likewise. * sysdeps/ia64/hp-timing.h (HP_TIMING_AVAIL, HP_SMALL_TIMING_AVAIL): Likewise. * sysdeps/powerpc/powerpc32/power4/hp-timing.h (HP_TIMING_AVAIL, HP_SMALL_TIMING_AVAIL): Likewise. * sysdeps/powerpc/powerpc64/hp-timing.h (HP_TIMING_AVAIL, HP_SMALL_TIMING_AVAIL): Likewise. * sysdeps/sparc/sparc32/sparcv9/hp-timing.h (HP_TIMING_AVAIL, HP_SMALL_TIMING_AVAIL): Likewise. * sysdeps/sparc/sparc64/hp-timing.h (HP_TIMING_AVAIL, HP_SMALL_TIMING_AVAIL): Likewise. * sysdeps/x86/hp-timing.h (HP_TIMING_AVAIL, HP_SMALL_TIMING_AVAIL): Likewise. * sysdeps/generic/hp-timing-common.h: Update comment with HP_TIMING_AVAIL removal.
* Do not use HP_TIMING_NOW for random bitsAdhemerval Zanella2019-03-225-54/+66
| | | | | | | | | | | | | | | | | | | | | This patch removes the HP_TIMING_BITS usage for fast random bits and replace with clock_gettime (CLOCK_MONOTONIC). It has unspecified starting time and nano-second accuracy, so its randomness is significantly better than gettimeofday. Althoug it should incur in more overhead (specially for architecture that support hp-timing), the symbol is also common implemented as a vDSO. Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu. I also checked on a i686-gnu build. * include/random-bits.h: New file. * resolv/res_mkquery.c [HP_TIMING_AVAIL] (RANDOM_BITS, (__res_context_mkquery): Remove usage hp-timing usage and replace with random_bits. * resolv/res_send.c [HP_TIMING_AVAIL] (nameserver_offset): Likewise. * sysdeps/posix/tempname.c [HP_TIMING_AVAIL] (__gen_tempname): Likewise.
* Remove __get_clockfreqAdhemerval Zanella2019-03-229-564/+90
| | | | | | | | | | | | | | | | | | | With clock_getres, clock_gettime, and clock_settime refactor to remove the generic CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID support through hp-timing, there is no usage of internal __get_clockfreq. This patch removes both generic and Linux implementation.. Checked with a build against aarch64-linux-gnu, i686-linux-gnu, ia64-linux-gnu, sparc64-linux-gnu, powerpc-linux-gnu-power4. * include/libc-internal.h (__get_clockfreq): Remove prototype. * rt/Makefile (clock-routines): Remove get_clockfreq. * rt/get_clockfreq.c: Remove file. * sysdeps/unix/sysv/linux/i386/get_clockfreq.c: Likewise. * sysdeps/unix/sysv/linux/ia64/get_clockfreq.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c: Move code to ... * sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c: ... here.
* linux: Assume clock_getres CLOCK_{PROCESS,THREAD}_CPUTIME_IDAdhemerval Zanella2019-03-224-130/+21
| | | | | | | | | | | | | | | | | | | | | | | | | The Linux 3.2 clock_getres kernel code (kernel/posix-cpu-timers.c) issued for clock_getres CLOCK_PROCESS_CPUTIME_ID (process_cpu_clock_getres) and CLOCK_THREAD_CPUTIME_ID (thread_cpu_clock_getres) call posix_cpu_clock_getres. And it fails on check_clock only if an invalid clock is used (not the case) or if we pass an invalid the pid/tid in 29 msb of clock_id (not the case either). This patch assumes that clock_getres syscall always support CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID, so there is no need to fallback to hp-timing support for _SC_MONOTONIC_CLOCK neither to issue the syscall to certify the clock_id is supported bt the kernel. This allows simplify the sysconf support to always use the syscall. it also removes ia64 itc drift check and assume kernel handles it correctly. Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu. * sysdeps/unix/sysv/linux/ia64/has_cpuclock.c: Remove file. * sysdeps/unix/sysv/linux/ia64/sysconf.c: Likewise. * sysdeps/unix/sysv/linux/sysconf.c (has_cpuclock): Remove function. (__sysconf): Assume kernel support for _SC_MONOTONIC_CLOCK, _SC_CPUTIME, and _SC_THREAD_CPUTIME.
* nptl: Remove pthread_clock_gettime pthread_clock_settimeAdhemerval Zanella2019-03-2218-417/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes CLOCK_THREAD_CPUTIME_ID and CLOCK_PROCESS_CPUTIME_ID support from clock_gettime and clock_settime generic implementation. For Linux, kernel already provides supports through the syscall and Hurd HTL lacks __pthread_clock_gettime and __pthread_clock_settime internal implementation. As described in clock_gettime man-page [1] on 'Historical note for SMP system', implementing CLOCK_{THREAD,PROCESS}_CPUTIME_ID with timer registers is error-prone and susceptible to timing and accurary issues that the libc can not deal without kernel support. This allows removes unused code which, however, still incur in some runtime overhead in thread creation (the struct pthread cpuclock_offset initialization). If hurd eventually wants to support them it should either either implement as a kernel facility (or something related due its architecture) or in system specific implementation. Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu. I also checked on a i686-gnu build. * nptl/Makefile (libpthread-routines): Remove pthread_clock_gettime and pthread_clock_settime. * nptl/pthreadP.h (__find_thread_by_id): Remove prototype. * elf/dl-support.c [!HP_TIMING_NOAVAIL] (_dl_cpuclock_offset): Remove. (_dl_non_dynamic_init): Remove _dl_cpuclock_offset setting. * elf/rtld.c (_dl_start_final): Likewise. * nptl/allocatestack.c (__find_thread_by_id): Remove function. * sysdeps/generic/ldsodefs.h [!HP_TIMING_NOAVAIL] (_dl_cpuclock_offset): Remove. * sysdeps/mach/hurd/dl-sysdep.c [!HP_TIMING_NOAVAIL] (_dl_cpuclock_offset): Remove. * nptl/descr.h (struct pthread): Rename cpuclock_offset to cpuclock_offset_ununsed. * nptl/nptl-init.c (__pthread_initialize_minimal_internal): Remove cpuclock_offset set. * nptl/pthread_create.c (START_THREAD_DEFN): Likewise. * sysdeps/nptl/fork.c (__libc_fork): Likewise. * nptl/pthread_clock_gettime.c: Remove file. * nptl/pthread_clock_settime.c: Likewise. * sysdeps/unix/clock_gettime.c (hp_timing_gettime): Remove function. [HP_TIMING_AVAIL] (realtime_gettime): Remove CLOCK_THREAD_CPUTIME_ID and CLOCK_PROCESS_CPUTIME_ID support. * sysdeps/unix/clock_settime.c (hp_timing_gettime): Likewise. [HP_TIMING_AVAIL] (realtime_gettime): Likewise. * sysdeps/posix/clock_getres.c (hp_timing_getres): Likewise. [HP_TIMING_AVAIL] (__clock_getres): Likewise. * sysdeps/unix/clock_nanosleep.c (CPUCLOCK_P, INVALID_CLOCK_P): Likewise. (__clock_nanosleep): Remove CPUCLOCK_P and INVALID_CLOCK_P usage. [1] http://man7.org/linux/man-pages/man2/clock_gettime.2.html
* S390: Add arch13 memmem ifunc variant.Stefan Liebler2019-03-227-6/+214
| | | | | | | | | | | | | | | | | | | | 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-227-6/+232
| | | | | | | | | | | | | | | | | | | | 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.