Commit Graph

30869 Commits

Author SHA1 Message Date
Chris Metcalf a329844ff8 Make sure tilepro uses kernel atomics fo atomic_store
It's not legal for raw stores to be mixed with atomic operations
on tilepro, since the atomics are managed by kernel fast syscalls.
It's possible for a hardware store and a kernel fast atomic to race
with each other in such a way that the hardware store is lost.

Suppose you have an initial zero value, and you race with a store
of 2 and a kernel cmpxchg from 0 to 1.  The legal output is only 2:
either the store hit first and the cmpxchg failed, or the cmpxchg
hit first and succeeded, then was overwritten by the 2.  But if
the kernel cmpxchg starts first and loads the zero, then the store
hits and sets the value to 2, the cmpxchg will still decide it was
successful and write the 1, leaving the value illegally set to 1.

Using atomic_exchange variants to implement atomic_store fixes this
problem for tilepro.
2016-11-10 20:08:24 -05:00
Joseph Myers b4e75104b4 Refactor some libm type-generic macros.
This patch refactors some type-generic libm macros, in both math.h and
math_private.h, to be based on a common __MATH_TG macro rather than
all replicating similar logic to choose a function to call based on
the type of the argument.

This should serve to illustrate what I think float128 support for such
macros should look like: common macros such as __MATH_TG may need
different definitions depending on whether float128 is supported in
glibc, so that the individual macros themselves do not need
conditionals on float128 support.

Tested for x86_64, x86, mips64 and powerpc.

	* math/math.h (__MATH_TG): New macro.
	[__USE_ISOC99] (fpclassify): Define using __MATH_TG.
	[__USE_ISOC99] (signbit): Likewise.
	[__USE_ISOC99] (isfinite): Likewise.
	[__USE_ISOC99] (isnan): Likewise.
	[__USE_ISOC99] (isinf): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (issignaling): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (__MATH_EVAL_FMT2): New macro.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (iseqsig): Define using
	__MATH_TG and __MATH_EVAL_FMT2.
	* sysdeps/generic/math_private.h (fabs_tg): Define using
	__MATH_TG.
	* sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
	[!__NO_LONG_DOUBLE_MATH] (__iscanonicalf): New macro.
	[!__NO_LONG_DOUBLE_MATH] (__iscanonical): Likewise.
	[!__NO_LONG_DOUBLE_MATH] (iscanonical): Define using __MATH_TG.
	* sysdeps/ieee754/ldbl-96/bits/iscanonical.h (__iscanonicalf): New
	macro.
	(__iscanonical): Likewise.
	(iscanonical): Define using __MATH_TG.
2016-11-10 21:41:56 +00:00
Adhemerval Zanella 0a557c105c Fix sh4 build with __ASSUME_ST_INO_64_BIT redefinition
Since 327792c sh4 builds fails with:

../sysdeps/unix/sysv/linux/kernel-features.h:49:0: error: "__ASSUME_ST_INO_64_BIT" redefined [-Werror]
 #define __ASSUME_ST_INO_64_BIT  1
 ^
In file included from ../sysdeps/unix/sysv/linux/sysdep.h:19:0,
                 from ../sysdeps/unix/sysv/linux/sh/sysdep.h:24,
                 from ../sysdeps/unix/sysv/linux/sh/sh4/sysdep.h:4,
                 from <stdin>:1:
../sysdeps/unix/sysv/linux/sh/kernel-features.h:47:0: note: this is the location of the previous definition
 #define __ASSUME_ST_INO_64_BIT 0

It is because sh4 kernel-features.sh is included multiple times
without guards and this patch fixes by adding them.

Tested on a sh4-linux-gnu build.

	* sysdeps/unix/sysv/linux/sh/kernel-features.h: Add include
	guards.
2016-11-10 18:03:37 -02:00
Adhemerval Zanella 3e06601fed Consolidate Linux access implementation
This patch consolidates the Linux access implementation on
sysdeps/unix/sysv/linux/access.c.  Similar to auto-generation through
syscalls.list, __NR_access is check and __NR_faccessat is used only
for newer architectures (where __NR_access is not defined).

Checked on x86_64.

	* sysdeps/unix/sysv/linux/access.c: New file.
	* sysdeps/unix/sysv/linux/generic/access.c: Remove file.
2016-11-10 16:38:07 -02:00
Steve Ellcey 4589d0715c Add definitions to sysdeps/tile/tilepro/bits/wordsize.h.
* sysdeps/tile/tilepro/bits/wordsize.h: Define __WORDSIZE32_SIZE_ULONG
	and __WORDSIZE32_PTRDIFF_LONG.
2016-11-10 07:46:18 -08:00
Siddhesh Poyarekar 8f3a4687ad Regenerate ULPs for aarch64
* sysdeps/aarch64/libm-test-ulps: Regenerated.
2016-11-10 16:52:35 +05:30
Adhemerval Zanella d4d8a12960 Consolidate Linux truncate implementations
This patch consolidates all Linux truncate implementation on
sysdeps/unix/sysv/linux/truncate{64}.c.  It is based on
{INTERNAL,INLINE}_SYSCALL patch [1] to simplify the syscall
construction.

General idea is to build ftruncate iff __OFF_T_MATCHES_OFF64_T is not
defined, otherwise ftruncate64 will be build and ftruncate will be an
alias.  The fallocate will use old compat syscall and pass 32-bit off_t
argument, while fallocate64 will handle the correct off64_t passing using
__ALIGNMENT_ARG and SYSCALL_LL64 macros.

Tested on x86_64, i386, aarch64, and armhf.

	* sysdeps/unix/sysv/linux/arm/truncate64.c: Remove file.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c: Likewise.
	* sysdeps/sysv/linux/generic/wordsize-32/truncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/truncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/truncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/truncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/truncate.c: New file.
	* sysdeps/unix/sysv/linux/truncate64.c (truncate64): Use
	INLINE_SYSCALL_CALL, __ALIGNMENT_ARG and SYSCALL_LL64 macros.
	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (truncate):
	Remove.
	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (truncate):
	Likewise.

[1] https://sourceware.org/ml/libc-alpha/2016-08/msg00646.html
2016-11-09 17:46:17 -02:00
Adhemerval Zanella 87686aeefd Consolidate Linux ftruncate implementations
THis patch consolidates all Linux ftruncate implementation on
sysdeps/unix/sysv/linux/ftruncate{64}.c.  It is based on
{INTERNAL,INLINE}_SYSCALL patch [1] to simplify the syscall construction.

General idea is to build ftruncate iff __OFF_T_MATCHES_OFF64_T is not
defined, otherwise ftruncate64 will be build and ftruncate will be an
alias.  The fallocate will use old compat syscall and pass 32-bit off_t
argument, while fallocate64 will handle the correct off64_t passing using
__ALIGNMENT_ARG and SYSCALL_LL64 macros.

Tested on x86_64, i386, aarch64, and armhf.

	* posix/tst-truncate-common.c: New file.
	* posix/tst-truncate.c: Use tst-truncate-common.c.
	* posix/tst-truncate64.c: Likewise and add LFS tests.
	* sysdeps/unix/sysv/linux/arm/ftruncate64.c: Remove file.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/ftruncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/ftruncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/ftruncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/ftruncate.c: New file.
	* sysdeps/unix/sysv/linux/ftruncate64.c (__ftruncate64): Use
	INLINE_SYSCALL_CALL, __ALIGNMENT_ARG and SYSCALL_LL64 macros.
	[__OFF_T_MATCHES_OFF64_T] (ftruncate): Add alias.
	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (ftruncate):
	Remove.
	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (ftruncate):
	Likewise.

[1] https://sourceware.org/ml/libc-alpha/2016-08/msg00646.html
2016-11-09 17:46:11 -02:00
Joseph Myers 5874510faa Fix rpcgen buffer overrun (bug 20790).
Building with GCC 7 produces an error building rpcgen:

rpc_parse.c: In function 'get_prog_declaration':
rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
     sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
                     ~~~~^
rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
     sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

That buffer overrun is for the case where the .x file declares a
program with a million arguments.  The strcpy two lines above can
generate a buffer overrun much more simply for a long argument name.

The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
provides a bound on the buffer size needed, so this patch just changes
the buffer size to MAXLINESIZE to avoid both possible buffer
overruns.  A testcase is added that rpcgen does not crash with a
500-character argument name, where it previously crashed.

It would not at all surprise me if there are many other ways of
crashing rpcgen with either valid or invalid input; fuzz testing would
likely find various such bugs, though I don't think they are that
important to fix (rpcgen is not that likely to be used with untrusted
.x files as input).  (As well as fuzz-findable bugs there are probably
also issues when various int variables get overflowed on very large
input.)  The test infrastructure for rpcgen-not-crashing tests would
need extending if tests are to be added for cases where rpcgen should
produce an error, as opposed to cases where it should succeed.

Tested for x86_64 and x86.

	[BZ #20790]
	* sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
	to MAXLINESIZE.
	* sunrpc/bug20790.x: New file.
	* sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
	variable.
	[$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
	[$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
2016-11-08 23:44:51 +00:00
Joseph Myers 116ae4fe5a Add localplt.data for sh.
This patch adds a localplt.data file for sh so that test passes.  The
architecture-specific entries are for _Unwind_Find_FDE, _exit and
__errno_location.

Tested for sh3 and sh4.

	* sysdeps/unix/sysv/linux/sh/localplt.data: New file.
2016-11-08 23:43:17 +00:00
Joseph Myers 2d5a67dc89 Add localplt.data for hppa.
This patch adds a localplt.data file for hppa so that test passes.
Architecture maintainers should feel free to clean up the sysdeps code
so that some or all of the system-specific entries

libc.so: _exit
libc.so: __sigsetjmp
libc.so: _IO_funlockfile
libc.so: sigprocmask
libc.so: __errno_location
libpthread.so: __errno_location

are no longer needed.

Tested for hppa.  Note: check-execstack and check-textrel still fail;
you may wish to look at those to get to a clean baseline there (they
are less obvious for people not familiar with the architecture).

	* sysdeps/unix/sysv/linux/hppa/localplt.data: New file.
2016-11-08 23:42:36 +00:00
Joseph Myers 58d6b0d865 Update alpha localplt.data.
This patch updates alpha localplt.data so the localplt test passes in
my compile-only all-ABIs glibc testing.  The failures I see without
this patch are:

Missing required PLT reference: ld.so: __tls_get_addr
Missing required PLT reference: ld.so: free

Now, __tls_get_addr can be made optional.  For free, rather than
making it optional as in libc.so it seems better to mark all the
malloc-related symbols in both libc.so and ld.so as allowing an
R_ALPHA_GLOB_DAT relocation as an alternative to using a PLT entry, so
this patch does so.

Tested for alpha.

	* sysdeps/unix/sysv/linux/alpha/localplt.data: Make __tls_get_addr
	optional in ld.so.  Allow R_ALPHA_GLOB_DAT relocation for malloc,
	calloc, realloc, free, memalign and __libc_memalign rather than
	making them optional.
2016-11-08 23:41:51 +00:00
Joseph Myers 38d84a0f37 Update nios2 localplt.data.
This patch updates nios2 localplt.data so the localplt test passes in
my compile-only all-ABIs glibc testing.  A new PLT entry for
__extendsfdf2 is added.

Tested for nios2.

	* sysdeps/unix/sysv/linux/nios2/localplt.data: Add __extendsfdf2
	for libc.so.
2016-11-08 23:41:05 +00:00
Adhemerval Zanella 3c7f1f59cd Consolidate lseek/lseek64/llseek implementations
This patch consolidates all Linux lseek/lseek64/llseek implementation
in on on sysdeps/unix/sysv/linux/lseek{64}.c.  It also removes the llseek
file and instead consolidate the LFS lseek implementation on lseek64.c
as for other LFS symbols implementations.

The general idea is:

  - lseek: ABIs that not define __OFF_T_MATCHES_OFF64_T will preferable
  use __NR__llseek if kernel supports it, otherwise they will use __NR_lseek.
  ABIs that defines __OFF_T_MATCHES_OFF64_T won't produce any symbol.

  - lseek64: ABIs with __OFF_T_MATCHES_OFF64_T will preferable use __NR_lseek
  (since it will use 64-bit arguments without low/high splitting) and
  __NR__llseek if __NR_lseek is not defined (for some ILP32 ports).

  - llseek: files will be removed and symbols will be aliased ot lseek64.

ABI without __OFF_T_MATCHES_OFF64_T and without __NR_llseek (basically MIPS64n32
so far) are covered by building lseek with off_t as expected and lseek64
using __NR_lseek (as expected for off64_t being passed using 64-bit registers).

For this consolidation I mantained the x32 assembly specific implementation
because to correctly fix this it would required both the x32 fix for
{INLINE,INTERNAL}_SYSCALL [1] and a wrapper to correctly subscribe it to
return 64 bits instead of default 32 bits (as for times).  It could a future
cleanup.

It is based on my previous {INTERNAL,INLINE}_SYSCALL_CALL macro [2],
although it is mainly for simplification.

Tested on x86_64, i686, aarch64, armhf, and powerpc64le.

	* nptl/Makefile (libpthread-routines): Remove ptw-llseek and add
	ptw-lseek64.
	* sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Remove llseek.
	* sysdeps/unix/sysv/linux/alpha/Makefile  (sysdeps_routines):
	Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c: Remove file.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c: Remove file.
	* sysdeps/unix/sysv/linux/mips/mips64/llseek.c: Likewise.
	* sysdeps/unix/sysv/linux/llseek.c: Remove file.
	* sysdeps/unix/sysv/linux/lseek.c: New file.
	* sysdeps/unix/sysv/linux/lseek64.c: Add default Linux implementation.
	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list: Remove lseek and
	__libc_lseek64 from auto-generation.
	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S: New file.

[1] https://sourceware.org/ml/libc-alpha/2016-08/msg00443.html
[2] https://sourceware.org/ml/libc-alpha/2016-08/msg00646.html
2016-11-08 16:04:33 -02:00
Gabriel F. T. Gomes e0c6851980 Write messages to stdout and use write_message instead of write
Replaces calls to write on file descriptor 2 with calls to write_message,
which writes to STDOUT_FILENO (1) and properly deals with the return of
write.
2016-11-07 22:09:42 -02:00
Gabriel F. T. Gomes d5b3879095 Use write_message instead of write
In the test cases, there are writes to stdout which do not check the result
value.  This patch replaces such occurrences with calls to write_message,
which properly deals with the unused result.

Tested for powerpc64le.
2016-11-07 22:09:42 -02:00
Joseph Myers 06b9e94f79 Make check-installed-headers.sh ignore sys/sysctl.h for x32.
check-installed-headers tests were failing for x32 because of the x86
bits/sysctl.h containing a #error for x32.  This patch makes the tests
ignore sys/sysctl.h for x32, similar to the other special-casing of
particular headers.

Tested for x86_64 (full testing for -m64, compile-only for x32).

	* scripts/check-installed-headers.sh: Ignore sys/sysctl.h for x32.
2016-11-07 23:32:17 +00:00
Steve Ellcey 327792ce57 Define __ASSUME_ST_INO_64_BIT on all platforms.
* sysdeps/unix/sysv/linux/alpha/kernel-features.h: #define
	  __ASSUME_ST_INO_64_BIT as 0
	* sysdeps/unix/sysv/linux/sh/kernel-features.h: Likewise.
	* sysdeps/unix/sysv/linux/fxstat64.c: Replace #ifdef with #if
	  over the code where __ASSUME_ST_INO_64_BIT is used.
	* sysdeps/unix/sysv/linux/lxstat64.c: Likewise.
	* sysdeps/unix/sysv/linux/xstat64.c: Likewise.
	* sysdeps/unix/sysv/linux/xstatconv.c: Likewise.
2016-11-07 13:26:27 -08:00
Florian Weimer c74940f2a7 nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
Steve Ellcey 5ffc980589 Document do_test in test-skeleton.c
* test-skeleton.c: Document do_test usage.
2016-11-07 08:28:52 -08:00
Aurelien Jarno 0623b9e6a9 gconv.h: fix build with GCC 7
gconv.h is using a flex array to define the __gconv_info member in an
invalid way, causing GCC 7 to issue an error:

| In file included from ../include/gconv.h:1:0,
|                  from ../sysdeps/unix/sysv/linux/_G_config.h:32,
|                  from ../libio/libio.h:31,
|                  from ../include/libio.h:4,
|                  from ../libio/stdio.h:74,
|                  from ../include/stdio.h:5,
|                  from test-math-isinff.cc:22:
| ../iconv/gconv.h:142:50: error: flexible array member '__gconv_info::__data' not at end of 'struct _IO_codecvt'
| In file included from ../include/libio.h:4:0,
|                  from ../libio/stdio.h:74,
|                  from ../include/stdio.h:5,
|                  from test-math-isinff.cc:22:
| ../libio/libio.h:211:14: note: next member '_G_iconv_t _IO_codecvt::__cd_out' declared here
| ../libio/libio.h:187:8: note: in the definition of 'struct _IO_codecvt'
| In file included from ../include/gconv.h:1:0,
|                  from ../sysdeps/unix/sysv/linux/_G_config.h:32,
|                  from ../libio/libio.h:31,
|                  from ../include/libio.h:4,
|                  from ../libio/stdio.h:74,
|                  from ../include/stdio.h:5,
|                  from test-math-isinff.cc:22:
| ../iconv/gconv.h:142:50: error: flexible array member '__gconv_info::__data' not at end of 'struct _IO_wide_data'
| In file included from ../include/libio.h:4:0,
|                  from ../libio/stdio.h:74,
|                  from ../include/stdio.h:5,
|                  from test-math-isinff.cc:22:
| ../libio/libio.h:211:14: note: next member '_G_iconv_t _IO_codecvt::__cd_out' declared here
| ../libio/libio.h:215:8: note: in the definition of 'struct _IO_wide_data'

This is basically a revert to the code from 15 years ago. More details
are available in the GCC bug:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78039

Changelog:
	* iconv/gconv.h (__gconv_info): Define __data element using a
	zero-length array.
2016-11-06 21:33:10 +01:00
Steve Ellcey 31c351e26d Speed up math/test-tgmath2.c
* math/test-tgmath2.c: Split up test function.
2016-11-04 15:59:22 -07:00
Joseph Myers e64e117177 Do not generate UNRESOLVED results for run-built-tests = no.
Testing with run-built-tests = no generates many UNRESOLVED results in
tests.sum (and so in the output of "make check"), for all the tests
that are only compiled and not run in such a configuration.  This
doesn't seem useful in the "make check" output, and also causes "make
check" to exist with error status even when all tests that can be run
in such a configuration passed.

This patch changes it not to consider those tests when generating
subdir-tests.sum, and so tests.sum, so that you get a smaller number
of tests considered in the final results rather than a huge pile of
UNRESOLVED.

Tested with a cross-compiler to ARM in a run-built-tests = no
configuration.

	* Rules (tests-expected): New variable, depending on
	$(run-built-tests).
	(tests): Pass $(tests-expected) to merge-test-results.sh, not
	$(tests).
2016-11-04 21:29:00 +00:00
Joseph Myers 5e37a69a04 Handle tests-unsupported if run-built-tests = no.
The tests-unsupported variable lists tests that should neither be
compiled nor run, because some support needed to compile them is
missing.

The implementation of this feature involves having a rule to create
.out files for these tests that takes precedence over the default
rule.  This does not work in the run-built-tests = no case (cross
compiling without use of a wrapper to run the tests on a separate
system, in which cases most tests are compiled only) because in that
case the tests target depends on $(tests) to ensure all tests get
compiled.  This patch changes that dependency to filter out
$(tests-unsupported).

Tested with cross-compilation to ARM with GCC 5, where libstdc++ is
missing some C++11 support because of the bug I fixed in
<https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01040.html> and so
tests-unsupported is nonempty and the tests in question fail to
compile.  (When I originally observed the bug, it was with a native
build / test simply using an x86_64 compiler that had been configured
as a cross compiler to isolate it from the system headers / libraries,
so the configuration issue applied to the compiler but run-built-tests
was yes, so I don't observe the issue with tests-unsupported with that
compiler.)

	* Rules [$(run-built-tests) = no] (tests): Do not depend on
	$(tests-unsupported).
2016-11-04 21:28:03 +00:00
Adhemerval Zanella 6d1774146f Fix sparc build due missing __WORDSIZE_TIME64_COMPAT32 definition
This patch adds the missing Linux sparc definitions from d060cd0.
Both value are copied from default sparc value [1] and with this
fix now both sparc 32 and 64 bits builds on Linux.

	* sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
	(__WORDSIZE_TIME64_COMPAT32): Define for both 32 and  64 bits.

[1] sysdeps/sparc/sparc{32,64}/bits/wordsize.h
2016-11-04 18:10:42 -02:00
Joseph Myers 860aacdad2 Fix alpha sqrt fegetenv namespace (bug 20768).
On alpha, sqrt (a C90 function) brings in references to fegetenv
(C99), resulting in linknamespace test failures:

[initial] __sqrt -> [libm.a(w_sqrt.o)] __ieee754_sqrt ->
[libm.a(e_sqrt.o)] __feholdexcept -> [libm.a(feholdexcpt.o)] fegetenv

This patch fixes this by making __feholdexcept call __fegetenv instead
of fegetenv.

Tested for Alpha (compilation only).

	[BZ #20768]
	* sysdeps/alpha/fpu/feholdexcpt.c (__feholdexcept): Call
	__fegetenv instead of fegetenv.
2016-11-04 17:19:13 +00:00
Joseph Myers 799131036e Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139).
manual/libm-err-tab.pl hardcodes a list of names for particular
platforms (mapping from sysdeps directory name to friendly name for
the manual).  This goes against the principle of keeping information
about individual platforms in their corresponding sysdeps directory,
and the list is also very out-of-date regarding supported platforms
and their corresponding sysdeps directories.

This patch fixes this by adding a libm-test-ulps-name file alongside
each libm-test-ulps file.  The script then gets the friendly name from
that file, which is required to exist, so it no longer needs to allow
for the mapping being missing.

Tested for x86_64.

	[BZ #14139]
	* manual/libm-err-tab.pl (%pplatforms): Initialize to empty.
	(find_files): Obtain platform name from libm-test-ulps-name and
	store in %pplatforms.
	(canonicalize_platform): Remove.
	(print_platforms): Use $pplatforms directly.
	(by_platforms): Do not allow for platforms missing from
	%pplatforms.
	* sysdeps/aarch64/libm-test-ulps-name: New file.
	* sysdeps/alpha/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/arm/libm-test-ulps-name: Likewise.
	* sysdeps/generic/libm-test-ulps-name: Likewise.
	* sysdeps/hppa/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/i386/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps-name: Likewise.
	* sysdeps/ia64/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/m68k/coldfire/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/m68k/m680x0/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/microblaze/libm-test-ulps-name: Likewise.
	* sysdeps/mips/mips32/libm-test-ulps-name: Likewise.
	* sysdeps/mips/mips64/libm-test-ulps-name: Likewise.
	* sysdeps/nios2/libm-test-ulps-name: Likewise.
	* sysdeps/powerpc/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/powerpc/nofpu/libm-test-ulps-name: Likewise.
	* sysdeps/s390/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/sh/libm-test-ulps-name: Likewise.
	* sysdeps/sparc/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/tile/libm-test-ulps-name: Likewise.
	* sysdeps/x86_64/fpu/libm-test-ulps-name: Likewise.
2016-11-04 16:49:06 +00:00
Joseph Myers 94bf0b4ac9 Make MIPS <sys/user.h> self-contained.
The check-installed-headers tests show up that the MIPS <sys/user.h>
is not self-contained, using size_t without including any header that
defines it.  This patch fixes it by including <stddef.h>, as done for
other architectures' versions of this header.

Tested for MIPS (all 24 ABIs, compilation only).

	* sysdeps/unix/sysv/linux/mips/sys/user.h: Include <stddef.h>.
2016-11-04 16:44:23 +00:00
Joseph Myers 7672e712e1 XFAIL check-execstack for MIPS.
This patch marks the check-execstack test as expected to fail for
MIPS, with a comment referencing previous RFC discussion of the
changes that would be needed to support non-executable stacks on MIPS.

Tested for MIPS (all 24 ABIs).

	* sysdeps/unix/sysv/linux/mips/Makefile [$(subdir) = elf]
	(test-xfail-check-execstack): New variable.
2016-11-04 16:42:37 +00:00
Joseph Myers a2049e7ab2 Add localplt.data for MIPS.
This patch adds a localplt.data file for MIPS, reflecting the
peculiarities of MIPS ELF that mean this test cannot detect PLT
entries (there aren't any in shared libraries), not GOT entries
(because of the implicit relocation).

Tested for MIPS (all 24 ABIs).

	* sysdeps/mips/localplt.data: New file.
2016-11-04 16:40:54 +00:00
Steve Ellcey d060cd002d Define wordsize.h macros everywhere
* bits/wordsize.h: Add documentation.
	* sysdeps/aarch64/bits/wordsize.h : New file
	* sysdeps/generic/stdint.h (PTRDIFF_MIN, PTRDIFF_MAX): Update
	definitions.
	(SIZE_MAX): Change ifdef to if in __WORDSIZE32_SIZE_ULONG check.
	* sysdeps/gnu/bits/utmp.h (__WORDSIZE_TIME64_COMPAT32): Check
	with #if instead of #ifdef.
	* sysdeps/gnu/bits/utmpx.h (__WORDSIZE_TIME64_COMPAT32): Ditto.
	* sysdeps/mips/bits/wordsize.h (__WORDSIZE32_SIZE_ULONG,
	__WORDSIZE32_PTRDIFF_LONG, __WORDSIZE_TIME64_COMPAT32):
	Add or change defines.
	* sysdeps/powerpc/powerpc32/bits/wordsize.h: Likewise.
	* sysdeps/powerpc/powerpc64/bits/wordsize.h: Likewise.
	* sysdeps/s390/s390-32/bits/wordsize.h: Likewise.
	* sysdeps/s390/s390-64/bits/wordsize.h: Likewise.
	* sysdeps/sparc/sparc32/bits/wordsize.h: Likewise.
	* sysdeps/sparc/sparc64/bits/wordsize.h: Likewise.
	* sysdeps/tile/tilegx/bits/wordsize.h: Likewise.
	* sysdeps/tile/tilepro/bits/wordsize.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/wordsize.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/wordsize.h: Likewise.
	* sysdeps/wordsize-32/bits/wordsize.h: Likewise.
	* sysdeps/wordsize-64/bits/wordsize.h: Likewise.
	* sysdeps/x86/bits/wordsize.h: Likewise.
2016-11-04 09:37:44 -07:00
Wilco Dijkstra 95e431cc73 An optimized memchr was missing for AArch64. This version is similar to
strchr and is significantly faster than the C version.

2016-11-04  Wilco Dijkstra  <wdijkstr@arm.com>
	    Kevin Petit  <kevin.petit@arm.com>

	* sysdeps/aarch64/memchr.S (__memchr): New file.
2016-11-04 14:37:10 +00:00
Joseph Myers 9a2835df5c Handle tilegx* machine names.
This patch makes sysdeps/tile/preconfigure handle tilegx* machine
names instead of just plain tilegx.  That matches GCC, and in
particular allows a big-endian toolchain to use the tilegxbe-linux-gnu
name when configuring both GCC and glibc.

Tested with compilation for tilegxbe-linux-gnu, both 32-bit and 64-bit
(building a subsequent GCC against that glibc still falls over because
of both 32-bit and 64-bit libraries going in the lib directory, as
noted at
<https://sourceware.org/ml/libc-alpha/2016-11/msg00129.html>).

	* sysdeps/tile/preconfigure: Accept tilegx* instead of tilegx.
2016-11-04 13:32:06 +00:00
Joseph Myers 6c50bb532b Fix linknamespace parallel test failures.
Having found that with my script to build many glibc variants I could
reproduce the linknamespace test failures in parallel builds (that
various people had previously reported but I hadn't seen myself), I
investigated those failures further.  This patch adds a missing
dependency to those tests.

Tested for x86_64, including the configuration where I saw those
failures and where I don't see them with this patch.

	* conform/Makefile ($(linknamespace-header-tests)): Also depend on
	$(linknamespace-symlists-tests).
2016-11-03 22:47:02 +00:00
Steve Ellcey 26d7185d6f Fix -Wformat-length warning in time/tst-strptime2.c
* time/tst-strptime2.c: Ignore -Wformat-length warning.
2016-11-02 16:00:39 -07:00
Carlos O'Donell 0cb9dcc8f2 Bug 20729: Fix build failures on ppc64 and other arches.
The changes to fix bug 20729 introduced an error which removed an
ignore diagnostic from -O2 by using the new -Os related macro.
This broke ppc64 builds. This commit fixes the mistake.

Tested on x86, x86_64, ppc64, ppc64le, arm, aarch64, and s390x.
2016-11-02 13:01:36 -04:00
Steve Ellcey 9032070dea Fix warning from latest GCC in tst-printf.c
* stdio-common/tst-printf.c: Ignore -Wformat-length warning.
2016-11-01 16:00:09 -07:00
Joseph Myers 6adaeadf95 Correct clog10 documentation (bug 19673).
Bug 19673 reports that the documentation of clog10 is incorrect, both
failing to include the division by log (10) in the imaginary part and,
in the non-TeX version of the equation only, describing the LHS as log
rather than log10.

This patch fixes both issues.  Note: I think it's appropriate that the
LHS says log10 not clog10, and that the cexp and clog descriptions
referred to in a comment in that bug report similarly say exp and log;
this is a mathematical description not a literal C one.

Tested for x86_64.

	[BZ #19673]
	* manual/math.texi (Exponents and Logarithms): Correct description
	of clog10.
2016-11-01 18:38:52 +00:00
Carlos O'Donell bb5badf170 Bug 20729: Include libc-internal.h where required.
The original fix for bug 20729 failed to include
libc-internal.h in the files that needed them and
this caused build failures on machines that don't
implicitly include this header. This commit fixes
that by following the consensus rule that a header,
if needed, should always be directly included.
2016-10-31 16:46:57 -04:00
Brent W. Baccala 561ff1ec42 hurd: Fix spurious port deallocation
* sysdeps/mach/hurd/dl-sysdep.c (__mmap): Do not deallocate memobj_wr
when it is MACH_PORT_NULL.
2016-10-31 17:32:25 +01:00
Andreas Schwab 44c637ce80 Properly initialize glob structure with GLOB_BRACE|GLOB_DOOFFS (bug 20707) 2016-10-31 12:36:08 +01:00
Carlos O'Donell 93fe09cb5f Bug 20729: Fix building with -Os.
This commit adds a new DIAG_IGNORE_Os_NEEDS_COMMENT which is only
enabled when compiling with -Os. This allows developers working on
-Os enabled builds to mark false-positive warnings without impacting the
warnings emitted at -O2.

Then using the new DIAG_IGNORE_Os_NEEDS_COMMENT we fix 6 warnings
generated with GCC 5 to get -Os builds working again.
2016-10-29 23:50:56 -04:00
Carlos O'Donell 960294f00a Add include/crypt.h.
To support tests that include crypt.h we add a wrapper.
2016-10-28 22:40:16 -04:00
Gabriel F T Gomes 1b16ff0b1e Fix warning caused by unused-result in bug-atexit3-lib.cc
The test case dlfcn/bug-atexit3-lib.cc calls write and doesn't check the
result.  When building with GCC 6.2, this generates a warning in 'make
check', which is treated as an error.  This patch replaces the call to
write with a call to write_message.

Tested for powerpc64le.
2016-10-28 19:26:14 -02:00
Joseph Myers f82a4bdb73 Add SNAN, SNANF, SNANL macros.
TS 18661-1 defines SNAN macros for signaling NaN values, suitable for
use in static initializers.  This patch adds them to glibc's <math.h>
(provided you are building with GCC 3.3 or later; no attempt is made
to provide any kind of nonconforming fallback for older compilers
without the __builtin_nans functions).

Tested for x86_64 and x86.

	* math/math.h
	[__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNANF):
	New macro.
	[__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNAN):
	Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNANL):
	Likewise.
	* manual/arith.texi (Infinity and NaN): Document SNANF, SNAN and
	SNANL.
	* math/test-double.h (snan_value_MACRO): New macro.
	* math/test-float.h (snan_value_MACRO): Likewise.
	* math/test-ldouble.h (snan_value_MACRO): Likewise.
	* math/libm-test.inc (issignaling_test_data): Add tests of
	snan_value_MACRO.
2016-10-28 21:16:58 +00:00
Tulio Magno Quites Machado Filho 739e14f900 Document a behavior of an elided pthread_rwlock_unlock
Explain that pthread_rwlock_unlock may crash if called on a lock not
held by the current thread.
2016-10-28 19:13:21 -02:00
Tulio Magno Quites Machado Filho ce193f551e powerpc: Fix TOC stub on powerpc64 clone()
Use a function call to _exit() so that the linker can create a TOC stub
instead of just a branch.

Tested on powerpc64.
2016-10-28 19:13:21 -02:00
Florian Weimer ae9166f2b8 malloc: Update comments about chunk layout 2016-10-28 22:36:58 +02:00
Florian Weimer 09472915dd crypt: Use internal names for the SHA-2 block functions
These functions are externally visible with a static libcrypt
library.
2016-10-28 21:49:21 +02:00
Carlos O'Donell b2fea743ab Fix building tst-linkall-static.
The crypt/ directory is not added as part of the sysdep directories.
Add it when building tst-linkall-static to include crypt.h.
2016-10-28 14:27:52 -04:00