about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Remove GCC version conditionals on -Wmaybe-uninitialized pragmas.Joseph Myers2015-10-2712-49/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One common case of __GNUC_PREREQ (4, 7) conditionals is use of diagnostic control pragmas for -Wmaybe-uninitialized, an option introduced in GCC 4.7 where older GCC needed -Wuninitialized to be controlled instead if the warning appeared with older GCC. This patch removes such conditionals. (There remain several older uses of -Wno-uninitialized in makefiles that still need to be converted to diagnostic control pragmas if the issue is still present with current sources and supported GCC versions, and it's likely that in most cases those pragmas also will end up controlling -Wmaybe-uninitialized.) Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch, except for libresolv since res_send.c contains assertions whose line numbers are changed by the patch). * resolv/res_send.c (send_vc) [__GNUC_PREREQ (4, 7)]: Make code unconditional. * soft-fp/fmadf4.c [__GNUC_PREREQ (4, 7)]: Likewise. [!__GNUC_PREREQ (4, 7)]: Remove conditional code. * soft-fp/fmasf4.c [__GNUC_PREREQ (4, 7)]: Make code unconditional. [!__GNUC_PREREQ (4, 7)]: Remove conditional code. * soft-fp/fmatf4.c [__GNUC_PREREQ (4, 7)]: Make code unconditional. [!__GNUC_PREREQ (4, 7)]: Remove conditional code. * stdlib/setenv.c [((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7)]: Make code unconditional. [!(((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7))]: Remove conditional code. * sysdeps/ieee754/dbl-64/e_lgamma_r.c (__ieee754_lgamma_r) [__GNUC_PREREQ (4, 7)]: Make code unconditional. (__ieee754_lgamma_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional code. * sysdeps/ieee754/flt-32/e_lgammaf_r.c (__ieee754_lgammaf_r) [__GNUC_PREREQ (4, 7)]: Make code unconditional. (__ieee754_lgammaf_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional code. * sysdeps/ieee754/ldbl-128/k_tanl.c (__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional. (__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code. * sysdeps/ieee754/ldbl-128ibm/k_tanl.c (__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional. (__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code. * sysdeps/ieee754/ldbl-96/e_lgammal_r.c (__ieee754_lgammal_r) [__GNUC_PREREQ (4, 7)]: Make code unconditional. (__ieee754_lgammal_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional code. * sysdeps/ieee754/ldbl-96/k_tanl.c (__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional. (__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
* Add -std=gnu11 and -std=c11 NPTL initializers tests.Joseph Myers2015-10-274-1/+12
| | | | | | | | | | | | | | NPTL has tests that initializers work with various -std= options. Now that we can rely on -std=gnu11 and -std=c11 being available, this patch adds versions of those tests for those options. Tested for x86_64 and x86 (testsuite). * nptl/tst-initializers1-c11.c: New file. * nptl/tst-initializers1-gnu11.c: Likewise. * nptl/Makefile (tests): Add these new tests. (CFLAGS-tst-initializers1-c11.c): New variable. (CFLAGS-tst-initializers1-gnu11.c): Likewise.
* Use -std=gnu11 instead of -std=gnu99.Joseph Myers2015-10-276-5/+14
| | | | | | | | | | | | | | | | | | | | Now that GCC 4.7 or later is required to build glibc, this patch moves the build from using -std=gnu99 to -std=gnu11 (option added in 4.7). This allows use of C11 features from GCC's headers, such as new float.h macros and max_align_t. Tested for x86_64 and x86 (testsuite; installed stripped shared libraries are unchanged by the patch on x86_64, while I see some slight code reordering of no significance on x86). * Makeconfig (CFLAGS): Use -std=gnu11 instead of -std=gnu99. * Makefile ($(objpfx)c++-types-check.out): Filter out -std=gnu11 instead of -std=gnu99. * configure.ac (systemtap): Test with -std=gnu11 instead of -std=gnu99. * configure: Regenerated. * math/gen-auto-libm-tests.c: Use -std=gnu11 instead of -std=gnu99 in compilation command in comment.
* Remove sysdeps/nptl/configure.ac.Joseph Myers2015-10-2712-167/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | sysdeps/nptl/configure.ac tests for forced unwind support and the C cleanup attribute, giving errors if either is unsupported. It does nothing beyond running those two tests. Both the attribute, and _Unwind_GetCFA which is used in the forced unwind test, were added in GCC 3.3. Thus these tests are long obsolete, and this patch removes the configure fragment running them, along with associated conditionals. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * sysdeps/nptl/configure.ac: Remove file. * sysdeps/nptl/configure: Remove generated file. * configure.ac (libc_cv_forced_unwind): Do not substitute. * configure: Regenerated. * config.h.in (HAVE_FORCED_UNWIND): Remove #undef. * config.make.in (have-forced-unwind): Remove variable. * nptl/Makefile [$(have-forced-unwind) = yes]: Make code unconditional. * nptl/descr.h [HAVE_FORCED_UNWIND]: Likewise. * nptl/unwind.c [HAVE_FORCED_UNWIND]: Likewise. (__pthread_unwind) [!HAVE_FORCED_UNWIND]: Remove conditional code. * nptl/version.c [HAVE_FORCED_UNWIND]: Make code unconditional. * sysdeps/nptl/Makefile [$(have-forced-unwind) = yes]: Make code unconditional.
* powerpc: Fix usage of elision transient failure adapt paramPaul Murphy2015-10-274-13/+19
| | | | | | | | | | | | | | The skip_lock_out_of_tbegin_retries adaptive parameter was not being used correctly, nor as described. This prevents a fallback for all users of the lock if a transient abort occurs within the accepted number of retries. [BZ #19174] * sysdeps/powerpc/nptl/elide.h (__elide_lock): Fix usage of .skip_lock_out_of_tbegin_retries. * sysdeps/unix/sysv/linux/powerpc/elision-lock.c (__lll_lock_elision): Likewise, and respect a value of try_tbegin <= 0.
* Add AT_PLATFORM to _dl_aux_init ()Carlos Eduardo Seo2015-10-272-0/+8
| | | | | | | | Added AT_PLATFORM to _dl_aux_init () function to keep it in sync with _dl_sysdep_start (). * elf/dl-support.c (_dl_aux_init): Added AT_PLATFORM to the case statement.
* Remove pre-GCC-4.7 conform/ test XFAILs.Joseph Myers2015-10-272-5/+5
| | | | | | | | | | | | | Now that GCC 4.7 or later is required to build glibc, this patch removes three conform/ test XFAILs that related to missing C11 support in GCC 4.6. Tested for x86_64 and x86 (conform/ tests). * conform/Makefile (test-xfail-ISO11/complex.h/conform): Remove variable. (test-xfail-ISO11/stdalign.h/conform): Likewise. (test-xfail-ISO11/stdnoreturn.h/conform): Likewise.
* Use -std=c11 for C11 conform/ tests.Joseph Myers2015-10-272-1/+4
| | | | | | | | | | | Now that GCC 4.7 or later is required to build glibc, this patch makes the conformance tests use -std=c11 for C11 tests instead of -std=c1x -D_ISOC11_SOURCE. Tested for x86_64 and x86 (conform/ tests). * conform/GlibcConform.pm ($CFLAGS{"ISO11"}): Use -std=c11 instead of -std=c1x -D_ISOC11_SOURCE.
* Require GCC 4.7 or later to build glibc.Joseph Myers2015-10-276-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements a requirement of GCC 4.7 or later to build glibc. This was discussed in the thread starting at <https://sourceware.org/ml/libc-alpha/2015-08/msg00851.html>. Concerns were expressed by Mike and David. At <https://sourceware.org/ml/libc-alpha/2015-10/msg00453.html> I have provided a 14-patch series showing in outline the cleanups facilitated by this version requirement, as requested by Mike (this patch is the first in that series, with the addition of a NEWS entry). Given the absence of further concerns or alternative proposals for criteria for updates to this version requirement as requested in <https://sourceware.org/ml/libc-alpha/2015-10/msg00065.html>, I am interpreting this as "absence of sustained opposition" under Carlos's definition at <https://sourceware.org/glibc/wiki/Consensus> and proposing this patch for inclusion in glibc. I'd like to remind people testing with 4.6 that if they move to testing with GCC 5 then it will probably be about four years before they need to update the compiler they use to test glibc again. Although on the principles of time-based updates I think a move to requiring binutils 2.23 would be reasonable, I'm not currently aware of any cleanups that would facilitate so am not proposing that at this time (but would expect to propose a move to requiring binutils 2.24 in a year's time, as that brings features such as AVX512 support that should allow some conditionals to be cleaned up). If someone thinks a move to requiring 2.23 would help clean things up for their architecture, please speak up. (And in general, I suspect there are lots of architecture-specific configure tests that could be removed on the basis of current GCC and binutils version requirements, given how I've found architecture-independent tests obsolete on the basis of version requirements going back 20 years.) Tested for x86_64 and x86 (testsuite, and that installed shared libraries are unchanged by the patch). * configure.ac (libc_cv_compiler_ok): Require GCC 4.7 or later. * configure: Regenerated. * manual/install.texi (Tools for Compilation): Document requirement for GCC 4.7 or later. * INSTALL: Regenerated.
* Gracefully handle incompatible locale dataLudovic Courtès2015-10-272-3/+9
| | | | | * locale/loadlocale.c (_nl_intern_locale_data): Change assertion on CNT to a conditional jump to 'puntdata'.
* Remove TLS configure tests.Joseph Myers2015-10-273-82/+4
| | | | | | | | | | | | | | | | | | | | | | | | There seemed to be support in response to <https://sourceware.org/ml/libc-alpha/2015-10/msg00510.html> for removing configure tests that exist only to produce errors, where we expect that tool versions failing the tests would also fail the tests of minimum GCC / binutils versions. This patch removes the tests for TLS support as one instance of such tests. Since the addition of TLS emulation support in GCC 4.3, I don't think these tests would have failed even if proper TLS support (as required by glibc) was missing in that architecture's GCC back end, so any new glibc ports wanting a substantive test (if there are actual GCC or binutils versions for those architectures, with supported version numbers, missing TLS support) would have needed an architecture-specific test anyway. Tested for x86_64 and x86 (testsuite, and that installed shared libraries are unchanged by the patch). * configure.ac (libc_cv_gcc___thread): Remove configure test. (libc_cv_gcc_tls_model_attr): Likewise. * configure: Regenerated.
* Remove configure test for needing -P for .S files.Joseph Myers2015-10-274-48/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a configure test for "whether we need to use -P to assemble .S files". I think this test is long obsolete. I don't have a specific reference to a binutils change or version that obsoleted this test, but: (a) we only support GNU binutils; (b) it looks like every architecture supported by glibc has '#' as a line comment character in its gas port; (c) in any case, if the (compiler, assembler) combination in use cannot compile a .S file without special options, that would clearly be a substantially broken combination, which I don't think we need to allow for at all. The test in question was added by: Thu Jan 27 16:46:03 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) * configure.in (asm-CPPFLAGS): Add new check to see if assembling a .S file loses without -P. If so, set asm-CPPFLAGS=-P in config.make. This patch removes the test and the reference to this issue in the comment on the default empty definition of asm-CPPFLAGS. (Various other settings of asm-CPPFLAGS remain in sysdeps Makefile fragments.) Tested for x86_64 and x86 (testsuite, and that installed shared libraries are unchanged by the patch). * configure.ac (libc_cv_need_minus_P): Remove configure test. * configure: Regenerated. * Makeconfig (asm-CPPFLAGS): Remove reference to -P in comment.
* Remove support for removing glibc 2.0 headers.Joseph Myers2015-10-265-65/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | There is a configure test for the presence of glibc 2.0 headers (that were renamed / no longer installed in glibc 2.1) and associated support for removing them on "make install". Normal practice for subsequent removal / renaming of installed files has been not to do anything special about removing them; if you want installed files from an old installation removed reliably, you need to use a packaging system that tracks what files were installed by a previous glibc package (via installing in an intermediate directory with install_root). I think it's been long enough since 2.0 that it's not particularly useful to have that special logic for those old headers either; this patch removes it. Tested for x86_64 and x86 (testsuite, and that installed shared libraries are unchanged by the patch). * configure.ac (old_glibc_headers): Remove configure test. * configure: Regenerated. * config.make.in (old-glibc-headers): Remove variable. * Makefile [!$(install_root) && $(old-glibc-headers) = yes] (install): Remove dependency on remove-old-headers. (headers2_0): Remove variable. (remove-old-headers): Remove rule.
* Remove configure test for assembler .text directive.Joseph Myers2015-10-263-46/+9
| | | | | | | | | | | | | | | | | | | | There is a configure test for assembler support for the .text directive. I suppose this test must have been aimed at some non-ELF platform or non-GNU assembler. Certainly the GNU assembler has had ELF-specific architecture-independent handling for .text since version 2.2, and generic non-ELF-specific support predates that. This patch removes this test as obsolete. Tested for x86_64 and x86 (testsuite, and that installed shared libraries are unchanged by the patch). * configure.ac (libc_cv_dot_text): Remove configure test. (libc_cv_asm_set_directive): Use .text instead of ${libc_cv_dot_text} in configure test. * configure: Regenerated.
* x86_64: Regenerate ulps [BZ #19168]Florian Weimer2015-10-262-6/+11
| | | | This comes from running “make regen-ulps” on AMD Opteron 6272 CPUs.
* Use the CXX compiler only if it can create dynamic and static programsFlorian Weimer2015-10-263-0/+48
| | | | | | * configure.ac (CXX): Clear the variable if the C++ toolchain does not support static linking. * configure: Regenerate.
* Remove libm-test.inc special-casing of errors up to 0.5 ulp.Joseph Myers2015-10-232-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libm-test.inc has special-case code treating errors of up to 0.5 ulp as allowed (for functions that aren't exactly determined) even if no such errors appeared in libm-test-ulps. This only applies to avoid errors for individual function calls, not for the overall check of ulps at the end of testing a function, resulting in confusing output of the form: testing double (without inline functions) Maximal error of `log_upward' is : 1 ulp accepted: 0 ulp with no report of what testcase produced that error. This patch removes the special case, so that instead you get: testing double (without inline functions) Failure: Test: log_upward (0x1.0000000000001p+0) Result: is: 2.2204460492503129e-16 0x1.fffffffffffffp-53 should be: 2.2204460492503131e-16 0x1.0000000000000p-52 difference: 2.4651903288156619e-32 0x1.0000000000000p-105 ulp : 0.5000 max.ulp : 0.0000 Maximal error of `log_upward' is : 1 ulp accepted: 0 ulp (for formats other than ldbl-128ibm, 0.5 ulp errors only occur in unusual cases such as this where the correctly rounded result is a power of 2 and the computed result is just below it). This should not affect which cases result in the test failing, just ensure that if it fails then some failure for an individual function call was reported. Tested for x86_64 and x86. * math/libm-test.inc (check_float_internal): Do not special-case errors up to 0.5 ulp.
* Add more libm tests (ilogb, is*, j0, j1, jn, lgamma, log*).Joseph Myers2015-10-235-0/+2889
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch improves the libm test coverage for a few more functions. Tested for x86_64 and x86. * math/auto-libm-test-in: Add more tests of log, log10, log1p and log2. * math/auto-libm-test-out: Regenerated. * math/libm-test.inc (MAX_EXP): New macro. (ilogb_test_data): Add more tests. (isfinite_test_data): Likewise. (isgreater_test_data): Likewise. (isgreaterequal_test_data): Likewise. (isinf_test_data): Likewise. (isless_test_data): Likewise. (islessequal_test_data): Likewise. (islessgreater_test_data): Likewise. (isnan_test_data): Likewise. (isnormal_test_data): Likewise. (issignaling_test_data): Likewise. (isunordered_test_data): Likewise. (j0_test_data): Likewise. (j1_test_data): Likewise. (jn_test_data): Likewise. (lgamma_test_data): Likewise. (log_test_data): Likewise. (log10_test_data): Likewise. (log1p_test_data): Likewise. (log2_test_data): Likewise. (logb_test_data): Likewise. * sysdeps/x86_64/fpu/libm-test-ulps: Update.
* Fix j1, jn missing errno setting on underflow (bug 18611).Joseph Myers2015-10-2313-259/+299
| | | | | | | | | | | | | | | | | | | | | | | | j1 and jn can underflow for small arguments, but fail to set errno when underflowing to 0. This patch fixes them to set errno in that case. Tested for x86_64, x86, mips64 and powerpc. [BZ #18611] * sysdeps/ieee754/dbl-64/e_j1.c (__ieee754_j1): Set errno and avoid excess range and precision on underflow. * sysdeps/ieee754/dbl-64/e_jn.c (__ieee754_jn): Likewise. * sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_j1f): Likewise. * sysdeps/ieee754/flt-32/e_jnf.c (__ieee754_jnf): Likewise. * sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_j1l): Set errno on underflow. * sysdeps/ieee754/ldbl-128/e_jnl.c (__ieee754_jnl): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_jnl.c (__ieee754_jnl): Likewise. * sysdeps/ieee754/ldbl-96/e_j1l.c (__ieee754_j1l): Likewise. * sysdeps/ieee754/ldbl-96/e_jnl.c (__ieee754_jnl): Likewise. * math/auto-libm-test-in: Do not allow missing errno setting for tests of j1 and jn. * math/auto-libm-test-out: Regenerated.
* Fix i386 / x86_64 nearbyint exception clearing (bug 15491).Joseph Myers2015-10-228-61/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementations of nearbyint functions using x87 floating point (i386 all versions, x86_64 long double only) use the fclex instruction, which clears any exceptions that were raised before the function was called. These functions must not clear exceptions that were raised before they were called. This patch fixes these functions to save and restore the whole floating-point environment (fnstenv / fldenv) as the way of avoiding raising "inexact" (recall that there isn't an x87 instruction for loading just the status word, so the whole environment has to be saved and loaded instead - the code already saved and loaded the control word, which is now obtained from the saved environment after this patch, to disable traps on "inexact"). In the case of the long double functions, any "invalid" exception from frndint (applied to a signaling NaN) needs merging into the saved state; this issue doesn't apply to the float and double functions because that exception would have been raised when the argument is loaded, before the environment is saved. [BZ #15491] * sysdeps/i386/fpu/s_nearbyint.S (__nearbyint): Save and restore floating-point environment instead of clearing all exceptions. * sysdeps/i386/fpu/s_nearbyintf.S (__nearbyintf): Likewise. * sysdeps/i386/fpu/s_nearbyintl.S (__nearbyintl): Likewise, merging in "invalid" exceptions from frndint. * sysdeps/x86_64/fpu/s_nearbyintl.S (__nearbyintl): Likewise. * math/test-nearbyint-except.c: New file. * math/Makefile (tests): Add test-nearbyint-except.
* Update NEWS to mention drive-by fix for bug 18699.Chris Metcalf2015-10-222-7/+10
| | | | | | | | | | | Wilco fixed this tilegx bug in commit fe8c2b33aed0 ("Since we now inline isinf, isnan and isfinite in math.h, replace uses of __isinf_ns(l/f) with isinf, and remove the unused inlines __isinf_ns(l/f), __isnan(f) and __finite(f).") I verified that reverting math/s_cprojf.c back to using the sysdeps/ieee754/flt-32/math_private.h version of __isinf_nsf() instead of isinf() brings back the bug on tilegx.
* tile: regenerate libm-test-ulpsChris Metcalf2015-10-222-20/+28
|
* Cleanup sync_file_range implementationAdhemerval Zanella2015-10-223-22/+7
| | | | | | | | | | | | | Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups the mips code to assume __NR_sync_file_range and the powerpc one to either assume __NR_sync_file_range2 or __NR_sync_file_range. Checked on powerpc64le and build for mips (ABIO32, ABIN32, and ABI64). * sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c (__NR_sync_file_range2): Assume it is always defined. * sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c (__NR_sync_file_range): Assume it is always defined.
* Always use INTERNAL_SYSCALL_ERRNO with INTERNAL_SYSCALLAndreas Schwab2015-10-227-6/+23
|
* Move io/tst-fcntl temporary file creation to do_prepare.Joseph Myers2015-10-212-8/+14
| | | | | | | | | | | | | | | | | | | | This patch makes the io/tst-fcntl test create its temporary file in do_prepare not do_test, so that add_temp_name is called in the parent on the correct file name, as requested in the thread starting at <https://sourceware.org/ml/libc-alpha/2015-10/msg00552.html>. I don't see any reason in this test that opening the file in the parent should be problematic. This patch is explicitly not exhaustive for such issues; other tests still call add_temp_file in the child. The general issue is noted at <https://sourceware.org/glibc/wiki/Development_Todo/Master#Use_test-skeleton.c>. Tested for x86_64 (that this test still passes and no longer leaves a file behind in /tmp). * io/tst-fcntl.c (fd): New static variable. (do_prepare): Open temporary file here.... (do_test): ...not here.
* Make io/ftwtest-sh remove temporary files on early exit.Joseph Myers2015-10-212-1/+7
| | | | | | | | | | | | | | | | | | | | | | The test io/ftwtest-sh creates a directory that at some points during the test does not have execute permission. To avoid leaving behind such a directory that prevents the build directory from being removed with a simple "rm -rf", it traps various signals to make the directory executable and remove it before exit. However, this doesn't cover the case where one of the tests simply fails (which happens with cross testing if testing on a remote system where the path to the build directory involves a symlink, or if that remote system fell over during testing - I think the latter is the case where the directory is left behind with bad permissions). This patch makes that test also trap signal 0 (exit) so that the directory gets properly removed in such failure cases as well. Tested in both configurations where the test passes and where it fails to verify that the result of the test is unchanged but the directory is no longer left behind where it was previously left behind. * io/ftwtest-sh: Also trap on exit to remove temporary files.
* Build i386 __libc_do_syscall when PROF is definedH.J. Lu2015-10-213-11/+17
| | | | | | | | | | | Need to provide i386 __libc_do_syscall when PROF is defined. Define OPTIMIZE_FOR_GCC_5 for .S files so that it can be used in libc-do-syscall.S. * sysdeps/unix/sysv/linux/i386/libc-do-syscall.S: Replace __GNUC_PREREQ (5,0) with OPTIMIZE_FOR_GCC_5. * sysdeps/unix/sysv/linux/i386/sysdep.h (OPTIMIZE_FOR_GCC_5): Moved before "#ifdef __ASSEMBLER__".
* Fix ldbl-128 j0l spurious underflows (bug 19156).Joseph Myers2015-10-213-1/+9
| | | | | | | | | | | | | | My recent addition of more tests for j0 showed up that the ldbl-128 implementation of j0l produces spurious underflow exceptions for arguments close to 0 (when the result is very close to 1). This patch fixes this by just returning the argument in that case. Tested for mips64 (where it fixes the recently-added tests that were previously failing). [BZ #19156] * sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_j0l): Return 1 for arguments very close to 0.
* tile: avoid preprocessor redefinition warningsChris Metcalf2015-10-212-0/+8
| | | | | | PSEUDO_END and PSEUDO_END_NOERRNO are being defined in sysdeps/unix/sysdep.h and then redefined for tile. Add an undef before each define to silence the warnings.
* Disable GCC 5 optimization when PROF is definedH.J. Lu2015-10-212-7/+18
| | | | | | | | | | | Since asm ("ebp") can't be used to put the 6th argument in %ebp for syscall when compiling for profiling, we disable GCC 5 optimization when PROF is defined. * sysdeps/unix/sysv/linux/i386/sysdep.h (OPTIMIZE_FOR_GCC_5): New. Defined for GCC 5 and above when not compiling for profiling. Replace __GNUC_PREREQ (5,0) with OPTIMIZE_FOR_GCC_5.
* Apply -fomit-frame-pointer only to .o/.os filesH.J. Lu2015-10-212-4/+24
| | | | | | | | | | | | | | | | | | | Since -fomit-frame-pointer is compatible with -pg, apply it only to .o/.os files. * sysdeps/unix/sysv/linux/i386/Makefile (CFLAGS-epoll_pwait.c): Renamed to ... (CFLAGS-epoll_pwait.o): This. (CFLAGS-mmap.c): Renamed to ... (CFLAGS-mmap.o): This. (CFLAGS-mmap64.c): Renamed to ... (CFLAGS-mmap64.o): This. (CFLAGS-epoll_pwait.os): New. (CFLAGS-mmap.os): Likewise. (CFLAGS-mmap64.os): Likewise. (CFLAGS-semtimedop.os): Likewise. (CFLAGS-semtimedop.c): Renamed to ... (CFLAGS-semtimedop.o): This.
* tst-backtrace4: fix a warning messageTulio Magno Quites Machado Filho2015-10-212-2/+7
| | | | | | | Modify a warning message so that it doesn't sound as an error, e.g.: "Obtained backtrace with 6 functions (but wanted at least 6)" Update a comment too.
* Use -Wold-style-definition.Joseph Myers2015-10-213-2/+6
| | | | | | | | | | | | | | | This patch makes glibc build with -Wold-style-definition to avoid old-style function definitions creeping back in by accident. Tested for x86_64 and x86 (testsuite, and that installed shared libraries are unchanged by the patch). Also tested build for arm, mips64 and powerpc32. Hopefully there aren't any remaining system-specific files with old-style definitions whose formatting evaded my searches, but if there are, they will be easy to fix. * Makeconfig (+gccwarn-c): Add -Wold-style-definition. * Makefile ($(objpfx)c++-types-check.out): Filter out $(+gccwarn-c) instead of -Wstrict-prototypes.
* Convert a few more function definitions to prototype style.Joseph Myers2015-10-218-59/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts a few more function definitions in glibc from old-style K&R to prototype style. This is sufficient to build and test on x86_64 and x86 with -Wold-style-definition (I'll test on some more architectures before proposing the actual addition of -Wold-style-definition). Tested for x86_64 and x86 with -Wold-style-definition in use (testsuite - this patch affects files containing assertions). * io/fts.c (fts_open): Convert to prototype-style function definition. * malloc/mcheck.c (mcheck): Likewise. (mcheck_pedantic): Likewise. * posix/regexec.c (re_search_2_stub): Likewise. Use internal_function. (re_search_internal): Likewise. * resolv/res_init.c [RESOLVSORT] (net_mask): Convert to prototype-style function definition. * sunrpc/clnt_udp.c (clntudp_call): Likewise. * sunrpc/pmap_rmt.c (clnt_broadcast): Likewise. * sunrpc/rpcsvc/rusers.x (xdr_utmp): Likewise. (xdr_utmpptr): Likewise. (xdr_utmparr): Likewise. (xdr_utmpidle): Likewise. (xdr_utmpidleptr): Likewise. (xdr_utmpidlearr): Likewise.
* Add more libm tests (fmod, fpclassify, frexp, hypot, ilogb, j0, j1, jn, log, ↵Joseph Myers2015-10-214-0/+3936
| | | | | | | | | | | | | | | | | | | log10, log2). This patch improves the libm test coverage for a few more functions. Tested for x86_64 and x86. 2015-10-21 Joseph Myers <joseph@codesourcery.com> * math/auto-libm-test-in: Add more tests of hypot, j0, j1, jn, log, log10 and log2. * math/auto-libm-test-out: Regenerated. * math/libm-test.inc (fmod_test_data): Add more tests. (fpclassify_test_data): Likewise. (frexp_test_data): Likewise. (hypot_test_data): Likewise. (ilogb_test_data): Likewise.
* Convert miscellaneous function definitions to prototype style.Joseph Myers2015-10-2050-355/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts various miscellaneous functions definitions in glibc, found with grep and not covered by my previous scripted conversions, from old-style K&R to prototype-style. These changes were made manually. This is not necessarily exhaustive as formatting variants may have prevented my grep from finding some such definitions. Regarding the changes to files from GMP, they may originally have been omitted when removing __STDC__ conditionals because of the files coming from another package, but (a) GMP no longer has __STDC__ conditionals there anyway and (b) we don't try to keep these files verbatim in sync with GMP (and there are licensing differences), so making the change to them in glibc seems reasonable. Tested for x86_64 and x86 (testsuite - this patch affects files containing assertions). * debug/fortify_fail.c (__fortify_fail): Convert to prototype-style function definition. Use internal_function. * libio/genops.c (save_for_backup): Convert to prototype-style function definition. * libio/wgenops.c (save_for_wbackup): Likewise. * login/grantpt.c (grantpt): Likewise. * login/ptsname.c (ptsname): Likewise. (__ptsname_r): Likewise. * login/unlockpt.c (unlockpt): Likewise. * mach/msgserver.c (__mach_msg_server): Likewise. * misc/efgcvt.c (__APPEND (FUNC_PREFIX, fcvt)): Likewise. (__APPEND (FUNC_PREFIX, ecvt)): Likewise. (__APPEND (FUNC_PREFIX, gcvt)): Likewise. * misc/efgcvt_r.c (__APPEND (FUNC_PREFIX, fcvt_r)): Likewise. (__APPEND (FUNC_PREFIX, ecvt_r)): Likewise. * nptl/cleanup_compat.c (_pthread_cleanup_push): Likewise. * nptl/cleanup_defer_compat.c (_pthread_cleanup_push_defer): Likewise. * nptl/libc_pthread_init.c (__libc_pthread_init): Likewise. Use internal_function. * nptl/pthread_atfork.c (__pthread_atfork): Convert to prototype-style function definition. * nptl/pthread_create.c (__pthread_create_2_1): Likewise. [SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)] (__pthread_create_2_0): Likewise. * nptl/pthread_key_create.c (__pthread_key_create): Likewise. * nptl/register-atfork.c (__register_atfork): Likewise. * posix/glob.c (glob): Likewise. * posix/regcomp.c (re_comp): Likewise. * posix/regexec.c (re_exec): Likewise. * stdlib/add_n.c [__STDC__]: Make code unconditional. [!__STDC__]: Remove conditional code. * stdlib/cmp.c [__STDC__]: Make code unconditional. [!__STDC__]: Remove conditional code. * stdlib/divmod_1.c [__STDC__]: Make code unconditional. [!__STDC__]: Remove conditional code. * stdlib/divrem.c [__STDC__]: Make code unconditional. [!__STDC__]: Remove conditional code. * stdlib/lshift.c [__STDC__]: Make code unconditional. [!__STDC__]: Remove conditional code. * stdlib/mod_1.c [__STDC__]: Make code unconditional. [!__STDC__]: Remove conditional code. * stdlib/mul.c [__STDC__]: Make code unconditional. [!__STDC__]: Remove conditional code. * stdlib/mul_n.c [__STDC__]: Make code unconditional. [!__STDC__]: Remove conditional code. * stdlib/rshift.c [__STDC__]: Make code unconditional. [!__STDC__]: Remove conditional code. * stdlib/strtod.c (INTERNAL (STRTOF)): Convert to prototype-style function definition. (STRTOF): Likewise. * stdlib/strtod_l.c (__STRTOF): Likewise. * stdlib/strtol.c (INTERNAL (strtol)): Likewise. * stdlib/strtol_l.c (INTERNAL (__strtol_l)): Likewise. (__strtol_l): Likewise. * stdlib/sub_n.c [__STDC__]: Make code unconditional. [!__STDC__]: Remove conditional code. * string/memrchr.c (MEMRCHR): Convert to prototype-style function definition. * string/strcasecmp.c (LOCALE_PARAM_DECL): Remove macro. [USE_IN_EXTENDED_LOCALE_MODEL] (LOCALE_PARAM): Include argument type. (__strcasecmp): Convert to prototype-style function definition. * string/strncase.c (LOCALE_PARAM_DECL): Remove macro. [USE_IN_EXTENDED_LOCALE_MODEL] (LOCALE_PARAM): Include argument type. (__strncasecmp): Convert to prototype-style function definition. * sunrpc/pm_getport.c (__libc_rpc_getport): Likewise. * sunrpc/xdr.c (xdr_union): Likewise. * sunrpc/xdr_array.c (xdr_array): Likewise. * sunrpc/xdr_ref.c (xdr_reference): Likewise. * sysdeps/m68k/m680x0/fpu/s_atan.c (__CONCATX(__,FUNC)): Likewise. * sysdeps/m68k/m680x0/fpu/s_isinf.c (__CONCATX(__,FUNC)): Likewise. * sysdeps/m68k/m680x0/fpu/s_scalbn.c (__CONCATX(__scalbn,suffix): Likewise. * sysdeps/m68k/m680x0/fpu/s_sincos.c (CONCATX(__,FUNC)): Likewise. * sysdeps/unix/sysv/linux/i386/scandir64.c (__old_scandir64): Likewise. * time/strftime_l.c (LOCALE_PARAM_DECL): Remove macro. (LOCALE_PARAM_PROTO): Likewise. [_LIBC && USE_IN_EXTENDED_LOCALE_MODEL] (LOCALE_PARAM): Include argument type. (ut_argument_spec): Remove macro. (ut_argument_spec_iso): Rename to ut_argument_spec. (memcpy_lowcase): Use LOCALE_PARAM in declaration. Convert to prototype-style function definition. (memcpy_uppcase): Likewise. (__strftime_internal): Likewise. (my_strftime): Likewise. * time/strptime_l.c (LOCALE_PARAM_PROTO): Remove macro. (LOCALE_PARAM_DECL): Likewise. [_LIBC] (LOCALE_PARAM): Include argument type. (__strptime_internal): Convert to prototype-style function definition. (strptime): Likewise. * wcsmbs/wcscasecmp.c (LOCALE_PARAM_DECL): Remove macro. [USE_IN_EXTENDED_LOCALE_MODEL] (LOCALE_PARAM): Include argument type. (__wcscasecmp): Convert to prototype-style function definition. * wcsmbs/wcsncase.c (LOCALE_PARAM_DECL): Remove macro. [USE_IN_EXTENDED_LOCALE_MODEL] (LOCALE_PARAM): Include argument type. (__wcsncasecmp): Convert to prototype-style function definition.
* Convert 113 more function definitions to prototype style (files with ↵Joseph Myers2015-10-2068-400/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assertions). This mostly automatically-generated patch converts 113 function definitions in glibc from old-style K&R to prototype-style. Following my other recent such patches, this one deals with the case of function definitions in files that either contain assertions or where grep suggested they might contain assertions - and thus where it isn't possible to use a simple object code comparison as a sanity check on the correctness of the patch, because line numbers are changed. A few such automatically-generated changes needed to be supplemented by manual changes for the result to compile. openat64 had a prototype declaration with "..." but an old-style definition in sysdeps/unix/sysv/linux/dl-openat64.c, and "..." needed adding to the generated prototype in the definition (I've filed <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68024> for diagnosing such cases in GCC; the old state was undefined behavior not requiring a diagnostic, but one seems a good idea). In addition, as Florian has noted regparm attribute mismatches between declaration and definition are only diagnosed for prototype definitions, and five functions needed internal_function added to their definitions (in the case of __pthread_mutex_cond_lock, via the macro definition of __pthread_mutex_lock) to compile on i386. After this patch is in, remaining old-style definitions are probably most readily fixed manually before we can turn on -Wold-style-definition for all builds. Tested for x86_64 and x86 (testsuite). * crypt/md5-crypt.c (__md5_crypt_r): Convert to prototype-style function definition. * crypt/sha256-crypt.c (__sha256_crypt_r): Likewise. * crypt/sha512-crypt.c (__sha512_crypt_r): Likewise. * debug/backtracesyms.c (__backtrace_symbols): Likewise. * elf/dl-minimal.c (_itoa): Likewise. * hurd/hurdmalloc.c (malloc): Likewise. (free): Likewise. (realloc): Likewise. * inet/inet6_option.c (inet6_option_space): Likewise. (inet6_option_init): Likewise. (inet6_option_append): Likewise. (inet6_option_alloc): Likewise. (inet6_option_next): Likewise. (inet6_option_find): Likewise. * io/ftw.c (FTW_NAME): Likewise. (NFTW_NAME): Likewise. (NFTW_NEW_NAME): Likewise. (NFTW_OLD_NAME): Likewise. * libio/iofwide.c (_IO_fwide): Likewise. * libio/strops.c (_IO_str_init_static_internal): Likewise. (_IO_str_init_static): Likewise. (_IO_str_init_readonly): Likewise. (_IO_str_overflow): Likewise. (_IO_str_underflow): Likewise. (_IO_str_count): Likewise. (_IO_str_seekoff): Likewise. (_IO_str_pbackfail): Likewise. (_IO_str_finish): Likewise. * libio/wstrops.c (_IO_wstr_init_static): Likewise. (_IO_wstr_overflow): Likewise. (_IO_wstr_underflow): Likewise. (_IO_wstr_count): Likewise. (_IO_wstr_seekoff): Likewise. (_IO_wstr_pbackfail): Likewise. (_IO_wstr_finish): Likewise. * locale/programs/localedef.c (normalize_codeset): Likewise. * locale/programs/locarchive.c (add_locale_to_archive): Likewise. (add_locales_to_archive): Likewise. (delete_locales_from_archive): Likewise. * malloc/malloc.c (__libc_mallinfo): Likewise. * math/gen-auto-libm-tests.c (init_fp_formats): Likewise. * misc/tsearch.c (__tfind): Likewise. * nptl/pthread_attr_destroy.c (__pthread_attr_destroy): Likewise. * nptl/pthread_attr_getdetachstate.c (__pthread_attr_getdetachstate): Likewise. * nptl/pthread_attr_getguardsize.c (pthread_attr_getguardsize): Likewise. * nptl/pthread_attr_getinheritsched.c (__pthread_attr_getinheritsched): Likewise. * nptl/pthread_attr_getschedparam.c (__pthread_attr_getschedparam): Likewise. * nptl/pthread_attr_getschedpolicy.c (__pthread_attr_getschedpolicy): Likewise. * nptl/pthread_attr_getscope.c (__pthread_attr_getscope): Likewise. * nptl/pthread_attr_getstack.c (__pthread_attr_getstack): Likewise. * nptl/pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Likewise. * nptl/pthread_attr_getstacksize.c (__pthread_attr_getstacksize): Likewise. * nptl/pthread_attr_init.c (__pthread_attr_init_2_1): Likewise. (__pthread_attr_init_2_0): Likewise. * nptl/pthread_attr_setdetachstate.c (__pthread_attr_setdetachstate): Likewise. * nptl/pthread_attr_setguardsize.c (pthread_attr_setguardsize): Likewise. * nptl/pthread_attr_setinheritsched.c (__pthread_attr_setinheritsched): Likewise. * nptl/pthread_attr_setschedparam.c (__pthread_attr_setschedparam): Likewise. * nptl/pthread_attr_setschedpolicy.c (__pthread_attr_setschedpolicy): Likewise. * nptl/pthread_attr_setscope.c (__pthread_attr_setscope): Likewise. * nptl/pthread_attr_setstack.c (__pthread_attr_setstack): Likewise. * nptl/pthread_attr_setstackaddr.c (__pthread_attr_setstackaddr): Likewise. * nptl/pthread_attr_setstacksize.c (__pthread_attr_setstacksize): Likewise. * nptl/pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise. * nptl/pthread_create.c (__find_in_stack_list): Likewise. * nptl/pthread_getattr_np.c (pthread_getattr_np): Likewise. * nptl/pthread_mutex_cond_lock.c (__pthread_mutex_lock): Define to use internal_function. * nptl/pthread_mutex_init.c (__pthread_mutex_init): Convert to prototype-style function definition. * nptl/pthread_mutex_lock.c (__pthread_mutex_lock): Likewise. (__pthread_mutex_cond_lock_adjust): Likewise. Use internal_function. * nptl/pthread_mutex_timedlock.c (pthread_mutex_timedlock): Convert to prototype-style function definition. * nptl/pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise. * nptl/pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise. (__pthread_mutex_unlock): Likewise. * nptl_db/td_ta_clear_event.c (td_ta_clear_event): Likewise. * nptl_db/td_ta_set_event.c (td_ta_set_event): Likewise. * nptl_db/td_thr_clear_event.c (td_thr_clear_event): Likewise. * nptl_db/td_thr_event_enable.c (td_thr_event_enable): Likewise. * nptl_db/td_thr_set_event.c (td_thr_set_event): Likewise. * nss/makedb.c (process_input): Likewise. * posix/fnmatch.c (__strchrnul): Likewise. (__wcschrnul): Likewise. (fnmatch): Likewise. * posix/fnmatch_loop.c (FCT): Likewise. * posix/glob.c (globfree): Likewise. (__glob_pattern_type): Likewise. (__glob_pattern_p): Likewise. * posix/regcomp.c (re_compile_pattern): Likewise. (re_set_syntax): Likewise. (re_compile_fastmap): Likewise. (regcomp): Likewise. (regerror): Likewise. (regfree): Likewise. * posix/regexec.c (regexec): Likewise. (re_match): Likewise. (re_search): Likewise. (re_match_2): Likewise. (re_search_2): Likewise. (re_search_stub): Likewise. Use internal_function (re_copy_regs): Likewise. (re_set_registers): Convert to prototype-style function definition. (prune_impossible_nodes): Likewise. Use internal_function. * resolv/inet_net_pton.c (inet_net_pton): Convert to prototype-style function definition. (inet_net_pton_ipv4): Likewise. * stdlib/strtod_l.c (____STRTOF_INTERNAL): Likewise. * sysdeps/pthread/aio_cancel.c (aio_cancel): Likewise. * sysdeps/pthread/aio_suspend.c (aio_suspend): Likewise. * sysdeps/pthread/timer_delete.c (timer_delete): Likewise. * sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise. Make variadic. * time/strptime_l.c (localtime_r): Convert to prototype-style function definition. * wcsmbs/mbsnrtowcs.c (__mbsnrtowcs): Likewise. * wcsmbs/mbsrtowcs_l.c (__mbsrtowcs_l): Likewise. * wcsmbs/wcsnrtombs.c (__wcsnrtombs): Likewise. * wcsmbs/wcsrtombs.c (__wcsrtombs): Likewise.
* Convert 29 more function definitions to prototype style (multiple parameters ↵Joseph Myers2015-10-2018-105/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in one K&R parameter declaration). This automatically-generated patch converts 29 function definitions in glibc (including one in an example in the manual) from old-style K&R to prototype-style. Following my other recent such patches, this one deals with the case of function definitions where one K&R parameter declaration declares multiple parameters, as in: void foo (a, b) int a, *b; { } Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * crypt/crypt.c (_ufc_doit_r): Convert to prototype-style function definition. (_ufc_doit_r): Likewise. * crypt/crypt_util.c (_ufc_copymem): Likewise. (_ufc_output_conversion_r): Likewise. * inet/inet_mkadr.c (__inet_makeaddr): Likewise. * inet/rcmd.c (rcmd_af): Likewise. (rcmd): Likewise. (ruserok_af): Likewise. (ruserok): Likewise. (ruserok2_sa): Likewise. (ruserok_sa): Likewise. (iruserok_af): Likewise. (iruserok): Likewise. (__ivaliduser): Likewise. (__validuser2_sa): Likewise. * inet/rexec.c (rexec_af): Likewise. (rexec): Likewise. * inet/ruserpass.c (ruserpass): Likewise. * locale/programs/xmalloc.c (xcalloc): Likewise. * manual/examples/timeval_subtract.c (timeval_subtract): Likewise. * math/w_drem.c (__drem): Likewise. * math/w_dremf.c (__dremf): Likewise. * math/w_dreml.c (__dreml): Likewise. * misc/daemon.c (daemon): Likewise. * resolv/res_debug.c (p_fqnname): Likewise. * stdlib/div.c (div): Likewise. * string/memcmp.c (memcmp_bytes): Likewise. * sunrpc/pmap_rmt.c (pmap_rmtcall): Likewise. * sunrpc/svc_udp.c (svcudp_bufcreate): Likewise.
* Convert 24 more function definitions to prototype style (array parameters).Joseph Myers2015-10-2025-77/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This automatically-generated patch converts 24 function definitions in glibc from old-style K&R to prototype-style. Following my other recent such patches, this one deals with the case of functions with array parameters. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * crypt/cert.c (main): Convert to prototype-style function definition. * io/pipe.c (__pipe): Likewise. * io/pipe2.c (__pipe2): Likewise. * misc/futimesat.c (futimesat): Likewise. * misc/utimes.c (__utimes): Likewise. * posix/execve.c (__execve): Likewise. * posix/execvp.c (execvp): Likewise. * posix/execvpe.c (__execvpe): Likewise. * posix/fexecve.c (fexecve): Likewise. * socket/socketpair.c (socketpair): Likewise. * stdlib/drand48-iter.c (__drand48_iterate): Likewise. * stdlib/erand48.c (erand48): Likewise. * stdlib/erand48_r.c (__erand48_r): Likewise. * stdlib/jrand48.c (jrand48): Likewise. * stdlib/jrand48_r.c (__jrand48_r): Likewise. * stdlib/lcong48.c (lcong48): Likewise. * stdlib/lcong48_r.c (__lcong48_r): Likewise. * stdlib/nrand48.c (nrand48): Likewise. * stdlib/nrand48_r.c (__nrand48_r): Likewise. * stdlib/seed48.c (seed48): Likewise. * stdlib/seed48_r.c (__seed48_r): Likewise. * sysdeps/mach/hurd/execve.c (__execve): Likewise. * sysdeps/mach/hurd/utimes.c (__utimes): Likewise. * sysdeps/unix/sysv/linux/fexecve.c (fexecve): Likewise.
* Remove gnu_unique_object configure test.Joseph Myers2015-10-1910-58/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a configure test for assembler support for the gnu_unique_object symbol type. This support was added in binutils 2.20, so is present in all versions supported for building glibc. Thus, I think the configure test can be removed; this patch does so. Now, there is a caveat that the gas NEWS entry refers to this as a feature for GNU/Linux targets. But the condition is use of ELFOSABI_GNU or ELFOSABI_NONE. ELFOSABI_GNU covers Hurd as well as GNU/Linux (as was the case with the older ELFOSABI_LINUX name), and ELFOSABI_NONE means this is effectively OS-independent. Furthermore, I think a correct binutils port for any glibc target ought to support this feature for use with glibc; glibc supports this as an OS-independent feature (the configure test is only about glibc testcases). Tested for x86_64 (testsuite, and that installed shared libraries are unchanged by the patch). * configure.ac (libc_cv_asm_unique_object): Remove configure test. * configure: Regenerated. * config.h.in (HAVE_ASM_UNIQUE_OBJECT): Remove #undef. * elf/tst-unique1.c (do_test) [HAVE_ASM_UNIQUE_OBJECT]: Make code unconditional. * elf/tst-unique1mod1.c [HAVE_ASM_UNIQUE_OBJECT]: Likewise. * elf/tst-unique1mod2.c [HAVE_ASM_UNIQUE_OBJECT]: Likewise. * elf/tst-unique2.c (do_test) [HAVE_ASM_UNIQUE_OBJECT]: Likewise. (do_test) [!HAVE_ASM_UNIQUE_OBJECT]: Remove conditional code. * elf/tst-unique2mod1.c [HAVE_ASM_UNIQUE_OBJECT]: Make code unconditional. * elf/tst-unique2mod2.c [HAVE_ASM_UNIQUE_OBJECT]: Likewise.
* Do not use -Wno-strict-prototypes.Joseph Myers2015-10-193-2/+4
| | | | | | | | | | | | Two glibc makefiles use -Wno-strict-prototypes. I don't know if this was needed before my recent conversion of many function definitions to prototype style, but it's not needed now; this patch removes it. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * posix/Makefile (CFLAGS-regex.c): Remove variable. * resolv/Makefile (+cflags): Do not use -Wno-strict-prototypes.
* Convert 69 more function definitions to prototype style (line wrap cases).Joseph Myers2015-10-1963-354/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This automatically-generated patch converts 69 function definitions in glibc from old-style K&R to prototype-style. This patch, covering both sysdeps and non-sysdeps files, deals with cases where the prototype needed to be wrapped over more than one line. Otherwise, exclusions and caveats are as for <https://sourceware.org/ml/libc-alpha/2015-10/msg00594.html> and <https://sourceware.org/ml/libc-alpha/2015-10/msg00599.html>. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * crypt/crypt-entry.c (__crypt_r): Convert to prototype-style function definition. * crypt/crypt_util.c (__encrypt_r): Likewise. * libio/genops.c (_IO_no_init): Likewise. * libio/iofopncook.c (_IO_fopencookie): Likewise. (_IO_old_fopencookie): Likewise. * libio/iofwrite_u.c (fwrite_unlocked): Likewise. * libio/iogetline.c (_IO_getline): Likewise. (_IO_getline_info): Likewise. * libio/iogetwline.c (_IO_getwline): Likewise. (_IO_getwline_info): Likewise. * libio/vsnprintf.c (_IO_vsnprintf): Likewise. * libio/vswprintf.c (_IO_vswprintf): Likewise. * locale/programs/simple-hash.c (insert_entry_2): Likewise. (find_entry): Likewise. (iterate_table): Likewise. (lookup): Likewise. * login/forkpty.c (forkpty): Likewise. * misc/hsearch_r.c (__hsearch_r): Likewise. * misc/select.c (__select): Likewise. * nptl/cleanup_defer_compat.c (_pthread_cleanup_pop_restore): Likewise. * nptl/old_pthread_cond_init.c (__pthread_cond_init_2_0): Likewise. * nptl/old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0): Likewise. * nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise. * nptl/pthread_barrierattr_getpshared.c (pthread_barrierattr_getpshared): Likewise. * nptl/pthread_getschedparam.c (__pthread_getschedparam): Likewise. * nptl/pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Likewise. * nptl/pthread_mutexattr_getprioceiling.c (pthread_mutexattr_getprioceiling): Likewise. * nptl/pthread_rwlock_init.c (__pthread_rwlock_init): Likewise. * nptl/pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock): Likewise. * nptl/pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock): Likewise. * nptl/pthread_setschedparam.c (__pthread_setschedparam): Likewise. * socket/recvfrom.c (__recvfrom): Likewise. * socket/sendto.c (__sendto): Likewise. * socket/setsockopt.c (__setsockopt): Likewise. * stdio-common/_itoa.c (_itoa): Likewise. * stdio-common/_itowa.c (_itowa): Likewise. * stdio-common/reg-printf.c (__register_printf_specifier): Likewise. (__register_printf_function): Likewise. * stdio-common/tempname.c (__path_search): Likewise. * stdlib/addmul_1.c (mpn_addmul_1): Likewise. * stdlib/mul_1.c (mpn_mul_1): Likewise. * stdlib/random_r.c (__initstate_r): Likewise. * stdlib/setenv.c (__add_to_environ): Likewise. * stdlib/submul_1.c (mpn_submul_1): Likewise. * streams/getpmsg.c (getpmsg): Likewise. * streams/putmsg.c (putmsg): Likewise. * streams/putpmsg.c (putpmsg): Likewise. * sunrpc/clnt_raw.c (clntraw_call): Likewise. * sunrpc/clnt_tcp.c (clnttcp_call): Likewise. * sunrpc/clnt_udp.c (clntudp_create): Likewise. * sunrpc/clnt_unix.c (clntunix_call): Likewise. * sunrpc/pm_getport.c (pmap_getport): Likewise. * sunrpc/svc_udp.c (cache_get): Likewise. * sunrpc/xdr_array.c (xdr_vector): Likewise. * sysdeps/mach/hurd/getcwd.c (__canonicalize_directory_name_internal): Likewise. * sysdeps/mach/hurd/pselect.c (__pselect): Likewise. * sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise. * sysdeps/mach/hurd/select.c (__select): Likewise. * sysdeps/posix/ttyname_r.c (getttyname_r): Likewise. * sysdeps/pthread/timer_settime.c (timer_settime): Likewise. * sysdeps/sparc/nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise. * sysdeps/unix/sysv/linux/i386/putmsg.c (putmsg): Likewise. * sysdeps/unix/sysv/linux/s390/semtimedop.c (semtimedop): Likewise. * sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Likewise. * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Likewise. * sysvipc/semtimedop.c (semtimedop): Likewise. * time/setitimer.c (__setitimer): Likewise. * time/strftime_l.c (emacs_strftime): Likewise.
* use -fstack-protector-strong when availableMike Frysinger2015-10-197-12/+58
| | | | | | | | | | | | | | | With gcc-4.9, a new -fstack-protector-strong flag is available that is between -fstack-protector (pretty weak) and -fstack-protector-all (pretty strong) that provides good trade-offs between overhead but still providing good coverage. Update the places in glibc that use ssp to use this flag when it's available. This also kills off the indirection of hardcoding the flag name in the Makefiles and adding it based on a have-ssp boolean. Instead, the build always expands the $(stack-protector) variable to the best ssp setting. This makes the build logic a bit simpler and allows people to easily set to a diff flag like: make stack-protector=-fstack-protector-all
* Mark ld.so internel __fxstatat64 hiddenH.J. Lu2015-10-192-0/+9
| | | | | | | | | Since ld.so internel __fxstatat64 is only used internally in ld.so, it can be made hidden. [BZ #19122] * include/sys/stat.h [IS_IN (rtld)] (__fxstatat64): Add attribute_hidden.
* PowerPC: Fix a race condition when eliding a lockTulio Magno Quites Machado Filho2015-10-193-59/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous code used to evaluate the preprocessor token is_lock_free to a variable before starting a transaction. This behavior can cause an error if another thread got the lock (without using a transaction) between the evaluation of the token and the beginning of the transaction. This bug can be triggered with the following order of events: 1. The lock accessed by is_lock_free is free. 2. Thread T1 evaluates is_lock_free and stores into register R1 that the lock is free. 3. Thread T2 acquires the same lock used in is_lock_free. 4. T1 begins the transaction, creating a memory barrier where is_lock_free is false, but R1 is true. 5. T1 reads R1 and doesn't abort the transaction. 6. T1 calls ELIDE_UNLOCK, which reads false from is_lock_free and decides to unlock a lock acquired by T2, leading to undefined behavior. This patch delays the evaluation of is_lock_free to inside a transaction by moving this part of the code to the macro ELIDE_LOCK. [BZ #18743] * sysdeps/powerpc/nptl/elide.h (__elide_lock): Move most of this code to... (ELIDE_LOCK): ...here. (__get_new_count): New function with part of the code from __elide_lock that updates the value of adapt_count after a transaction abort. (__elided_trylock): Moved this code to... (ELIDE_TRYLOCK): ...here.
* timezone: polish grammar a bit in documentationMike Frysinger2015-10-195-8/+15
| | | | Reported-by: ricaljasan@pacific.net
* timezone: document new --disable-timezone-tools optionMike Frysinger2015-10-191-0/+5
| | | | Reported-by: Joseph Myers <joseph@codesourcery.com>
* pt_chown: Clear any signal mask inherited from the parent process.Geoffrey Thomas2015-10-192-0/+11
| | | | | | | | | | | | | | If grantpt() is called from a thread that is masking signals (for instance, from a program using signalfd or using a dedicated signal-handling thread), then that mask will get inherited to pt_chown. This means that signals like SIGINT will not interrup pt_chown, so if it hangs (e.g., because getgrnam("tty") hangs on a remote name service), Ctrl-C will terminate the parent process but leave pt_chown around. Since it's setuid, it's hard to kill any other way. It is safe for pt_chown to unmask all signals, because grantpt() can be (and usually is) called from an unprivileged process with all signals unmasked.
* Remove -fgnu89-inline configure test.Joseph Myers2015-10-195-63/+7
| | | | | | | | | | | | | | There is a configure test for -fgnu89-inline. This option was added in GCC 4.2, so the test is obsolete; this patch removes it. Tested for x86_64 (testsuite, and that installed shared libraries are unchanged by the patch). * configure.ac (libc_cv_gnu89_inline): Remove configure test. * configure: Regenerated. * config.make.in (gnu89-inline-CFLAGS): Remove variable. * Makeconfig (CFLAGS): Use -fgnu89-inline instead of $(gnu89-inline-CFLAGS).
* Remove .weak, .weakext configure tests.Joseph Myers2015-10-195-136/+15
| | | | | | | | | | | | | | | | | | | | | | | | | There are configure tests for assembler .weak support, and, as a fallback, for .weakext support. .weakext appears to be an ECOFF thing (although a few ELF targets support it as well). .weak has been supported by the GNU assembler for ELF targets since version 2.2, so given the requirement for ELF the configure tests are obsolete; this patch removes them. Tested for x86_64 (testsuite, and that installed shared libraries are unchanged by the patch). * configure.ac (libc_cv_asm_weak_directive): Remove configure test. (libc_cv_asm_weakext_directive): Likewise. * configure: Regenerated. * config.h.in (HAVE_ASM_WEAK_DIRECTIVE): Remove #undef. (HAVE_ASM_WEAKEXT_DIRECTIVE): Likewise. * include/libc-symbols.h [!HAVE_ASM_WEAK_DIRECTIVE && !HAVE_ASM_WEAKEXT_DIRECTIVE]: Remove #error. [HAVE_ASM_WEAKEXT_DIRECTIVE]: Remove conditional code. [!HAVE_ASM_WEAKEXT_DIRECTIVE]: Make code unconditional.