summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* i386: Replace assembly versions of e_powf with generic e_powf.chjl/nsz/mathH.J. Lu2017-09-298-401/+66
| | | | | | | | | | | | | | | | This patch replaces i386 assembly versions of e_powf with generic e_powf.c. * sysdeps/i386/fpu/e_powf.S: Removed. * sysdeps/i386/fpu/e_powf_log2_data.c: Likewise. * sysdeps/i386/fpu/w_powf.c: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_powf.c. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines): Add e_powf-sse2. (CFLAGS-e_powf-sse2.c): New. * sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c: New file. * sysdeps/i386/i686/fpu/multiarch/e_powf.c: Likewise.
* i386: Replace assembly versions of e_log2f with generic e_log2f.cH.J. Lu2017-09-298-72/+49
| | | | | | | | | | | | | | | | This patch replaces i386 assembly versions of e_log2f with generic e_log2f.c. * sysdeps/i386/fpu/e_log2f.S: Removed. * sysdeps/i386/fpu/e_log2f_data.c: Likewise. * sysdeps/i386/fpu/w_log2f.c: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_log2f.c. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines): Add e_log2f-sse2. (CFLAGS-e_log2f-sse2.c): New. * sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c: New file. * sysdeps/i386/i686/fpu/multiarch/e_log2f.c: Likewise.
* x86-64: Add powf with FMAH.J. Lu2017-09-293-1/+49
| | | | | | | | * sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines): Add e_powf-fma. (CFLAGS-e_powf-fma.c): New. * sysdeps/x86_64/fpu/multiarch/e_powf-fma.c: New file. * sysdeps/x86_64/fpu/multiarch/e_powf.c: Likewise.
* x86-64: Add log2f with FMAH.J. Lu2017-09-293-1/+45
| | | | | | | | * sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines): Add e_log2f-fma. (CFLAGS-e_log2f-fma.c): New. * sysdeps/x86_64/fpu/multiarch/e_log2f-fma.c: New file. * sysdeps/x86_64/fpu/multiarch/e_log2f.c: Likewise.
* x86-64: Add logf with FMAH.J. Lu2017-09-293-1/+45
| | | | | | | | * sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines): Add e_logf-fma. (CFLAGS-e_logf-fma.c): New. * sysdeps/x86_64/fpu/multiarch/e_logf-fma.c: New file. * sysdeps/x86_64/fpu/multiarch/e_logf.c: Likewise.
* i386: Replace assembly versions of e_logf with generic e_logf.cH.J. Lu2017-09-299-143/+62
| | | | | | | | | | | | | | | | | This patch replaces i386 assembly versions of e_logf with generic e_logf.c. * sysdeps/i386/fpu/e_logf.S: Removed. * sysdeps/i386/fpu/e_logf_data.c: Likewise. * sysdeps/i386/fpu/w_logf.c: Likewise. * sysdeps/i386/i686/fpu/e_logf.S: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_logf.c. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines): Add e_logf-sse2. (CFLAGS-e_logf-sse2.c): New. * sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c: New file. * sysdeps/i386/i686/fpu/multiarch/e_logf.c: Likewise.
* i386: Replace assembly versions of e_exp2f with generic e_exp2f.cH.J. Lu2017-09-297-54/+46
| | | | | | | | | | | | | | | This patch replaces i386 assembly versions of e_exp2f with generic e_exp2f.c. * sysdeps/i386/fpu/e_exp2f.S: Removed. * sysdeps/i386/fpu/w_exp2f.c: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_exp2f.c. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines): Add e_exp2f-sse2. (CFLAGS-e_exp2f-sse2.c): New. * sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c: New file. * sysdeps/i386/i686/fpu/multiarch/e_exp2f.c: Likewise.
* x86-64: Add exp2f with FMAH.J. Lu2017-09-293-1/+42
| | | | | | | | * sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines): Add e_exp2f-fma. (CFLAGS-e_exp2f-fma.c): New. * sysdeps/x86_64/fpu/multiarch/e_exp2f-fma.c: New file. * sysdeps/x86_64/fpu/multiarch/e_exp2f.c: Likewise.
* i386: Replace assembly versions of e_expf with generic e_expf.cH.J. Lu2017-09-2912-442/+35
| | | | | | | | | | | | | | | | | | | | This patch replaces i386 assembly versions of e_expf with generic e_expf.c. * sysdeps/i386/fpu/e_exp2f_data.c: Removed. * sysdeps/i386/fpu/e_expf.S: Likewise. * sysdeps/i386/fpu/math_errf.c: Likewise. * sysdeps/i386/fpu/w_expf.c: Likewise. * sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S: Likewise. * sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S: Likewise. * sysdeps/i386/i686/fpu/multiarch/w_expf.c: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_expf.c. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines): Remove e_expf-ia32. (CFLAGS-e_expf-sse2.c): New. * sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c: New file. * sysdeps/i386/i686/fpu/multiarch/e_expf.c: Rewritten.
* x86-64: Replace assembly versions of e_expf with generic e_expf.cH.J. Lu2017-09-297-531/+31
| | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces x86-64 assembly versions of e_expf with generic e_expf.c. * sysdeps/x86_64/fpu/e_expf.S: Removed. * sysdeps/x86_64/fpu/multiarch/e_expf-fma.S: Likewise. * sysdeps/x86_64/fpu/w_expf.c: Likewise. * sysdeps/x86_64/fpu/libm-test-ulps: Updated for generic e_expf.c. * sysdeps/x86_64/fpu/multiarch/Makefile (CFLAGS-e_expf-fma.c): New. * sysdeps/x86_64/fpu/multiarch/e_expf-fma.c: New file. * sysdeps/x86_64/fpu/multiarch/e_expf.c (__redirect_ieee754_expf): Renamed to ... (__redirect_expf): This. (SYMBOL_NAME): Changed to expf. (__ieee754_expf): Renamed to ... (__expf): This. (__GI___expf): This. (__ieee754_expf): Add strong_alias. (__expf_finite): Likewise. (__expf): New. Include <sysdeps/ieee754/flt-32/e_expf.c>.
* Do not wrap logf, log2f and powfnsz/mathSzabolcs Nagy2017-09-2912-6/+30
| | | | | | | | | | | | | | | | | | | | The new generic logf, log2f and powf code don't need wrappers any more, they set errno inline so only use the wrappers on targets that need it. 2017-09-19 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/ieee754/flt-32/e_log2f.c (__log2f): Define without wrapper. * sysdeps/ieee754/flt-32/e_logf.c (__logf): Likewise * sysdeps/ieee754/flt-32/e_powf.c (__powf): Likewise * sysdeps/ieee754/flt-32/w_log2f.c: New file. * sysdeps/ieee754/flt-32/w_logf.c: New file. * sysdeps/ieee754/flt-32/w_powf.c: New file. * sysdeps/i386/fpu/w_log2f.c: New file. * sysdeps/i386/fpu/w_logf.c: New file. * sysdeps/i386/fpu/w_powf.c: New file. * sysdeps/m68k/m680x0/fpu/w_log2f.c: New file. * sysdeps/m68k/m680x0/fpu/w_logf.c: New file. * sysdeps/m68k/m680x0/fpu/w_powf.c: New file.
* Do not wrap expf and exp2fSzabolcs Nagy2017-09-2913-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The new generic expf and exp2f code don't need wrappers any more, they set errno inline, so only use the wrappers on targets that need it. (If the wrapper is needed, then the top level wrapper code is included, otherwise empty w_exp*f.c is used to suppress the wrapper.) A powerpc64 expf implementation includes the expf c code directly which needed some changes. 2017-09-25 Szabolcs Nagy <szabolcs.nagy@arm.com> H.J. Lu <hongjiu.lu@intel.com> * sysdeps/ieee754/flt-32/e_exp2f.c (__exp2f): Define without wrapper. * sysdeps/ieee754/flt-32/e_expf.c (__expf): Likewise * sysdeps/ieee754/flt-32/w_exp2f.c: New file. * sysdeps/ieee754/flt-32/w_expf.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c: Update for the new expf code. * sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c: New file. * sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c: New file. * sysdeps/m68k/m680x0/fpu/w_exp2f.c: New file. * sysdeps/m68k/m680x0/fpu/w_expf.c: New file. * sysdeps/i386/fpu/w_exp2f.c: New file. * sysdeps/i386/fpu/w_expf.c: New file. * sysdeps/i386/i686/fpu/multiarch/w_expf.c: New file. * sysdeps/x86_64/fpu/w_expf.c: New file.
* New symbol version for logf, log2f and powf without SVID compatSzabolcs Nagy2017-09-2936-14/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the logf, log2f and powf error handling semantics to only set errno accoring to POSIX rules. New symbol version is introduced at GLIBC_2.27. The old wrappers are kept for compat symbols. ia64 needed assembly change to have the new and compat versioned symbol map to the same function. All linux libm abilists are updated. 2017-09-19 Szabolcs Nagy <szabolcs.nagy@arm.com> * math/Versions (logf): New libm symbol at GLIBC_2.27. (log2f): Likewise. (powf): Likewise. * math/w_log2f.c: New file. * math/w_logf.c: New file. * math/w_powf.c: New file. * math/w_log2f_compat.c (__log2f_compat): For compat symbol only. * math/w_logf_compat.c (__logf_compat): Likewise. * math/w_powf_compat.c (__powf_compat): Likewise. * sysdeps/ia64/fpu/e_log2f.S: Add versioned symbols. * sysdeps/ia64/fpu/e_logf.S: Likewise. * sysdeps/ia64/fpu/e_powf.S: Likewise. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
* New generic powfSzabolcs Nagy2017-09-298-201/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | without wrapper on aarch64: powf reciprocal-throughput: 4.2x faster powf latency: 2.6x faster old worst-case error: 1.11 ulp new worst-case error: 0.82 ulp aarch64 .text size: -780 bytes aarch64 .rodata size: +144 bytes powf(x,y) is implemented as exp2(y*log2(x)) with the same algorithms that are used in exp2f and log2f, except that the log2f polynomial is larger for extra precision and its output (and exp2f input) may be scaled by a power of 2 (POWF_SCALE) to simplify the argument reduction step of exp2 (possible when efficient round and convert toint operation is available). The special case handling tries to minimize the checks in the hot path. When the input of exp2_inline is checked, int arithmetics is used as that was faster on the tested aarch64 cores. 2017-09-19 Szabolcs Nagy <szabolcs.nagy@arm.com> * math/Makefile (type-float-routines): Add e_powf_log2_data. * sysdeps/ieee754/flt-32/e_powf.c: New implementation. * sysdeps/ieee754/flt-32/e_powf_log2_data.c: New file. * sysdeps/ieee754/flt-32/math_config.h (__powf_data): Define. (issignalingf_inline): Likewise. (POWF_LOG2_TABLE_BITS): Likewise. (POWF_LOG2_POLY_ORDER): Likewise. (POWF_SCALE_BITS): Likewise. (POWF_SCALE): Likewise. * sysdeps/i386/fpu/e_powf_log2_data.c: New file. * sysdeps/ia64/fpu/e_powf_log2_data.c: New file. * sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c: New file.
* New generic log2fSzabolcs Nagy2017-09-298-75/+136
| | | | | | | | | | | | | | | | | | | | | | | | | Similar to the new logf: double precision arithmetics and a small lookup table is used. The argument reduction step is the same as in the new logf. without wrapper on aarch64: log2f reciprocal-throughput: 2.3x faster log2f latency: 2.1x faster old worst case error: 1.72 ulp new worst case error: 0.75 ulp aarch64 .text size: -252 bytes aarch64 .rodata size: +244 bytes 2017-09-19 Szabolcs Nagy <szabolcs.nagy@arm.com> * math/Makefile (type-float-routines): Add e_log2f_data. * sysdeps/ieee754/flt-32/e_log2f.c: New implementation. * sysdeps/ieee754/flt-32/e_log2f_data.c: New file. * sysdeps/ieee754/flt-32/math_config.h (__log2f_data): Define. (LOG2F_TABLE_BITS, LOG2F_POLY_ORDER): Define. * sysdeps/i386/fpu/e_log2f_data.c: New file. * sysdeps/ia64/fpu/e_log2f_data.c: New file. * sysdeps/m68k/m680x0/fpu/e_log2f_data.c: New file.
* missed ChangeLog entrySzabolcs Nagy2017-09-291-0/+11
|
* New generic logfSzabolcs Nagy2017-09-298-75/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | without wrapper on aarch64: logf reciprocal-throughput: 2.2x faster logf latency: 1.9x faster old worst case error: 0.89 ulp new worst case error: 0.82 ulp aarch64 .text size: -356 bytes aarch64 .rodata size: +240 bytes Uses double precision arithmetics and a lookup table to allow smaller polynomial and avoid the use of division. Data is in a separate translation unit with fixed layout to prevent the compiler generating suboptimal literal access. Errors are handled inline according to POSIX rules, but this patch keeps the wrapper with SVID compatible error handling. Needs libm-test-ulps adjustment for clogf in non-nearest rounding mode. * math/Makefile (type-float-routines): Add e_logf_data. * sysdeps/ieee754/flt-32/e_logf.c: New implementation. * sysdeps/ieee754/flt-32/e_logf_data.c: New file. * sysdeps/ieee754/flt-32/math_config.h (__logf_data): Define. (LOGF_TABLE_BITS, LOGF_POLY_ORDER): Define. * sysdeps/i386/fpu/e_logf_data.c: New file. * sysdeps/ia64/fpu/e_logf_data.c: New file. * sysdeps/m68k/m680x0/fpu/e_logf_data.c: New file.
* x86: Allow undefined _DYNAMIC in static executableH.J. Lu2017-09-283-4/+25
| | | | | | | | | | | | When --enable-static-pie is used to build static PIE, _DYNAMIC is used to compute the load address of static PIE. But _DYNAMIC is undefined when creating static executable. This patch makes _DYNAMIC weak in PIE libc.a so that it can be undefined. * sysdeps/i386/dl-machine.h (elf_machine_load_address): Allow undefined _DYNAMIC in PIE libc.a. * sysdeps/x86_64/dl-machine.h (elf_machine_load_address): Likewse.
* Remove ancient __signbit inlinesWilco Dijkstra2017-09-2810-436/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove __signbit inlines from mathinline.h. Math.h already uses the builtin when supported, so additional inlines are only used on pre 4.0 GCCs. Similarly remove ancient copysign and fabs inlines. * sysdeps/alpha/fpu/bits/mathinline.h: Delete file. * sysdeps/ia64/fpu/bits/mathinline.h: Delete file. * sysdeps/m68k/coldfire/fpu/bits/mathinline.h: Delete file. * sysdeps/m68k/m680x0/fpu/bits/mathinline.h: (__signbitf): Remove. (__signbit): Remove. (__signbitl): Remove. * sysdeps/powerpc/bits/mathinline.h (__signbitf): Remove. (__signbit): Remove. (__signbitl): Remove. * sysdeps/s390/fpu/bits/mathinline.h: (__signbitf): Remove. (__signbit): Remove. (__signbitl): Remove * sysdeps/sparc/fpu/bits/mathinline.h (__signbitf): Remove. (__signbit): Remove. (__signbitl): Remove. * sysdeps/tile/bits/mathinline.h: Delete file. * sysdeps/x86/fpu/bits/mathinline.h (__signbitf): Remove. (__signbit): Remove. (__signbitl): Remove.
* Simplify C99 isgreater macrosWilco Dijkstra2017-09-287-349/+41
| | | | | | | | | | | | | | | | Simplify the C99 isgreater macros. Although some support was added in GCC 2.97, not all targets added support until GCC 3.1. Therefore only use the builtins in math.h from GCC 3.1 onwards, and defer to generic macros otherwise. Improve the generic isunordered macro to use compares rather than call fpclassify twice - this is not only faster but also correct for signaling NaNs. * math/math.h: Improve handling of C99 isgreater macros. * sysdeps/alpha/fpu/bits/mathinline.h: Remove isgreater macros. * sysdeps/m68k/m680x0/fpu/bits/mathinline.h: Likewise. * sysdeps/powerpc/bits/mathinline.h: Likewise. * sysdeps/sparc/fpu/bits/mathinline.h: Likewise. * sysdeps/x86/fpu/bits/mathinline.h: Likewise.
* AArch64: update libm-test-ulpsSzabolcs Nagy2017-09-282-2/+12
| | | | | | Update for new expf and logf. * sysdeps/aarch64/libm-test-ulps: Update.
* Fix nearbyint arithmetic moved before feholdexcept (bug 22225).Joseph Myers2017-09-285-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In <https://sourceware.org/ml/libc-alpha/2013-05/msg00722.html> I remarked on the possibility of arithmetic in various nearbyint implementations being scheduled before feholdexcept calls, resulting in spurious "inexact" exceptions. I'm now actually observing this occurring in glibc built for ARM with GCC 7 (in fact, both copies of the same addition/subtraction sequence being combined and moved out before the conditionals and feholdexcept/fesetenv pairs), resulting in test failures. This patch makes the nearbyint implementations with this particular feholdexcept / arithmetic / fesetenv pattern consistently use math_opt_barrier on the function argument when first used in arithmetic, and also consistently use math_force_eval before fesetenv (the latter was generally already done, but the dbl-64/wordsize-64 implementation used math_opt_barrier instead, and as math_opt_barrier's intended effect is through its output value being used, such a use that doesn't use the return value is suspect). Tested for x86_64 (--disable-multi-arch so more of these implementations get used), and for ARM in a configuration where I saw the problem scheduling. [BZ #22225] * sysdeps/ieee754/dbl-64/s_nearbyint.c (__nearbyint): Use math_opt_barrier on argument when doing arithmetic on it. * sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c (__nearbyint): Likewise. Use math_force_eval not math_opt_barrier after arithmetic. * sysdeps/ieee754/flt-32/s_nearbyintf.c (__nearbyintf): Use math_opt_barrier on argument when doing arithmetic on it. * sysdeps/ieee754/ldbl-128/s_nearbyintl.c (__nearbyintl): Likewise.
* Update sysdeps/unix/sysv/linux/ifaddrs.cH.J. Lu2017-09-272-0/+8
| | | | | | | | | | | | | | | | | | | | | | Fix ../sysdeps/unix/sysv/linux/ifaddrs.c:835:27: error: ‘getifaddrs’ aliased to undefined symbol ‘__getifaddrs’ weak_alias (__getifaddrs, getifaddrs) ^ ../sysdeps/unix/sysv/linux/ifaddrs.c:844:28: error: ‘freeifaddrs’ aliased to undefined symbol ‘__freeifaddrs’ weak_alias (__freeifaddrs, freeifaddrs) caused by commit 4009ddc69225d571772aaea597615a0c032e14ab Author: Samuel Thibault <samuel.thibault@ens-lyon.org> Date: Thu Sep 28 00:19:18 2017 +0200 hurd: Fix `getifaddrs' and `freeifaddrs' symbol exposition * sysdeps/unix/sysv/linux/ifaddrs.c (__getifaddrs): Add libc_hidden_def. (__freeifaddrs): Likewise.
* hurd: Fix `getifaddrs' and `freeifaddrs' symbol expositionSamuel Thibault2017-09-285-2/+18
| | | | | | | | | | | | | | | from `freeaddrinfo'. `getifaddrs' and `freeifaddrs' are not in POSIX, they should not be exposed along `freeaddrinfo' (through `__check_pf') which is POSIX. * include/ifaddrs.h (__getifaddrs, __freeifaddrs): New declarations, and use libc_hidden_def on them. * inet/ifaddrs.c (__getifaddrs, __freeifaddrs): Use libc_hidden_def on them. * sysdeps/gnu/ifaddrs.c (__getifaddrs, __freeifaddrs): Likewise. * inet/check_pf.c (__check_pf): Use __getifaddrs and __freeifaddrs instead of getifaddrs and freeifaddrs.
* hurd: Fix `seekdir' symbol exposition from `rewinddir'Samuel Thibault2017-09-284-3/+10
| | | | | | | | | | | `seekdir' is MISC || XOPEN, it should not be exposed along `rewinddir' which is POSIX. * include/dirent.h (__seekdir): New declaration. * sysdeps/mach/hurd/seekdir.c (seekdir): Rename to __seekdir and redefine as weak alias. * sysdeps/mach/hurd/rewinddir.c (__rewinddir): Use __seekdir instead of seekdir.
* hurd: Fix `revoke' symbol exposition from `unlockpt'Samuel Thibault2017-09-285-3/+14
| | | | | | | | | | | | `revoke' is MISC only, it should not be exposed along `unlockpt' which is XOPEN. * include/unistd.h (__revoke): New declaration. * misc/revoke.c (revoke): Rename to __revoke, and redefine as weak alias. * sysdeps/mach/hurd/revoke.c (revoke): Likewise. * sysdeps/unix/bsd/unlockpt.c (unlockpt): Use __revoke instead of revoke.
* hurd: Fix dirfd symbol exposition from ftwSamuel Thibault2017-09-286-6/+21
| | | | | | | | | | | dirfd is XOPEN2K8 only, it should not be exposed along ftw which is earlier. * include/dirent.h (__dirfd): New declaration. * dirent/dirfd.c (dirfd): Rename to __dirfd, and redefine as weak alias. * sysdeps/posix/dirfd/dirfd.c (dirfd): Likewise. * sysdeps/mach/hurd/dirfd.c (dirfd): Likewise. * io/ftw.c (open_dir_stream, ftw_dir): Use __dirfd instead of dirfd.
* Mark __dso_handle as hidden [BZ #18822]H.J. Lu2017-09-2613-46/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since __dso_handle is always defined by either crtbegin.o from GCC or dso_handle.c, it should be marked as hidden and be passed directly. [BZ #18822] * dlfcn/modatexit.c (foo): Remove __dso_handle check. * dlfcn/modcxaatexit.c: Include <dso_handle.h>. (__dso_handle): Remove declaration. * dlfcn/tstatexit.c (__dso_handle): Removed. (main): Don't check __dso_handle. * dlfcn/tstcxaatexit.c (__dso_handle): Removed. (main): Don't check __dso_handle. * include/dso_handle.h: New file. * malloc/mtrace.c: Include <dso_handle.h>. (mtrace): Pass __dso_handle directly. * nptl/pthread_atfork.c: Include <dso_handle.h>. (__dso_handle): Remove declaration. (__pthread_atfork): Pass __dso_handle directly. * nptl/tst-atfork2mod.c: Include <dso_handle.h>. (__dso_handle): Removed. * posix/wordexp-test.c: Include <dso_handle.h>. (__dso_handle): Remove declaration. (__app_register_atfork): Pass __dso_handle directly. * stdlib/at_quick_exit.c: Include <dso_handle.h>. (__dso_handle): Remove declaration. (at_quick_exit): Pass __dso_handle directly. * stdlib/atexit.c: Include <dso_handle.h>. (__dso_handle): Remove declaration. (atexit): Pass __dso_handle directly. * stdlib/tst-tls-atexit-lib.c: Include <dso_handle.h>. (__dso_handle): Removed.
* Fix make-syscalls.sh VDSO support for GCC 8.Joseph Myers2017-09-262-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | sysdeps/unix/make-syscalls.sh has support, used only by x32, for generating IFUNCs for kernel VDSO symbols. This support creates IFUNCs by setting symbol types manually, which is bad for debug info and does not work with current GCC mainline because it results in errors from the checks on types of function aliases. This patch fixes it to use the common __ifunc macro, which uses the ifunc attribute when available and so works with GCC mainline. Note however that the original error resulted from an indirect inclusion of a header declaring __gettimeofday from the generated sources, and using __ifunc now relies on such an indirect inclusion remaining as it means use of __typeof to determine the correct types. If glibc's headers change in such a way as to remove that indirect inclusion, it will become necessary to change the syscalls.list syntax for VDSO syscalls so the name of the header to include can be specified. Tested (compilation only) with build-many-glibcs.py that this fixes the build for x32 with GCC mainline. * sysdeps/unix/make-syscalls.sh: Use __ifunc to define symbols using VDSO.
* Fix range check in do_tunable_update_valAlexey Makhalov2017-09-273-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation of tunables does not set arena_max and arena_test values. Any value provided by glibc.malloc.arena_max and glibc.malloc.arena_test parameters is ignored. These tunables have minval value set to 1 (see elf/dl-tunables.list file) and undefined maxval value. In that case default value (which is 0. see scripts/gen-tunables.awk) is being used to set maxval. For instance, generated tunable_list[] entry for arena_max is: (gdb) p *cur $1 = {name = 0x7ffff7df6217 "glibc.malloc.arena_max", type = {type_code = TUNABLE_TYPE_SIZE_T, min = 1, max = 0}, val = {numval = 0, strval = 0x0}, initialized = false, security_level = TUNABLE_SECLEVEL_SXID_IGNORE, env_alias = 0x7ffff7df622e "MALLOC_ARENA_MAX"} As a result, any value of glibc.malloc.arena_max is ignored by TUNABLE_SET_VAL_IF_VALID_RANGE macro __type min = (__cur)->type.min; <- initialized to 1 __type max = (__cur)->type.max; <- initialized to 0! if (min == max) <- false { min = __default_min; max = __default_max; } if ((__type) (__val) >= min && (__type) (val) <= max) <- false { (__cur)->val.numval = val; (__cur)->initialized = true; } Assigning correct min/max values at a build time fixes a problem. Plus, a bit of optimization: Setting of default min/max values for the given type at a run time might be eliminated. * elf/dl-tunables.c (do_tunable_update_val): Range checking fix. * scripts/gen-tunables.awk: Set unspecified minval and/or maxval values to correct default value for given type.
* Skip PT_DYNAMIC segment with p_filesz == 0 [BZ #22101]H.J. Lu2017-09-264-3/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | ELF objects generated with "objcopy --only-keep-debug" have Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align DYNAMIC 0x0+e28 0x0+200e40 0x0+200e40 0x0+ 0x0+1a0 RW 0x8 with 0 file size. ld.so should skip such PT_DYNAMIC segments. Without a PT_DYNAMIC segment the loading of the shared object will fail, and therefore ldd on such objects will also fail instead of crashing. This provides better diagnostics for tooling that is attempting to inspect the invalid shared objects which may just contain debug information. [BZ #22101] * elf/Makefile (tests): Add tst-debug1. ($(objpfx)tst-debug1): New. ($(objpfx)tst-debug1.out): Likewise. ($(objpfx)tst-debug1mod1.so): Likewise. * elf/dl-load.c (_dl_map_object_from_fd): Skip PT_DYNAMIC segment with p_filesz == 0. * elf/tst-debug1.c: New file. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Use generic __ifunc for SPARC.Joseph Myers2017-09-262-8/+7
| | | | | | | | | | | | | | | | | | | | | glibc fails to build with GCC mainline for SPARC because of the use of manually-created IFUNCs, which fail the tests of compatibility of function alias types. This patch changes sparc-ifunc.h to use the generic __ifunc in defining sparc_libm_ifunc. The generic __ifunc can use the GCC ifunc attribute when available, so ensuring type-correctness as well as better debug info than when setting symbol types in asm statements. Note that for this to fix the build with GCC mainline the GCC patch <https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01779.html>, or building GCC with --enable-gnu-indirect-function, is also needed. Tested (compilation only) with build-many-glibcs.py (sparc64-linux-gnu and sparcv9-linux-gnu, with GCC 8 with the above patch, and also with GCC 7). * sysdeps/sparc/sparc-ifunc.h [!__ASSEMBLER__] (sparc_libm_ifunc): Define using __ifunc.
* powerpc: Regenerate ULPs for expf() and exp2f()Tulio Magno Quites Machado Filho2017-09-262-8/+9
| | | | | | | Remove all entries for expf() and exp2f() and regenerate them. * sysdeps/powerpc/fpu/libm-test-ulps: Regenerate expf() and exp2f() values.
* Fix ia64 executable stack default (bug 22156).Joseph Myers2017-09-262-3/+7
| | | | | | | | | | | | | | | | | | As per https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01220.html ia64 defaults to non-executable stacks in the Linux kernel (furthermore, the use of function descriptors means that trampolines for nested function pointers never need an executable stack). glibc however defines DEFAULT_STACK_PERMS to include PF_X for that architecture, meaning (a) elf/check-execstack fails and (b) (from code inspection, not tested, but this is why I think this is a user-visible bug) thread stacks are unnecessarily mapped with execute permission. This patch fixes the DEFAULT_STACK_PERMS definition in question. Tested (compilation only) with build-many-glibcs.py for ia64. This fixes the check-execstack failure. [BZ #22156] * sysdeps/ia64/stackinfo.h (DEFAULT_STACK_PERMS): Likewise.
* resolv/Makefile: Fix typo in commentFlorian Weimer2017-09-262-1/+5
|
* resolv/nss_dns/dns-host.c: Fix typo in commentFlorian Weimer2017-09-262-1/+6
| | | | And only the resolv/map*.h actually contain implementations.
* scratch_buffer: use union for internal bufferAdhemerval Zanella2017-09-254-6/+12
| | | | | | | | | | | | | | | | | Problem reported by Florian Weimer [1] and solution suggested by Andreas Schwab [2]. It also set the same buffer size independent of architecture max_align_t size. Checked on x86_64-linux-gnu and i686-linux-gnu. * lib/malloc/scratch_buffer.h (struct scratch_buffer): Use an union instead of a max_align_t array for __space, so that __space is the same size on all platforms. * malloc/scratch_buffer_grow_preserve.c (__libc_scratch_buffer_grow_preserve): Likewise. [1] https://sourceware.org/ml/libc-alpha/2017-09/msg00693.html [2] https://sourceware.org/ml/libc-alpha/2017-09/msg00695.html
* posix: Add compat glob symbol to not follow dangling symbolsAdhemerval Zanella2017-09-2546-61/+632
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch follows commit 5554304f0 (posix: Allow glob to match dangling symlinks [BZ #866]) by adding a compat symbol that follow previous semantic of not following dangling symlinks and thus avoiding call gl_lstat with GLOB_ALTDIRFUNC. It avoids failure with old binaries that not set the alternate function pointer for lstat (GNUmake for instance). The following scenario, for instance, fails with current GNUmake because glibc will access unitialized memory when calling gl_lstat: $ cat src/t/t.c int main () { return 0; } $ cat Makefile SRC = $(wildcard src/*/t.c) OBJ = $(patsubst src/%.c, obj/%.o, $(SRC)) prog: $(OBJ) $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $(OBJ) -o prog obj/%.o: src/%.c $(CC) $(CFLAGS) -c $< -o $@ $ make This works as expected with the patch applied. Since it is for generic ABI, default compat symbols are added with override for Linux due LFS. Now we have two compat symbols for glob on Linux: 1. sysdeps/unix/sysv/linux/oldglob.c which implements glob64 with the old dirent layout. For this implementation I also set it to not follow dangling symlinks (which is the safest path). 2. sysdeps/unix/sysv/linux/glob{64}-lstat-compat.c which implements the compat symbol for dangling symlinks. As for generic glob, the implementation uses XSTAT_IS_XSTAT64 to define whether both __glob_lstat_compat and __glob64_lstat_compat should be different implementations. For archictures that define XSTAT_IS_XSTAT64, __glob_lstat_compat is aliased to __glob64_lstat_compat. 3. sysdeps/unix/sysv/linux/alpha/oldglob.c with a different glob_t layout. As for 1. this patch changes it to not follow dangling symlinks. The patch also bumps _GNU_GLOB_INTERFACE_VERSION to 2 to advertise the new semantic. On GNUmake, for instance, it will force to it use its internal glob implementation instead and avoiding triggering the same failure on builds against newer GLIBCs. Checked on x86_64-linux-gnu and i686-linux-gnu. I also checked with a build against the major ABIs required to check for the abilist. The changes should also work on gnulib (I run gnulib-tool.py check glob and it shown no regressions). [BZ #22183] * include/gnu-versions.h (_GNU_GLOB_INTERFACE_VERSION): Increase version to 2. * posix/Makefile (routines): Add glob-lstat-compat and glob64-lstat-compat. * posix/Versions (GLIBC_2.27, glob, glob64): Add symbol version. * posix/glob-lstat-compat.c: New file. * posix/glob64-lstat-compat.c: Likewise. * posix/tst-glob_lstat_compat.c: Likewise. * sysdeps/unix/sysv/linux/glob-lstat-compat.c: Likewise. * sysdeps/unix/sysv/linux/alpha/glob-lstat-compat.c: Likewise. * sysdeps/unix/sysv/linux/glob64-lstat-compat.c: Likewise. * sysdeps/unix/sysv/linux/alpha/glob.c: Remove file. * posix/glob.c (glob_lstat): New function. (glob): Rename to __glob and add versioned symbol to 2.27. (glob_in_dir): Use glob_lstat. * posix/glob64.c (glob64): Add GLOB_ATTRIBUTE. * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/glob.c (glob): Add versioned symbol for 2.27. * sysdeps/unix/sysv/linux/glob64.c (glob64): Likewise. * sysdeps/unix/sysv/linux/oldglob.c (GLOB_NO_LSTAT): Define. * sysdeps/unix/sysv/linux/alpha/oldglob.c (__old_glob): Do not use gl_lstat on glob call. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Add GLIBC_2.27 glob and glob64 symbols. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
* Update configure.ac for binutils 2.25H.J. Lu2017-09-253-4/+9
| | | | | | | | | | | | | | Commit 073e8fa7739ed453d6854b834f290c263a6cdb9f requires binutils 2.25 or later to build glibc: * configure.ac (AS): Require binutils 2.25 or later. (LD): Likewise. But it only updated LD version check in configure.ac. This patch adds the missing AS version check. * configure.ac (AS): Require binutils 2.25 or later. * configure: Regenerated.
* Reduce total memory required to create all threads to 128MiB. This fixesPaul Pluzhnikov2017-09-252-0/+11
| | | | | intermittent failure in stdlib/test-{atexit,at_quick_exit,...} tests (Bug 22207).
* nscd: Release read lock after resetting timeout.DJ Delorie2017-09-252-0/+8
| | | | | | | | | | | | [BZ #22161] * nscd/netgroupcache.c (addinnetgrX): Release read lock after resetting timeout. Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Reviewed-by: Andreas Schwab <schwab@suse.de> A lock is held by mempool_allocate() when CACHEABLE is true; we must release this lock if we exit early.
* Revert "resolv_test.c: also cope with CONNREFUSED errors returned by recvfrom"Samuel Thibault2017-09-252-9/+1
| | | | This reverts commit 6174537c24cfe324d6e8f5a2a421883df12b8b6a.
* Fix typo in sincos32.h inclusion guard.Stefan Liebler2017-09-252-1/+7
| | | | | | | | | | This patch fixes a typo in inclusion guard in sincos32.h. ChangeLog: * sysdeps/ieee754/dbl-64/sincos32.h [SINCCOS32_H]: Remove define. [SINCOS32_H]: Define.
* New expf and exp2f version without SVID compat wrapperSzabolcs Nagy2017-09-2534-9/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the expf and exp2f error handling semantics to only set errno accoring to POSIX rules. New symbol version is introduced at GLIBC_2.27. The old wrappers are kept for compat symbols. Internal calls to __expf now get the new error semantics, this seems to only affect sysdeps/i386/fpu/s_expm1f.S where the errno-only behaviour should be correct. ia64 needed assembly change to have the new and compat versioned symbol map to the same function. All linux libm abilists are updated. * math/Versions (expf): New libm symbol at GLIBC_2.27. (exp2f): Likewise. * math/w_exp2f.c: New file. * math/w_expf.c: New file. * math/w_exp2f_compat.c (__exp2f_compat): For compat symbol only. * math/w_expf_compat.c (__expf_compat): Likewise. * sysdeps/ia64/fpu/e_exp2f.S: Add versioned symbols. * sysdeps/ia64/fpu/e_expf.S: Likewise. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
* Optimized generic expf and exp2f with wrappersSzabolcs Nagy2017-09-2516-567/+421
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on new expf and exp2f code from https://github.com/ARM-software/optimized-routines/ with wrapper on aarch64: expf reciprocal-throughput: 2.3x faster expf latency: 1.7x faster without wrapper on aarch64: expf reciprocal-throughput: 3.3x faster expf latency: 1.7x faster without wrapper on aarch64: exp2f reciprocal-throughput: 2.8x faster exp2f latency: 1.3x faster libm.so size on aarch64: .text size: -152 bytes .rodata size: -1740 bytes expf/exp2f worst case nearest rounding error: 0.502 ulp worst case non-nearest rounding error: 1 ulp Error checks are inline and errno setting is in separate tail called functions, but the wrappers are kept in this patch to handle the _LIB_VERSION==_SVID_ case. (So e.g. errno is set twice for expf calls and once for __expf_finite calls on targets where the new code is used.) Double precision arithmetics is used which is expected to be faster on most targets (including soft-float) than using single precision and it is easier to get good precision result with it. Const data is kept in a separate translation unit which complicates maintenance a bit, but is expected to give good code for literal loads on most targets and allows sharing data across expf, exp2f and powf. (This data is disabled on i386, m68k and ia64 which have their own expf, exp2f and powf code.) Some details may need target specific tweaks: - best convert and round to int operation in the arg reduction may be different across targets. - code was optimized on fma target, optimal polynomial eval may be different without fma. - gcc does not always generate good code for fp bit representation access via unions or it may be inherently slow on some targets. The libm-test-ulps will need adjustment because.. - The argument reduction ideally uses nearest rounded rint, but that is not efficient on most targets, so the polynomial can get evaluated on a wider interval in non-nearest rounding mode making 1 ulp errors common in that case. - The polynomial is evaluated such that it may have 1 ulp error on negative tiny inputs with upward rounding. * math/Makefile (type-float-routines): Add math_errf and e_exp2f_data. * sysdeps/aarch64/fpu/math_private.h (TOINT_INTRINSICS): Define. (roundtoint, converttoint): Likewise. * sysdeps/ieee754/flt-32/e_expf.c: New implementation. * sysdeps/ieee754/flt-32/e_exp2f.c: New implementation. * sysdeps/ieee754/flt-32/e_exp2f_data.c: New file. * sysdeps/ieee754/flt-32/math_config.h: New file. * sysdeps/ieee754/flt-32/math_errf.c: New file. * sysdeps/ieee754/flt-32/t_exp2f.h: Remove. * sysdeps/i386/fpu/e_exp2f_data.c: New file. * sysdeps/i386/fpu/math_errf.c: New file. * sysdeps/ia64/fpu/e_exp2f_data.c: New file. * sysdeps/ia64/fpu/math_errf.c: New file. * sysdeps/m68k/m680x0/fpu/e_exp2f_data.c: New file. * sysdeps/m68k/m680x0/fpu/math_errf.c: New file.
* hurd: Fix exposition of s/gettimeofday through timespec_s/getSamuel Thibault2017-09-253-3/+7
| | | | | | | | | | | | | conform/ISO11/time.h/linknamespace complains that using timespec_get exposes gettimeofday. conform/POSIX/time.h/linknamespace complains that using clock_settime exposes settimeofday. * sysdeps/unix/clock_gettime.c (realtime_gettime, __clock_gettime): Use __gettimeofday instead of gettimeofday. * sysdeps/unix/clock_settime.c (__clock_settime): Use __settimeofday instead of settimeofday.
* resolv_test.c: also cope with CONNREFUSED errors returned by recvfromSamuel Thibault2017-09-252-1/+9
| | | | | | | | | | | server_thread_udp_process_one already takes care of calling sendto() instead of xsendto to be able to ignore the case where the client has closed the socket. Depending on the TCP/IP stack behavior, this error could be notified later through recvfrom(), so we need to ignore it there too. * support/resolv_test.c (server_thread_udp_process_one): Call recvfrom instead of xrecvfrom, and ignore ECONNREFUSED errors.
* hurd: Fix bits/socket.h conformitySamuel Thibault2017-09-243-18/+42
| | | | | | | | | | | | | * sysdeps/mach/hurd/bits/socket.h: Include <bits/wordsize.h> instead of <limits.h> (__need_NULL): Do not define. (__ss_aligntype): Use __WORDSIZE instead of ULONG_MAX to determine alignment. [!__USE_MISC] (pseudo_AF_XTP, pseudo_AF_RTIP, pseudo_AF_PIP, CMGROUP_MAX, cmsgcred): Do not define. (CMSG_FIRSTHDR, __cmsg_nxthdr): Use (struct cmsghdr *) 0 instead of NULL. * bits/socket.h: Likewise.
* hurd: Make sure dl-sysdep.c defines proper symbol namesSamuel Thibault2017-09-242-7/+33
| | | | | | | | * sysdeps/mach/hurd/dl-sysdep.c (check_no_hidden): New macro. (__open, __close, __libc_read, __libc_write, __writev, __libc_lseek64, __mmap, __fxstat64, __xstat64, __access, __access_noerrno, __getpid, __getcwd, __sbrk, __strtoul_internal, _exit, abort): Use check_no_hidden to make sure that these symbols are defined.
* Use libm_alias_float in flt-32.Joseph Myers2017-09-2241-39/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes flt-32 libm functions use libm_alias_float to define public interfaces (in cases where _Float32 aliases of those interfaces would be appropriate, so not for finitef / isinff / isnanf). Tested for x86_64. Also tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by the patch. * sysdeps/ieee754/flt-32/s_asinhf.c: Include <libm-alias-float.h>. (asinhf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_atanf.c: Include <libm-alias-float.h>. (atanf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_cbrtf.c: Include <libm-alias-float.h>. (cbrtf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_ceilf.c: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_copysignf.c: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_cosf.c: Include <libm-alias-float.h>. (cosf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_erff.c: Include <libm-alias-float.h>. (erff): Define using libm_alias_float. (erfcf): Likewise. * sysdeps/ieee754/flt-32/s_expm1f.c: Include <libm-alias-float.h>. (expm1f): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_fabsf.c: Include <libm-alias-float.h>. (fabsf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_floorf.c: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_frexpf.c: Include <libm-alias-float.h>. (frexpf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_fromfpf.c (fromfpf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_fromfpf_main.c: Include <libm-alias-float.h>. * sysdeps/ieee754/flt-32/s_fromfpxf.c (fromfpxf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_getpayloadf.c: Include <libm-alias-float.h>. (getpayloadf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_llrintf.c: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_llroundf.c: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_logbf.c: Include <libm-alias-float.h>. (logbf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_lrintf.c: Include <libm-alias-float.h>. (lrintf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_lroundf.c: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_modff.c: Include <libm-alias-float.h>. (modff): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_nearbyintf.c: Include <libm-alias-float.h>. (nearbyintf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_nextafterf.c: Include <libm-alias-float.h>. (nextafterf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_nextupf.c: Include <libm-alias-float.h>. (nextupf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_remquof.c: Include <libm-alias-float.h>. (remquof): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_rintf.c: Include <libm-alias-float.h>. (rintf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_roundevenf.c: Include <libm-alias-float.h>. (roundevenf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_roundf.c: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_setpayloadf.c (setpayloadf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_setpayloadf_main.c: Include <libm-alias-float.h>. * sysdeps/ieee754/flt-32/s_setpayloadsigf.c (setpayloadsigf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_sincosf.c: Include <libm-alias-float.h>. (sincosf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_sinf.c: Include <libm-alias-float.h>. (sinf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_tanf.c: Include <libm-alias-float.h>. (tanf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_tanhf.c: Include <libm-alias-float.h>. (tanhf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_totalorderf.c: Include <libm-alias-float.h>. (totalorderf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_totalordermagf.c: Include <libm-alias-float.h>. (totalordermagf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_truncf.c: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_ufromfpf.c (ufromfpf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_ufromfpxf.c (ufromfpxf): Define using libm_alias_float.