summaryrefslogtreecommitdiff
path: root/NEWS
AgeCommit message (Collapse)Author
2014-12-11Properly handle forced elision in pthread_mutex_trylock (bug 16657)Andreas Schwab
2014-12-11intl: Merge with gettext version 0.19.3Will Newton
This patch merges the latest release of gettext into the intl subdirectory. The initial motivation was to include the plural.y changes which enable building with bison 3.0, but the majority of the other changes are merely cosmetic so it seemed like merging the whole directory was simpler than trying to take it piecemeal. The merge was done by copying across the latext gettext code and adding in a few small glibc changes that have been added over the years that seemed beneficial, as well as a couple of small build fixes that should be merged back to gettext. I also reverted the gettext commit: commit 279b57fc367251666f00e8e2b599b83703451afb Author: Bruno Haible <bruno@clisp.org> Date: Fri Jun 14 12:03:49 2002 +0000 Make absolute pathnames inside $LANGUAGE work. As it caused localedata/tst-setlocale3 to fail and it wasn't clear that glibc wanted that behaviour. The merge has dropped many uses of __glibc_likely/unlikely. This is intentional given that it eases merging. It seems to me that the cost of continually rewriting these lines when merging and the risk of adding bugs when doing so outweighs the benefits of using these macros when code is shared with another project. Tested with make check on x86_64. ChangeLog: 2014-12-11 Will Newton <will.newton@linaro.org> Merge gettext 0.19.3 into intl/. This involves a number of cosmetic changes to comments and ANSI function definitions and prototypes throughout all the files. The gettext copyright header is used but with the date ranges taken from the glibc copy. * NEWS: Add gettext merge to 2.21. * intl/bindtextdom.c: Switch to gettext copyright. Use ANSI definitions and prototypes. Use gl_* locking primitives rather than __libc_* ones. Use __builtin_expect rather than __glibc_likely/unlikely. * intl/dcgettext.c: Switch to gettext copyright. Use ANSI definitions and prototypes. * intl/dcigettext.c: Switch to gettext copyright. Use ANSI definitions and prototypes. (INTDIV0_RAISES_SIGFPE): New define. Use gl_* locking primitives rather than __libc_* ones. Include eval-plural.h instead of plural-eval.c. Use __builtin_expect rather than __glibc_likely/unlikely. * intl/dcngettext.c: Switch to gettext copyright. Use ANSI definitions and prototypes. * intl/dgettext.c: Likewise. * intl/dngettext.c: Likewise. * intl/plural-eval.c: Renamed to... * intl/eval-plural.h: ...this. * intl/explodename.c: Switch to gettext copyright. Use ANSI definitions and prototypes. (_nl_explode_name): Use strchr instead of __rawmemchr. * intl/finddomain.c: Switch to gettext copyright. Use ANSI definitions and prototypes. Use gl_* locking primitives rather than __libc_* ones. (_nl_find_domain): Use malloc rather than alloca for allocation of temporary locale name. * intl/gettext.c: Switch to gettext copyright. Use ANSI definitions and prototypes. * intl/gettextP.h: Switch to gettext copyright. Use ANSI definitions and prototypes. Use gl_* locking primitives rather than __libc_* ones. * intl/gmo.h: Switch to gettext copyright. (struct sysdep_string): Move struct segment_pair outside of struct definition. * intl/hash-string.c: Use ANSI definitions and prototypes. * intl/hash-string.h: Switch to gettext copyright. Use ANSI definitions and prototypes. * intl/l10nflist.c: Switch to gettext copyright. Use ANSI definitions and prototypes. (_nl_normalize_codeset): Avoid integer overflow. * intl/loadinfo.h: Switch to gettext copyright. Use ANSI definitions and prototypes. (LIBINTL_DLL_EXPORTED): New define. (PATH_SEPARATOR): New define. * intl/loadmsgcat.c: Switch to gettext copyright. * intl/localealias.c: Switch to gettext copyright. Use ANSI definitions and prototypes. (_nl_expand_alias): Use PATH_SEPARATOR. * intl/ngettext.c: Switch to gettext copyright. Use ANSI definitions and prototypes. * intl/plural-exp.c: Likewise. * intl/plural-exp.h: Switch to gettext copyright. Use ANSI definitions and prototypes. (struct expression): Move definition of enum operator outside of struct definition. * intl/plural.c: Regenerate. * intl/plural.y: Switch to gettext copyright. Use ANSI definitions and prototypes. Port to bison 3.0. * intl/textdomain.c: Switch to gettext copyright. Use ANSI definitions and prototypes. Use gl_* locking primitives rather than __libc_* ones.
2014-12-10Fix strftime wcschr namespace (bug 17634).Joseph Myers
Use of strftime, a C90 function, ends up bringing in wcschr, which is not a C90 function. Although not a conformance bug (C90 reserves wcs*), this is still contrary to glibc practice of avoiding relying on those reservations; this patch arranges for the internal uses to use __wcschr instead, with wcschr being a weak alias. This is more complicated than some such patches because of the various IFUNC definitions of wcschr (which include code redefining libc_hidden_def in a way that involves creating __GI_wcschr manually and so also needs to create __GI___wcschr after the change of internal uses to use __wcschr). Tested for x86_64 and 32-bit x86 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). 2014-12-10 Joseph Myers <joseph@codesourcery.com> Adhemerval Zanella <azanella@linux.vnet.ibm.com> [BZ #17634] * wcsmbs/wcschr.c [!WCSCHR] (wcschr): Define as __wcschr. Undefine after defining function. Define as weak alias of __wcschr. Use libc_hidden_weak. * include/wchar.h (__wcschr): Declare. Use libc_hidden_proto. * sysdeps/i386/i686/multiarch/wcschr-c.c [IS_IN (libc) && SHARED] (libc_hidden_def): Also define __GI___wcschr alias. * sysdeps/i386/i686/multiarch/wcschr.S (wcschr): Rename to __wcschr and define as weak alias of __wcschr. * sysdeps/powerpc/power6/wcschr.c [!WCSCHR] (WCSCHR): Define as __wcschr. [!WCSCHR] (DEFAULT_WCSCHR): Define. [DEFAULT_WCSCHR] (__wcschr): Use libc_hidden_def. [DEFAULT_WCSCHR] (wcschr): Define as weak alias of __wcschr. Use libc_hidden_weak. Do not use libc_hidden_def. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c [IS_IN (libc) && SHARED] (libc_hidden_def): Also define __GI___wcschr alias. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c [IS_IN (libc)] (wcschr): Define as macro expanding to __redirect_wcschr. [IS_IN (libc)] (__wcschr_ppc): Use __redirect_wcschr in typeof. [IS_IN (libc)] (__wcschr_power6): Likewise. [IS_IN (libc)] (__wcschr_power7): Likewise. [IS_IN (libc)] (__libc_wcschr): New. Define with libc_ifunc instead of wcschr. [IS_IN (libc)] (wcschr): Undefine and define as weak alias of __libc_wcschr. [!IS_IN (libc)] (libc_hidden_def): Do not undefine and redefine. * sysdeps/powerpc/powerpc64/multiarch/wcschr.c (wcschr): Rename to __wcschr and define as weak alias of __wcschr. Use libc_hidden_builtin_def. * sysdeps/x86_64/wcschr.S (wcschr): Rename to __wcschr and define as weak alias of __wcschr. Use libc_hidden_weak. * time/alt_digit.c (_nl_get_walt_digit): Use __wcschr instead of wcschr. * time/era.c (_nl_init_era_entries): Likewise. * conform/Makefile (test-xfail-ISO/time.h/linknamespace): Remove variable. (test-xfail-XPG3/time.h/linknamespace): Likewise. (test-xfail-XPG4/time.h/linknamespace): Likewise.
2014-12-10manual: Remove incorrect claim that qsort() can be stabilizedAnders Kaseorg
Under certain conditions on the size of the array and its items, qsort() may fall back to an in-place quicksort if it cannot allocate memory for a temporary array with malloc(). This algorithm is not a stable sort even if the comparison function is written in the described manner. Fixes #10672. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2014-12-10Update NEWSAndreas Schwab
2014-12-10Use -Werror by default, add --disable-werror.Joseph Myers
As discussed starting at <https://sourceware.org/ml/libc-alpha/2014-11/msg00323.html>, this patch makes the glibc build use -Werror by default to avoid accidentally adding new warnings to the build. The configure option --disable-werror can be used to disable this. -Wno-error=undef is temporarily used because the build isn't clean regarding -Wundef warnings. The idea is that once the remaining -Wundef warnings have been cleaned up (in at least one configuration), -Wno-error=undef will be removed. I get a clean build and test on x86_64 (GCC 4.9 branch) with this patch. The expectation is that this may well break the build for some other configurations, and people seeing such breakage should make appropriate fixes to fix or suppress the warnings for their configurations. In some cases that may involve using pragmas as the right fix (I think that will be right for the -Wno-inline issue for MIPS I referred to in <https://sourceware.org/ml/libc-alpha/2012-11/msg00798.html>, for example), in some cases -Wno-error in sysdeps makefiles (__restore_rt in MIPS sigaction, for example), in some cases substantive fixes for the warnings. Note that if, with a view to listing all the warnings then fixing them all, you just look for "warning:" in output from building and testing with --disable-werror, you'll see lots of warnings from the linker about functions such as tmpnam. Those warnings can be ignored - only compiler warnings are relevant to -Werror, not linker warnings. * configure.ac (--disable-werror): New configure option. (enable_werror): New AC_SUBST. * configure: Regenerated. * config.make.in (enable-werror): New variable. * Makeconfig [$(enable-werror) = yes] (+gccwarn): Add -Werror -Wno-error=undef. (+gccwarn-c): Do not use -Werror=implicit-function-declaration. * manual/install.texi (Configuring and compiling): Document --disable-werror. * INSTALL: Regenerated. * debug/Makefile (CFLAGS-tst-chk1.c): Add -Wno-error. (CFLAGS-tst-chk2.c): Likewise. (CFLAGS-tst-chk3.c): Likewise. (CFLAGS-tst-chk4.cc): Likewise. (CFLAGS-tst-chk5.cc): Likewise. (CFLAGS-tst-chk6.cc): Likewise. (CFLAGS-tst-lfschk1.c): Likewise. (CFLAGS-tst-lfschk2.c): Likewise. (CFLAGS-tst-lfschk3.c): Likewise. (CFLAGS-tst-lfschk4.cc): Likewise. (CFLAGS-tst-lfschk5.cc): Likewise. (CFLAGS-tst-lfschk6.cc): Likewise.
2014-12-06Fix pthreads getrlimit, gettimeofday namespace (bug 17682).Joseph Myers
Some pthreads functions use getrlimit and gettimeofday, but these functions are XSI, not base POSIX; this is a namespace issue for dynamic linking as well as static linking. This patch makes them use __getrlimit and __gettimeofday instead - the former needed to be newly exported from libc.so at GLIBC_PRIVATE (and so now needs libc_hidden_proto / libc_hidden_def), the latter was already exported. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #17682] * resource/Versions (libc): Add __getrlimit at GLIBC_PRIVATE. * resource/getrlimit.c (__getrlimit): Use libc_hidden_def. * sysdeps/mach/hurd/getrlimit.c (__getrlimit): Likewise. * include/sys/resource.h (__getrlimit): Use libc_hidden_proto. * nptl/nptl-init.c (__pthread_initialize_minimal_internal): Use __getrlimit instead of getrlimit. * nptl/pthread_cond_timedwait.c (__pthread_cond_timedwait): Use __gettimeofday instead of gettimeofday. * nptl/pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock): Likewise. * nptl/pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock): Likewise. * sysdeps/pthread/aio_misc.c (handle_fildes_io): Likewise. * conform/Makefile (test-xfail-POSIX2008/aio.h/linknamespace): Remove variable. (test-xfail-POSIX2008/pthread.h/linknamespace): Likewise. (test-xfail-POSIX2008/time.h/linknamespace): Likewise.
2014-12-04Reset cached offset when reading to end of stream (BZ #17653)Siddhesh Poyarekar
POSIX allows applications to switch file handles when a read results in an end of file. Unset the cached offset at this point so that it is queried again.
2014-12-04ftell: seek to end only when there are unflushed bytes (BZ #17647)Siddhesh Poyarekar
Currently we seek to end of file if there are unflushed writes or the stream is in write mode, to get the current offset for writing in append mode, which is the end of file. The latter case (i.e. stream is in write mode, but no unflushed writes) is unnecessary since it will only happen when the stream has just been flushed, in which case the recorded offset ought to be reliable. Removing that case lets ftell give the correct offset when it follows an ftruncate. The latter truncates the file, but does not change the file position, due to which it is permissible to call ftell without an intervening fseek call. Tested on x86_64 to verify that the added test case fails without the patch and succeeds with it, and that there are no additional regressions due to it. [BZ #17647] * libio/fileops.c (do_ftell): Seek only when there are unflushed writes. * libio/wfileops.c (do_ftell_wide): Likewise. * libio/tst-ftell-active-handler.c (do_ftruncate_test): New test case. (do_one_test): Call it.
2014-12-02Fix getifaddrs, freeifaddrs namespace (bug 17668).Joseph Myers
Various objects in glibc bring in ifaddrs.o (via references to __netlink_*) and thereby getifaddrs and freeifaddrs, which are not part of any standard supported by glibc. These should be weak aliases of __getifaddrs and __freeifaddrs; this patch makes them so. (The path by which these functions are brought in is Linux-specific, but it seems less confusing to make all versions of these functions weak aliases rather than only the Linux-specific versions that definitely need it.) Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by this patch). [BZ #17668] * inet/ifaddrs.c (getifaddrs): Rename to __getifaddrs and define as weak alias of __getifaddrs. Use libc_hidden_weak. (freeifaddrs): Rename to __freeifaddrs and define as weak alias of __freeifaddrs. Use libc_hidden_weak. * sysdeps/gnu/ifaddrs.c (getifaddrs): Rename to __getifaddrs and define as weak alias of __getifaddrs. Use libc_hidden_weak. (freeifaddrs): Rename to __freeifaddrs and define as weak alias of __freeifaddrs. Use libc_hidden_weak. * sysdeps/unix/sysv/linux/ifaddrs.c (getifaddrs): Rename to __getifaddrs and define as weak alias of __getifaddrs. Use libc_hidden_weak. (freeifaddrs): Rename to __freeifaddrs and define as weak alias of __freeifaddrs. Use libc_hidden_weak. * conform/Makefile (test-xfail-XOPEN2K/net/if.h/linknamespace): Remove variable. (test-xfail-POSIX2008/net/if.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/net/if.h/linknamespace): Likewise.
2014-12-02mips: Do not use jal to reach __libc_start_mainPetar Jovanovic
Since __libc_start_main may not be in the same 256MB-aligned region as the function __start, replace use of jal instruction with la/jalr. This fixes linker issue reported in: https://sourceware.org/bugzilla/show_bug.cgi?id=17601 [BZ #17601] * sysdeps/mips/start.S (__start): Use indirect jump to call __libc_start_main.
2014-12-02Remove excess declarations from unistd.h for XPG3/XPG4 (bug 17665).Joseph Myers
For XPG3/XPG4 (defined __USE_XOPEN && !defined __USE_UNIX98), unistd.h declares many functions that should only be declared for __USE_MISC (none of them are in XPG3/XPG4): sethostname sethostid getdomainname setdomainname vhangup revoke profil acct getusershell endusershell setusershell daemon. The whole block with the [__USE_MISC || (__USE_XOPEN && !__USE_UNIX98)] conditional contains only functions that are not in XPG3/XPG4, so this patch simply changes the conditional. Tested for x86_64 (testsuite, and that installed stripped shared libraries are unchanged by this patch). [BZ #17665] * posix/unistd.h [__USE_MISC || (__USE_XOPEN && !__USE_UNIX98)]: Change conditional to [__USE_MISC].
2014-12-02Fix fgets_unlocked namespace issues (bug 17664).Joseph Myers
Various POSIX functions bring in res_init.o, res_hconf.o or mntent_r.o, which use fgets_unlocked, which is not a POSIX function. This patch arranges for them to use __fgets_unlocked instead. (The IS_IN (libc) conditional in rec_hconf.c is needed because that file is also used in nscd.) Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch except for an assertion line number). Note that most of the linknamespace tests that failed because of fgets_unlocked from the resolver also fail because of other symbols brought in by the resolver, so the number of XFAILs this removes is limited. Also note that fgets_unlocked failures for unistd.h for XPG3/XPG4 showed up that actually unistd.h is declaring too much for XPG3/XPG4 (bug 17665) - there is no actual need to make getusershell.c use __fgets_unlocked (at least as regards formal standards are concerned; maybe it should still change for namespace-cleanness of _DEFAULT_SOURCE) because the functions there aren't actually in any of the supported standards; the correct fix for those failures will be to stop the *usershell* functions appearing in unistd.h for XPG3/XPG4. [BZ #17664] * misc/mntent_r.c (__getmntent_r): Use __fgets_unlocked instead of fgets_unlocked. * resolv/res_hconf.c [IS_IN (libc)] (fgets_unlocked): Define to __fgets_unlocked. * resolv/res_init.c (__res_vinit): Use __fgets_unlocked instead of fgets_unlocked. * conform/Makefile (test-xfail-XPG4/sys/statvfs.h/linknamespace): Remove variable. (test-xfail-POSIX/sys/mman.h/linknamespace): Likewise. (test-xfail-UNIX98/sys/mman.h/linknamespace): Likewise. (test-xfail-UNIX98/sys/statvfs.h/linknamespace): Likewise. (test-xfail-XOPEN2K/sys/mman.h/linknamespace): Likewise. (test-xfail-XOPEN2K/sys/statvfs.h/linknamespace): Likewise. (test-xfail-POSIX2008/sys/mman.h/linknamespace): Likewise. (test-xfail-POSIX2008/sys/statvfs.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/sys/mman.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/sys/statvfs.h/linknamespace): Likewise.
2014-12-01Fix for test "malloc_usable_size: expected 7 but got 11"James Lemke
[BZ #17581] The checking chain of unused chunks was terminated by a hash of the block pointer, which was sometimes confused with the chunk length byte. The chain is now terminated by a NULL byte.
2014-12-01Update NEWS for previous two commitsSiddhesh Poyarekar
2014-11-28Mention fix for PR 13862H.J. Lu
2014-11-26FIx ldbl-128ibm frexpl for 32-bit systems (bug 16619, bug 16740).Joseph Myers
This patch fixes bugs in ldbl-128ibm frexpl for 32-bit systems shown up by warnings: ../sysdeps/ieee754/ldbl-128ibm/s_frexpl.c:82:4: warning: left shift count >= width of type ../sysdeps/ieee754/ldbl-128ibm/s_frexpl.c:129:5: warning: left shift count >= width of type This did in fact show up in test-ldouble.out (alongside all the other problems there ... maybe we should again consider running the libm tests at finer granularity from the makefiles) as already covered by the testsuite after the previous patch that fixed these bugs for 64-bit systems. The fix is simply using 1LL instead of 1L when shifting by 52. Tested for powerpc32 (soft float). [BZ #16619] [BZ #16740] * sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Use 1LL << 52 instead of 1L << 52.
2014-11-24Update NEWS for bug 17608Florian Weimer
2014-11-24Fix perror fileno namespace (bug 17633).Joseph Myers
perror, an ISO C function, uses fileno, which is not an ISO C function. This patch makes it use __fileno instead. (The nearby call to fdopen is not a problem because that's #defined to _IO_new_fdopen.) Tested for x86_64 (testsuite, and that installed stripped shared libraries are unchanged by this patch). [BZ #17633] * stdio-common/perror.c (perror): Call __fileno instead of fileno. * conform/Makefile (test-xfail-ISO/stdio.h/linknamespace): Remove variable. (test-xfail-ISO99/stdio.h/linknamespace): Likewise. (test-xfail-ISO11/stdio.h/linknamespace): Likewise.
2014-11-21BZ#16469: don't drop trailing dot in res_nquerydomain(..., name, NULL, ...)Alexandre Oliva
If we drop it here, we will fail to detect a duplicate trailing dot later on. Retaining, OTOH, has no ill effects whatsoever, and it even saves us the trouble of copying the domain name minus the trailing dot, like we used to do. for ChangeLog [BZ #16469] * NEWS: Update. * resolv/res_query.c (__libc_res_nquerydomain): Retain trailing dot. * posix/tst-getaddrinfo5.c: New. * posix/Makefile (tests): Add it.
2014-11-21BZ#14498: fix infinite loop in nss_db_getservbynameAlexandre Oliva
nss_db uses nss_files code for services, but a continue on protocol mismatch that doesn't affect nss_files skipped the code that advanced to the next db entry. Any one of these changes would suffice to fix it, but fixing both makes them both safer to reuse elsewhere. for ChangeLog [BZ #14498] * NEWS: Fixed. * nss/nss_db/db-XXX.c (_nss_db_get##name##_r): Update hidx after parsing line but before break_if_match. * nss/nss_files/files-service (DB_LOOKUP): Don't "continue;" if there is a protocol mismatch.
2014-11-19CVE-2014-7817: wordexp fails to honour WRDE_NOCMD.Carlos O'Donell
The function wordexp() fails to properly handle the WRDE_NOCMD flag when processing arithmetic inputs in the form of "$((... ``))" where "..." can be anything valid. The backticks in the arithmetic epxression are evaluated by in a shell even if WRDE_NOCMD forbade command substitution. This allows an attacker to attempt to pass dangerous commands via constructs of the above form, and bypass the WRDE_NOCMD flag. This patch fixes this by checking for WRDE_NOCMD in exec_comm(), the only place that can execute a shell. All other checks for WRDE_NOCMD are superfluous and removed. We expand the testsuite and add 3 new regression tests of roughly the same form but with a couple of nested levels. On top of the 3 new tests we add fork validation to the WRDE_NOCMD testing. If any forks are detected during the execution of a wordexp() call with WRDE_NOCMD, the test is marked as failed. This is slightly heuristic since vfork might be used in the future, but it provides a higher level of assurance that no shells were executed as part of command substitution with WRDE_NOCMD in effect. In addition it doesn't require libpthread or libdl, instead we use the public implementation namespace function __register_atfork (already part of the public ABI for libpthread). Tested on x86_64 with no regressions.
2014-11-18Fix libm mpone, mptwo namespace (bug 17616).Joseph Myers
libm uses symbols mpone and mptwo for internal purposes. This patch moves them to the implementation namespace (__mpone and __mptwo). Tested for x86_64 (testsuite, and that installed stripped shared libraries are unchanged by the patch). [BZ #17616] * sysdeps/ieee754/dbl-64/mpa.c (mpone): Rename to __mpone. (mptwo): Rename to __mptwo. (__inv): Use __mptwo instead of mptwo. * sysdeps/ieee754/dbl-64/mpa.h (mpone): Rename to __mpone. (mptwo): Rename to __mptwo. * sysdeps/ieee754/dbl-64/mpatan.c (__mpatan): Use __mpone instead of mpone and __mptwo instead of mptwo. * sysdeps/ieee754/dbl-64/mpatan2.c (__mpatan2): Use __mpone instead of mpone. * sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): Likewise. * sysdeps/ieee754/dbl-64/mplog.c (__mplog): Likewise. * sysdeps/ieee754/dbl-64/sincos32.c (__c32): Use __mpone instead of mpone and __mptwo instead of mptwo. (__mpranred): Use __mpone instead of mpone. * conform/Makefile (test-xfail-ISO/math.h/linknamespace): Remove variable. (test-xfail-ISO99/complex.h/linknamespace): Likewise. (test-xfail-ISO99/math.h/linknamespace): Likewise. (test-xfail-ISO99/tgmath.h/linknamespace): Likewise. (test-xfail-ISO11/complex.h/linknamespace): Likewise. (test-xfail-ISO11/math.h/linknamespace): Likewise. (test-xfail-ISO11/tgmath.h/linknamespace): Likewise. (test-xfail-XPG3/math.h/linknamespace): Likewise. (test-xfail-XPG4/math.h/linknamespace): Likewise. (test-xfail-POSIX/math.h/linknamespace): Likewise. (test-xfail-UNIX98/math.h/linknamespace): Likewise. (test-xfail-XOPEN2K/complex.h/linknamespace): Likewise. (test-xfail-XOPEN2K/math.h/linknamespace): Likewise. (test-xfail-XOPEN2K/tgmath.h/linknamespace): Likewise. (test-xfail-POSIX2008/complex.h/linknamespace): Likewise. (test-xfail-POSIX2008/math.h/linknamespace): Likewise. (test-xfail-POSIX2008/tgmath.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/complex.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/math.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/tgmath.h/linknamespace): Likewise.
2014-11-14Remove sigvec.Roland McGrath
2014-11-14Require GCC 4.6 or later to build glibc.Joseph Myers
As discussed in the thread starting at <https://sourceware.org/ml/libc-alpha/2014-10/msg00792.html>, and continuing into November, this patch increases the minimum GCC version for building glibc to 4.6 (there seemed to be no clear consensus for 4.7). In particular, this allows us to use #pragma GCC diagnostic for fine-grained warning control with -Werror (subject to establishing a suitable policy for that use). The documentation has a statement, as requested, about the most recent GCC version tested for building glibc, and I've updated <https://sourceware.org/glibc/wiki/Release> to refer to updating that statement. A NEWS entry is added for this change, although previous such changes didn't get them. Tested for x86_64 (testsuite, and that installed shared libraries are unchanged by this patch). * configure.ac (libc_cv_compiler_ok): Require GCC 4.6 or later. * configure: Regenerated. * manual/install.texi (Tools for Compilation): Document a requirement of GCC 4.6 or later and that GCC 4.9 is the newest compiler verified to work. * INSTALL: Regenerated.
2014-11-13Fix strtoll / strtoull namespace for 32-bit (bug 17594).Joseph Myers
For 32-bit platforms, strtoll and strtoull are strong symbols in libc, but they are not in ISO C90, and are brought in by references to __strtoll_internal / __strtoull_internal from scanf. (For 64-bit platforms, they are properly weak.) This patch makes them weak for 32-bit (it has a side-effect of making other symbols weak that don't need to be weak, such as strtol, but that's harmless). Tested for x86 (testsuite, and that the disassembly of installed shared libraries is unchanged by the patch). This fixes all 120 unXFAILed FAILs of the new linknamespace tests seen for x86 (in fact, there are now seven XPASSes of those tests for x86 XPASS: conform/POSIX2008/fcntl.h/linknamespace XPASS: conform/UNIX98/libgen.h/linknamespace XPASS: conform/XOPEN2K/fcntl.h/linknamespace XPASS: conform/XOPEN2K/libgen.h/linknamespace XPASS: conform/XOPEN2K8/fcntl.h/linknamespace XPASS: conform/XOPEN2K8/libgen.h/linknamespace XPASS: conform/XPG4/libgen.h/linknamespace so suggesting that the failures seen for those on x86_64 are in some way architecture-specific or 64-bit-specific). [BZ #17594] * stdlib/strtol.c (SYM__): New macro. (SYM__1): Likewise. (__strtol): Likewise. (strtol): Rename to __strtol and define as weak alias of __strtol. Use libc_hidden_weak.
2014-11-12Fix localealias.c fgets_unlocked namespace (bug 17589).Joseph Myers
intl/localealias.c is brought in by ISO C functions, but uses fgets_unlocked, which is not an ISO C function. This patch changes this to use __fgets_unlocked. Tested for x86_64 (testsuite, and that stripped installed shared libraries are unchanged by the patch). [BZ #17589] * intl/localealias.c [_LIBC] (FGETS): Use __fgets_unlocked instead of fgets_unlocked.
2014-11-12Fix locale memmem namespace (bug 17585).Joseph Myers
Locale code, brought in by ISO C functions, calls memmem, which is not an ISO C function. This isn't an ISO C conformance bug, because all mem* names are reserved, but glibc practice is not to rely on that reservation (thus, memmem is only declared in string.h if __USE_GNU even though ISO C would allow it to be declared unconditionally, for example). This patch changes that code to use __memmem. Note: there are uses of memmem elsewhere in glibc that I didn't change, although it may turn out some of those also need to use __memmem. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by this patch). [BZ #17585] * string/memmem.c [!_LIBC] (__memmem): Define to memmem. (memmem): Rename to __memmem and define as weak alias of __memmem. Use libc_hidden_weak. (__memmem): Use libc_hidden_def. * include/string.h (__memmem): Declare. Use libc_hidden_proto. * locale/findlocale.c (valid_locale_name): Use __memmem instead of memmem.
2014-11-12Fix __get_nprocs fgets_unlocked namespace (bug 17582).Joseph Myers
__get_nprocs is called from malloc code, but calls fgets_unlocked, which is not an ISO C or POSIX function. This patch fixes it to call a new __fgets_unlocked name instead. Note: there are various other uses of fgets_unlocked in glibc's libraries, and I haven't yet investigated which others might also be problematic (called directly or indirectly from standard functions) and so need to change to use __fgets_unlocked. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #17582] * libio/iofgets.c [weak_alias && !_IO_MTSAFE_IO] (__fgets_unlocked): Add alias of _IO_fgets. Use libc_hidden_def. * libio/iofgets_u.c (fgets_unlocked): Rename to __fgets_unlocked and define as weak alias of __fgets_unlocked. Use libc_hidden_weak. (__fgets_unlocked): Use libc_hidden_def. * include/stdio.h (__fgets_unlocked): Declare. Use libc_hidden_proto. * sysdeps/unix/sysv/linux/getsysstats.c (phys_pages_info): Use __fgets_unlocked instead of fgets_unlocked. * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_CONF_PARSER): Likewise. * sysdeps/unix/sysv/linux/sparc/getsysstats.c (GET_NPROCS_CONF_PARSER): Likewise.
2014-11-12Fix __printf_fp wmemset namespace (bug 17574).Joseph Myers
__printf_fp calls wmemset, but that is not an ISO C90 function. This patch fixes it to call a new __wmemset name instead (with wmemset being a weak alias). Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #17574] * wcsmbs/wmemset.c (wmemset): Rename to __wmemset and define as weak alias of __wmemset. Use libc_hidden_weak. (__wmemset): Use libc_hidden_def. * include/wchar.h (__wmemset): Declare. Use libc_hidden_proto. * stdio-common/printf_fp.c (___printf_fp): Call __wmemset instead of wmemset.
2014-11-12Fix stpcpy / mempcpy namespace (bug 17573).Joseph Myers
Various glibc functions call __stpcpy and __mempcpy for namespace reasons instead of plain stpcpy and mempcpy. But __stpcpy and __mempcpy are macros that call __builtin_stpcpy and __builtin_mempcpy, and unless GCC optimizes the calls, they end up calling the C functions stpcpy and mempcpy. For calls from within shared libc, libc_hidden_builtin_proto ensures that calls to those C functions are in turn mapped to call __GI_stpcpy and __GI_mempcpy. However, for static libc, and for calls from shared libraries other than libc, the ELF symbols stpcpy and mempcpy end up getting called, breaking the ISO C namespace (in the case of stpcpy) or glibc conventions about not relying on the "future library directions" reservations (in the case of mempcpy). This patch fixes this by adding declarations of these functions to include/string.h, under an appropriate condition, with __asm__ used to change the assembler name used for calls (the mempcpy case was previously discussed, and the approach for the fix is as I suggested in <https://sourceware.org/ml/libc-alpha/2013-02/msg00063.html>). Tested for x86_64 with the testsuite; also checked that dcigettext.o (an example previously noted of undesired calls to stpcpy and mempcpy) now calls __stpcpy and __mempcpy instead, as do non-libc shared libraries (__stpcpy and __mempcpy were already exported from shared libc). Disassembly of installed shared libraries isn't easy to compare because of reordered PLT entries resulting from the change in functions called (libnsl, libnss_compat, libnss_dns, libnss_files, libnss_hesiod, libnss_nis, libnss_nisplus, libpthread, librt all have such changes). [BZ #17573] * include/string.h [NOT_IN_libc || !SHARED] (mempcpy): Declare with asm name __mempcpy. [NOT_IN_libc || !SHARED] (stpcpy): Declare with asm name __stpcpy.
2014-11-12Fix x86_64 rawmemchr namespace (bug 17572).Joseph Myers
rawmemchr is not an ISO C function, but __rawmemchr is called from ISO C functions, so rawmemchr should be a weak alias. On most architecture it is, but x86_64 defines the function as rawmemchr with __rawmemchr as a strong alias. This patch makes x86_64 follow the same arrangements as other architectures. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #17572] * sysdeps/x86_64/rawmemchr.S (rawmemchr): Rename to __rawmemchr and define as weak alias of __rawmemchr. (__rawmemchr): Do not define as strong alias of rawmemchr.
2014-11-12Fix qsort_r namespace (bug 17571).Joseph Myers
qsort_r is defined in the same file as qsort, but is not an ISO C function, so should be a weak alias for __qsort_r. The uses in getaddrinfo should also call __qsort_r, since getaddrinfo is a POSIX function and qsort_r isn't. This patch implements this. Because nscd uses the getaddrinfo sources outside libc, as do the tst-rfc3484 tests, a #define of __qsort_r to qsort_r is added there alongside the similar defines for other libc-internal symbols used in getaddrinfo. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #17571] * stdlib/msort.c (qsort_r): Rename to __qsort_r and define as weak alias of __qsort_r. (qsort): Call __qsort_r instead of qsort_r. * include/stdlib.h (qsort_r): Do not call libc_hidden_proto. (__qsort_r): Declare. Call libc_hidden_proto. * sysdeps/posix/getaddrinfo.c (getaddrinfo): Call __qsort_r instead of qsort_r. * nscd/gai.c (__qsort_r): Define to qsort_r. * posix/tst-rfc3484.c (__qsort_r): Likewise. * posix/tst-rfc3484-2.c (__qsort_r): Likewise. * posix/tst-rfc3484-3.c (__qsort_r): Likewise.
2014-11-12Fix malloc_info namespace (bug 17570).Joseph Myers
malloc_info is defined in the same file as malloc and free, but is not an ISO C function, so should be a weak symbol. This patch makes it so. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #17570] * malloc/malloc.c (malloc_info): Rename to __malloc_info and define as weak alias of __malloc_info.
2014-11-12Fix __getcwd rewinddir namespace (bug 17584).Joseph Myers
__getcwd is called from dcigettext.o (brought in by various ISO C functionality), but calls rewinddir, which is not an ISO C function. This patch makes __getcwd call __rewinddir instead and makes rewinddir a weak alias for __rewinddir. Since getcwd.c is shared with gnulib (albeit not merged in either direction for a long time, and omitted from gnulib's config/srclist.txt list of shared files) I put in a #ifndef _LIBC define of __rewinddir to rewinddir, although a future merged version of getcwd could end up looking significantly different. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by this patch). [BZ #17584] * dirent/rewinddir.c (rewinddir): Rename to __rewinddir and define as weak alias of __rewinddir. Don't use libc_hidden_def. (__rewinddir): Use libc_hidden_def. * sysdeps/mach/hurd/rewinddir.c: Rename to __rewinddir and define as weak alias of __rewinddir. Don't use libc_hidden_def. (__rewinddir): Use libc_hidden_def. * sysdeps/posix/rewinddir.c: Rename to __rewinddir and define as weak alias of __rewinddir. Don't use libc_hidden_def. (__rewinddir): Use libc_hidden_def. * include/dirent.h (rewinddir): Don't use libc_hidden_proto. (__rewinddir): Use libc_hidden_proto. * sysdeps/posix/getcwd.c [!_LIBC] (__rewinddir): Define to rewinddir. (__getcwd): Use __rewinddir instead of rewinddir.
2014-11-12Fix tzfile.c namespace (bug 17583).Joseph Myers
tzfile.c is brought in by various ISO C functions, but calls fileno, fread_unlocked and ftello, which are not ISO C functions. This patch adds names __fileno, __fread_unlocked and __ftello for those functions, making tzfile.c use those new names. Note: there are various uses of fileno elsewhere in glibc that I didn't change, although it may turn out that some of those also need to use __fileno. Tested for x86_64 with the glibc testsuite. Changed line numbers in tzfile.c cause changes in assertions, and for some reason this ends up with different instruction choice and register allocation, affecting the size of __tzfile_read and so making comparison of disassembly for libc.so problematic. [BZ #17583] * libio/fileno.c (fileno): Rename to __fileno and define as weak alias of __fileno. Use libc_hidden_weak. (__fileno): Use libc_hidden_def. [weak_alias] (fileno_unlocked): Define as weak alias of __fileno. * libio/ftello.c (ftello): Rename to __ftello and define as weak alias of __ftello. [__OFF_T_MATCHES_OFF64_T] (ftello64): Define as weak alias of __ftello. * libio/iofread.c [weak_alias && !_IO_MTSAFE_IO] (__fread_unlocked): Define as strong alias of _IO_fread. Use libc_hidden_def. (fread_unlocked): Don't use libc_hidden_ver. * libio/iofread_u.c (fread_unlocked): Rename to __fread_unlocked and define as weak alias of __fread_unlocked. Don't use libc_hidden_def. (__fread_unlocked): Use libc_hidden_def. * include/stdio.h (__fileno): Declare. Use libc_hidden_proto. (ftello): Don't use libc_hidden_proto. (__ftello): Declare. Use libc_hidden_proto. (fread_unlocked): Don't use libc_hidden_proto. (__fread_unlocked): Declare. Use libc_hidden_proto. * time/tzfile.c (__tzfile_read): Use __fileno, __fread_unlocked and __ftello instead of fileno, fread_unlocked and ftello.
2014-11-12Fix tst-strcoll-overflow returning before timeout (BZ #17506)Leonhard Holz
Modifies the test examination in test-skeleton.c so that a test can be successful if it is interrupted or it returns uninterrupted with the expected status. For this both EXPECTED_SIGNAL and EXPECTED_STATUS have to be set, as is done in tst-strcoll-overflow.c.
2014-11-12New Bhilodi and Tulu locales (BZ #17475)Tatiana Udalova
2014-11-11[AArch64] End frame record chain correctly.Renlin Li
2014-11-05Remove INTDEF / INTUSE / INTVARDEF (bug 14132).Joseph Myers
Completing the removal of the obsolete INTDEF / INTUSE mechanism, this patch removes the final use - that for _dl_starting_up - replacing it by rtld_hidden_def / rtld_hidden_proto. Having removed the last use, the mechanism itself is also removed. Tested for x86_64 that installed stripped shared libraries are unchanged by the patch. (This is not much of a test since this variable is only defined and used in the !HAVE_INLINED_SYSCALLS case.) [BZ #14132] * include/libc-symbols.h (INTUSE): Remove macro. (INTDEF): Likewise. (INTVARDEF): Likewise. (_INTVARDEF): Likewise. (INTDEF2): Likewise. (INTVARDEF2): Likewise. * elf/rtld.c [!HAVE_INLINED_SYSCALLS] (_dl_starting_up): Use rtld_hidden_def instead of INTVARDEF. * sysdeps/generic/ldsodefs.h [IS_IN_rtld] (_dl_starting_up_internal): Remove declaration. (_dl_starting_up): Use rtld_hidden_proto. * elf/dl-init.c [!HAVE_INLINED_SYSCALLS] (_dl_starting_up): Remove declaration. [!HAVE_INLINED_SYSCALLS] (_dl_starting_up_internal): Likewise. (_dl_init) [!HAVE_INLINED_SYSCALLS]: Don't use INTUSE with _dl_starting_up. * elf/dl-writev.h (_dl_writev): Likewise. * sysdeps/powerpc/powerpc64/dl-machine.h [!HAVE_INLINED_SYSCALLS] (DL_STARTING_UP_DEF): Use __GI__dl_starting_up instead of _dl_starting_up_internal.
2014-11-05[AArch64] Add optimized strchrnul.Richard Earnshaw
Here is an optimized implementation of __strchrnul. The simplification that we don't have to track precisely why the loop terminates (match or end-of-string) means we have to do less work in both setup and the core inner loop. That means this should never be slower than strchr. As with strchr, the use of LD1 means we do not need different versions for big-/little-endian.
2014-11-03Don't error out writing a multibyte character to an unbuffered stream (bug ↵Andreas Schwab
17522)
2014-10-31Add bug 15215 to NEWS; move bug 17344 to correct version's list in NEWS.Joseph Myers
2014-10-31Move powerpc64 pread/pwrite definitions to syscalls.list (bug 14138).Joseph Myers
Concluding the move of syscall definitions to syscalls.list, where the removal of support for old kernel versions has made this possible, this patch removes C definitions of pread, pread64, pwrite and pwrite64 for powerpc64. As far as I can tell, the existing syscalls.list definitions in sysdeps/unix/sysv/linux/wordsize-64/syscalls.list should suffice to produce results equivalent to what these C files do. [BZ #14138] * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c: Remove file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c: Likewise.
2014-10-27Fix misdetected Slow_SSE4_2 cpu feature bit (bug 17501)Andreas Schwab
2014-10-23hppa: Make __SIGRTMIN 32 (ABI break).Carlos O'Donell
In the Linux kernel version 3.17 the signal numbers were rearranged in order to make hppa like every other arch. Previously we started __SIGRTMIN at 37, and that meant several pieces of important software, including systemd, would fail to build. To support systemd we removed SIGEMT and SIGLOST, and rearranged the others according to expected values. This is technically an ABI incompatible change, but because zero applications use SIGSTKFLT, SIGXCPU, SIGXFSZ and SIGSYS nothing broke. Nothing uses SIGEMT and SIGLOST, and they were present for HPUX compatibility which is no longer supported. Thus because nothing breaks we don't do any compatibility work here. Upstream kernel commit is 1f25df2eff5b25f52c139d3ff31bc883eee9a0ab. Signed-off-by: Carlos O'Donell <carlos@systemhalted.org> Signed-off-by: Helge Deller <deller@gmx.de> 2014-10-23 Carlos O'Donell <carlos@systemhalted.org> Helge Deller <deller@gmx.de> [BZ #17508] * sysdeps/unix/sysv/linux/hppa/bits/signum.h: Remove SIGEMT. Define SIGSTKFLT as 7. Define SIGSYS as 31. Define SIGXCPU as 12. Remove SIGLOST. Define SIGXFSZ as 30. Define __SIGRTMIN as 32.
2014-10-22MIPS: Avoid a dangling `vfork@GLIBC_2.0' referenceMaciej W. Rozycki
This satisfies a symbol reference created with: .symver __libc_vfork, vfork@GLIBC_2.0 where `__libc_vfork' has not been defined or referenced. In this case the `vfork@GLIBC_2.0' reference is supposed to be discarded, however a bug present in GAS since forever causes an undefined symbol table entry to be created. This in turn triggers a problem in the linker that can manifest itself by link errors such as: ld: libpthread.so: invalid string offset 2765592330 >= 5154 for section `.dynstr' The GAS and linker bugs need to be resolved, but we can avoid them too by providing a `__libc_vfork' definition just like our other platforms. [BZ #17485] * sysdeps/unix/sysv/linux/mips/vfork.S (__libc_vfork): Define.
2014-10-17strcoll: improve performance by removing the cache (#15884)Leonhard Holz
this is a path that should solve bug 15884. It complains about the performance of strcoll(). It was found out that the runtime of strcoll() is actually bound to strlen which is needed for calculating the size of a cache that was installed to improve the comparison performance. The idea for this patch was that the cache is only useful in rare cases (strings of same length and same first-level-chars) and that it would be better to avoid memory allocation at all. To prove this I wrote a performance test bench-strcoll.c with test data in benchtests-strcoll.tar.gz. Also modifications in benchtests/Makefile and localedata/Makefile are necessary to make it work. After removing the cache the strcoll method showed the predicted behavior (getting slightly faster) in all but the test case for hindi word sorting. This was due the hindi text having much more equal words than the other ones. For equal strings the performance was worse since all comparison levels were run through and from the second level on the cache improved the comparison performance of the original version. Therefore I added a bytewise test via strcmp iff the first level comparison found that both strings did match because in this case it is very likely that equal strings are compared. This solved the problem with the hindi test case and improved the performance of the others. Performance comparison: glibc files -33.77% vi_VN.UTF-8 -34.12% en_US.UTF-8 -42.42% ar_SA.UTF-8 -27.49% zh_CN.UTF-8 +07.90% cs_CZ.UTF-8 -29.67% en_GB.UTF-8 -28.50% da_DK.UTF-8 -36.57% pl_PL.UTF-8 -39.31% fr_FR.UTF-8 -28.57% pt_PT.UTF-8 -22.82% el_GR.UTF-8 -26.77% ru_RU.UTF-8 -35.81% iw_IL.UTF-8 -35.34% es_ES.UTF-8 -34.46% hi_IN.UTF-8 -00.38% sv_SE.UTF-8 -36.99% hu_HU.UTF-8 -16.35% tr_TR.UTF-8 -27.80% is_IS.UTF-8 -33.24% it_IT.UTF-8 -24.39% sr_RS.UTF-8 -37.55% ja_JP.UTF-8 +02.84%
2014-10-14Fix infinite loop in check_pf (BZ #12926)Siddhesh Poyarekar
The recvmsg could return 0 under some conditions and cause the make_request function to be stuck in an infinite loop. Thank you Jim King <jim.king@simplivity.com> for posting Paul's patch on the list.
2014-10-08BZ#17460: Fix buffer overrun in nscd --help.Roland McGrath