Commit Graph

19010 Commits

Author SHA1 Message Date
H.J. Lu 521266a819 Call x86-64 __setcontext directly
Since x86-64 __start_context calls the internal __setcontext:

5089: 00000000000417e0   145 FUNC    LOCAL  DEFAULT   13 __setcontext

it should call __setcontext directly.

	* sysdeps/unix/sysv/linux/x86_64/__start_context.S
	(__start_context): Call __setcontext directly.
2016-03-01 16:55:36 -08:00
Joseph Myers ad1b6d85ba Remove kernel-features.h conditionals on pre-3.2 kernels.
This patch follows up on the increase in minimum kernel version by
removing conditionals in non-x86, non-x86_64 kernel-features.h headers
that are now constant for all supported kernel versions.

	* sysdeps/unix/sysv/linux/alpha/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x020621]: Make code unconditional.
	[__LINUX_KERNEL_VERSION >= 0x030200]: Likewise.
	[__LINUX_KERNEL_VERSION < 0x020621]: Remove conditional code.
	* sysdeps/unix/sysv/linux/arm/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x020621]: Make code unconditional.
	[__LINUX_KERNEL_VERSION >= 0x020624]: Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000]: Likewise.
	* sysdeps/unix/sysv/linux/hppa/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x020622]: Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030100]: Likewise.
	[__LINUX_KERNEL_VERSION < 0x020625]: Remove conditional code.
	* sysdeps/unix/sysv/linux/ia64/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x020621]: Make code unconditional.
	[__LINUX_KERNEL_VERSION >= 0x030000]: Likewise.
	* sysdeps/unix/sysv/linux/m68k/kernel-features.h
	[__LINUX_KERNEL_VERSION < 0x030000]: Remove conditional code.
	* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x020621]: Make code unconditional.
	[__LINUX_KERNEL_VERSION < 0x020621]: Remove conditional code.
	[__LINUX_KERNEL_VERSION < 0x020625]: Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x020621]: Make code unconditional.
	[__LINUX_KERNEL_VERSION >= 0x030100]: Likewise.
	[_MIPS_SIM == _ABIN32 && __LINUX_KERNEL_VERSION < 0x020623]:
	Remove conditional code.
	* sysdeps/unix/sysv/linux/powerpc/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x020625]: Make code unconditional.
	[__LINUX_KERNEL_VERSION >= 0x030000]: Likewise.
	* sysdeps/unix/sysv/linux/sh/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x020625]: Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000]: Likewise.
	[__LINUX_KERNEL_VERSION < 0x020625]: Remove conditional code.
	* sysdeps/unix/sysv/linux/sparc/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x020621]: Make code unconditional.
	[__LINUX_KERNEL_VERSION >= 0x030000]: Likewise.
	* sysdeps/unix/sysv/linux/tile/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x030000]: Likewise.
2016-02-26 16:17:25 +00:00
Carlos O'Donell de51ff8c05 NEWS (2.23): Fix typo in bug 19048 text. 2016-02-24 22:04:13 -05:00
Carlos O'Donell 314f6deec9 Enable --localedir to set message catalog directory (Bug 14259)
In 1999 the project split "localedir" into "localedir" (path to compiled
locale archives) and "msgcatdir" (path to message catalogs). This
predates the 2002 change in the GNU Coding Standard to document the use
of "localedir" for the path to the message catalogs. It appears that
newlib, gcc, and several other projects also used "msgcatdir" at one
point or another in the past, and so it is in line with historical
precedent that glibc would also use "msgcatdir." However, given that the
GNU Coding Standard uses "localedir", we will switch to that for
consistency as a GNU project. Previous uses of --localdir didn't work
anyway (see bug 14259).

I am committing this patch in the understanding that nobody would object
to fixing #14259 as part of aligning our variable usage to the GNU
Coding Standard.

Given that previous "localedir" uses were converted to "complocaledir"
by [1], we can now convert "msgcatdir" to "localedir" and complete the
transition. With an addition to config.make.in we also fix bug 14259 and
allow users to specify the locale dependent data directory with
"--localedir" at configure time. There is still no way to control at
configure time the location of the *compiled* locale directory.

Tested on x86_64 with no regressions.

Tested using "--localedir" to specify alternate locale dependent data
directory and verified with "make install DESTDIR=/tmp/glibc".

[1] 90fe682d30
2016-02-24 20:06:04 -05:00
Carlos O'Donell 7e6eccb5f6 GB 18030-2005: Document non-rountrip and PUA mappings (bug 19575). 2016-02-24 14:31:35 -05:00
Joseph Myers f4a2740a69 Remove linux/fanotify.h configure test.
Now we require Linux 3.2 or later kernel headers everywhere, the
configure test for <linux/fanotify.h> is obsolete; this patch removes
it.

Tested for x86_64.

	* sysdeps/unix/sysv/linux/configure.ac (linux/fanotify.h): Do not
	test for header.
	* sysdeps/unix/sysv/linux/configure: Regenerated.
	* config.h.in (HAVE_LINUX_FANOTIFY_H): Remove #undef.
	* sysdeps/unix/sysv/linux/tst-fanotify.c [!HAVE_LINUX_FANOTIFY_H]:
	Remove conditional code.
	[HAVE_LINUX_FANOTIFY_H]: Make code unconditional.
2016-02-24 18:44:10 +00:00
Joseph Myers 5b4ecd3f95 Require Linux 3.2 except on x86 / x86_64, 3.2 headers everywhere.
In <https://sourceware.org/ml/libc-alpha/2016-01/msg00885.html> I
proposed a minimum Linux kernel version of 3.2 for glibc 2.24, since
Linux 2.6.32 has reached EOL.

In the discussion in February, some concerns were expressed about
compatibility with OpenVZ containers.  It's not clear that these are
real issues, given OpenVZ backporting kernel features and faking the
kernel version for guest software, as discussed in
<https://sourceware.org/ml/libc-alpha/2016-02/msg00278.html>.  It's
also not clear that supporting running GNU/Linux distributions from
late 2016 (at the earliest) on a kernel series from 2009 is a sensible
expectation.  However, as an interim step, this patch increases the
requirement everywhere except x86 / x86_64 (since the controversy was
only about those architectures); the special caveats and settings can
easily be removed later when we're ready to increase the requirements
on x86 / x86_64 (and if someone would like to raise the issue on LWN
as suggested in the previous discussion, that would be welcome).  3.2
kernel headers are required everywhere by this patch.

(x32 already requires 3.4 or later, so is unaffected by this patch.)

As usual for such a change, this patch only changes the configure
scripts and associated documentation.  The intent is to follow up with
removal of dead __LINUX_KERNEL_VERSION conditionals.  Each __ASSUME_*
or other macro that becomes dead can then be removed independently.

Tested for x86_64 and x86.

	* sysdeps/unix/sysv/linux/configure.ac (LIBC_LINUX_VERSION):
	Define to 3.2.0.
	(arch_minimum_kernel): Likewise.
	* sysdeps/unix/sysv/linux/configure: Regenerated.
	* sysdeps/unix/sysv/linux/i386/configure.ac (arch_minimum_kernel):
	Define to 2.6.32.
	* sysdeps/unix/sysv/linux/i386/configure: Regenerated.
	* sysdeps/unix/sysv/linux/x86_64/64/configure.ac
	(arch_minimum_kernel): Define to 2.6.32.
	* sysdeps/unix/sysv/linux/x86_64/64/configure: Regenerated.
	* README: Document Linux 3.2 requirement.
	* manual/install.texi (Linux): Document Linux 3.2 headers
	requirement.
	* INSTALL: Regenerated.
2016-02-24 17:15:12 +00:00
Andreas Schwab 8dfdd0794a Don't use long double math functions if NO_LONG_DOUBLE 2016-02-24 11:59:42 +01:00
Roland McGrath b2e722855b Add fts64_* to sysdeps/arm/nacl/libc.abilist 2016-02-22 15:19:56 -08:00
Dmitry V. Levin 80fcb5c583 intl: reintroduce unintentionally disabled optimization
HAVE_BUILTIN_EXPECT macro was removed by commit glibc-2.14-280-g3ce1f29,
but then its use was unintentionally reintroduced during merge with GNU
gettext 0.19.3 by commit glibc-2.20-324-g6d24885, effectively disabling
all optimization based on __builtin_expect.  As intl files are also part
of GNU gettext, HAVE_BUILTIN_EXPECT macro cannot be removed, so define
it unconditionally in config.h.in instead.

[BZ #19512]
* config.h.in (HAVE_BUILTIN_EXPECT): New macro.
2016-02-22 22:00:00 +00:00
Stefan Liebler de6e5df27e Add missing inclusion of libc-internal.h.
The build of posix/tst-dir.c fails due to undefined DIAG_* macros.
The usage of the macros were introduced in recent commit
7584a3f96d
"Deprecate readdir_r, readdir64_r [BZ #19056]".
This patch adds the missing header libc-internal.h.
2016-02-22 17:44:41 +01:00
Florian Weimer 7584a3f96d Deprecate readdir_r, readdir64_r [BZ #19056] 2016-02-20 12:56:55 +01:00
H.J. Lu 8d9c92017d [x86_64] Set DL_RUNTIME_UNALIGNED_VEC_SIZE to 8
Due to GCC bug:

   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066

__tls_get_addr may be called with 8-byte stack alignment.  Although
this bug has been fixed in GCC 4.9.4, 5.3 and 6, we can't assume
that stack will be always aligned at 16 bytes.  Since SSE optimized
memory/string functions with aligned SSE register load and store are
used in the dynamic linker, we must set DL_RUNTIME_UNALIGNED_VEC_SIZE
to 8 so that _dl_runtime_resolve_sse will align the stack before
calling _dl_fixup:

Dump of assembler code for function _dl_runtime_resolve_sse:
   0x00007ffff7deea90 <+0>:	push   %rbx
   0x00007ffff7deea91 <+1>:	mov    %rsp,%rbx
   0x00007ffff7deea94 <+4>:	and    $0xfffffffffffffff0,%rsp
                                ^^^^^^^^^^^ Align stack to 16 bytes
   0x00007ffff7deea98 <+8>:	sub    $0x100,%rsp
   0x00007ffff7deea9f <+15>:	mov    %rax,0xc0(%rsp)
   0x00007ffff7deeaa7 <+23>:	mov    %rcx,0xc8(%rsp)
   0x00007ffff7deeaaf <+31>:	mov    %rdx,0xd0(%rsp)
   0x00007ffff7deeab7 <+39>:	mov    %rsi,0xd8(%rsp)
   0x00007ffff7deeabf <+47>:	mov    %rdi,0xe0(%rsp)
   0x00007ffff7deeac7 <+55>:	mov    %r8,0xe8(%rsp)
   0x00007ffff7deeacf <+63>:	mov    %r9,0xf0(%rsp)
   0x00007ffff7deead7 <+71>:	movaps %xmm0,(%rsp)
   0x00007ffff7deeadb <+75>:	movaps %xmm1,0x10(%rsp)
   0x00007ffff7deeae0 <+80>:	movaps %xmm2,0x20(%rsp)
   0x00007ffff7deeae5 <+85>:	movaps %xmm3,0x30(%rsp)
   0x00007ffff7deeaea <+90>:	movaps %xmm4,0x40(%rsp)
   0x00007ffff7deeaef <+95>:	movaps %xmm5,0x50(%rsp)
   0x00007ffff7deeaf4 <+100>:	movaps %xmm6,0x60(%rsp)
   0x00007ffff7deeaf9 <+105>:	movaps %xmm7,0x70(%rsp)

	[BZ #19679]
	* sysdeps/x86_64/dl-trampoline.S (DL_RUNIME_UNALIGNED_VEC_SIZE):
	Renamed to ...
	(DL_RUNTIME_UNALIGNED_VEC_SIZE): This.  Set to 8.
	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.  Updated.
	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.
	* sysdeps/x86_64/dl-trampoline.h
	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.
2016-02-19 15:45:09 -08:00
Mark Wielaard eab5028860 elf.h: Add NT_ARM_SYSTEM_CALL constant.
Linux kernel 3.18 added the NT_ARM_SYSTEM_CALL regset for aarch64.

	* elf/elf.h: Add NT_ARM_SYSTEM_CALL.
2016-02-19 20:48:22 +01:00
Mark Wielaard 7aa5adfbc3 elf/elf.h: Add new 386 and X86_64 relocations from binutils.
The following new 386 and X86_64 were added to binutils. They are
non-dynamic relocations, so don't need direct handling in glibc.
But other programs, like elfutils, use the glibc elf.h definitions
for the names and numbers when inspecting ET_REL files.

R_386_GOT32X was proposed in
https://groups.google.com/forum/#!topic/ia32-abi/GbJJskkid4I

X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX were proposed in
https://groups.google.com/forum/#!topic/x86-64-abi/n9AWHogmVY0

There also used to be R_X86_64_PC32_BND and R_X86_64_PLT32_BND
but those already got deprecated in
https://groups.google.com/d/msg/x86-64-abi/-hdQyMixt8Y/XFDOvioG85cJ

	* elf/elf.h (R_386_GOT32X): New.
	(R_386_NUM): Update.
	(R_X86_64_GOTPCRELX: New.
	(R_X86_64_REX_GOTPCRELX): New.
	(R_X86_64_NUM): Update.
2016-02-19 20:48:22 +01:00
Mike Frysinger a28605b229 test-skeleton: increase default TIMEOUT to 20 seconds
The vast majority of timeouts I've seen w/glibc tests are due to:
 - slow system (e.g. <1 GHz cpu)
 - loaded system (e.g. lots of parallelism)
Even then, I've seen timeouts on system I don't generally consider
slow, or even loaded, and considering TIMEOUT is set to <=10 in ~60
tests (and <=20 in ~75 tests), it seems I'm not alone.  I've just
gotten in the habit of doing `export TIMEOUTFACTOR=10` on all my
setups.

In the edge case where there is a bug in the test and the timeout is
hit, I think we all agree that's either a problem with the test or a
real bug in the library somewhere.  In either case, the incident rate
should be low, so catering to that seems like the wrong trade-off.

Other developers too usually set large timeout factors.  Increase the
default to 20 seconds to match reality.
2016-02-19 13:48:56 -05:00
Carlos O'Donell d615a47355 nptl: support thread stacks that grow up
Gentoo has been carrying this for all arches since 2.17.

URL: http://bugs.gentoo.org/301642
2016-02-19 12:41:29 -05:00
Adhemerval Zanella 11fca9615f Update NEWS with 2.24 template 2016-02-19 15:30:48 -02:00
Joseph Myers 7b428e744b Fix ldbl-128ibm nextafterl, nexttowardl sign of zero result (bug 19678).
The ldbl-128ibm implementation of nextafterl / nexttowardl returns -0
in FE_DOWNWARD mode when taking the next value below the least
positive subnormal, when it should return +0.  This patch fixes it to
check explicitly for this case.

Tested for powerpc.

	[BZ #19678]
	* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl):
	Ensure +0.0 is returned when taking the next value below the least
	positive value.
2016-02-19 17:19:53 +00:00
Florian Weimer 59eda029a8 malloc: Remove NO_THREADS
No functional change.  It was not possible to build without
threading support before.
2016-02-19 17:07:45 +01:00
Florian Weimer ca135f824b malloc: Remove max_total_mem member form struct malloc_par
Also note that sumblks in struct mallinfo is always 0.
No functional change.
2016-02-19 17:07:04 +01:00
Florian Weimer 00d4e2ea35 malloc: Remove arena_mem variable
The computed value is never used.  The accesses were data races.
2016-02-19 17:06:33 +01:00
Florian Weimer aff8c7a9a7 res_ninit: Update comment
Since commit e66e7419a6 (Actually make
it possible to user the default name server.), the default is
INADDR_LOOPBACK, not INADDR_ANY.
2016-02-19 17:00:47 +01:00
Florian Weimer 6793dd51d8 Improve file descriptor checks for posix_spawn actions [BZ #19505] 2016-02-19 14:49:38 +01:00
Florian Weimer 2a38688932 tst-malloc-thread-exit: Use fewer system resources 2016-02-19 14:12:56 +01:00
Joseph Myers c091488e51 Fix ldbl-128ibm powl overflow handling (bug 19674).
The ldbl-128ibm implementation of powl has some problems in the case
of overflow or underflow, which are mainly visible in non-default
rounding modes.

* When overflow or underflow is detected early, the correct sign of an
  overflowing or underflowing result is not allowed for.  This is
  mostly hidden in the default rounding mode by the errno-setting
  wrappers recomputing the result (except in non-default
  error-handling modes such as -lieee), but visible in other rounding
  modes where a result that is not zero or infinity causes the
  wrappers not to do the recomputation.

* The final scaling is done before the sign is incorporated in the
  result, but should be done afterwards for correct overflowing and
  underflowing results in directed rounding modes.

This patch fixes those problems.  Tested for powerpc.

	[BZ #19674]
	* sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Include
	sign in overflowing and underflowing results when overflow or
	underflow is detected early.  Include sign in result before rather
	than after scaling.
2016-02-19 01:07:40 +00:00
Joseph Myers 9120a57f48 Fix ldbl-128ibm remainderl, remquol equality tests (bug 19603).
The ldbl-128ibm implementations of remainderl and remquol have logic
resulting in incorrect tests for equality of the absolute values of
the arguments.  Equality is tested based on the integer
representations of the high and low parts, with the sign bit masked
off the high part - but when this changes the sign of the high part,
the sign of the low part needs to be changed as well, and failure to
do this means arguments are wrongly treated as equal when they are
not.

This patch fixes the logic to adjust signs of low parts as needed.
Tested for powerpc.

	[BZ #19603]
	* sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
	(__ieee754_remainderl): Adjust sign of integer version of low part
	when taking absolute value of high part.
	* sysdeps/ieee754/ldbl-128ibm/s_remquol.c (__remquol): Likewise.
	* math/libm-test.inc (remainder_test_data): Add another test.
	(remquo_test_data): Likewise.
2016-02-19 00:55:46 +00:00
Joseph Myers 0fed79a827 Fix ldbl-128ibm fmodl handling of equal arguments with low part zero (bug 19602).
The ldbl-128ibm implementation of fmodl has logic to detect when the
first argument has absolute value less than or equal to the second.
This logic is only correct for nonzero low parts; if the high parts
are equal and the low parts are zero, then the signs of the low parts
(which have no semantic effect on the value of the long double number)
can result in equal values being wrongly treated as unequal, and an
incorrect result being returned from fmodl.  This patch fixes this by
checking for the case of zero low parts.

Although this does show up in tests from libm-test.inc (both tests of
fmodl, and, indirectly, of remainderl / dreml), the dependence on
non-semantic zero low parts means that test shouldn't be expected to
reproduce it reliably; thus, this patch adds a standalone test that
sets up affected values using unions.

Tested for powerpc.

	[BZ #19602]
	* sysdeps/ieee754/ldbl-128ibm/e_fmodl.c (__ieee754_fmodl): Handle
	equal high parts and both low parts zero specially.
	* sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c: New test.
	* sysdeps/ieee754/ldbl-128ibm/Makefile [$(subdir) = math] (tests):
	Add test-fmodl-ldbl-128ibm.
2016-02-18 22:54:07 +00:00
Joseph Myers e2c631384a Fix ldbl-128ibm fmodl handling of subnormal results (bug 19595).
The ldbl-128ibm implementation of fmodl has completely bogus logic for
subnormal results (in this context, that means results for which the
result is in the subnormal range for double, not results with absolute
value below LDBL_MIN), based on code used for ldbl-128 that is correct
in that case but incorrect in the ldbl-128ibm use.  This patch fixes
it to convert the mantissa into the correct form expected by
ldbl_insert_mantissa, removing the other cases of the code that were
incorrect and in one case unreachable for ldbl-128ibm.  A correct
exponent value is then passed to ldbl_insert_mantissa to reflect the
shifted result.

Tested for powerpc.

	[BZ #19595]
	* sysdeps/ieee754/ldbl-128ibm/e_fmodl.c (__ieee754_fmodl): Use
	common logic for all cases of shifting subnormal results.  Do not
	insert sign bit in shifted mantissa.  Always pass -1023 as biased
	exponent to ldbl_insert_mantissa in subnormal case.
2016-02-18 22:42:06 +00:00
Joseph Myers b9a76339be Fix ldbl-128ibm roundl for non-default rounding modes (bug 19594).
The ldbl-128ibm implementation of roundl is only correct in
round-to-nearest mode (in other modes, there are incorrect results and
overflow exceptions in some cases).  This patch reimplements it along
the lines used for floorl, ceill and truncl, using __round on the high
part, and on the low part if the high part is an integer, and then
adjusting in the cases where this is incorrect.

Tested for powerpc.

	[BZ #19594]
	* sysdeps/ieee754/ldbl-128ibm/s_roundl.c (__roundl): Use __round
	on high and low parts then adjust result and use
	ldbl_canonicalize_int if needed.
2016-02-18 22:24:32 +00:00
Joseph Myers e2310a27be Fix ldbl-128ibm truncl for non-default rounding modes (bug 19593).
The ldbl-128ibm implementation of truncl is only correct in
round-to-nearest mode (in other modes, there are incorrect results and
overflow exceptions in some cases).  It is also unnecessarily
complicated, rounding both high and low parts to the nearest integer
and then adjusting for the semantics of trunc, when it seems more
natural to take the truncation of the high part (__trunc optimized
inline versions can be used), and the floor or ceiling of the low part
(depending on the sign of the high part) if the high part is an
integer, as was done for floorl and ceill.  This patch makes it use
that simpler approach.

Tested for powerpc.

	[BZ #19593]
	* sysdeps/ieee754/ldbl-128ibm/s_truncl.c (__truncl): Use __trunc
	on high part and __floor or __ceil on low part then use
	ldbl_canonicalize_int if needed.
2016-02-18 21:52:07 +00:00
Joseph Myers 8a9fa0086d Fix ldbl-128ibm ceill for non-default rounding modes (bug 19592).
The ldbl-128ibm implementation of ceill is only correct in
round-to-nearest mode (in other modes, there are incorrect results and
overflow exceptions in some cases).  It is also unnecessarily
complicated, rounding both high and low parts to the nearest integer
and then adjusting for the semantics of ceil, when it seems more
natural to take the ceiling of the high part (__ceil optimized inline
versions can be used), and that of the low part if the high part is an
integer, as was done for floorl.  This patch makes it use that simpler
approach.

Tested for powerpc.

	[BZ #19592]
	* sysdeps/ieee754/ldbl-128ibm/s_ceill.c (__ceill): Use __ceil on
	high and low parts then use ldbl_canonicalize_int if needed.
2016-02-18 21:40:39 +00:00
Joseph Myers 1833769e19 Fix ldbl-128ibm floorl for non-default rounding modes (bug 17899).
The ldbl-128ibm implementation of floorl is only correct in
round-to-nearest mode (in other modes, there are incorrect results and
overflow exceptions in some cases going beyond the incorrect signs of
zero results noted in bug 17899).  It is also unnecessarily
complicated, rounding both high and low parts to the nearest integer
and then adjusting for the semantics of floor, when it seems more
natural to take the floor of the high part (__floor optimized inline
versions can be used), and that of the low part if the high part is an
integer.  This patch makes it use that simpler approach, with a
canonicalization that works in all rounding modes (given that the only
way the result can be noncanonical is if taking the floor of a
negative noninteger low part increased its exponent).

Tested for powerpc, where over a thousand failures are removed from
test-ldouble.out (floorl problems affect many powl tests).

	[BZ #17899]
	* sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_canonicalize_int):
	New function.
	* sysdeps/ieee754/ldbl-128ibm/s_floorl.c (__floorl): Use __floor
	on high and low parts then use ldbl_canonicalize_int if needed.
2016-02-18 21:31:10 +00:00
Adhemerval Zanella 656ee792a9 Regenerated configure scripts. 2016-02-18 18:36:10 -02:00
Adhemerval Zanella eabd6f49d1 Regenerate libc.pot for 2.23. 2016-02-18 17:48:27 -02:00
Adhemerval Zanella 31ef23afe2 Updated translations for 2.23. 2016-02-18 17:48:22 -02:00
Adhemerval Zanella c6f391dbf9 Open development for 2.24. 2016-02-18 16:11:58 -02:00
Adhemerval Zanella ab30899d88 Update version.h and include/features.h for 2.23 release 2016-02-18 15:54:00 -02:00
Adhemerval Zanella ad372e296b Update NEWS with fixed bugs for 2.23 release 2016-02-18 15:51:45 -02:00
H.J. Lu 16396c41de Add _STRING_INLINE_unaligned and string_private.h
As discussed in

https://sourceware.org/ml/libc-alpha/2015-10/msg00403.html

the setting of _STRING_ARCH_unaligned currently controls the external
GLIBC ABI as well as selecting the use of unaligned accesses withing
GLIBC.

Since _STRING_ARCH_unaligned was recently changed for AArch64, this
would potentially break the ABI in GLIBC 2.23, so split the uses and add
_STRING_INLINE_unaligned to select the string ABI. This setting must be
fixed for each target, while _STRING_ARCH_unaligned may be changed from
release to release.  _STRING_ARCH_unaligned is used unconditionally in
glibc.  But <bits/string.h>, which defines _STRING_ARCH_unaligned, isn't
included with -Os.  Since _STRING_ARCH_unaligned is internal to glibc and
may change between glibc releases, it should be made private to glibc.
_STRING_ARCH_unaligned should defined in the new string_private.h heade
file which is included unconditionally from internal <string.h> for glibc
build.

	[BZ #19462]
	* bits/string.h (_STRING_ARCH_unaligned): Renamed to ...
	(_STRING_INLINE_unaligned): This.
	* include/string.h: Include <string_private.h>.
	* string/bits/string2.h: Replace _STRING_ARCH_unaligned with
	_STRING_INLINE_unaligned.
	* sysdeps/aarch64/bits/string.h (_STRING_ARCH_unaligned): Removed.
	(_STRING_INLINE_unaligned): New.
	* sysdeps/aarch64/string_private.h: New file.
	* sysdeps/generic/string_private.h: Likewise.
	* sysdeps/m68k/m680x0/m68020/string_private.h: Likewise.
	* sysdeps/s390/string_private.h: Likewise.
	* sysdeps/x86/string_private.h: Likewise.
	* sysdeps/m68k/m680x0/m68020/bits/string.h
	(_STRING_ARCH_unaligned): Renamed to ...
	(_STRING_INLINE_unaligned): This.
	* sysdeps/s390/bits/string.h (_STRING_ARCH_unaligned): Renamed
	to ...
	(_STRING_INLINE_unaligned): This.
	* sysdeps/sparc/bits/string.h (_STRING_ARCH_unaligned): Renamed
	to ...
	(_STRING_INLINE_unaligned): This.
	* sysdeps/x86/bits/string.h (_STRING_ARCH_unaligned): Renamed
	to ...
	(_STRING_INLINE_unaligned): This.
2016-02-18 14:55:29 -02:00
Andrew Senkevich a5df3210a6 Use PIC relocation in ALIAS_IMPL
Since libmvec_nonshared.a may be linked into shared objects, ALIAS_IMPL
should use PIC relocation.

	[BZ #19590]
	* sysdeps/x86_64/fpu/svml_finite_alias.S (ALIAS_IMPL): Use PIC
	relocation.
2016-02-17 14:23:32 -08:00
Carlos O'Donell e9db92d3ac CVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug 18665).
* A stack-based buffer overflow was found in libresolv when invoked from
  libnss_dns, allowing specially crafted DNS responses to seize control
  of execution flow in the DNS client.  The buffer overflow occurs in
  the functions send_dg (send datagram) and send_vc (send TCP) for the
  NSS module libnss_dns.so.2 when calling getaddrinfo with AF_UNSPEC
  family.  The use of AF_UNSPEC triggers the low-level resolver code to
  send out two parallel queries for A and AAAA.  A mismanagement of the
  buffers used for those queries could result in the response of a query
  writing beyond the alloca allocated buffer created by
  _nss_dns_gethostbyname4_r.  Buffer management is simplified to remove
  the overflow.  Thanks to the Google Security Team and Red Hat for
  reporting the security impact of this issue, and Robert Holiday of
  Ciena for reporting the related bug 18665. (CVE-2015-7547)

See also:
https://sourceware.org/ml/libc-alpha/2016-02/msg00416.html
https://sourceware.org/ml/libc-alpha/2016-02/msg00418.html
2016-02-16 21:29:32 -05:00
Carlos O'Donell 2c8f75f79b Update INSTALL with latest versions tested to work. 2016-02-14 20:54:29 -05:00
Carlos O'Donell 3c47c83a97 Ensure isinff, isinfl, isnanf, and isnanl are defined (Bug 19439)
In ICO C++11 mode ensure that isinff, isinfl, isnanf, and isnanl
are defined.  These functions were accidentally removed from the
header as part of commit d9b965fa56,
but being GNU extensions, they should have been left in place.
2016-02-14 20:09:52 -05:00
Florian Weimer f34f146e68 hsearch_r: Apply VM size limit in test case 2016-02-12 12:57:40 +01:00
Szabolcs Nagy e535ce2501 [ARM] add missing -funwind-tables to test case (bug 19529)
stdlib/tst-makecontext test failed on arm because it used backtrace
without -funwind-tables.
2016-02-11 17:27:20 +00:00
Rajalakshmi Srinivasaraghavan ebf1264f61 powerpc: Regenerate libm-test-ulps 2016-02-04 16:40:54 -02:00
Joseph Myers 5163b4b76f Fix MIPS mmap negative offset handling for consistency (bug 19550).
The handling of negative offsets in MIPS mmap is inconsistent with
other architectures, as shown by failure of the test
posix/tst-mmap-offset for o32 and n32.  The MIPS mmap syscall uses a
signed argument and does a signed arithmetic shift on it, whereas the
glibc semantics expected by that test are for the offset to be
considered as a large positive offset.  This patch makes MIPS
consistent with other architectures as far as possible by using the
mmap2 syscall on o32 (#including the generic implementation), and
making mmap not an alias for mmap64 for n32, with a custom
implementation for n32 that zero-extends the offset argument to 64-bit
before calling the mmap syscall.

Tested for MIPS64 (o32, n32, n64).

	[BZ #19550]
	* sysdeps/unix/sysv/linux/mips/mips32/mmap.c: New file.
	* sysdeps/unix/sysv/linux/mips/mips64/mmap64.c: Move to ....
	* sysdeps/unix/sysv/linux/mips/mips64/n64/mmap64.c: ... here.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/mmap.c: New file.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list (mmap64):
	New syscall entry.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list (mmap):
	New syscall entry.
	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (mmap): Remove
	syscall entry.
2016-02-01 18:20:21 +00:00
Mark Wielaard 0f0f4db5b7 Revert "elf/elf.h: Add new 386 and X86_64 relocations from binutils."
This reverts commit 3da75f0881.

glibc 2.23 hard freeze doesn't allow this change at this time.
2016-01-31 18:34:27 +01:00
Mark Wielaard 3da75f0881 elf/elf.h: Add new 386 and X86_64 relocations from binutils.
The following new 386 and X86_64 were added to binutils. They are
non-dynamic relocations, so don't need direct handling in glibc.
But other programs, like elfutils, use the glibc elf.h definitions
for the names and numbers when inspecting ET_REL files.

R_386_GOT32X was proposed in
https://groups.google.com/forum/#!topic/ia32-abi/GbJJskkid4I

X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX were proposed in
https://groups.google.com/forum/#!topic/x86-64-abi/n9AWHogmVY0

There also used to be R_X86_64_PC32_BND and R_X86_64_PLT32_BND
but those already got deprecated in
https://groups.google.com/d/msg/x86-64-abi/-hdQyMixt8Y/XFDOvioG85cJ

	* elf/elf.h (R_386_GOT32X): New.
	(R_386_NUM): Update.
	(R_X86_64_GOTPCRELX: New.
	(R_X86_64_REX_GOTPCRELX): New.
	(R_X86_64_NUM): Update.
2016-01-31 11:44:32 +01:00
Florian Weimer bae7c7c764 Improve check against integer wraparound in hcreate_r [BZ #18240] 2016-01-28 13:59:11 +01:00
Steve Ellcey 8a71d2e27f Fix MIPS64 memcpy regression.
The MIPS memcpy optimizations at
<https://sourceware.org/ml/libc-alpha/2015-10/msg00597.html>
introduced a bug causing many string function tests to fail with
segfaults for n32 and n64:

FAIL: string/stratcliff
FAIL: string/test-bcopy
FAIL: string/test-memccpy
FAIL: string/test-memcmp
FAIL: string/test-memcpy
FAIL: string/test-memmove
FAIL: string/test-mempcpy
FAIL: string/test-stpncpy
FAIL: string/test-strncmp
FAIL: string/test-strncpy

(Some failures in other directories could also be caused by this bug.)

The problem is that after the check for whether a word of input is
left that can be copied as a word before moving to byte copies, a load
can occur in the branch delay slot, resulting in a segfault if we are
at the end of a page and the following page is unmapped.  I don't see
how this would have passed the tests as reported in the original patch
posting (different kernel configurations affecting the code setting up
unmapped pages, maybe?), since the tests in question don't appear to
have changed recently.

This patch moves a later instruction into the delay slot, as suggested
at <https://sourceware.org/ml/libc-alpha/2016-01/msg00584.html>.

Tested for n32 and n64.

2016-01-28  Steve Ellcey  <sellcey@imgtec.com>
            Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/mips/memcpy.S (MEMCPY_NAME) [USE_DOUBLE]: Avoid word
	load in branch delay slot when less than a word of input left.
2016-01-28 01:52:05 +00:00
Andreas Schwab 4fb66fac3a Remove unused variables
They are flagged by -Wunused-const-variable.
2016-01-27 09:30:16 +01:00
David S. Miller 6ef1cb957e Update localplt.data for 32-bit sparc.
* sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data: Add _Q_cmp.
2016-01-26 16:16:38 -08:00
David S. Miller 82e5836613 Define __sqrtl_finite on sparc 32-bit with correct symbol version.
* sysdeps/sparc/sparc32/Versions (GLIBC_2.23): Add entry for __sqrtl_finite.
	* sysdeps/sparc/sparc32/fpu/e_sqrtl.c (__sqrtl_finite): Define instead using
	versioned_symbol.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Fix ordering of entries.
2016-01-25 16:07:15 -08:00
David S. Miller 7a18c2a0c1 Adjust sparc 32-bit __sqrtl_finite version tag.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Move
	__sqrtl_finite to GLIBC_2.23
2016-01-25 10:42:17 -08:00
Richard Henderson 89cfb554b8 Update Alpha libm-test-ulps 2016-01-25 10:43:41 -08:00
Andreas Schwab 5aded6f2ab Don't do lock elision on an error checking mutex (bug 17514)
Error checking mutexes are not supposed to be subject to lock elision.
That would defeat the error checking nature of the mutex because lock
elision doesn't record ownership.
2016-01-25 16:26:07 +01:00
Paul E. Murphy 9200e581e5 Cleanup ppc bits/ipc.h
Ages ago (commit e9dcb08) the ipc syscalls were inlined and
eventually abstracted away any need for direct __ipc calls.
2016-01-25 10:35:21 -02:00
Stefan Liebler f69f887092 S390: Fix build failure in test string/tst-endian.c with gcc 6.
Building string/tst-endian.c with gcc 6 produces an build warning/error on s390 (big endian machine):
gcc tst-endian.c -c -std=gnu11 -fgnu89-inline  -O2 or -O3 ...
tst-endian.c: In function ‘do_test’:
tst-endian.c:16:30: error: self-comparison always evaluates to false [-Werror=tautological-compare]
    if (htobe16 (be16toh (i)) != i)
                              ^~
...

See definitions of htobexx, bexxtoh in string/endian.h:
...

This patch silences these warnings with DIAG_* macros if build with gcc 6
and newer.

The same warnings occur on little endian machines with the
"htoleXX (leXXtoh (i)) != i" if-statements.

ChangeLog:

	* string/tst-endian.c: Include <libc-internal.h>.
	(do_test): Ignore tautological-compare warnings around
	"htobeXX (beXXtoh (i)) != i" and
	"htoleXX (leXXtoh (i)) != i" if-statements.
2016-01-25 12:44:46 +01:00
David S. Miller c34ae92056 Fix missing __sqrtl_finite symbol in libm on sparc 32-bit.
* sysdeps/sparc/sparc32/fpu/e_sqrtl.c: New file.
	* sysdeps/sparc/sparc32/soft-fp/q_sqrt.c (__ieee754_sqrtl): Remove alias.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Add __sqrtl_finite.
2016-01-24 21:14:12 -08:00
David S. Miller a9d460a977 Update sparc ULPS.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2016-01-24 21:12:58 -08:00
Maciej W. Rozycki d5f2798a0a MIPS: Set the required Linux kernel version to 4.5.0 for 2008 NaN
Complement the addition of the required kernel support, present upstream
as from commit 2b5e869ecfcb3112f7e1267cb0328f3ff6d49b18 ("MIPS: ELF:
Interpret the NAN2008 file header flag") and released with Linux 4.5-rc1
on Jan 24th, 2016.

	* sysdeps/unix/sysv/linux/mips/configure.ac: Set
	`arch_minimum_kernel' to 4.5.0 if 2008 NaN encoding is used.
	* sysdeps/unix/sysv/linux/mips/configure: Regenerate.
2016-01-25 00:19:27 +00:00
Paul E. Murphy fad7e4d706 Fix nptl/tst-setuid3.c
pthread_barrier_wait can return either PTHREAD_BARRIER_SERIAL_THREAD
or 0.  Posix makes no guarantees about which thread return the unique
value.

Additionally, pthread_join was not called despite seemingly checking
for the error.
2016-01-22 14:21:03 -02:00
Paul E. Murphy af8ea0f449 powerpc: Fix macro usage of htm builtins
Some extraneous semicolons were included in a
recent patch which causes a build failure with
newer compilers.
2016-01-22 14:13:08 -02:00
Chung-Lin Tang fba91f1232 Maintainence patch for nios2: update ULPS file and localplt.data changes. 2016-01-21 22:58:03 -08:00
Chris Metcalf 2a9feb9277 Silence some false positive warnings for gcc 4.7 2016-01-21 09:11:17 -05:00
Roland McGrath a3140836c8 NaCl: Fix unused variable errors in lowlevellock-futex.h macros. 2016-01-20 13:57:14 -08:00
Paul Pluzhnikov b274130206 2016-01-20 Paul Pluzhnikov <ppluzhnikov@google.com>
[BZ #19490]
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S (pthread_cond_broadcast): Use ENTRY/END
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S (pthread_cond_signal): Likewise
* sysdeps/x86_64/nptl/pthread_spin_lock.S (pthread_spin_lock): Likewise
* sysdeps/x86_64/nptl/pthread_spin_trylock.S (pthread_spin_trylock): Likewise
* sysdeps/x86_64/nptl/pthread_spin_unlock.S (pthread_spin_unlock): Likewise
2016-01-20 13:39:20 -08:00
Joseph Myers dcb133b7a4 Fix __finitel libm compat symbol version.
The changes to restrict implementation-namespace symbol aliases such
as __finitel to compat symbols used code for __finitel in libm
analogous to that for __finitel in libc.  However, the versions for
the two symbols are actually different, GLIBC_2.0 in libc and
GLIBC_2.1 in libm.  This patch fixes the handling of the libm compat
symbol.

Tested for mips (o32), where it fixes an ABI test failure.

	* sysdeps/ieee754/dbl-64/s_finite.c
	[NO_LONG_DOUBLE && LDBL_CLASSIFY_COMPAT] (__finitel): Define
	compat symbol at version GLIBC_2_1 and use GLIBC_2_1 in
	SHLIB_COMPAT condition for libm, not GLIBC_2_0.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
	[NO_LONG_DOUBLE && LDBL_CLASSIFY_COMPAT] (__finitel): Likewise.
2016-01-20 19:04:43 +00:00
Joseph Myers 00b85374a9 Update localplt.data for powerpc-nofpu.
Testing for powerpc-nofpu showed that localplt.data was out of date.
Two new soft-fp functions showed up in the list: __gtsf2 and
__unordsf2; this patch adds these as optional.  __signbit and
__signbitl no longer appear as local PLT entries; given the move to
__builtin_signbit* for all GCC versions supported for building glibc
(and given the use of the type-generic signbit macro within glibc),
those can safely be removed from the list, which this patch does.

Tested for powerpc-nofpu.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data
	(__gtsf2): Add as optional for libc.so.
	(__unordsf2): Likewise.
	(__signbit): Remove for libc.so.
	(__signbitl): Likewise.
2016-01-20 18:19:10 +00:00
Stefan Liebler ab9f6255ab S390: Fix build error in iconvdata/bug-iconv11.c.
This fixes the following build error on S390 31bit while building the test
iconvdata/bug-iconv11.c with gcc 5.3:
bug-iconv11.c: In function ‘test_ibm93x’:
bug-iconv11.c:59:11: error: format ‘%td’ expects argument of type ‘ptrdiff_t’, but argument 2 has type ‘size_t {aka long unsigned int}’ [-Werror=format=]
   printf ("  ==> %td: %s\n"
           ^
cc1: all warnings being treated as errors

This patch uses %zu format specifier for argument size_t ret instead of %td.

ChangeLog:

	* iconvdata/bug-iconv11.c (test_ibm93x):
	Use %zu printf format specifier for size_t argument.
2016-01-20 08:32:37 +01:00
Joseph Myers 2e3d0de31f Fix ulps regeneration for *-finite tests.
On running tests after from-scratch ulps regeneration, I found that
some libm tests failed with ulps in excess of those recorded in the
from-scratch regeneration, which should never happen unless those ulps
exceed the limit on ulps that can go in libm-test-ulps files.

Failure: Test: atan2_upward (inf, -inf)
Result:
 is:          2.35619498e+00   0x1.2d97ccp+1
 should be:   2.35619450e+00   0x1.2d97c8p+1
 difference:  4.76837159e-07   0x1.000000p-21
 ulp       :  2.0000
 max.ulp   :  1.0000
Maximal error of `atan2_upward'
 is      : 2 ulp
 accepted: 1 ulp
Failure: Test: carg_upward (-inf + inf i)
Result:
 is:          2.35619498e+00   0x1.2d97ccp+1
 should be:   2.35619450e+00   0x1.2d97c8p+1
 difference:  4.76837159e-07   0x1.000000p-21
 ulp       :  2.0000
 max.ulp   :  1.0000
Maximal error of `carg_upward'
 is      : 2 ulp
 accepted: 1 ulp

The problem comes from the addition of tests for the finite-math-only
versions of libm functions.  Those tests share ulps with the default
function variants.  make regen-ulps runs the default tests before the
finite-math-only tests, concatenating the resulting ulps before
feeding them to gen-libm-test.pl to generate a new libm-test-ulps
file.  But gen-libm-test.pl always takes the last ulps value given for
any (function, type) pair.  So, if the largest ulps for a function
come from non-finite inputs, a from-scratch regeneration loses those
ulps.

This patch fixes gen-libm-test.pl, in the case where there are
multiple ulps values for a (function, type) pair - which can only
happen as part of a regeneration - to take the largest ulps value
rather than the last one.

Tested for ARM / MIPS / powerpc-nofpu.

	* math/gen-libm-test.pl (parse_ulps): Do not reduce
	already-recorded ulps.
	* sysdeps/arm/libm-test-ulps: Regenerated.
	* sysdeps/mips/mips32/libm-test-ulps: Likewise.
	* sysdeps/mips/mips64/libm-test-ulps: Likewise.
	* sysdeps/powerpc/nofpu/libm-test-ulps: Likewise.
2016-01-19 21:42:58 +00:00
Andrew Senkevich df782dc690 Fixed build with assembler w/o AVX-512 support.
* sysdeps/x86_64/multiarch/ifunc-impl-list.c: Fixed build with
    assembler not supporting AVX-512.
2016-01-19 14:34:53 +03:00
Stefan Liebler 415031f734 S390: Regenerate ULPs
I've regenerated ulps from scratch for s390/s390x.
All math testcases are passing afterwards.

ChangeLog:

	* sysdeps/s390/fpu/libm-test-ulps: Regenerated.
2016-01-19 10:02:44 +01:00
Joseph Myers 204a038e57 Regenerate MIPS libm-test-ulps.
* sysdeps/mips/mips32/libm-test-ulps: Regenerated.
	* sysdeps/mips/mips64/libm-test-ulps: Likewise.
2016-01-18 23:32:40 +00:00
Joseph Myers 844c75aa06 Regenerate powerpc-nofpu libm-test-ulps.
* sysdeps/powerpc/nofpu/libm-test-ulps: Regenerated.
2016-01-18 23:02:03 +00:00
Joseph Myers a99236df89 Regenerate ARM libm-test-ulps.
* sysdeps/arm/libm-test-ulps: Regenerated.
2016-01-18 22:55:47 +00:00
Paul Pluzhnikov 8d079ae0cd [BZ #19451]
* math/Makefile (libm-vec-tests): Move libraries after wrappers.o to fix
"make check" link failure on Ubuntu.
2016-01-18 14:36:28 -08:00
Stefan Liebler c4d17461e0 S/390: Do not raise inexact exception in lrint/lround. [BZ #19486]
I get some math test-failures on s390 for float/double/ldouble for
various lrint/lround functions like:
lrint (0x1p64): Exception "Inexact" set
lrint (-0x1p64): Exception "Inexact" set
lround (0x1p64): Exception "Inexact" set
lround (-0x1p64): Exception "Inexact" set
...

GCC emits "convert to fixed" instructions for casting floating point
values to integer values. These instructions raise invalid and inexact
exceptions if the floating point value exceeds the integer type ranges.

This patch enables the various FIX_DBL_LONG_CONVERT_OVERFLOW macros in
order to avoid a cast from floating point to integer type and raise the
invalid exception with feraiseexcept.
The ldbl-128 rint/round functions are now using the same logic.

ChangeLog:

	[BZ #19486]
	* sysdeps/s390/fix-fp-int-convert-overflow.h: New File.
	* sysdeps/generic/fix-fp-int-convert-overflow.h
	(FIX_LDBL_LONG_CONVERT_OVERFLOW,
	FIX_LDBL_LLONG_CONVERT_OVERFLOW): New define.
	* sysdeps/arm/fix-fp-int-convert-overflow.h: Likewise.
	* sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h:
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl):
	Avoid conversions to long int where inexact exceptions
	could be raised.
	* sysdeps/ieee754/ldbl-128/s_lroundl.c (__lroundl):
	Likewise.
	* sysdeps/ieee754/ldbl-128/s_llrintl.c (__llrintl):
	Avoid conversions to long long int where inexact exceptions
	could be raised.
	* sysdeps/ieee754/ldbl-128/s_llroundl.c (__llroundl):
	Likewise.
2016-01-18 12:48:06 +01:00
Mike Frysinger 4e58b64859 configure: make the unsupported error message less hostile 2016-01-17 15:24:54 -05:00
Andrew Senkevich 214a44f394 Fixed typos in __memcpy_chk.
* sysdeps/x86_64/multiarch/memcpy_chk.S: Fixed typos.
2016-01-16 14:42:26 +03:00
Mike Frysinger 3f2c97261b sparc: mman.h: fix bad comment insertion
The MCL_ONFAULT define was inserted into the middle of a comment which
breaks the build.
2016-01-16 02:34:15 -05:00
Torvald Riegel 019bf21ca7 nptl: Add first-line description for barrier tests. 2016-01-15 23:16:49 +01:00
Torvald Riegel 12c3bb770d Fix pthread_barrier_init typo.
Applies Paul Eggert's fix for BZ 18868.
2016-01-15 23:00:19 +01:00
Andrew Senkevich 72276d6e88 Added memcpy/memmove family optimized with AVX512 for KNL hardware.
Added AVX512 implementations of memcpy, mempcpy, memmove, memcpy_chk,
mempcpy_chk, memmove_chk.
It shows average improvement more than 30% over AVX versions on KNL
hardware (performance results in the thread
<https://sourceware.org/ml/libc-alpha/2016-01/msg00258.html>).

    * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Added new files.
    * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Added new tests.
    * sysdeps/x86_64/multiarch/memcpy-avx512-no-vzeroupper.S: New file.
    * sysdeps/x86_64/multiarch/mempcpy-avx512-no-vzeroupper.S: Likewise.
    * sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S: Likewise.
    * sysdeps/x86_64/multiarch/memcpy.S: Added new IFUNC branch.
    * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise.
    * sysdeps/x86_64/multiarch/memmove.c: Likewise.
    * sysdeps/x86_64/multiarch/memmove_chk.c: Likewise.
    * sysdeps/x86_64/multiarch/mempcpy.S: Likewise.
    * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise.
2016-01-16 00:49:45 +03:00
Torvald Riegel b02840bacd New pthread_barrier algorithm to fulfill barrier destruction requirements.
The previous barrier implementation did not fulfill the POSIX requirements
for when a barrier can be destroyed.  Specifically, it was possible that
threads that haven't noticed yet that their round is complete still access
the barrier's memory, and that those accesses can happen after the barrier
has been legally destroyed.
The new algorithm does not have this issue, and it avoids using a lock
internally.
2016-01-15 21:20:34 +01:00
Paul E. Murphy a3e5b4feeb Fix race in tst-mqueue5
The check is done on line 117 by a thread spawned
from do_child(), forked from do_test().  This test
generates a signal in the forked process.

Either thread may handle the signal, and on ppc,
it happens to be done on do_child, on the thread
which is not doing the check on line 117.

This exposes a race condition whereby the test
incorrectly fails as the signal is caught during
or after the check.

This is mitigated by ensuring the signal is blocked
in the child thread while thread is running.
2016-01-15 16:53:08 -02:00
Martin Sebor 692de4b396 Have iconv accept redundant escape sequences in IBM900, IBM903, IBM905,
IBM907, and IBM909.

Patch for bug #17197 changes the encoder to avoid generating redundant
shift sequences.  However, those sequences may already be present in
data encododed by prior versions of the encoder.  This change modifies
the decoder to also avoid rejecting redundant shift sequences.

        [BZ #19432]
        * iconvdata/Makefile: Add bug-iconv11.
        * iconvdata/bug-iconv11.c: New test.
        * iconvdata/ibm930.c: Do not reject redundant shift sequences.
        * iconvdata/ibm933.c: Same.
        * iconvdata/ibm935.c: Same.
        * iconvdata/ibm937.c: Same.
        * iconvdata/ibm939.c: Same.
2016-01-15 11:25:13 -07:00
Martin Sebor f2b3078e6a Fix build failures with -DDEBUG.
[BZ #19443]
        * crypt/crypt_util.c [DEBUG] (_ufc_prbits): Correct format string.
        [DEBUG] (_ufc_set_bits): Declare used.
        * iconv/gconv_dl.c [DEBUG]: Add a missing include directive.
        [DEBUG] (print_all): Declare used.
        * resolv/res_send.c [DEBUG] (__libc_res_nsend): Explicitly convert
        operands of the ternary ?: expression to target type.
        * stdlib/rshift.c [DEBUG] (mpn_rshift): Use assert() instead of
        calling the undeclared abort.
        * time/mktime.c [DEBUG] (DEBUG): Rename to DEBUG_MKTIME.
2016-01-15 11:07:41 -07:00
Martin Sebor ad37480c4b Fix build errors with -DNDEBUG.
[BZ #18755]
        * iconv/skeleton.c (FUNCTION_NAME): Suppress -Wunused-but-set-variable
        warnings.
        * sysdeps/nptl/gai_misc.h (__gai_start_notify_thread): Same.
        (__gai_create_helper_thread): Same.
        * nscd/nscd.c (do_exit): Suppress -Wunused-variable.
        * iconvdata/iso-2022-cn-ext.c (BODY): Initialize local variable
        to suppress -Wmaybe-uninitialized warnings.
2016-01-15 10:44:07 -07:00
H.J. Lu 09245377da Call math_opt_barrier inside if
Since floating-point operation may trigger floating-point exceptions,
we call math_opt_barrier inside if to prevent code motion.

	[BZ #19465]
	* sysdeps/ieee754/dbl-64/s_fma.c (__fma): Call math_opt_barrier
	inside if.
	* sysdeps/ieee754/ldbl-128/s_fmal.c (__fmal): Likewise.
	* sysdeps/ieee754/ldbl-96/s_fma.c (__fma): Likewise.
	* sysdeps/ieee754/ldbl-96/s_fmal.c (__fmal): Likewise.
2016-01-15 05:23:20 -08:00
H.J. Lu 82c9a4f85e Use TIME_T_MAX and TIME_T_MIN in tst-mktime2.c
GCC 5.3 compiles

for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
    continue;

into an infinite loop with -Os.  We can copy TIME_T_MAX and TIME_T_MIN
from time/mktime.c.

	[BZ #19466]
	* time/tst-mktime2.c (time_t_max): Removed.
	(time_t_min): Likewise.
	(TYPE_SIGNED): New.
	(TYPE_MINIMUM): Likewise.
	(TYPE_MAXIMUM): Likewise.
	(TIME_T_MIN): Likewise.
	(TIME_T_MAX): Likewise.
	(mktime_test): Replace time_t_max and time_t_min with TIME_T_MAX
	and TIME_T_MIN.
	(do_test): Likewise.
2016-01-14 16:35:40 -08:00
Amit Pawar d7890e6947 Set index_Fast_Unaligned_Load for Excavator family CPUs
GLIBC benchtest testcases shows SSE2_Unaligned based implementations
are performing faster compare to SSE2 based implementations for
routines: strcmp, strcat, strncat, stpcpy, stpncpy, strcpy, strncpy
and strstr. Flag index_Fast_Unaligned_Load is set for Excavator family
0x15h CPU's. This makes SSE2_Unaligned based implementations as
default for these routines.

	[BZ #19467]
	* sysdeps/x86/cpu-features.c (init_cpu_features): Set
	index_Fast_Unaligned_Load flag for Excavator family CPUs.
2016-01-14 08:14:31 -08:00
Marcin Kościelnicki a4b5177ca8 Add __private_ss to s390 struct tcbhead.
Preparation for gcc -fsplit-stack support (gcc bug #68191).  The new
field is basically identical to the one on x86.  Its TCB offset needs
to be constant, as it'll be hardcoded in gcc.

ChangeLog:

	* sysdeps/s390/nptl/tls.h (struct tcbhead_t): Add __private_ss field.
2016-01-14 16:48:55 +01:00
Carlos O'Donell 67fc563718 Use $(PYTHON) to run benchtests python files. 2016-01-13 11:00:57 -05:00
Flavio Cruz e42ce0f45e Fix O_DIRECTORY lookup on trivial translators
* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Do not remove
leading slash when `file_name' is "/".
2016-01-13 00:48:30 +01:00
Joseph Myers fb53a27c57 Add new header definitions from Linux 4.4 (plus older ptrace definitions).
This patch adds some new header definitions from Linux 4.4:

* MCL_ONFAULT is added to bits/mman.h / bits/mman-linux.h (this was
  already done for hppa).

* PTRACE_SECCOMP_GET_FILTER is added to sys/ptrace.h.  Along with it,
  the older PTRACE_GETSIGMASK and PTRACE_SETSIGMASK, added in Linux
  3.11 but missed at the time, are also added.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	* bits/mman-linux.h [!MCL_CURRENT] (MCL_ONFAULT): New macro.
	* sysdeps/unix/sysv/linux/alpha/bits/mman.h (MCL_ONFAULT):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/mman.h (MCL_ONFAULT):
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/mman.h (MCL_ONFAULT):
	Likewise.
	* sysdeps/unix/sysv/linux/sys/ptrace.h (PTRACE_GETSIGMASK): New
	enum constant and macro.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
	(PTRACE_GETSIGMASK): Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h (PTRACE_GETSIGMASK):
	Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
	(PTRACE_GETSIGMASK): Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/s390/sys/ptrace.h (PTRACE_GETSIGMASK):
	Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h (PTRACE_GETSIGMASK):
	Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/tile/sys/ptrace.h (PTRACE_GETSIGMASK):
	Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
2016-01-12 12:42:55 +00:00
Adhemerval Zanella d9b965fa56 Fix isinf/isnan declaration conflict with C++11
GLIBC declares isinf and isnan as expected by Unix98 and for C99 programs
these functions are hidden by the generics inf and isnan macros.
However C++11 defines isinf and isnan with the same semantics as C99
but requires that they are functions not macros (C++11 26.8 [c.math]
paragraph 10).

This then results in a conflict for perfectly valid C++11 programs:

--
using std::isinf;
using std::isnan;

double d1 = isinf(1.0);
double d2 = isnan(1.0);

d.cc:3:12: error: ‘constexpr bool std::isinf(double)’ conflicts with a previous declaration
 using std::isinf;
[...]
/usr/include/bits/mathcalls.h:201:1: note: previous declaration ‘int isinf(double)’
 __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
[...]
--

This patch fixes the prototypes by leaving the obsolete functions
defined for C++98 code (since they do not conflict with any standard
function in C++98), however preventing them on C++11.

No issues found in libstdc++ tests and check on x86_64 and i686 with
glibc testsuite.

Patch from Jonathan Wakely  <jwakely.gcc@gmail.com>.

	[BZ #19439]
	* math/bits/mathcalls.h
	[!__cplusplus || __cplusplus < 201103L] (isinf): Do not declare
	prototype.
	[!__cplusplus || __cplusplus < 201103L] (isnan): Likewise.
2016-01-11 17:13:36 -02:00
Andreas Schwab c83196b0df Force rereading TZDEFRULES after it was used to set DST rules only (bug #19253)
If the TZDEFRULES file was used to set the DST rules when $TZ didn't
provide any we need to make sure that the next time it is used we
recompute everything as __tzfile_default changes some setting from what is
provided by TZDEFRULES.
2016-01-11 16:42:25 +01:00