AArch64: Remove asm/ptrace.h inclusion in sys/user.h and sys/procfs.h

This patch fixes an issue observed by the Xen project, where including
signal.h exposes various PSR_MODE #defines.  This is due to the usage
in sys/user.h and sys/procfs.h of the struct user_pt_regs and
user_fpsimd_state included via asm/ptrace.h.  The namespace pollution
this inclusion introduce is already partially fixed with some #undef
of the PTRACE_* symbols, but other symbols like the PSR_MODE ones are
still present, and undefining them is not safe since a user can
include ptrace.h before user.h.

My proposition is to define the 2 structures we need in user.h and get
rid of the asm/ptrace.h inclusion.

Build and make check are clean on AArch64.

2014-05-20  Will Newton  <will.newton@linaro.org>
	    Yvan Roux  <yvan.roux@linaro.org>

	* sysdeps/unix/sysv/linux/aarch64/sys/user.h: Remove unused
	#include of asm/ptrace.h.
	(PTRACE_GET_THREAD_AREA): Remove #undef.
	(PTRACE_GETHBPREGS): Likewise.
	(PTRACE_SETHBPREGS): Likewise.
	(struct user_regs_struct): New structure.
	(struct user_fpsimd_struct): New structure.
	* sysdeps/unix/sysv/linux/aarch64/sys/procfs.h: Remove unused
	#include of asm/ptrace.h and second #include of sys/user.h.
	(PTRACE_GET_THREAD_AREA): Remove #undef.
	(PTRACE_GETHBPREGS): Likewise.
	(PTRACE_SETHBPREGS): Likewise.
	(ELF_NGREG): Use new struct user_regs_struct.
	(elf_fpregset_t): Use new struct user_fpsimd_struct.
AArch64: Fix handling of nocancel syscall failures

The current code for nocancel syscalls does not do a comparison of
the system call return value. This leads to code being generated
where the b.cs follows the svc instruction directly without setting
the flags on which the branch depends.

ChangeLog:

2014-05-20  Will Newton  <will.newton@linaro.org>

	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
	Test the return value of the system call in the nocancel case.
alpha: Define ELF_MACHINE_NO_RELA
alpha: Remove bits/siginfo.h (BZ 16966)

Using the default header instead.  This matches the kernel, which also
uses the generic header.  Fixes the sys/wait.h conform issue, where
si_band had the wrong type.
alpha: fix sa_flags type (BZ 16967)
fix nl_langinfo with static linking (BZ #16915)

For static linking the locale code avoids linking code and data for
unused categories. However for nl_langinfo we know only at runtime which
categories are used, so direct reference to every nl_current_CATEGORY
symbol should be done.

This was broken by commit bc3e1c127392da88d0c8bf2ae728147982a3d1bc where
nl_langinfo_l and nl_langinfo have been merged and some code has been
lost in the process.

In order to detect locales issues with static linking, compile a version
of tst-langinfo with static linking.

Note: this is Debian bug#747103 reported by Raphael <raphael.astier@eliot-sa.com>
Fix strtold on 32-bit sparc (and probably others) (BZ #16965)

This patch fixes an issue observed running the tst-strtod-round test on
32 bit sparc. In some conditions, strtold calls round_and_return, which in
turn calls __mpn_rshift with cnt = 0, while stdlib/rshift.c explicitly says
that cnts should satisfy 0 < CNT < BITS_PER_MP_LIMB. In this case, the code
end up doing a logical shift right of the same amount than the register,
which is undefined in the C standard.

Due to this bug, 32-bit sparc does not correctly convert the value
"0x1p-16446", but it is likely that other architectures are also
affected for other input values.
PowerPC: Fix copysignf optimization macro

This patch fixes the __copysignf optimized macro meant to internal libm
usage when used with constant value.  Without the explicit cast to
float, if it is used with const double value (for instance, on
s_casinhf.c) double constants will be used and it may lead to precision
issues in some algorithms.

It fixes the following failures on PPC64/POWER7:

Failure: Test: Real part of: cacos_downward (inf + 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_downward (inf - 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_downward (inf + 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_downward (inf - 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf + 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf - 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf + 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf - 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Update powerpc-fpu ULPs.
Fix ARM build with GCC trunk.

sysdeps/unix/sysv/linux/arm/unwind-resume.c and
sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
variables that are written in C code but only read from toplevel asms.
Current GCC trunk now optimizes away such apparently write-only static
variables, so causing a build failure.  This patch marks those
variables with __attribute_used__ to avoid that optimization.

Tested that this fixes the build for ARM.

	* sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
	(libgcc_s_resume): Use __attribute_used__.
	* sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
	Likewise.