ARM: Improve fenv implementation
ARM: Improve fenv implementation
ptsname_r: don't leak uninitialized memory (BZ #16917)

If the fd refers to a terminal device, but not a pty master, the
TIOCGPTN ioctl returns with ENOTTY. This error is not caught, and the
possibly undefined buffer passed to ptsname_r is sent directly to the
stat64 syscall.

Fix this by using a fallback to the old method only if the TIOCGPTN
ioctl fails with EINVAL. This also fix the return value in that specific
case (it return ENOENT without this patch).

Also add tests to the ptsname_r function (and ptsname at the same time).

Note: this is Debian bug#741482, reported by Jakub Wilk <jwilk@debian.org>
SPARC: add prlimit and prlimit64 in <bits/resource.h> (BZ #16943)

prlimit and prlimit64 have been added in the main <bits/resource.h>, but
not in the SPARC specific version. Fix that.

Note: this is Debian bug#703559, reported by Emilio Pozuelo Monfort
<pochu@debian.org>
Fix variable used in sed expression in timezone/Makefile
Update Swedish translations
Split arch-fork.h from fork.h
Add stub arch-fork.h header.
ARM: Convert fork.c to arch-fork.h
Alpha: Convert fork.c to arch-fork.h
PowerPC: clean BSD Terminal Modes expectation in termios.h

This patch guard the BSD definition for terminal modes in PowerPC
specific header fixing the following conformance failures:

FAIL: conform/POSIX/termios.h/conform
FAIL: conform/POSIX2008/termios.h/conform
FAIL: conform/UNIX98/termios.h/conform
Use existing makefile variables for dependencies on glibc libraries.

glibc's Makeconfig defines some variables such as $(libm) and $(libdl)
for linking with libraries built by glibc, and nptl/Makeconfig
(included by the toplevel Makeconfig) defines others such as
$(shared-thread-library).

In some places glibc's Makefiles use those variables when linking
against the relevant libraries, but in other places they hardcode the
location of the libraries in the build tree.  This patch cleans up
various places to use the variables that already exist (in the case of
libm, replacing several duplicate definitions of a $(link-libm)
variable in subdirectory Makefiles).  (It's not necessarily exactly
equivalent to what the existing code does - in particular,
$(shared-thread-library) includes libpthread_nonshared, but is
replacing places that just referred to libpthread.so.  But I think
that change is desirable on the general principle of linking things as
close as possible to the way in which they would be linked with an
installed library, unless there is a clear reason not to do so.)

To support running tests with an installed copy of glibc without
needing the full build tree from when that copy was built, I think it
will be useful to use such variables more generally and systematically
- every time the rules for building a test refer to some file from the
build tree that's also installed by glibc, use a makefile variable so
that the installed-testing case can point those variables to installed
copies of the files.  This patch just deals with straightforward cases
where such variables already exist.

It's quite possible some uses of $(shared-thread-library) should
actually be a new $(thread-library) variable that's set appropriately
in the --disable-shared case, if those uses would in fact work without
shared libraries.  I didn't change the status quo that those cases
hardcode use of a shared library whether or not it's actually needed
(but other uses such as $(libm) and $(libdl) would now get the static
library if the shared library isn't built, when some previously
hardcoded use of the shared library - if they actually need shared
libraries, the test itself needs an enable-shared conditional anyway).

Tested x86_64.

	* benchtests/Makefile
	($(addprefix $(objpfx)bench-,$(bench-math))): Depend on $(libm),
	not $(common-objpfx)math/libm.so.
	($(addprefix $(objpfx)bench-,$(bench-pthread))): Depend on
	$(shared-thread-library), not $(common-objpfx)nptl/libpthread.so.
	* elf/Makefile ($(objpfx)noload): Depend on $(libdl), not
	$(common-objpfx)dlfcn/libdl.so.
	($(objpfx)tst-audit8): Depend on $(libm), not
	$(common-objpfx)math/libm.so.
	* malloc/Makefile ($(objpfx)libmemusage.so): Depend on $(libdl),
	not $(common-objpfx)dlfcn/libdl.so.
	* math/Makefile
	($(addprefix $(objpfx),$(filter-out $(tests-static),$(tests)))):
	Depend on $(libm), not $(objpfx)libm.so.  Do not condition on
	[$(build-shared) = yes].
	($(objpfx)test-fenv-tls): Depend on $(shared-thread-library), not
	$(common-objpfx)nptl/libpthread.so.
	* misc/Makefile ($(objpfx)tst-tsearch): Depend on $(libm), not
	$(common-objpfx)math/libm.so$(libm.so-version) or
	$(common-objpfx)math/libm.a depending on [$(build-shared) = yes].
	* nptl/Makefile ($(objpfx)tst-unload): Depend on $(libdl), not
	$(common-objpfx)dlfcn/libdl.so.
	* setjmp/Makefile (link-libm): Remove variable.
	($(objpfx)tst-setjmp-fp): Depend on $(libm), not $(link-libm).
	* stdio-common/Makefile (link-libm): Remove variable.
	($(objpfx)tst-printf-round): Depend on $(libm), not $(link-libm).
	* stdlib/Makefile (link-libm): Remove variable.
	($(objpfx)bug-getcontext): Depend on $(libm), not $(link-libm).
	($(objpfx)tst-strtod-round): Likewise.
	($(objpfx)tst-tininess): Likewise.
	($(objpfx)tst-strtod-underflow): Likewise.
	($(objpfx)tst-strtod6): Likewise.
	($(objpfx)tst-tls-atexit): Depend on $(shared-thread-library) and
	$(libdl), not $(common-objpfx)nptl/libpthread.so and
	$(common-objpfx)dlfcn/libdl.so.
ARM: soft-fp NaN representation correction

Commit 7d92b78723848ae616709eb8f0191ea067025b18 [Fix ARM NAN fraction
bits.] removed all the bits set from NANFRAC macros and, when propagated
to libgcc, regressed gcc.dg/torture/builtin-math-7.c on soft-fp arm-eabi
targets, currently ARMv6-M (`-march=armv6-m -mthumb') only.  This is
because when used to construct a NaN in the semi-raw mode, they now
build an infinity instead.  Consequently operations such as (Inf - Inf)
now produce Inf rather than NaN.  The change worked for the original
test case, posted with PR libgcc/60166, because division is made in the
canonical mode, where the quiet bit is set separately, from the fp
class.

This change brings the quiet bit back to these macros, making semi-raw
mode calculations produce the expected results again.
Fix __waitpid_nocancel link error.
Fix some termios.h conformtest failures on sparc.

	* sysdeps/unix/sysv/linux/sparc/bits/termios.h (PAGEOUT, WRAP):
	Protect with __USE_GNU.
	(TIOCSET_TEMPT): Likewise.
	(TIOCM_LE, TIOCM_DTR, TIOCM_RTS, TIOCM_ST, TIOCM_SR, TIOCM_CTS,
	TIOCM_CAR, TIOCM_RNG, TIOCM_DSR, TIOCM_CD, TIOCM_RI): Remove as
	these are already provided in bits/ioctl-types.h
Merge remote-tracking branch 'origin/roland/nptl-alpha'
alpha: Create __syscall_nocancel entry points
Fix sparc memcpy data corruption when using niagara2 optimized routines.

	* sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S: Add missing
	membar to avoid block loads/stores to overlap previous stores.