aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-19nptl: Move wait implementation to libcAdhemerval Zanella
Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.
2019-12-19Remove __waitpid_nocancelAdhemerval Zanella
It enables and disables cancellation with pthread_setcancelstate before calling the waitpid. It simplifies the waitpid implementation for architectures that do not provide either __NR_waitpid or __NR_wait4. Checked on x86_64-linux-gnu.
2019-12-19Fix test isolation for elf/tst-ifunc-fault-lazy, elf/tst-ifunc-fault-bindnowFlorian Weimer
Previously, ld.so was invoked only with the elf subdirectory on the library search path. Since the soname link for libc.so only exists in the top-level build directory, this leaked the system libc into the test.
2019-12-19Fix __libc_signal_block_all on sparc64Adhemerval Zanella
The posix_spawn on sparc issues invalid sigprocmask calls: rt_sigprocmask(0xffe5e15c /* SIG_??? */, ~[], 0xffe5e1dc, 8) = -1 EINVAL (Invalid argument) Which make support/tst-support_capture_subprocess fails with random output (due the child signal being wrongly captured by the parent). Tracking the culprit it seems to be a wrong code generation in the INTERNAL_SYSCALL due the automatic sigset_t used on __libc_signal_block_all: return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &SIGALL_SET, set, _NSIG / 8); Where SIGALL_SET is defined as: ((__sigset_t) { .__val = {[0 ... _SIGSET_NWORDS-1 ] = -1 } }) Building the expanded __libc_signal_block_all on sparc64 with recent compiler (gcc 8.3.1 and 9.1.1): #include <signal> int _libc_signal_block_all (sigset_t *set) { INTERNAL_SYSCALL_DECL (err); return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &SIGALL_SET, set, _NSIG / 8); } The first argument (SIG_BLOCK) is not correctly set on 'o0' register: __libc_signal_block_all: save %sp, -304, %sp add %fp, 1919, %o0 mov 128, %o2 sethi %hi(.LC0), %o1 call memcpy, 0 or %o1, %lo(.LC0), %o1 add %fp, 1919, %o1 mov %i0, %o2 mov 8, %o3 mov 103, %g1 ta 0x6d; bcc,pt %xcc, 1f mov 0, %g1 sub %g0, %o0, %o0 mov 1, %g1 1: sra %o0, 0, %i0 return %i7+8 nop Where if SIGALL_SET is defined a const object, gcc correctly sets the expected kernel argument in correct register: sethi %hi(.LC0), %o1 call memcpy, 0 or %o1, %lo(.LC0), %o1 -> mov 1, %o0 add %fp, 1919, %o1 Another possible fix is use a static const object. Although there should not be a difference between a const compound literal and a static const object, the gcc C99 status page [1] has a note stating that this optimization is not implemented: "const-qualified compound literals could share storage with each other and with string literals, but currently don't.". This patch fixes it by moving both sigset_t that represent the signal sets to static const data object. It generates slight better code where the object reference is used directly instead of a stack allocation plus the content materialization. Checked on x86_64-linux-gnu, i686-linux-gnu, and sparc64-linux-gnu. [1] https://gcc.gnu.org/c99status.html
2019-12-19powerpc: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214]Adhemerval Zanella
This patch adds the missing bits for powerpc and fixes both tst-ifunc-fault-lazy and tst-ifunc-fault-bindnow failures on powerpc-linux-gnu. Checked on powerpc-linux-gnu and powerpc-linux-gnu-power4. Reviewed-by: Florian Weimer <fweimer@redhat.com> Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
2019-12-18hurd: Do not make sigprocmask available in ld.soFlorian Weimer
After commit f7649d5780aa4682393b9daedd653e4d9c12784c ("dlopen: Do not block signals"), the dynamic linker no longer uses sigprocmask, which means that it does not have to be made available explicitly on hurd. This reverts commit 892badc9bbcd4a6f8c2eb6c8a99be3aa22517532 ("hurd: Make __sigprocmask GLIBC_PRIVATE") and commit d5ed9ba29a3c818b3433a1784862494968abda45 ("hurd: Fix ld.so link"), but keeps the comment changes from the second commit.
2019-12-18build-many-glibcs.py: Do not build C++ PCHs by defaultFlorian Weimer
They are not used during the subsequent glibc build, so creating them merely wastes time.
2019-12-17hurd: Make getrandom honour GRND_NONBLOCKJames Clarke
* sysdeps/mach/hurd/getrandom.c (__getrandom): Open the random source with O_NONBLOCK when the GRND_NONBLOCK flag is provided. Message-Id: <20191217182929.90989-1-jrtc27@jrtc27.com>
2019-12-16tunables: report sbrk() failureDJ Delorie
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2019-12-16build-many-glibcs.py: Add mipsisa64r6el-linux-gnu targetDragan Mladjenovic
This patch enables building mips/r6 isa/little-endian/hard-float configuration in o32, n32, and n64 variants.
2019-12-16mips: Do not include hi and lo in __SYSCALL_CLOBBERS for R6Dragan Mladjenovic
GCC 10 (PR 91233) won't silently allow registers that are not architecturally available to be present in the clobber list anymore, resulting in build failure for mips*r6 targets in form of: ... .../sysdep.h:146:2: error: the register ‘lo’ cannot be clobbered in ‘asm’ for the current target 146 | __asm__ volatile ( \ | ^~~~~~~ This is because base R6 ISA doesn't define hi and lo registers w/o DSP extension. This patch provides the alternative definitions of __SYSCALL_CLOBBERS for r6 targets that won't include those registers. * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (__SYSCALL_CLOBBERS): Exclude hi and lo from the clobber list for __mips_isa_rev >= 6. * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (__SYSCALL_CLOBBERS): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (__SYSCALL_CLOBBERS): Likewise.
2019-12-13ldbl-128ibm-compat: Add ISO C99 versions of scanf functionsGabriel F. T. Gomes
In the format string for *scanf functions, the '%as', '%aS', and '%a[]' modifiers behave differently depending on ISO C99 compatibility. When _GNU_SOURCE is defined and -std=c89 is passed to the compiler, these functions behave like ascanf, and the modifiers allocate memory for the output. Otherwise, the ISO C99 compliant version of these functions is used, and the modifiers consume a floating-point argument. This patch adds the IEEE binary128 variant of ISO C99 compliant functions for the third long double format on powerpc64le. Tested for powerpc64le. Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com>
2019-12-13ldbl-128ibm-compat: Fix selection of GNU and ISO C99 scanfGabriel F. T. Gomes
Since commit commit 03992356e6fedc5a5e9d32df96c1a2c79ea28a8f Author: Zack Weinberg <zackw@panix.com> Date: Sat Feb 10 11:58:35 2018 -0500 Use C99-compliant scanf under _GNU_SOURCE with modern compilers. the selection of the GNU versions of scanf functions requires both _GNU_SOURCE and -std=c89. This patch changes the tests in ldbl-128ibm-compat so that they actually test the GNU versions (without this change, the redirection to the ISO C99 version always happens, so GNU versions of the new implementation (e.g. __scanfieee128) were left untested). Tested for powerpc64le. Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com>
2019-12-13hurd: Fix local PLTSamuel Thibault
* include/sys/random.h (__getrandom): Add hidden prototype. * stdlib/getrandom.c (getrandom): Rename to hidden definition __getrandom. Add weak alias. * sysdeps/mach/hurd/getrandom.c (getrandom): Likewise. * sysdeps/unix/sysv/linux/getrandom.c (getrandom): Likewise. * sysdeps/mach/hurd/getentropy.c (getentropy): Use __getrandom instead of getrandom.
2019-12-13dlopen: Do not block signalsFlorian Weimer
Blocking signals causes issues with certain anti-malware solutions which rely on an unblocked SIGSYS signal for system calls they intercept. This reverts commit a2e8aa0d9ea648068d8be52dd7b15f1b6a008e23 ("Block signals during the initial part of dlopen") and adds comments related to async signal safety to active_nodelete and its caller. Note that this does not make lazy binding async-signal-safe with regards to dlopen. It merely avoids introducing new async-signal-safety hazards as part of the NODELETE changes. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2019-12-13dlopen: Rework handling of pending NODELETE statusFlorian Weimer
Commit a2e8aa0d9ea648068d8be52dd7b15f1b6a008e23 ("Block signals during the initial part of dlopen") was deemed necessary because of read-modify-write operations like the one in add_dependency in elf/dl-lookup.c. In the old code, we check for any kind of NODELETE status and bail out: /* Redo the NODELETE check, as when dl_load_lock wasn't held yet this could have changed. */ if (map->l_nodelete != link_map_nodelete_inactive) goto out; And then set pending status (during relocation): if (flags & DL_LOOKUP_FOR_RELOCATE) map->l_nodelete = link_map_nodelete_pending; else map->l_nodelete = link_map_nodelete_active; If a signal arrives during relocation and the signal handler, through lazy binding, adds a global scope dependency on the same map, it will set map->l_nodelete to link_map_nodelete_active. This will be overwritten with link_map_nodelete_pending by the dlopen relocation code. To avoid such problems in relation to the l_nodelete member, this commit introduces two flags for active NODELETE status (irrevocable) and pending NODELETE status (revocable until activate_nodelete is invoked). As a result, NODELETE processing in dlopen does not introduce further reasons why lazy binding from signal handlers is unsafe during dlopen, and a subsequent commit can remove signal blocking from dlopen. This does not address pre-existing issues (unrelated to the NODELETE changes) which make lazy binding in a signal handler during dlopen unsafe, such as the use of malloc in both cases. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2019-12-13dlopen: Fix issues related to NODELETE handling and relocationsFlorian Weimer
The assumption behind the assert in activate_nodelete was wrong: Inconsistency detected by ld.so: dl-open.c: 459: activate_nodelete: Assertion `!imap->l_init_called || imap->l_type != lt_loaded' failed! (edit) It can happen that an already-loaded object that is in the local scope is promoted to NODELETE status, via binding to a unique symbol. Similarly, it is possible that such NODELETE promotion occurs to an already-loaded object from the global scope. This is why the loop in activate_nodelete has to cover all objects in the namespace of the new object. In do_lookup_unique, it could happen that the NODELETE status of an already-loaded object was overwritten with a pending NODELETE status. As a result, if dlopen fails, this could cause a loss of the NODELETE status of the affected object, eventually resulting in an incorrect unload. Fixes commit f63b73814f74032c0e5d0a83300e3d864ef905e5 ("Remove all loaded objects if dlopen fails, ignoring NODELETE [BZ #20839]").
2019-12-13hurd: Fix __close_nocancel_nostatus availabilitySamuel Thibault
Not only libc/rtld use __close_nocancel_nostatus. * sysdeps/mach/hurd/Makefile [$(subdir) == io] (sysdep_routines): Add close_nocancel_nostatus. * sysdeps/mach/hurd/Versions (libc): Add __close_nocancel_nostatus to GLIBC_PRIVATE. * sysdeps/mach/hurd/not-cancel.h (__close_nocancel_nostatus): Declare function instead of defining inline. [IS_IN (libc) || IS_IN (rtld)] (__close_nocancel_nostatus): Make function hidden. * sysdeps/mach/hurd/close_nocancel_nostatus.c: New file.
2019-12-13hurd: add getrandom and getentropy implementationsAndrew Eggenberger
* sysdeps/mach/hurd/getentropy.c: New file. * sysdeps/mach/hurd/getrandom.c: Likewise.
2019-12-13hurd: Implement __close_nocancel_nostatusSamuel Thibault
* sysdeps/mach/hurd/not-cancel.h: New file.
2019-12-11manual: clarify fopen with the x flagPaul Eggert
* manual/stdio.texi (Opening Streams): Say how glibc's implementation of fopen with "x" follows ISO C11.
2019-12-11S390: Use sysdeps/ieee754/dbl-64/wordsize-64 on s390x.Stefan Liebler
This patch enables the usage of implementations in sysdeps/ieee754/dbl-64/wordsize-64 on 64bit s390x.
2019-12-11S390: Implement roundtoint and converttoint and define TOINT_INTRINSICS.Stefan Liebler
This patch implements roundtoint and convertoint for s390 by using the load-fp-integer and convert-to-fixed instructions. Both functions are using "round to nearest with ties away from zero" rounding mode and do not raise inexact exceptions.
2019-12-11S390: Implement math-barriers math_opt_barrier and math_force_eval.Stefan Liebler
This patch implements the s390 specific math barriers in order to omit the store and load from stack if possible.
2019-12-11S390: Use libc_fe* macros in fe* functions.Stefan Liebler
This patch updates the s390 specific functions fegetround, fesetround, feholdexcept, fesetenv, feupdateenv, fegetexceptflag, fetestexcept, fesetexceptflag, fetestexceptflag. Now those functions are using the libc_fe* macros if possible. Furthermore fegetexceptflag is now returning the exception from dxc field shifted to the usual exception-flags. Thus a special fetestexceptflag implementation is not needed anymore.
2019-12-11S390: Implement libc_fe* macros.Stefan Liebler
This patch provides the s390 specific implementation for libc_feholdexcept, libc_fesetround, libc_feholdexcept_setround, libc_fetestexcept, libc_fesetenv, libc_feupdateenv_test, libc_feupdateenv, libc_feholdsetround_ctx, libc_feresetround_ctx, libc_feholdsetround_noex_ctx and libc_feresetround_noex_ctx.
2019-12-11S390: Use convert-to-fixed instruction for llround functions.Stefan Liebler
If compiled with z196 zarch support, the convert-to-fixed instruction is used to implement llround, llroundf, llroundl. Otherwise the common-code implementation is used.
2019-12-11S390: Use convert-to-fixed instruction for lround functions.Stefan Liebler
If compiled with z196 zarch support, the convert-to-fixed instruction is used to implement lround, lroundf, lroundl. Otherwise the common-code implementation is used.
2019-12-11S390: Use convert-to-fixed instruction for llrint functions.Stefan Liebler
If compiled with z196 zarch support, the convert-to-fixed instruction is used to implement llrint, llrintf, llrintl. Otherwise the common-code implementation is used.
2019-12-11S390: Use convert-to-fixed instruction for lrint functions.Stefan Liebler
If compiled with z196 zarch support, the convert-to-fixed instruction is used to implement lrint, lrintf, lrintl. Otherwise the common-code implementation is used.
2019-12-11S390: Use load-fp-integer instruction for roundeven functions.Stefan Liebler
If compiled with z196 zarch support, the load-fp-integer instruction is used to implement roundeven, roundevenf, roundevenl. Otherwise the common-code implementation is used.
2019-12-11Adjust s_copysignl.c regarding code style.Stefan Liebler
This patch just adjusts the generic implementation regarding code style. No functional change. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Adjust s_ceilf.c and s_ceill.c regarding code style.Stefan Liebler
This patch just adjusts the generic implementation regarding code style. No functional change. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Adjust s_floorf.c and s_floorl.c regarding code style.Stefan Liebler
This patch just adjusts the generic implementation regarding code style. No functional change. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Adjust s_rintf.c and s_rintl.c regarding code style.Stefan Liebler
This patch just adjusts the generic implementation regarding code style. No functional change. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Adjust s_nearbyintf.c and s_nearbyintl.c regarding code style.Stefan Liebler
This patch just adjusts the generic implementation regarding code style. No functional change. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Use GCC builtins for copysign functions if desired.Stefan Liebler
This patch is always using the corresponding GCC builtin for copysignf, copysign, and is using the builtin for copysignl, copysignf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. Altough the long double version is enabled by default we still need the macro and the alternative implementation as the _Float128 version of the builtin is not available with all supported GCC versions. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Use GCC builtins for round functions if desired.Stefan Liebler
This patch is using the corresponding GCC builtin for roundf, round, roundl and roundf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Use GCC builtins for trunc functions if desired.Stefan Liebler
This patch is using the corresponding GCC builtin for truncf, trunc, truncl and truncf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Use GCC builtins for ceil functions if desired.Stefan Liebler
This patch is using the corresponding GCC builtin for ceilf, ceil, ceill and ceilf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Use GCC builtins for floor functions if desired.Stefan Liebler
This patch is using the corresponding GCC builtin for floorf, floor, floorl and floorf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Use GCC builtins for rint functions if desired.Stefan Liebler
This patch is using the corresponding GCC builtin for rintf, rint, rintl and rintf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Use GCC builtins for nearbyint functions if desired.Stefan Liebler
This patch is using the corresponding GCC builtin for nearbyintf, nearbyint, nearbintl and nearbyintf128 if the USE_FUNCTION_BUILTIN macros are defined to one in math-use-builtins.h. This is the case for s390 if build with at least --march=z196 --mzarch. Otherwise the generic implementation is used. The code of the generic implementation is not changed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Always use wordsize-64 version of s_round.c.Stefan Liebler
This patch replaces s_round.c in sysdeps/dbl-64 with the one in sysdeps/dbl-64/wordsize-64 and removes the latter one. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Always use wordsize-64 version of s_trunc.c.Stefan Liebler
This patch replaces s_trunc.c in sysdeps/dbl-64 with the one in sysdeps/dbl-64/wordsize-64 and removes the latter one. The code is not changed except changes in code style. Also adjusted the include path in x86_64 and sparc64 files. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Always use wordsize-64 version of s_ceil.c.Stefan Liebler
This patch replaces s_ceil.c in sysdeps/dbl-64 with the one in sysdeps/dbl-64/wordsize-64 and removes the latter one. The code is not changed except changes in code style. Also adjusted the include path in x86_64 and sparc64 files. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Always use wordsize-64 version of s_floor.c.Stefan Liebler
This patch replaces s_floor.c in sysdeps/dbl-64 with the one in sysdeps/dbl-64/wordsize-64 and removes the latter one. The code is not changed except changes in code style. Also adjusted the include path in x86_64 and sparc64 files. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Always use wordsize-64 version of s_rint.c.Stefan Liebler
This patch replaces s_rint.c in sysdeps/dbl-64 with the one in sysdeps/dbl-64/wordsize-64 and removes the latter one. The code is not changed except changes in code style. Also adjusted the include path in x86_64 file. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11Always use wordsize-64 version of s_nearbyint.c.Stefan Liebler
This patch replaces s_nearbyint.c in sysdeps/dbl-64 with the one in sysdeps/dbl-64/wordsize-64 and removes the latter one. The code is not changed except changes in code style. Also adjusted the include path in x86_64 file. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-12-11ldconfig: Do not print a warning for a missing ld.so.conf fileFlorian Weimer
The configuration file is not needed for working system, so printing a warning is not helpful. Reviewed-by: Carlos O'Donell <carlos@redhat.com>