]> sourceware.org Git - glibc.git/log
glibc.git
9 years ago Simplify strncat.
Ondřej Bílka [Fri, 19 Dec 2014 22:09:40 +0000 (23:09 +0100)]
 Simplify strncat.

We rewrite strncat to use strnlen and malloc calls which simplifies code
an is faster as these functions are better optimized than original code.

9 years agoFix soft-fp build warning on sparc about strict aliasing.
David S. Miller [Fri, 19 Dec 2014 21:34:30 +0000 (13:34 -0800)]
Fix soft-fp build warning on sparc about strict aliasing.

* sysdeps/sparc/sparc32/soft-fp/q_neg.c (_Q_neg): Use a union to
access the quad as both a long double and as a series of 4 words.

9 years agoFix array bounds warnings in elf_get_dyanmic_info() on sparc with gcc-4.6
David S. Miller [Fri, 19 Dec 2014 21:23:40 +0000 (13:23 -0800)]
Fix array bounds warnings in elf_get_dyanmic_info() on sparc with gcc-4.6

* get-dynamic-info.h (elf_get_dynamic_info): Ignore -Warray-bounds for a
link_map->l_info array access.

9 years agoiconvdata/tst-loading: bump up timeout to 10s
Chris Metcalf [Fri, 19 Dec 2014 21:36:00 +0000 (16:36 -0500)]
iconvdata/tst-loading: bump up timeout to 10s

9 years agomath: increase timeout for math/atest-*.c
Chris Metcalf [Fri, 19 Dec 2014 20:11:04 +0000 (15:11 -0500)]
math: increase timeout for math/atest-*.c

These tests run in the 2-5 second range on tilegx, so just bump
up the timeout to 10 seconds generically.

9 years agoReplace -Wno-error with -fno-builtin-lround
H.J. Lu [Fri, 19 Dec 2014 16:32:05 +0000 (08:32 -0800)]
Replace -Wno-error with -fno-builtin-lround

9 years agoi386: Move futex functions from lowlevellock.h to lowlevellock-futex.h.
Torvald Riegel [Wed, 17 Dec 2014 18:09:04 +0000 (19:09 +0100)]
i386: Move futex functions from lowlevellock.h to lowlevellock-futex.h.

9 years agoUse generic lowlevellock-futex.h in x86_64 lowlevellock.h.
Torvald Riegel [Wed, 17 Dec 2014 17:55:19 +0000 (18:55 +0100)]
Use generic lowlevellock-futex.h in x86_64 lowlevellock.h.

9 years agosh: Remove custom lowlevellock, barrier, condvar, and rwlock implementations.
Torvald Riegel [Wed, 17 Dec 2014 22:28:38 +0000 (23:28 +0100)]
sh: Remove custom lowlevellock, barrier, condvar, and rwlock implementations.

9 years agoCompile s_llround.c with -Wno-error for x32 build
H.J. Lu [Fri, 19 Dec 2014 13:37:29 +0000 (05:37 -0800)]
Compile s_llround.c with -Wno-error for x32 build

Since x32 returns 32-bit long int and 64-bit long long int in the
same 64-bit register, we make the 32b-bit lround an alias of the
64-bit llround.  Add -Wno-error for x32 build to silence the compiler.

9 years agoReplace 1L with (mp_limb_t) 1
H.J. Lu [Fri, 19 Dec 2014 13:28:06 +0000 (05:28 -0800)]
Replace 1L with (mp_limb_t) 1

X86-64 and x32 use sysdeps/i386/ldbl2mpn.c.  res_ptr is a pointer
to mp_limb_t, which is long for i386 and x86-64 and long long for
x32.  On x32, I got

../sysdeps/x86_64/../i386/ldbl2mpn.c: In function ‘__mpn_extract_long_double’:
../sysdeps/x86_64/../i386/ldbl2mpn.c:72:4: error: left shift count >= width of type [-Werror]
    res_ptr[N - 1] &= ~(1L << ((LDBL_MANT_DIG - 1) % BITS_PER_MP_LIMB));
    ^
cc1: all warnings being treated as errors

This patch replaces 1L with (mp_limb_t) 1.  Verified on x32, i686 and
x86-64 with GCC 4.8.3.

9 years agoLabel CVE-2014-9402 in NEWS
Allan McRae [Thu, 18 Dec 2014 01:01:43 +0000 (11:01 +1000)]
Label CVE-2014-9402 in NEWS

9 years agoNPTL: Move fork state variables to initializer files.
Roland McGrath [Wed, 17 Dec 2014 22:33:28 +0000 (14:33 -0800)]
NPTL: Move fork state variables to initializer files.

9 years agoNPTL: Remove gratuitous Linuxisms from gai_misc.h.
Roland McGrath [Wed, 17 Dec 2014 22:07:18 +0000 (14:07 -0800)]
NPTL: Remove gratuitous Linuxisms from gai_misc.h.

9 years agoFix stub __if_freenameindex build error.
Roland McGrath [Wed, 17 Dec 2014 21:22:41 +0000 (13:22 -0800)]
Fix stub __if_freenameindex build error.

9 years agoRemove explicit inline on malloc perturb functions.
Roland McGrath [Wed, 17 Dec 2014 18:41:28 +0000 (10:41 -0800)]
Remove explicit inline on malloc perturb functions.

9 years agoFix profil_counter namespace (bug 17725).
Joseph Myers [Wed, 17 Dec 2014 18:10:37 +0000 (18:10 +0000)]
Fix profil_counter namespace (bug 17725).

On ARM, where profil_counter is not static, it is brought in by
references to various standard functions, as noted in
<https://sourceware.org/ml/libc-alpha/2014-11/msg00890.html>, although
it is not a standard function itself.  I don't know if this also
causes test failures on SPARC, although I see no reason for it not to
do so.

This patch fixes this namespace issue.  profil_counter is renamed to
__profil_counter and made a weak alias on ARM and SPARC.  Because of
the uses in profil.c / sprofil.c it seems simplest to make the rename
globally, including on the other architectures for which
profil_counter was static and so the change is of no substance.  The
variant names profil_counter_* used in sprofil.c are also renamed to
start with __ so that undesired function names do not get exported in
static libc.

As I noted in bug 17726, profil_counter should probably be a compat
symbol on ARM and SPARC, so it wouldn't exist at all in static libc
even as a weak alias.  Since defining a compat symbol still requires
an internal name as a target of an alias, this patch still seems
reasonable as an intermediate step towards that goal: it wouldn't be
possible for the function simply to be static profil_counter on ARM
and SPARC with profil_counter also being the exported compat symbol
name, so profil.c / sprofil.c would still need to be prepared to call
the function under another name (here, __profil_counter).

Tested for x86_64 (testsuite, and that stripped installed shared
libraries are unchanged by the patch) and ARM (ABI and linknamespace
tests - this patch reduces the number of linknamespace failures I see
on ARM from 227 to 5, the residue being math.h failures for fe*
functions and for j0l/j1n/jnl/y0l/y1l/ynl aliases).

2014-12-17  Joseph Myers  <joseph@codesourcery.com>

[BZ #17725]
* sysdeps/generic/profil-counter.h (profil_counter): Rename to
__profil_counter.
* sysdeps/unix/sysv/linux/hppa/profil-counter.h (profil_counter):
Likewise.
* sysdeps/unix/sysv/linux/i386/profil-counter.h (profil_counter):
Likewise.
* sysdeps/unix/sysv/linux/ia64/profil-counter.h (profil_counter):
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h
(profil_counter): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h
(profil_counter): Likewise.
* sysdeps/unix/sysv/linux/sh/profil-counter.h (profil_counter):
Likewise.
* sysdeps/unix/sysv/linux/tile/profil-counter.h (profil_counter):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/profil-counter.h
(profil_counter): Likewise.
* sysdeps/unix/sysv/linux/arm/profil-counter.h (profil_counter):
Likewise.
[!__profil_counter] (profil_counter): Define as weak alias of
__profil_counter.
* sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h
(profil_counter): Rename to __profil_counter.
[!__profil_counter] (profil_counter): Define as weak alias of
__profil_counter.
* sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h
(profil_counter): Rename to __profil_counter.
[!__profil_counter] (profil_counter): Define as weak alias of
__profil_counter.
* sysdeps/posix/profil.c: Update comment referring to
profil_counter.
(__profil): Use __profil_counter instead of profil_counter.
* sysdeps/posix/sprofil.c (profil_counter): Rename to
__profil_counter.  Use __profil_counter_ushort and
__profil_counter_uint in definitions.
(__sprofil): Use __profil_counter_uint and __profil_counter_ushort
instead of profil_counter_uint and profil_counter_ushort.

9 years agoFix resolver inet_* namespace (bug 17722).
Joseph Myers [Wed, 17 Dec 2014 18:09:11 +0000 (18:09 +0000)]
Fix resolver inet_* namespace (bug 17722).

Parts of the resolver brought in by pthreads (at least) use inet_*
functions that aren't in the 1995/6 edition of POSIX that introduced
pthreads (or in one case, use __inet_aton which is then defined in the
same file as non-weak inet_addr).  This patch fixes this by making the
affected functions into weak alias for __inet_* and using those names
in the problematic resolver code.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).

[BZ #17722]
* inet/inet_mkadr.c (inet_makeaddr): Rename to __inet_makeaddr and
define as weak alias of __inet_makeaddr.
* resolv/inet_addr.c (inet_addr): Rename to __inet_addr and define
as weak alias of __inet_addr.
* resolv/inet_pton.c (inet_pton): Rename to __inet_pton and define
as weak alias of __inet_pton.  Use libc_hidden_weak.
* include/arpa/inet.h (__inet_pton): Declare.  Use
libc_hidden_proto.
(inet_makeaddr): Don't use libc_hidden_proto.
(__inet_makeaddr): Declare.  Use libc_hidden_proto.
* resolv/res_init.c (__res_vinit): Use __inet_pton instead of
inet_pton.  Use __inet_makeaddr instead of inet_makeaddr.
* conform/Makefile (test-xfail-POSIX/pthread.h/linknamespace):
Remove variable.
(test-xfail-POSIX/sched.h/linknamespace): Likewise.
(test-xfail-POSIX/time.h/linknamespace): Likewise.

9 years ago2014-12-17 Steve Ellcey <sellcey@imgtec.com>
Steve Ellcey [Wed, 17 Dec 2014 18:00:37 +0000 (10:00 -0800)]
2014-12-17  Steve Ellcey  <sellcey@imgtec.com>

* inet/getnetgrent_r.c: Move while loop to be inside if statement.

9 years agoGet rid of format warning in bug-vfprintf-nargs.c.
Stefan Liebler [Wed, 17 Dec 2014 15:43:34 +0000 (16:43 +0100)]
Get rid of format warning in bug-vfprintf-nargs.c.

9 years agoGet rid of format warning in tst-widetext.c.
Stefan Liebler [Wed, 17 Dec 2014 15:42:51 +0000 (16:42 +0100)]
Get rid of format warning in tst-widetext.c.

9 years agoFix printf format error
Andreas Schwab [Wed, 17 Dec 2014 12:04:07 +0000 (13:04 +0100)]
Fix printf format error

9 years agoUse PTR_MANGLE on libgcc unwinder function pointers.
Roland McGrath [Tue, 16 Dec 2014 23:14:03 +0000 (15:14 -0800)]
Use PTR_MANGLE on libgcc unwinder function pointers.

9 years agoRevert "Use pragmas rather than makefiles for necessary options for unwind code."
Roland McGrath [Tue, 16 Dec 2014 23:46:00 +0000 (15:46 -0800)]
Revert "Use pragmas rather than makefiles for necessary options for unwind code."

This reverts commit c324fcfe75c3976ae0b16943df00710e1d0d74f7.

9 years agoUse pragmas rather than makefiles for necessary options for unwind code.
Roland McGrath [Tue, 16 Dec 2014 22:31:24 +0000 (14:31 -0800)]
Use pragmas rather than makefiles for necessary options for unwind code.

9 years agoFix x86_64 memrchr namespace (bug 17719).
Joseph Myers [Tue, 16 Dec 2014 18:31:31 +0000 (18:31 +0000)]
Fix x86_64 memrchr namespace (bug 17719).

On x86_64, memrchr (not a standard function) is defined as a strong
symbol, instead of a weak alias of __memrchr as on other
architectures.  This results in linknamespace test failures from the
use of __memrchr from dirname.  (Not a conformance issue because of
the mem* reservation, but contrary to glibc conventions.)  This patch
makes x86_64 follow other architectures by defining memrchr as a weak
alias.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).

[BZ #17719]
* sysdeps/x86_64/memrchr.S (memrchr): Rename to __memrchr and
define as weak alias of __memrchr.
(__memrchr): Do not define as strong alias of memrchr.
* conform/Makefile (test-xfail-XPG4/libgen.h/linknamespace):
Remove variable.
(test-xfail-UNIX98/libgen.h/linknamespace): Likewise.
(test-xfail-XOPEN2K/libgen.h/linknamespace): Likewise.
(test-xfail-XOPEN2K8/libgen.h/linknamespace): Likewise.

9 years agoFix resolver if_* namespace (bug 17717).
Joseph Myers [Tue, 16 Dec 2014 18:18:49 +0000 (18:18 +0000)]
Fix resolver if_* namespace (bug 17717).

Resolver code, brought in by pthreads (at least), uses if_* interfaces
that weren't in POSIX before 2001, resulting in linknamespace
failures.  This patch changes those interfaces to be weak aliases of
__if_* and makes the resolver use __if_* directly.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).

[BZ #17717]
* inet/if_index.c (if_nametoindex): Rename to __if_nametoindex and
define as weak alias of __if_nametoindex.  Use libc_hidden_weak.
(if_indextoname): Rename to __if_indextoname and define as weak
alias of __if_indextoname.  Use libc_hidden_weak.
(if_freenameindex): Rename to __if_freenameindex and define as
weak alias of __if_freenameindex.
(if_nameindex): Rename to __if_nameindex and define as weak alias
of __if_nameindex.
* sysdeps/mach/hurd/if_index.c (if_nametoindex): Rename to
__if_nametoindex and define as weak alias of __if_nametoindex.
Use libc_hidden_weak.
(if_freenameindex): Rename to __if_freenameindex and define as
weak alias of __if_freenameindex.
(if_nameindex): Rename to __if_nameindex and define as weak alias
of __if_nameindex.
(if_indextoname): Rename to __if_indextoname and define as weak
alias of __if_indextoname.  Use libc_hidden_weak.
* sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Rename to
__if_nametoindex and define as weak alias of __if_nametoindex.
Use libc_hidden_weak.
(if_freenameindex): Rename to __if_freenameindex and define as
weak alias of __if_freenameindex.  Use libc_hidden_weak.
(if_nameindex_netlink): Use __if_freenameindex instead of
if_freenameindex.
(if_nameindex): Rename to __if_nameindex and define as weak alias
of __if_nameindex.  Use libc_hidden_weak.
(if_indextoname): Rename to __if_indextoname and define as weak
alias of __if_indextoname.  Use libc_hidden_weak.
* include/net/if.h [!_ISOMAC] (__if_nametoindex): Declare and use
libc_hidden_proto.
[!_ISOMAC] (__if_freenameindex): Likewise.
* resolv/res_init.c (__res_vinit): Use __if_nametoindex instead of
if_nametoindex.
* conform/Makefile (test-xfail-XPG4/grp.h/linknamespace): Remove
variable.
(test-xfail-XPG4/pwd.h/linknamespace): Likewise.
(test-xfail-UNIX98/aio.h/linknamespace): Likewise.
(test-xfail-UNIX98/grp.h/linknamespace): Likewise.
(test-xfail-UNIX98/pthread.h/linknamespace): Likewise.
(test-xfail-UNIX98/pwd.h/linknamespace): Likewise.
(test-xfail-UNIX98/sched.h/linknamespace): Likewise.
(test-xfail-UNIX98/time.h/linknamespace): Likewise.

9 years agoRemove some semaphore.h linknamespace XFAILs.
Joseph Myers [Tue, 16 Dec 2014 16:25:08 +0000 (16:25 +0000)]
Remove some semaphore.h linknamespace XFAILs.

Roland's recent sem_* changes introduced some XPASSes for semaphore.h
linknamespace tests by removing a non-static variable "mountpoint".
This patch removes the XFAILs for the fixed bug.

Tested for x86_64.

* conform/Makefile (test-xfail-UNIX98/semaphore.h/linknamespace):
Remove variable.
(test-xfail-XOPEN2K/semaphore.h/linknamespace): Likewise.
(test-xfail-XOPEN2K8/semaphore.h/linknamespace): Likewise.

9 years agoFix the 'array subscript is above array bounds' warning correctly
Siddhesh Poyarekar [Tue, 16 Dec 2014 14:10:47 +0000 (19:40 +0530)]
Fix the 'array subscript is above array bounds' warning correctly

Use DIAG_IGNORE_NEEDS_COMMENT instead since the compiler should have
seen that NS never goes beyond MAXNS.

9 years agoFix 'array subscript is above array bounds' warning in res_send.c
Siddhesh Poyarekar [Tue, 16 Dec 2014 11:23:05 +0000 (16:53 +0530)]
Fix 'array subscript is above array bounds' warning in res_send.c

I see this warning in my build on F21 x86_64, which seems to be due to
a weak check for array bounds.  Fixed by making the bounds check
stronger.

This is not an actual bug since nscount is never set to anything
greater than MAXNS.  The compiler however does not know this, so we
need the stronger bounds check to quieten the compiler.

9 years agoModify libio/tst-fopenloc.c to use test-skeleton.c
Arjun Shankar [Tue, 16 Dec 2014 09:51:01 +0000 (15:21 +0530)]
Modify libio/tst-fopenloc.c to use test-skeleton.c

This test would earlier fail when run under test-skeleton.c due to
bug #17522 in 'fputws'. That bug is now fixed and so this test may
be modified.

9 years agoModify stdlib/tst-bsearch.c to use test-skeleton.c
Arjun Shankar [Tue, 16 Dec 2014 09:49:51 +0000 (15:19 +0530)]
Modify stdlib/tst-bsearch.c to use test-skeleton.c

This test used to define a 'struct entry' that conflicts with the
definition in search.h included in test-skeleton. The struct is
now renamed 'item'.

9 years agoModify stdio-common/tst-fseek.c to use test-skeleton.c
Arjun Shankar [Tue, 16 Dec 2014 09:48:46 +0000 (15:18 +0530)]
Modify stdio-common/tst-fseek.c to use test-skeleton.c

This test needs a TIMEOUT longer than the default 2 seconds since it
sleeps twice for a second each.

9 years agoIgnore warning in string/tester.c.
Torvald Riegel [Mon, 15 Dec 2014 19:13:11 +0000 (20:13 +0100)]
Ignore warning in string/tester.c.

9 years agoFix warning in misc/tst-mntent2.c.
Torvald Riegel [Mon, 15 Dec 2014 21:11:56 +0000 (22:11 +0100)]
Fix warning in misc/tst-mntent2.c.

9 years agoFix warning in elf/tst-unique4lib.cc.
Torvald Riegel [Mon, 15 Dec 2014 21:05:06 +0000 (22:05 +0100)]
Fix warning in elf/tst-unique4lib.cc.

9 years agoAvoid infinite loop in nss_dns getnetbyname [BZ #17630]
Florian Weimer [Mon, 15 Dec 2014 16:41:13 +0000 (17:41 +0100)]
Avoid infinite loop in nss_dns getnetbyname [BZ #17630]

9 years agostdio-common/Makefile: readd bug26 testcase
Allan McRae [Tue, 16 Dec 2014 03:20:25 +0000 (13:20 +1000)]
stdio-common/Makefile: readd bug26 testcase

This testcase was accidentally removed in commit a5357b7c.

9 years agoReturn allocated array instead of unallocated.
Ondřej Bílka [Mon, 15 Dec 2014 23:09:32 +0000 (00:09 +0100)]
Return allocated array instead of unallocated.

In locale/programs/ld-ctype.c we returned array that was on stack.
Fixed by returning static array instead.

9 years agoAdd comments for the generic lowlevellock implementation.
Torvald Riegel [Mon, 15 Dec 2014 21:49:29 +0000 (22:49 +0100)]
Add comments for the generic lowlevellock implementation.

Patch by Bernard Ogden <bernie.ogden@linaro.org>.

9 years agoFix nptl/tst-sem4: always start with a fresh semaphore.
Torvald Riegel [Tue, 29 Jul 2014 19:44:58 +0000 (21:44 +0200)]
Fix nptl/tst-sem4: always start with a fresh semaphore.

9 years agoFix nptl/tst-mutex5.c: Do not skip tests if elision is enabled.
Torvald Riegel [Mon, 15 Dec 2014 21:09:55 +0000 (22:09 +0100)]
Fix nptl/tst-mutex5.c: Do not skip tests if elision is enabled.

9 years agostdio-common: Include <libc-internal.h> in some tests
Adhemerval Zanella [Mon, 15 Dec 2014 17:29:09 +0000 (11:29 -0600)]
stdio-common: Include <libc-internal.h> in some tests

This patch adds the missing libc-internal.h include on test-vprintf.c
tst-sprintf.c.

9 years agoRemove custom pthread_once implementation on s390.
Torvald Riegel [Mon, 8 Dec 2014 17:32:14 +0000 (18:32 +0100)]
Remove custom pthread_once implementation on s390.

9 years agoCVE-2012-3406: Stack overflow in vfprintf [BZ #16617]
Jeff Law [Mon, 15 Dec 2014 09:09:32 +0000 (10:09 +0100)]
CVE-2012-3406: Stack overflow in vfprintf [BZ #16617]

A larger number of format specifiers coudld cause a stack overflow,
potentially allowing to bypass _FORTIFY_SOURCE format string
protection.

9 years agoBump required version of texinfo to 4.7
Will Newton [Thu, 11 Dec 2014 17:59:45 +0000 (17:59 +0000)]
Bump required version of texinfo to 4.7

It seems we require texinfo 4.7 for the --plaintext option, so
document that and check for the correct version in configure.

ChangeLog:

2014-12-15  Will Newton  <will.newton@linaro.org>

* manual/install.texi: Bump required version of texinfo
to 4.7 from 4.5.
* INSTALL: Regenerated.
* configure.ac: Check for makeinfo version 4.7 and above.
* configure: Regenerated.

9 years agoNPTL: Refactor named semaphore code to use shm-directory.h
Roland McGrath [Fri, 12 Dec 2014 21:17:21 +0000 (13:17 -0800)]
NPTL: Refactor named semaphore code to use shm-directory.h

9 years agoNPTL: Add stubs for Linux-only extension functions.
Roland McGrath [Fri, 12 Dec 2014 22:52:14 +0000 (14:52 -0800)]
NPTL: Add stubs for Linux-only extension functions.

9 years agoFix NPTL build for !__ASSUME_SET_ROBUST_LIST case.
Roland McGrath [Fri, 12 Dec 2014 22:00:37 +0000 (14:00 -0800)]
Fix NPTL build for !__ASSUME_SET_ROBUST_LIST case.

9 years agoresolv: Suppress maybe uninitialized warning
Stefan Liebler [Thu, 11 Dec 2014 12:38:01 +0000 (07:38 -0500)]
resolv: Suppress maybe uninitialized warning

In send_vc function at resolv/res_send.c, There is the
following warning on some architectures:

  'resplen' may be used uninitialized in this function
  [-Wmaybe-uninitialized]

And this is a false positive.  This patch suppress the
compiler warning.

9 years agoGet rid of warning comparision will always evaluate as true
Stefan Liebler [Fri, 12 Dec 2014 10:13:09 +0000 (11:13 +0100)]
Get rid of warning comparision will always evaluate as true

9 years agoFix for test "malloc_usable_size: expected 7 but got 11"
James Lemke [Fri, 12 Dec 2014 00:38:15 +0000 (16:38 -0800)]
Fix for test "malloc_usable_size: expected 7 but got 11"

[BZ #17581] Revert this fix while investigating a problem.

9 years agoRefactor shm_{open,unlink} code to separate Linux-specific directory choice from...
Roland McGrath [Thu, 11 Dec 2014 22:15:51 +0000 (14:15 -0800)]
Refactor shm_{open,unlink} code to separate Linux-specific directory choice from POSIX-generic code.

9 years ago* Fix SH specific compiler warnings which are for integer-pointer
Kaz Kojima [Thu, 11 Dec 2014 23:07:35 +0000 (08:07 +0900)]
* Fix SH specific compiler warnings which are for integer-pointer
  type conversions without cast.

9 years agoMove semaphore.h to sysdeps/pthread/.
Joseph Myers [Thu, 11 Dec 2014 22:58:48 +0000 (22:58 +0000)]
Move semaphore.h to sysdeps/pthread/.

Carlos reported failures in conform/ tests in environments where the
compiler used could only find headers in glibc's source and build
trees, not any previously installed headers
<https://sourceware.org/ml/libc-alpha/2014-09/msg00040.html>.

This patch moves nptl/semaphore.h to sysdeps/pthread/semaphore.h so
that it can be found by builds from all glibc subdirectories; it's not
in any way NPTL-specific.  (I left the Makefile setting to install
this header in nptl/, but maybe it should move as well - it's just not
clear to me what ifeq ($(subdir),...) conditional should be used to
select the directory to associate the header with for installation
purposes.  The path in the toplevel Makefile used for begin-end-check
also remains hardcoded; it's a known todo issue to rework that test to
run in each subdirectory checking the headers installed from that
subdirectory, rather than a separate hardcoded list.)

Tested for x86_64 (testsuite, and that installed stripped shared
libraries are unchanged by the patch).  I did *not* test a
configuration such as that in which Carlos saw failure.

* nptl/semaphore.h: Move to ...
* sysdeps/pthread/semaphore.h: ... here.
* Makefile (installed-headers): Change nptl/semaphore.h to
sysdeps/pthread/semaphore.h.

9 years agoSuppress -Wformat-security in tst-error1.c.
Roland McGrath [Thu, 11 Dec 2014 21:52:57 +0000 (13:52 -0800)]
Suppress -Wformat-security in tst-error1.c.

9 years agoEliminate -Wno-format from printf/scanf tests.
Roland McGrath [Thu, 11 Dec 2014 21:46:21 +0000 (13:46 -0800)]
Eliminate -Wno-format from printf/scanf tests.

9 years agoAdd more headers to include/ for conform tests.
Joseph Myers [Thu, 11 Dec 2014 21:41:30 +0000 (21:41 +0000)]
Add more headers to include/ for conform tests.

Carlos reported failures in conform/ tests in environments where the
compiler used could only find headers in glibc's source and build
trees, not any previously installed headers
<https://sourceware.org/ml/libc-alpha/2014-09/msg00040.html>.

This patch adds wrappers for two of the affected headers to include/,
which is the normal way to make headers visible when building or
testing in directories other than the one containing the header (I
suppose these headers weren't needed in any such directories except
conform/, or other build or test failures would have resulted).  I
believe the same issue applies at least to regexp.h and re_comp.h - we
don't currently have conform/ expectations for those, but when such
expectations are added we'll also need to add header wrappers.

Tested for x86_64 (testsuite, and that installed stripped shared
libraries are unchanged by the patch).  I did *not* test a
configuration such as that in which Carlos saw failure.

* include/cpio.h: New file.
* include/fmtmsg.h: Likewise.

9 years agoClean up localedata tests printf formats, don't use -Wno-format.
Joseph Myers [Thu, 11 Dec 2014 21:15:08 +0000 (13:15 -0800)]
Clean up localedata tests printf formats, don't use -Wno-format.

9 years agoFix -Wformat-security warnings in posix/regexbug1.c
Roland McGrath [Thu, 11 Dec 2014 21:08:26 +0000 (13:08 -0800)]
Fix -Wformat-security warnings in posix/regexbug1.c

9 years agotile: add inhibit_loop_to_libcall to string functions
Chris Metcalf [Thu, 11 Dec 2014 20:13:48 +0000 (15:13 -0500)]
tile: add inhibit_loop_to_libcall to string functions

Without this, on gcc 4.8.2 the built glibc crashes when memcpy
or memset are invoked, since they call themselves recursively.
See commit 85c2e6110c9a01ec for the generic inhibit_loop_to_libcall.

9 years agoFix __sendmmsg prototype guards
Adhemerval Zanella [Thu, 11 Dec 2014 19:54:22 +0000 (14:54 -0500)]
Fix __sendmmsg prototype guards

Add __USE_GNU guards on 'socket/sys/socket.h' __sendmmsg prototype.

9 years ago * sysdeps/mips/dl-trampoline.c: Modify switch expression to have
Steve Ellcey [Thu, 11 Dec 2014 18:23:01 +0000 (10:23 -0800)]
* sysdeps/mips/dl-trampoline.c: Modify switch expression to have
integer value instead of boolean.

9 years ago2014-12-11 Steve Ellcey <sellcey@imgtec.com>
Steve Ellcey [Thu, 11 Dec 2014 16:14:17 +0000 (08:14 -0800)]
2014-12-11  Steve Ellcey  <sellcey@imgtec.com>

* malloc/malloc.c: Fix powerof2 check.

9 years agoGet rid of warning inlining failed in call to maybe_swap_uint32
Stefan Liebler [Thu, 11 Dec 2014 16:03:37 +0000 (17:03 +0100)]
Get rid of warning inlining failed in call to maybe_swap_uint32

9 years agoS/390: Get rid of assembler warning value truncated.
Stefan Liebler [Thu, 11 Dec 2014 16:02:24 +0000 (17:02 +0100)]
S/390: Get rid of assembler warning value truncated.

9 years agoConstify string parameters
Andreas Schwab [Thu, 11 Dec 2014 15:00:49 +0000 (16:00 +0100)]
Constify string parameters

9 years agopowerpc: Fix lgammal_r overflow warnings
Adhemerval Zanella [Thu, 11 Dec 2014 12:17:11 +0000 (07:17 -0500)]
powerpc: Fix lgammal_r overflow warnings

ldbl-128ibm uses ldbl-128 e_lgammal_r implementation as is, however some
constants definitions overflows for IBM long double range.  This patch
suppress the compiler warnings until the ldbl-128ibm implementation is
fixed.

9 years agoRemove obsolete comment
Andreas Schwab [Thu, 11 Dec 2014 11:45:57 +0000 (12:45 +0100)]
Remove obsolete comment

9 years agoProperly handle forced elision in pthread_mutex_trylock (bug 16657)
Andreas Schwab [Tue, 4 Mar 2014 12:00:26 +0000 (13:00 +0100)]
Properly handle forced elision in pthread_mutex_trylock (bug 16657)

9 years agoRemove duplication from gconv-modules
Andreas Schwab [Thu, 11 Dec 2014 11:33:15 +0000 (12:33 +0100)]
Remove duplication from gconv-modules

9 years agointl: Merge with gettext version 0.19.3
Will Newton [Wed, 10 Dec 2014 12:03:53 +0000 (12:03 +0000)]
intl: Merge with gettext version 0.19.3

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.

9 years ago2014-12-10 Steve Ellcey <sellcey@imgtec.com>
Steve Ellcey [Wed, 10 Dec 2014 21:46:28 +0000 (13:46 -0800)]
2014-12-10  Steve Ellcey  <sellcey@imgtec.com>

* debug/warning-nop.c: Add used atrribute.

9 years agoFix MIPS waitid build.
Joseph Myers [Wed, 10 Dec 2014 18:50:07 +0000 (18:50 +0000)]
Fix MIPS waitid build.

As previously discussed in
<https://sourceware.org/ml/libc-alpha/2012-11/msg00798.html>, MIPS (o32)
waitid has build warnings (now errors) because a function is declared
inline but functions with five-argument syscalls cannot be inlined for
MIPS o32.

This patch disables the -Winline warnings for waitid.c using a
MIPS-specific wrapper file.  As it's whole-file disabling, there's no
point in using push and pop, so just DIAG_IGNORE_NEEDS_COMMENT is
used.

* sysdeps/unix/sysv/linux/mips/mips32/waitid.c: New file.

9 years agoFix MIPS sigaction build.
Joseph Myers [Wed, 10 Dec 2014 18:45:03 +0000 (18:45 +0000)]
Fix MIPS sigaction build.

Building MIPS sigaction (for ABIs other than o32) fails because of
"'restore_rt' used but never defined", arising from static functions
being defined in asms and referred to from C code.  There is no
corresponding -W option for that warning, so this patch uses
-Wno-error for building sigaction.c.

* sysdeps/unix/sysv/linux/mips/mips64/Makefile
[$(subdir) == signal] (CFLAGS-sigaction.c): New variable.
[$(subdir) == nptl] (CFLAGS-sigaction.c): Likewise.

9 years agoFix typo in changelog.
Ondřej Bílka [Wed, 10 Dec 2014 18:20:57 +0000 (19:20 +0100)]
Fix typo in changelog.

9 years agoFix strftime wcschr namespace (bug 17634).
Joseph Myers [Wed, 10 Dec 2014 16:59:02 +0000 (16:59 +0000)]
Fix strftime wcschr namespace (bug 17634).

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.

9 years agoFix tst-ftell-active-handler.c warning.
Joseph Myers [Wed, 10 Dec 2014 16:03:23 +0000 (16:03 +0000)]
Fix tst-ftell-active-handler.c warning.

A recent change to libio/tst-ftell-active-handler.c (postdating my
last check for warnings on x86) introduced a format warning from a
long int variable used with a %zu format.  This patch fixes it by
using %ld for the format to match the variable.

Tested for x86.

* libio/tst-ftell-active-handler.c (do_ftruncate_test): Use %ld
format for long int variable.

9 years agomanual: Remove incorrect claim that qsort() can be stabilized
Anders Kaseorg [Thu, 3 Jul 2014 01:17:50 +0000 (21:17 -0400)]
manual: Remove incorrect claim that qsort() can be stabilized

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>
9 years agoUpdate NEWS
Andreas Schwab [Wed, 10 Dec 2014 15:09:45 +0000 (16:09 +0100)]
Update NEWS

9 years agoDon't touch user-controlled stdio locks in forked child (bug 12847)
Andreas Schwab [Mon, 8 Dec 2014 14:13:38 +0000 (15:13 +0100)]
Don't touch user-controlled stdio locks in forked child (bug 12847)

The stdio locks for streams with the _IO_USER_LOCK flag should not be
touched by internal code.

9 years ago[AArch64] Fix strchrnul clobbering v15
Richard Earnshaw [Wed, 10 Dec 2014 09:54:09 +0000 (09:54 +0000)]
[AArch64] Fix strchrnul clobbering v15

9 years agoUse -Werror by default, add --disable-werror.
Joseph Myers [Wed, 10 Dec 2014 01:14:48 +0000 (01:14 +0000)]
Use -Werror by default, add --disable-werror.

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.

9 years agoDisable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c.
Joseph Myers [Wed, 10 Dec 2014 00:44:54 +0000 (00:44 +0000)]
Disable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c.

This patch uses diagnostic control pragmas to disable warnings in
stdio-common/tst-printfsz.c for use of the deprecated
register_printf_function.  Because this test is testing printf_size
and printf_size_info, and the latter has the interface expected for
register_printf_function instead of the newer
register_printf_specifier, it seems correct for this test to use the
deprecated interface (wrapping printf_size_info in some way to use
register_printf_specifier would seem an excessive change to what's
tested).

Tested for x86_64.

* stdio-common/tst-printfsz.c: Include <libc-internal.h>.
(main): Disable -Wdeprecated-declarations around calls to
register_printf_function.

9 years agoDisable -Wdiv-by-zero for some tests in stdio-common/tst-unlockedio.c.
Joseph Myers [Wed, 10 Dec 2014 00:43:36 +0000 (00:43 +0000)]
Disable -Wdiv-by-zero for some tests in stdio-common/tst-unlockedio.c.

This patch uses diagnostic control pragmas to disable some
division-by-zero warnings in stdio-common/tst-unlockedio.c.  This is
another test where disabling warnings using diagnostic pragmas seems
appropriate (the warnings are not wildly inappropriate for what the
test deliberately does; the deliberate use of unusual arguments to the
macros being tested means that changing the arguments in a way that
avoids the warning would also unduly perturb what is being tested).

Tested for x86_64.

* stdio-common/tst-unlockedio.c: Include <libc-internal.h>.
(do_test): Disable -Wdiv-by-zero around some calls to
fwrite_unlocked and fread_unlocked.

9 years agoAdd macros for diagnostic control, use for scanf %a tests.
Joseph Myers [Wed, 10 Dec 2014 00:41:19 +0000 (00:41 +0000)]
Add macros for diagnostic control, use for scanf %a tests.

In <https://sourceware.org/ml/libc-alpha/2014-11/msg00326.html>,
Roland requested internal macros for use of "#pragma GCC diagnostic".

This patch adds such macros and uses them to disable -Wformat warnings
for some code testing GNU scanf %as where GCC expects C99 scanf %a
(several other stdio tests currently use -Wno-format to disable
warnings).  Limitations in GCC's diagnostic pragmas require separate
macros before and after the code generating the warnings, rather than
a single macro taking that code as an argument.

The macros are named DIAG_*_NEEDS_COMMENT to emphasise to reviewers
the need for a comment accompanying any use of them (such comments may
however just appear once for several uses of the macros for the same
issue in the same file).  I put a GCC version in the arguments to
DIAG_IGNORE_NEEDS_COMMENT, as that seems something useful to grep for
when obsoleting support for an old GCC version and needing to decide
if warning-disabling code is still relevant.

These macros should be usable for replacing existing -Wno-* use in
makefiles (as also suggested by Roland), though I have no plans to
work on that (only on use of the macros in cases where warnings are
currently present that need disabling to use -Werror).

Tested for x86_64.

* include/libc-internal.h (DIAG_PUSH_NEEDS_COMMENT): New macro.
(DIAG_POP_NEEDS_COMMENT): Likewise.
(_DIAG_STR1): Likewise.
(_DIAG_STR): Likewise.
(DIAG_IGNORE_NEEDS_COMMENT): Likewise.
* stdio-common/bug21.c: Include <libc-internal.h>.
(do_test): Disable -Wformat around call to sscanf.
* stdio-common/scanf14.c: Include <libc-internal.h>.
(main): Disable -Wformat around some calls to scanf functions.

9 years agoRemove custom pthread_once implementation on sh.
Torvald Riegel [Mon, 8 Dec 2014 17:29:18 +0000 (18:29 +0100)]
Remove custom pthread_once implementation on sh.

9 years agolibio: Fix variable aligment in tst-ftell-active-handler
Adhemerval Zanella [Mon, 8 Dec 2014 12:20:07 +0000 (07:20 -0500)]
libio: Fix variable aligment in tst-ftell-active-handler

This patch fixes a stack allocated variable to force it to have wchar_t
alignment.

9 years agoFix pthreads getrlimit, gettimeofday namespace (bug 17682).
Joseph Myers [Sat, 6 Dec 2014 23:40:48 +0000 (23:40 +0000)]
Fix pthreads getrlimit, gettimeofday namespace (bug 17682).

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.

9 years agolibio: Fix buffer overrun in tst-ftell-active-handler
Adhemerval Zanella [Fri, 5 Dec 2014 12:41:22 +0000 (07:41 -0500)]
libio: Fix buffer overrun in tst-ftell-active-handler

On 'do_ftell_test' the code:

365           if (test_modes[i].fd_mode != O_WRONLY)
366             {
367               char tmpbuf[data_len];
368
369               rewind (fp);
370
371               while (fgets_func (tmpbuf, sizeof (tmpbuf), fp) && !feof (fp));

The 'data_len' is calculated with wsclen and allocated as 'char'.  The
subsequent fgetws will then try to write at most 'data_len' wchar_t
in a buffer with just data_len 'char'.  This patch fixes it by
allocating the tmpbuf using 'wchar_t' * data_len bytes.

9 years agoDe-warning a few stubs.
Roland McGrath [Thu, 4 Dec 2014 20:31:38 +0000 (12:31 -0800)]
De-warning a few stubs.

9 years agoFix linknamespace h_errno handling.
Joseph Myers [Thu, 4 Dec 2014 17:12:46 +0000 (17:12 +0000)]
Fix linknamespace h_errno handling.

Some linknamespace tests were failing because of references to
h_errno.  References to this symbol should be allowed for XPG4, UNIX98
and XOPEN2K; this patch adds it to the list of allowed data symbols
for those standards.  (h_errno was removed in the 2008 edition of
POSIX, so POSIX2008 and XOPEN2K8 references to it are genuine bugs;
fortunately it's not a public data symbol - __h_errno_location is
public, TLS h_errno is GLIBC_PRIVATE - so the symbol can simply be
renamed to __h_errno to fix those bugs without the ABI complications
normally associated with namespace issues for data symbols.)

Tested for x86_64.

* conform/list-header-symbols.pl (%extra_syms): Add h_errno for
XPG4, UNIX98 and XOPEN2K.
* conform/Makefile (test-xfail-XOPEN2K/grp.h/linknamespace):
Remove variable.
(test-xfail-XOPEN2K/pwd.h/linknamespace): Likewise.

9 years agoFix another typo in the ChangeLog
Siddhesh Poyarekar [Thu, 4 Dec 2014 10:45:46 +0000 (16:15 +0530)]
Fix another typo in the ChangeLog

9 years agoFix date in ChangeLog
Siddhesh Poyarekar [Thu, 4 Dec 2014 03:29:27 +0000 (08:59 +0530)]
Fix date in ChangeLog

9 years agoFix up function definition style
Siddhesh Poyarekar [Thu, 4 Dec 2014 03:15:55 +0000 (08:45 +0530)]
Fix up function definition style

Don't use K&R style for function definitions.

9 years agoReset cached offset when reading to end of stream (BZ #17653)
Siddhesh Poyarekar [Thu, 4 Dec 2014 02:43:28 +0000 (08:13 +0530)]
Reset cached offset when reading to end of stream (BZ #17653)

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.

9 years agotst-ftell-active-handler: Open file with O_TRUNC for w modes
Siddhesh Poyarekar [Thu, 4 Dec 2014 02:41:07 +0000 (08:11 +0530)]
tst-ftell-active-handler: Open file with O_TRUNC for w modes

The test case fails to truncate the file when a file is intended to be
opened in w or w+ mode.  Add O_TRUNC to fix this.  The test still
succeeds with this change.

9 years agoftell: seek to end only when there are unflushed bytes (BZ #17647)
Siddhesh Poyarekar [Thu, 4 Dec 2014 02:38:37 +0000 (08:08 +0530)]
ftell: seek to end only when there are unflushed bytes (BZ #17647)

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.

9 years agoFix linknamespace getdate_err handling.
Joseph Myers [Wed, 3 Dec 2014 15:21:28 +0000 (15:21 +0000)]
Fix linknamespace getdate_err handling.

Some linknamespace tests were failing because of references to
getdate_err.  References to this symbol should be allowed for XPG4 and
later XSI standards; it was missing from the whitelist of data
symbols.  This patch adds it to that list.

Tested for x86_64.

* conform/list-header-symbols.pl (%extra_syms): Add getdate_err
for XPG4, UNIX98, XOPEN2K and XOPEN2K8.
* conform/Makefile (test-xfail-XOPEN2K/pthread.h/linknamespace):
Remove variable.
(test-xfail-XOPEN2K/time.h/linknamespace): Likewise.
(test-xfail-XOPEN2K8/pthread.h/linknamespace): Likewise.
(test-xfail-XOPEN2K8/time.h/linknamespace): Likewise.

9 years agoRemove some linknamespace test XFAILs.
Joseph Myers [Tue, 2 Dec 2014 23:38:47 +0000 (23:38 +0000)]
Remove some linknamespace test XFAILs.

It seems two of the XFAILed linknamespace tests were completely fixed
by some of my recent namespace fixes in combination (although not by
any individual one of those fixes relative to the sources used for
testing each patch, or that individual fix would also have removed the
XFAIL in question).  This patch removes those XFAILs that are no
longer needed.

Tested for x86_64.

* conform/Makefile (test-xfail-XOPEN2K/aio.h/linknamespace):
Remove variable.
(test-xfail-XOPEN2K8/aio.h/linknamespace): Likewise.

This page took 0.083087 seconds and 5 git commands to generate.