Require autoconf 2.69

	* aclocal.m4: Require autoconf 2.69.
	* configure: Regenerated.
	* sysdeps/aarch64/configure: Likewise.
	* sysdeps/alpha/configure: Likewise.
	* sysdeps/arm/armv7/configure: Likewise.
	* sysdeps/arm/configure: Likewise.
	* sysdeps/ia64/configure: Likewise.
	* sysdeps/mach/configure: Likewise.
	* sysdeps/mips/configure: Likewise.
	* sysdeps/s390/configure: Likewise.
	* sysdeps/unix/sysv/linux/mips/configure: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/configure: Likewise.

	* sysdeps/alpha/configure.ac: Avoid empty lines at the end of
	file.
	* sysdeps/ia64/configure.ac: Likewise.
remove nested function hack_digit
Correctly size profiling reloc table (bug 17411)

During auditing or profiling modes the dynamic loader
builds a cache of the relocated PLT entries in order
to reuse them when called again through the same PLT
entry. This way the PLT entry is never completed and
the call into the resolver always results in profiling
or auditing code running.

The problem is that the PLT relocation cache size
is not computed correctly. The size of the cache
should be "Size of a relocation result structure"
x "Number of PLT-related relocations". Instead the
code erroneously computes "Size of a relocation
result" x "Number of bytes worth of PLT-related
relocations". I can only assume this was a mistake
in the understanding of the value of DT_PLTRELSZ
which is the number of bytes of PLT-related relocs.
We do have a DT_RELACOUNT entry, which is a count
for dynamic relative relocs, but we have no
DT_PLTRELCOUNT and thus we need to compute it.

This patch corrects the computation of the size of the
relocation table used by the glibc profiling code.

For more details see:
https://sourceware.org/ml/libc-alpha/2014-09/msg00513.html

	[BZ #17411]
	* elf/dl-reloc.c (_dl_relocate_object): Allocate correct amount for
	l_reloc_result.
Run tst-ld-sse-use.sh with bash.

tst-ld-sse-use.sh is a bash script, not a POSIX shell script, and so
needs to be run with $(BASH) not $(SHELL) to avoid errors of the form:

../sysdeps/x86/tst-ld-sse-use.sh: 41: ../sysdeps/x86/tst-ld-sse-use.sh: declare: not found

(when /bin/sh is dash).  This patch makes that change.

Tested for x86_64.

	* sysdeps/x86/Makefile ($(objpfx)tst-ld-sse-use.out): Run script
	with $(BASH) not $(SHELL).
Allow cross-building of tests

Allow building tests in a cross configuration without a test wrapper
defined. This is helpful for doing simple build testing of tests.

ChangeLog:

2014-09-30  Will Newton  <will.newton@linaro.org>

	* localedata/Makefile: Move assignment to tests-special
	into an ifdef testing run-built-tests.
	* timezone/Makefile: Likewise.
stdlib/tst-strtod-round.c: Fix build on ARM

Building this test on ARM fails because the prototypes for the long
double variants of the math functions are unavailable.

Add an additional include guard to math.h that enables long double math
function declarations if _LIBC_TEST is defined and define _LIBC_TEST in
stdlib/tst-strtod-round.c.

ChangeLog:

2014-09-30  Will Newton  <will.newton@linaro.org>

	* math/math.h: Define long double math functions if
	_LIBC_TEST is defined.
	* stdlib/tst-strtod-round.c: Define _LIBC_TEST.
Move some *at definitions to syscalls.list (bug 14138).

Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves definitions of various *at functions in
sysdeps/unix/sysv/linux/.

These particular moves are straightforward: there are no #includes of
these source files, no special architecture-specific versions, no
special symbol version handling and no aliases.  Each source file can
be replaced by a single line in sysdeps/unix/sysv/linux/syscalls.list.

Tested for x86_64.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/syscalls.list (fchownat): New syscall.
	(linkat): Likewise.
	(mkdirat): Likewise.
	(readlinkat): Likewise.
	(renameat): Likewise.
	(symlinkat): Likewise.
	(unlinkat): Likewise.
	* sysdeps/unix/sysv/linux/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/linkat.c: Likewise.
	* sysdeps/unix/sysv/linux/mkdirat.c: Likewise.
	* sysdeps/unix/sysv/linux/readlinkat.c: Likewise.
	* sysdeps/unix/sysv/linux/renameat.c: Likewise.
	* sysdeps/unix/sysv/linux/symlinkat.c: Likewise.
	* sysdeps/unix/sysv/linux/unlinkat.c: Likewise.
Use inline syscalls for non-cancellable versions

This patch uses inline calls (through INLINE_SYSCALL macro) to define
the non-cancellable functions macros to avoid use of the
syscall_nocancel entrypoint.
Function declaration cleanup

This patch changes the some function declaration from K&R style to
default ANSI C.
nptl: Fix testcases for new pthread cancellation mechanism

With upcoming fix for BZ#12683, pthread cancellation does not act for:

1. If syscall is blocked but with some side effects already having taken
   place (e.g. a partial read or write)
2. After the syscall has returned.

It is because program need to act on such cases (for instance, to avoid
leak of allocated resources our handling partial read/write).

This patches fixes the NPTL testcase that assumes the old behavior and
also remove the tst-cancel-wrappers.sh test (which checks for symbols
that does not exist anymore).
nptl: x86_64: remove assembly implementation

This patch removes the x86_64 assembly implementation for
pthread_cond_timedwait, pthread_cond_wait, sem_timedwait, and sem_wait
for upcoming BZ#12683 fix.  The fix require that cancellable futex calls
to be called through __syscall_cancel.

Although it not strictly require, the remove of the x86_64 specific
implementation follows the rationale:

1. The adjustments required to this fix is extensive (parameters
   save, functions calls, etc.) and there is little gain in keep an
   alternate implementation for x86_64 in term of maintanability.
2. There is no pthread_cond benchmark that shows these implementations
   are more 'optimized' that what current compilers can produce using
   generic C code.
3. The changes required also can change the exact gains this optimized is
   intended to provide.
Rewrite cancellation macros

This patch changes the way cancellation entrypoints are defined to
instead call the macro SYSCALL_CANCEL.  An usual cnacellation definition
is defined as:

  if (SINGLE_THREAD_P)
    return INLINE_SYSCALL (syscall, NARGS, args...)

  int oldtype = LIBC_CANCEL_ASYNC ();

  return INLINE_SYSCALL (syscall, NARGS, args...)

  LIBC_CANCEL_RESET (oldtype);

And it is rewrited as just:

  SYSCALL_CANCEL (syscall, args...)

The idea is to remove LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET explicit
usage.
nptl: Fix Race conditions in pthread cancellation

This patches fixes some race conditions in NPTL cancellation code by
redefining how cancellable syscalls are defined and handled.  Current
approach is to enable asynchronous cancellation prior to making the syscall
and restore the previous cancellation type once the syscall returns.

As decribed in BZ#12683, this approach shows 2 important problems:

1. Cancellation can act after the syscall has returned from kernel, but
   before userspace saves the return value.  It might result in a resource
   leak if the syscall allocated a resource or a side effect (partial
   read/write), and there is no way to program handle it with cancellation
   handlers.

2. If a signal is handled while the thread is blocked at a cancellable
   syscall, the entire signal handler runs with asynchronous cancellation
   enabled.  This can lead to issues if the signal handler call functions
   which are async-signal-safe but not async-cancel-safe.

For cancellation to work correctly, there are 5 points at which the
cancellation signal could arrive:

1. Before the final testcancel before the syscall is made.
2. Between the testcancel and the syscall.
3. While the syscall is blocked and no side effects have yet taken place.
4. While the syscall is blocked but with some side effects already having
   taken place (e.g. a partial read or write).
5. After the syscall has returned.

And GLIBC wants to act on cancellation in cases 1, 2, and 3 but not in case
4 or 5.  The proposed solution follows:

* Handling case 1 is trivial: do a conditional branch based on whether the
  thread has received a cancellation request;
* Case 2 can be caught by the signal handler determining that the saved
  program counter (from the ucontext_t) is in some address range beginning
  just before the "testcancel" and ending with the syscall instruction.
* In this case, except for certain syscalls that ALWAYS fail with EINTR
  even for non-interrupting signals, the kernel will reset the program
  counter to point at the syscall instruction during signal handling, so
  that the syscall is restarted when the signal handler returns. So, from
  the signal handler's standpoint, this looks the same as case 2, and thus
  it's taken care of.
* In this case, the kernel cannot restart the syscall; when it's
  interrupted by a signal, the kernel must cause the syscall to return
  with whatever partial result it obtained (e.g. partial read or write).
* In this case, the saved program counter points just after the syscall
  instruction, so the signal handler won't act on cancellation.
  This one is equal to 4. since the program counter is past the syscall
  instruction already.

Another case that needs handling is syscalls that fail with EINTR even
when the signal handler is non-interrupting. In this case, the syscall
wrapper code can just check the cancellation flag when the errno result
is EINTR, and act on cancellation if it's set.

The proposed GLIBC adjustments are:

1. Remove the enable_asynccancel/disable_asynccancel function usage in
   syscall definition and instead make them call a common symbol that will
   check if cancellation is enabled, call the arch-specific cancellable
   entry-point and cancel the thread when required.
2. Provide a arch-specific symbol that contains global markers. These
   markers will be used in SIGCANCEL handler to check if the interruption
   has been called in a valid syscall and if the syscalls has been
   completed or not.
3. Rewrite SIGCANCEL asynchronous handler to check for both cancelling type
   and if current IP from signal handler falls between the global markes
   and act accordingly.
4. Adjust nptl/pthread_cancel.c to send an signal instead of acting
   directly. This avoid synchronization issues about updating the
   cancellation status and also focus the logic on signal handler and
   cancellation syscall code.
5. Adjust pthread code to replace CANCEL_ASYNC/CANCEL_RESET calls to
   appropriated cancelable futex syscalls.
6. Adjust libc code to replace LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET to
   appropriated cancelable syscalls.
7. Adjust 'lowlevellock.h' arch-specific implementations to provide
   cancelable futex calls (used in libpthread code).

This patch adds the proposed changes to NPTL and the changes required
for powerpc64.
nptl: x86_64: Fix Race conditions in pthread cancellation (BZ#12683)

This patches adds the x86_64 modification required for the BZ#12683 fix.
It basically removes the enable_asynccancel/disable_asynccancel function
usage on code used on x86_64, provide a arch-specific symbol that
contains global markers to be used in SIGCANCEL handler, and remove
x86_64 assembly pthread conditional and semaphore code to use default
one (that already contains the cancel call fixes).
nptl: ppc32: Fix Race conditions in pthread cancellation (BZ#12683)

This patches adds the ppc32 modification required for the BZ#12683
fix.  It basically removes the enable_asynccancel/disable_asynccancel
function usage on code used on ppc32.
Remove i486/i586/i686 assembly implementation
nptl: i386: Fix Race conditions in pthread cancellation (BZ#12683)

Still WIP.