]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
7 years agotunables: Make tunable_list relro
Siddhesh Poyarekar [Thu, 11 May 2017 14:43:49 +0000 (20:13 +0530)] 
tunables: Make tunable_list relro

As of now we don't need tunables to be writable after they have been
set initially, so there is no point in having them writable.  Put
tunable_list in .data.rel.ro so that it is set as read-only after
relocation.  This also allows us to move some of the dl_* variables
that are tunables controlled into the tunables infrastructure instead
of having two copies.

In future if we ever need specific tunables to be writable at runtime,
we can split the tunable_list into two.

Regression tested on x86_64 to verify that tests continue to pass.

* scripts/gen-tunables.awk: Add attribute_relro to
tunable_list.

7 years agoCondition some sys/ucontext.h contents on __USE_MISC (bug 21457).
Joseph Myers [Thu, 11 May 2017 14:15:26 +0000 (14:15 +0000)] 
Condition some sys/ucontext.h contents on __USE_MISC (bug 21457).

Continuing the fixes for namespace issues arising from sys/ucontext.h,
this patch conditions various definitions, that are not needed for
defining mcontext_t / ucontext_t, on __USE_MISC, so they do not appear
in strict POSIX modes.

This patch is non-exhaustive; that is, it only conditions
straightforward cases and there may be more such definitions that can
be conditioned for these and other architectures, to be dealt with
later in separate patches.  Also, using __USE_MISC is the minimum
change for these definitions where they conflict with POSIX; some
headers already have __USE_GNU conditionals on similar definitions of
names for registers.  The patch specifically does not do anything with
definitions in bits/sigcontext.h, and nor does it condition any
inclusions of bits/sigcontext.h even where in fact that is not needed
on some architectures for the definitions of mcontext_t / ucontext_t.

As other namespace issues in these headers remain, this patch does not
fix bug 21457, nor allow any XFAILs to be removed.

Tested with build-many-glibcs.py.

[BZ #21457]
* sysdeps/arm/sys/ucontext.h (R0): Condition on [__USE_MISC].
(R1): Likewise.
(R2): Likewise.
(R3): Likewise.
(R4): Likewise.
(R5): Likewise.
(R6): Likewise.
(R7): Likewise.
(R8): Likewise.
(R9): Likewise.
(R10): Likewise.
(R11): Likewise.
(R12): Likewise.
(R13): Likewise.
(R14): Likewise.
(R15): Likewise.
* sysdeps/i386/sys/ucontext.h (REG_GS): Likewise.
(REG_FS): Likewise.
(REG_ES): Likewise.
(REG_DS): Likewise.
(REG_EDI): Likewise.
(REG_ESI): Likewise.
(REG_EBP): Likewise.
(REG_ESP): Likewise.
(REG_EBX): Likewise.
(REG_EDX): Likewise.
(REG_ECX): Likewise.
(REG_EAX): Likewise.
(REG_TRAPNO): Likewise.
(REG_ERR): Likewise.
(REG_EIP): Likewise.
(REG_CS): Likewise.
(REG_EFL): Likewise.
(REG_UESP): Likewise.
(REG_SS): Likewise.
* sysdeps/m68k/sys/ucontext.h (R_D0): Likewise.
(R_D1): Likewise.
(R_D2): Likewise.
(R_D3): Likewise.
(R_D4): Likewise.
(R_D5): Likewise.
(R_D6): Likewise.
(R_D7): Likewise.
(R_A0): Likewise.
(R_A1): Likewise.
(R_A2): Likewise.
(R_A3): Likewise.
(R_A4): Likewise.
(R_A5): Likewise.
(R_A6): Likewise.
(R_A7): Likewise.
(R_SP): Likewise.
(R_PC): Likewise.
(R_PS): Likewise.
(fpregset_t): Likewise.
(MCONTEXT_VERSION): Likewise.
* sysdeps/mips/sys/ucontext.h (CTX_R0): Likewise.
(CTX_AT): Likewise.
(CTX_V0): Likewise.
(CTX_V1): Likewise.
(CTX_A0): Likewise.
(CTX_A1): Likewise.
(CTX_A2): Likewise.
(CTX_A3): Likewise.
(CTX_T0): Likewise.
(CTX_T1): Likewise.
(CTX_T2): Likewise.
(CTX_T3): Likewise.
(CTX_T4): Likewise.
(CTX_T5): Likewise.
(CTX_T6): Likewise.
(CTX_T7): Likewise.
(CTX_S0): Likewise.
(CTX_S1): Likewise.
(CTX_S2): Likewise.
(CTX_S3): Likewise.
(CTX_S4): Likewise.
(CTX_S5): Likewise.
(CTX_S6): Likewise.
(CTX_S7): Likewise.
(CTX_T8): Likewise.
(CTX_T9): Likewise.
(CTX_K0): Likewise.
(CTX_K1): Likewise.
(CTX_GP): Likewise.
(CTX_SP): Likewise.
(CTX_S8): Likewise.
(CTX_RA): Likewise.
(CTX_MDLO): Likewise.
(CTX_MDHI): Likewise.
(CTX_CAUSE): Likewise.
(CTX_EPC): Likewise.
* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Condition
inclusion of <sys/procfs.h> on [__USE_MISC].
(greg_t): Condition on [__USE_MISC].
(gregset_t): Likewise.
(fpregset_t): Likewise.
* sysdeps/unix/sysv/linux/arm/sys/ucontext.h (greg_t): Likewise.
(NGREG): Likewise.
(gregset_t): Likewise.
(REG_R0): Likewise.
(REG_R1): Likewise.
(REG_R2): Likewise.
(REG_R3): Likewise.
(REG_R4): Likewise.
(REG_R5): Likewise.
(REG_R6): Likewise.
(REG_R7): Likewise.
(REG_R8): Likewise.
(REG_R9): Likewise.
(REG_R10): Likewise.
(REG_R11): Likewise.
(REG_R12): Likewise.
(REG_R13): Likewise.
(REG_R14): Likewise.
(REG_R15): Likewise.
(struct _libc_fpstate): Likewise.
(fpregset_t): Likewise.
* sysdeps/unix/sysv/linux/hppa/sys/ucontext.h (NGREG): Likewise.
(NFPREG): Likewise.
(gregset_t): Likewise.
(fpregset_t): Likewise.
* sysdeps/unix/sysv/linux/m68k/sys/ucontext.h (R_D0): Likewise.
(R_D1): Likewise.
(R_D2): Likewise.
(R_D3): Likewise.
(R_D4): Likewise.
(R_D5): Likewise.
(R_D6): Likewise.
(R_D7): Likewise.
(R_A0): Likewise.
(R_A1): Likewise.
(R_A2): Likewise.
(R_A3): Likewise.
(R_A4): Likewise.
(R_A5): Likewise.
(R_A6): Likewise.
(R_A7): Likewise.
(R_SP): Likewise.
(R_PC): Likewise.
(R_PS): Likewise.
(fpregset_t): Likewise.
(MCONTEXT_VERSION): Likewise.
* sysdeps/unix/sysv/linux/nios2/sys/ucontext.h (MCONTEXT_VERSION):
Likewise.
* sysdeps/unix/sysv/linux/sh/sys/ucontext.h (REG_R0): Likewise.
(REG_R1): Likewise.
(REG_R2): Likewise.
(REG_R3): Likewise.
(REG_R4): Likewise.
(REG_R5): Likewise.
(REG_R6): Likewise.
(REG_R7): Likewise.
(REG_R8): Likewise.
(REG_R9): Likewise.
(REG_R10): Likewise.
(REG_R11): Likewise.
(REG_R12): Likewise.
(REG_R13): Likewise.
(REG_R14): Likewise.
(REG_R15): Likewise.
* sysdeps/unix/sysv/linux/tile/sys/ucontext.h: Condition inclusion
of <arch/abi.h> on [__USE_MISC].
(greg_t): Condition on [__USE_MISC].
(NGREG): Likewise.
(gregset_t): Likewise.

7 years agoRemove wrong definitions from pthread header refactor
Adhemerval Zanella [Thu, 11 May 2017 13:46:03 +0000 (10:46 -0300)] 
Remove wrong definitions from pthread header refactor

This patch removes wrong struct definition from eab380d (Move shared
pthread definitions to common headers) on ARM and hppa.

Checked on arm-linux-gnueabihf.

* sysdeps/arm/nptl/bits/pthreadtypes-arch.h
(__pthread_rwlock_arch_t): Remove __data definition.
* sysdeps/hppa/nptl/bits/pthreadtypes-arch.h
(__pthread_rwlock_arch_t): Likewise.

7 years agoinet_pton: Reformat in GNU style
Florian Weimer [Thu, 11 May 2017 12:48:51 +0000 (14:48 +0200)] 
inet_pton: Reformat in GNU style

Generated machine code is identical on x86-64.

7 years agosupport_format_addrinfo: Fix flags and canonname formatting
Florian Weimer [Thu, 11 May 2017 09:32:16 +0000 (11:32 +0200)] 
support_format_addrinfo: Fix flags and canonname formatting

The address family splitting via format_ai_family made unpredictable
the place where the canonname field was printed.  This commit adjusts
the implementation so that the ai_flags is checked for consistency
across the list, and ai_canonname must only be present on the first
list element.

Tests for AI_CANONNAME are added to resolv/tst-resolv-basic.

7 years agogetaddrinfo: Unconditionally use malloc for address list
Florian Weimer [Thu, 11 May 2017 08:01:49 +0000 (10:01 +0200)] 
getaddrinfo: Unconditionally use malloc for address list

getaddrinfo has to call malloc eventually anyway, so the complexity
of avoiding malloc calls is not worth potential savings.

7 years agoUse test-driver in ntpl/tst-fork1.c
Andreas Schwab [Mon, 8 May 2017 15:49:59 +0000 (17:49 +0200)] 
Use test-driver in ntpl/tst-fork1.c

7 years agoFix rawmemchr build with GCC 8.
Joseph Myers [Wed, 10 May 2017 00:25:59 +0000 (00:25 +0000)] 
Fix rawmemchr build with GCC 8.

The default rawmemchr implementation uses memchr with size (size_t)-1,
which produces a warning with current GCC mainline.  The warning seems
reasonable for normal code, so this patch uses the DIAG_* macros to
disable it.

Tested (compilation of glibc only) with build-many-glibcs.py for
arm-linux-gnueabi and powerpc64le-linux-gnu, two architectures for
which the build was previously failing.  Note that the glibc testsuite
will still fail to build with GCC mainline because of
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80669>.

* string/rawmemchr.c: Include <libc-diag.h>.
(RAWMEMCHR): Disable -Wstringop-overflow around call to memchr
with size (size_t)-1.

7 years agoRemove MIPS32 accept4, recvmmsg, sendmmsg implementations.
Joseph Myers [Tue, 9 May 2017 23:16:19 +0000 (23:16 +0000)] 
Remove MIPS32 accept4, recvmmsg, sendmmsg implementations.

MIPS32 has its own implementations of accept4, recvmmsg and sendmmsg
because at one point it needed to avoid socketcall being used for
those functions (MIPS32 has socketcall, but has never used it in
glibc, and so never had socket.S at the time when socketcall used such
a per-architecture file instead of C code).  The current code no
longer uses socketcall based on __NR_socketcall being defined, and the
syscalls are always present on MIPS for supported kernels so the
socketcall case in the code is dead for MIPS; this patch removes the
implementations that are, as Adhemerval noted, no longer needed.

Tested compilation for mips-linux-gnu with build-many-glibcs.py.

* sysdeps/unix/sysv/linux/mips/mips32/accept4.c: Remove file.
* sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c: Likewise.

7 years agoSimplify accept4, recvmmsg, sendmmsg code.
Joseph Myers [Tue, 9 May 2017 21:59:36 +0000 (21:59 +0000)] 
Simplify accept4, recvmmsg, sendmmsg code.

The accept4, recvmmsg and sendmmsg functions had macros
__ASSUME_*_SYSCALL_WITH_SOCKETCALL.  Before we could assume kernels
with the relevant functionality, these macros represented the
conditions under which, on a socketcall architecture, glibc could just
call the syscall unconditionally and not have to deal with socketcall
at all for those functions, because if the syscall didn't work for
them the socketcall call wouldn't either.

Now we can assume kernels with the relevant functionality, the only
question is whether we can assume the syscall is present; if not, we
are on a socketcall architecture and just use socketcall instead.
Thus, this patch removes the macros that are no longer necessary, and
simplifies the code for accept4, recvmmsg and sendmmsg to use the same
logic as the other C implementations of socket functions that may use
a syscall or socketcall depending on kernel support.

Tested for x86_64 and x86.

* sysdeps/unix/sysv/linux/accept4.c (accept4): Use syscall if
[__ASSUME_ACCEPT4_SYSCALL], otherwise socketcall.
* sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Use syscall if
[__ASSUME_RECVMMSG_SYSCALL], otherwise socketcall.
* sysdeps/unix/sysv/linux/sendmmsg.c (__sendmmsg): Use syscall if
[__ASSUME_SENDMMSG_SYSCALL], otherwise socketcall.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_ACCEPT4_SYSCALL): Move to general list of macros for
socket syscalls.
(__ASSUME_RECVMMSG_SYSCALL): Likewise.
(__ASSUME_SENDMMSG_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/i386/kernel-features.h
(__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Remove.
(__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
(__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Remove.
* sysdeps/unix/sysv/linux/powerpc/kernel-features.h
(__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
* sysdeps/unix/sysv/linux/sh/kernel-features.h
(__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
* sysdeps/unix/sysv/linux/sparc/kernel-features.h
(__ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL): Likewise.
(__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
(__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.

7 years agoMove shared pthread definitions to common headers
Adhemerval Zanella [Tue, 4 Apr 2017 18:51:10 +0000 (15:51 -0300)] 
Move shared pthread definitions to common headers

This patch removes all the replicated pthread definition accross the
architectures and consolidates it on shared headers.  The new
organization is as follow:

  * Architecture specific definition (such as pthread types sizes) are
    place in the new pthreadtypes-arch.h header in arch specific path.

  * All shared structure definition are moved to a common NPTL header
    at sysdeps/nptl/bits/pthreadtypes.h (with now includes the arch
    specific one for internal definitions).

  * Also, for C11 future thread support, both mutex and condition
    definition are placed in a common header at
    sysdeps/nptl/bits/thread-shared-types.h.

It is also a refactor patch without expected functional changes.
Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu,
arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu,
m68k-linux-gnu, microblaze-linux-gnu, mips{64}-linux-gnu, nios2-linux-gnu,
powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu,
tile{pro,gx}-linux-gnu, and x86_64-linux-gnu).

* posix/Makefile (headers): Add pthreadtypes-arch.h and
thread-shared-types.h.
* sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h: New file: arch
specific thread definition.
* sysdeps/alpha/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/arm/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/hppa/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/ia64/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/m68k/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/mips/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/nios2/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/s390/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/sh/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/sparc/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/tile/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/x86/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/nptl/bits/thread-shared-types.h: New file: shared
thread definition between POSIX and C11.
* sysdeps/aarch64/nptl/bits/pthreadtypes.h.: Remove file.
* sysdeps/alpha/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/arm/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/hppa/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/m68k/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/microblaze/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/mips/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/nios2/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/ia64/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/powerpc/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/s390/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/sh/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/sparc/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/tile/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/x86/nptl/bits/pthreadtypes.h: Likewise.
* sysdeps/nptl/bits/pthreadtypes.h: New file: common thread
definitions shared across all architectures.

7 years agoSimplify sendmmsg code.
Joseph Myers [Tue, 9 May 2017 20:01:52 +0000 (20:01 +0000)] 
Simplify sendmmsg code.

Now we can assume a kernel with sendmmsg support, this patch
simplifies the implementation to be similar to that for accept4:
either using socketcall or the syscall according to whether the
syscall is known to be available, without further fallback
implementations.  The __ASSUME_SENDMMSG macro is kept (now defined
unconditionally), since it's used in resolv/res_send.c.

Tested for x86_64 and x86.

* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_SENDMMSG_SYSCALL): Define unconditionally.
(__ASSUME_SENDMMSG): Likewise.
(__ASSUME_SENDMMSG_SOCKETCALL): Remove macro.
* sysdeps/unix/sysv/linux/sendmmsg.c (__sendmmsg): Define using
sendmmsg syscall if that can be assumed to be present, socketcall
otherwise, with no fallback for runtime failure.

7 years agoSimplify recvmmsg code.
Joseph Myers [Tue, 9 May 2017 20:01:01 +0000 (20:01 +0000)] 
Simplify recvmmsg code.

Now we can assume a kernel with recvmmsg support, this patch
simplifies the implementation to be similar to that for accept4:
either using socketcall or the syscall according to whether the
syscall is known to be available, without further fallback
implementations.

(In fact further simplification is possible, getting rid of the
__ASSUME_*_SYSCALL_WITH_SOCKETCALL macros now that the minimum kernel
is guaranteed support for all of accept4, recvmmsg, sendmmsg, whether
through syscalls or through socketcall.  I intend to do that for all
of accept4 / recvmmsg / sendmmsg together - so making their
implementations just like those for older socket functions - once the
basic cleanup for 3.2 minimum kernel is done for sendmmsg as well as
recvmmsg.)

Tested for x86_64 and x86.

* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_RECVMMSG_SYSCALL): Define unconditionally.
(__ASSUME_RECVMMSG_SOCKETCALL): Remove macro.
(__ASSUME_RECVMMSG): Likewise.
* sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Define using
recvmmsg syscall if it can be assumed to be present, socketcall
otherwise, with no fallback for runtime failure.

7 years agoAdd support for testing __STDC_WANT_IEC_60559_TYPES_EXT__
Paul E. Murphy [Wed, 20 Jul 2016 17:14:21 +0000 (12:14 -0500)] 
Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__

This macro is defined by TS 18661-3 for supporting the _FloatN and
_FloatNx types, as well as the functions suffixed with fN.

* bits/libc-header-start.h:
(__GLIBC_USE_IEC_60559_TYPES_EXT): New macro.
* include/features.h: Describe __STDC_WANT_IEC_60559_TYPES_EXT__.
* manual/creature.texi: Likewise.

7 years agofloat128: Add _Float128 make bits to libm.
Paul E. Murphy [Fri, 15 Jul 2016 19:05:51 +0000 (14:05 -0500)] 
float128: Add _Float128 make bits to libm.

This adds the appropriate common bits for a platform to
enable float128 and expose ABI.

* math/Makefile:
(type-float128-suffix): New variable
(type-float128-routines): Likewise
(type-float128-yes): Likewise
(types): Append float128 if supported
(types-basic): New variable to control the use of templates for
float, double, and long double, but not for float128 or newer types.
(type-basic-foreach): Likewise.

* sysdeps/ieee754/float128/Makeconfig: New file.
* sysdeps/ieee754/float128/Versions: New file.

7 years agoAssume prlimit64 is available.
Joseph Myers [Tue, 9 May 2017 14:05:09 +0000 (14:05 +0000)] 
Assume prlimit64 is available.

This patch makes sysdeps/unix/sysv/linux code assume the prlimit64
syscall is always available, given the minimum of a 3.2 kernel.

__ASSUME_PRLIMIT64, which in fact was no longer used, is removed.
Code conditional on __NR_prlimit64 being defined is made
unconditional.  Fallback code for the case where prlimit64 produces an
ENOSYS error is removed, substantially simplifying some functions.

Tested for x86_64 and x86.

* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PRLIMIT64):
Remove macro.
* sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Assume
prlimit64 is always available and does not give an ENOSYS error.
* sysdeps/unix/sysv/linux/prlimit.c [__NR_prlimit64]: Make code
unconditional.
[!__NR_prlimit64]: Remove conditional code.
* sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Assume
prlimit64 is always available and does not give an ENOSYS error.
* sysdeps/unix/sysv/linux/setrlimit64.c (__setrlimit64): Likewise.

7 years agosunrpc/tst-xdrmem2.c: Include stdint.h.
Zack Weinberg [Tue, 9 May 2017 11:50:56 +0000 (07:50 -0400)] 
sunrpc/tst-xdrmem2.c: Include stdint.h.

7 years agoresolv: Use RES_DFLRETRY consistently [BZ #21474]
Florian Weimer [Tue, 9 May 2017 10:28:01 +0000 (12:28 +0200)] 
resolv: Use RES_DFLRETRY consistently [BZ #21474]

7 years agoRename cppflags-iterator.mk to libof-iterator.mk, remove extra-modules.mk.
Zack Weinberg [Mon, 8 May 2017 19:52:26 +0000 (15:52 -0400)] 
Rename cppflags-iterator.mk to libof-iterator.mk, remove extra-modules.mk.

cppflags-iterator.mk no longer has anything to do with CPPFLAGS; all
it does is set libof-$(foo) for a list of files.  extra-modules.mk
does the same thing, but with a different input variable, and doesn't
let the caller control the module.  Therefore, this patch gives
cppflags-iterator.mk a better name, removes extra-modules.mk, and
updates all uses of both.

* extra-modules.mk: Delete file.
* cppflags-iterator.mk: Rename to ...
* libof-iterator.mk: ...this.  Adjust comments.

* Makerules, extra-lib.mk, benchtests/Makefile, elf/Makefile
* elf/rtld-Rules, iconv/Makefile, locale/Makefile, malloc/Makefile
* nscd/Makefile, sunrpc/Makefile, sysdeps/s390/Makefile:
Use libof-iterator.mk instead of cppflags-iterator.mk or
extra-modules.mk.

* benchtests/strcoll-inputs/filelist#en_US.UTF-8: Remove
extra-modules.mk and cppflags-iterator.mk, add libof-iterator.mk.

7 years agoS390: Regenerate ULPs
Stefan Liebler [Tue, 9 May 2017 07:18:09 +0000 (09:18 +0200)] 
S390: Regenerate ULPs

Updated ulps file - Needed if build with GCC 7.

ChangeLog:

* sysdeps/s390/fpu/libm-test-ulps: Regenerated.

7 years agovfprintf.c: Refactor magic number 32 into EXTSIZ.
Carlos O'Donell [Mon, 8 May 2017 20:11:45 +0000 (16:11 -0400)] 
vfprintf.c: Refactor magic number 32 into EXTSIZ.

The magic number 32 is used everywhere as extra size to
use when doing certain operations. This commit refactors
that into a macro so you can change this value if you're
debugging something in a local build.

7 years agoRemove __ASSUME_PROC_PID_TASK_COMM.
Joseph Myers [Mon, 8 May 2017 16:44:54 +0000 (16:44 +0000)] 
Remove __ASSUME_PROC_PID_TASK_COMM.

This patch removes the __ASSUME_PROC_PID_TASK_COMM macro, and
associated conditional code (in a testcase), now that 3.2 is the
global minimum Linux kernel version supported.

Tested for x86_64.

* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_PROC_PID_TASK_COMM): Remove macro.
* sysdeps/unix/sysv/linux/tst-setgetname.c: Do not include
<kernel-features.h>.
(do_test) [!__ASSUME_PROC_PID_TASK_COMM]: Remove conditional code.

7 years agoRemove __ASSUME_GETCPU_SYSCALL.
Joseph Myers [Mon, 8 May 2017 14:36:42 +0000 (14:36 +0000)] 
Remove __ASSUME_GETCPU_SYSCALL.

This patch removes the definition of __ASSUME_GETCPU_SYSCALL.  In fact
this macro is unused, probably since:

commit dd26c44403582fdf10d663170f947dfe4b3207a0
Author: Adhemerval Zanella <adhemerval.zanella@linaro.com>
Date:   Wed Apr 22 14:21:39 2015 -0300

    Consolidate sched_getcpu

so it could have been removed even without the move to 3.2 as minimum
kernel version on x86_64.

Tested for x86_64.

* sysdeps/unix/sysv/linux/x86_64/kernel-features.h
(__ASSUME_GETCPU_SYSCALL): Remove macro.

7 years agosupport: Prevent multiple deletion of temporary files
Florian Weimer [Mon, 8 May 2017 12:57:59 +0000 (14:57 +0200)] 
support: Prevent multiple deletion of temporary files

Otherwise, another user might recreate these files after the first
deletion.  Particularly with temporary directories, this could result
in the removal of unintended files through symbol link attacks.

7 years agosupport: Delete temporary files in LIFO order
Florian Weimer [Mon, 8 May 2017 12:32:58 +0000 (14:32 +0200)] 
support: Delete temporary files in LIFO order

This is required to remove temporary directories which contain
temporary files.  Previously, FIFO order meant that directory
removal was attempted when the directory still contained files,
which meant that temporary directory cleanup was essentially
unsupported.

7 years agoRemove <sys/ultrasound.h>
Florian Weimer [Mon, 8 May 2017 12:59:21 +0000 (14:59 +0200)] 
Remove <sys/ultrasound.h>

This header was once used for constants related to the Gravis
Ultrasound sound card.

7 years agoRequire Linux kernel 3.2 or later on x86 / x86_64.
Joseph Myers [Mon, 8 May 2017 10:45:20 +0000 (10:45 +0000)] 
Require Linux kernel 3.2 or later on x86 / x86_64.

As per the recent discussion, this patch implements a requirement for
Linux 3.2 or later for x86 and x86_64.  This is only the initial
change to increase the configured minimum; it's expected that followup
patches would deal with associated removal of conditionals that are no
longer needed.  If we remove the start-up test on the kernel version,
of course the NEWS and README text should then be revised (to reflect
that this version is just one such that glibc does not intend to
include compatibility code for any older kernel version, rather than
older kernels necessarily failing to work or glibc necessarily having
compatibility code for newer interfaces).

The followups would be able to assume presence of getcpu (x86_64),
recvmmsg (not always through its own syscall, sometimes only through
socketcall), sendmmsg (likewise), /proc/$pid/task/$tid/comm, f_flags
from statfs, prlimit64.

Tested for x86_64 and x86.

* sysdeps/unix/sysv/linux/i386/configure.ac (arch_minimum_kernel):
Remove.
* sysdeps/unix/sysv/linux/i386/configure: Regenerated.
* sysdeps/unix/sysv/linux/x86_64/64/configure.ac
(arch_minimum_kernel): Remove.
* sysdeps/unix/sysv/linux/x86_64/64/configure: Regenerated.
* README: Update statement about Linux kernel requirements.

7 years agomanual: Add preadv and pwritev documentation
Adhemerval Zanella [Mon, 1 May 2017 19:38:56 +0000 (16:38 -0300)] 
manual: Add preadv and pwritev documentation

* manual/llio.texi: Add preadv and pwritev documentation.

7 years agoFix network headers stdint.h namespace (bug 21455).
Joseph Myers [Thu, 4 May 2017 20:36:42 +0000 (20:36 +0000)] 
Fix network headers stdint.h namespace (bug 21455).

conform/ namespace tests of arpa/inet.h, netdb.h and netinet/in.h fail
for UNIX98 and XPG42 because of inclusion of stdint.h, which defines
macros not permitted in those headers for those standards.  UNIX98
allows them to include inttypes.h, but (predating C99) has restricted
inttypes.h contents (not yet tested in the conform/ tests) not
including those macros; XPG4.2 has no such permission and no
inttypes.h / stdint.h at all.

This patch rearranges the headers to avoid this issue.  intN_t
definitions move to bits/stdint-intn.h, and uintN_t definitions to
bits/stdint-uintn.h.  (These are not bits/types/ headers because they
each define four types.  They are separate rather than just a single
header because sys/types.h defines intN_t but u_intN_t rather than
uintN_t - and while sys/types.h could define uintN_t because of the
POSIX reservation of *_t, existing practice there is largely to
condition types on appropriate feature test macros, and indeed there
is at least one open bug report (14553) about a type that's not
so-conditioned, so maybe types there should actually have conditions
added where appropriate.)  The affected network headers are then made
to include bits/stdint-uintn.h instead of stdint.h.  This allows six
XFAILs to be removed.

This doesn't do anything about inttypes.h defining more than it should
for UNIX98, but we don't have conformtest expectations for that case
at present (and my inclination is that a fix for that should be as
local as possible - affecting only inttypes.h, not stdint.h, only for
the case of __USE_UNIX98 && !__USE_ISOC99).

Tested for x86_64.

[BZ #21455]
* bits/stdint-intn.h: New file.
* bits/stdint-uintn.h: Likewise.
* stdlib/Makefile (headers): Add bits/stdint-intn.h and
bits/stdint-uintn.h.
* inet/netinet/in.h: Include <bits/stdint-uintn.h> instead of
<stdint.h>.
* posix/sys/types.h: Include <bits/stdint-intn.h>.
(__int8_t_defined): Do not define here.
(int8_t): Likewise.
(int16_t): Likewise.
(int32_t): Likewise.
(int64_t): Likewise.
[__GNUC_PREREQ (2, 7)] (__intN_t): Likewise.
* resolv/netdb.h: Include <bits/stdint-uintn.h> instead of
<stdint.h>.
* include/netdb.h [_ISOMAC]: Do not include <stdint.h>.
* sysdeps/generic/stdint.h: Include <bits/stdint-intn.h> and
<bits/stdint-uintn.h>.
(int8_t): Do not define here.
(int16_t): Likewise.
(int32_t): Likewise.
(int64_t): Likewise.
(uint8_t): Likewise.
(uint16_t): Likewise.
(uint32_t): Likewise.
(uint64_t): Likewise.
* conform/Makefile (test-xfail-XPG42/arpa/inet.h/conform): Remove
variable.
(test-xfail-XPG42/netdb.h/conform): Likewise.
(test-xfail-XPG42/netinet/in.h/conform): Likewise.
(test-xfail-UNIX98/arpa/inet.h/conform): Likewise.
(test-xfail-UNIX98/netdb.h/conform): Likewise.
(test-xfail-UNIX98/netinet/in.h/conform): Likewise.

7 years agoldbl-128: Use mathx_hidden_def inplace of hidden_def
Paul E. Murphy [Thu, 4 May 2017 17:47:27 +0000 (14:47 -0300)] 
ldbl-128: Use mathx_hidden_def inplace of hidden_def

This provides a extra macro expansion before invoking
the hidden_def macro.  This is necessary to build the
ldbl-128 files as float128 correctly.

* sysdeps/generic/math_private.h:
(mathx_hidden_def): New macro.
* sysdeps/ieee754/ldbl-128/s_finitel.c: Replace hidden_def with
the above.
* sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise.

7 years agoFix signal.h bsd_signal namespace (bug 21445).
Joseph Myers [Thu, 4 May 2017 17:38:05 +0000 (17:38 +0000)] 
Fix signal.h bsd_signal namespace (bug 21445).

signal.h declares bsd_signal for __USE_XOPEN.  But this function was
obsoleted in the 2001 edition of POSIX and removed in the 2008
edition, so it should not be declared when the 2008 edition is in use.
This patch fixes the conditionals accordingly.  (This does not fix any
conform/ test failures because of other namespace issues in signal.h.)

Tested for x86_64.

[BZ #21445]
* signal/signal.h [__USE_XOPEN2K8] (bsd_signal): Do not declare.

7 years agoUse __glibc_reserved convention in mcontext, sigcontext (bug 21457).
Joseph Myers [Thu, 4 May 2017 11:26:33 +0000 (11:26 +0000)] 
Use __glibc_reserved convention in mcontext, sigcontext (bug 21457).

This patch implements the most straightforward part of fixing
namespace issues for sys/ucontext.h and related headers: where fields
in sys/ucontext.h or bits/sigcontext.h are named "reserved", "padding"
or similar, they are renamed to use the __glibc_reserved* naming
convention.  It does not change fields with a leading underscore, or
even those with a prefix such as uc_ or sc_.  It only fixes a small
part of bug 21457, so no XFAILs are removed.

Tested for x86_64 and x86, and with build-many-glibcs.py.

[BZ #21457]
* sysdeps/unix/sysv/linux/mips/sys/ucontext.h
[_MIPS_SIM != _ABIO32] (mcontext_t): Rename field reserved to
__glibc_reserved1.
* sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
(struct _fpx_sw_bytes): Rename field padding to __glibc_reserved1.
(struct _fpxreg): Likewise.
[!__x86_64__] (struct _fpstate): Rename field reserved to
__glibc_reserved1.  Rename field padding to __glibc_reserved2.
[__x86_64__] (struct _fpstate): Rename field padding to
__glibc_reserved1.
(struct _xsave_hdr): Rename field reserved1 to __glibc_reserved1.
Rename field reserved2 to __glibc_reserved2.
* sysdeps/unix/sysv/linux/x86/sys/ucontext.h
[__x86_64__] (struct _libc_fpxreg): Rename field padding to
__glibc_reserved1.
[__x86_64__] (struct _libc_fpstate): Rename field padding to
__glibc_reserved1.

7 years agopowerpc: Fix strncat ifunc selection
Rajalakshmi Srinivasaraghavan [Thu, 4 May 2017 07:05:56 +0000 (12:35 +0530)] 
powerpc: Fix strncat ifunc selection

Correct hwcap usage in strncat introduced by commit
249dcdb71b79e4c488a46c9027e0014c0bc27044.
Tested on power7 and power8 systems

7 years agox86: Set dl_platform and dl_hwcap from CPU features [BZ #21391]
H.J. Lu [Wed, 3 May 2017 20:42:42 +0000 (13:42 -0700)] 
x86: Set dl_platform and dl_hwcap from CPU features [BZ #21391]

dl_platform and dl_hwcap are set from AT_PLATFORM and AT_HWCAP very
early during startup.  They are used by dynamic linker to determine
platform and build an array of hardware capability names, which are
added to search path when loading shared object.  dl_platform and
dl_hwcap are unused on x86-64.  On i386, i386, i486, i586 and i686
platforms were supported and only SSE2 capability was used.

On x86, usage of AT_PLATFORM and AT_HWCAP to determine platform and
processor capabilities is obsolete since all information is available
in dl_x86_cpu_features.  This patch sets dl_platform and dl_hwcap from
dl_x86_cpu_features in dynamic linker.  On i386, the available plaforms
are changed to i586 and i686 since i386 has been deprecated.  On x86-64,
the available plaforms are haswell, which is for Haswell class processors
with BMI1, BMI2, LZCNT, MOVBE, POPCNT, AVX2 and FMA, and xeon_phi, which
is for Xeon Phi class processors with AVX512F, AVX512CD, AVX512ER and
AVX512PF.  A capability, avx512_1, is also added to x86-64 for AVX512
ISAs: AVX512F, AVX512CD, AVX512BW, AVX512DQ and AVX512VL.

[BZ #21391]
* sysdeps/i386/dl-machine.h (dl_platform_init) [IS_IN (rtld)]:
Only call init_cpu_features.
[!IS_IN (rtld)]: Only set GLRO(dl_platform) to NULL if needed.
* sysdeps/x86_64/dl-machine.h (dl_platform_init): Likewise.
* sysdeps/i386/dl-procinfo.h: Removed.
* sysdeps/unix/sysv/linux/i386/dl-procinfo.h: Don't include
<sysdeps/i386/dl-procinfo.h> nor <ldsodefs.h>.  Include
<sysdeps/x86/dl-procinfo.h>.
(_dl_procinfo): Replace _DL_HWCAP_COUNT with 32.
* sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h [!IS_IN (ldconfig)]:
Include <sysdeps/x86/dl-procinfo.h> instead of
 <sysdeps/generic/dl-procinfo.h>.
* sysdeps/x86/cpu-features.c: Include <dl-hwcap.h>.
(init_cpu_features): Set dl_platform, dl_hwcap and dl_hwcap_mask.
* sysdeps/x86/cpu-features.h (bit_cpu_LZCNT): New.
(bit_cpu_MOVBE): Likewise.
(bit_cpu_BMI1): Likewise.
(bit_cpu_BMI2): Likewise.
(index_cpu_BMI1): Likewise.
(index_cpu_BMI2): Likewise.
(index_cpu_LZCNT): Likewise.
(index_cpu_MOVBE): Likewise.
(index_cpu_POPCNT): Likewise.
(reg_BMI1): Likewise.
(reg_BMI2): Likewise.
(reg_LZCNT): Likewise.
(reg_MOVBE): Likewise.
(reg_POPCNT): Likewise.
* sysdeps/x86/dl-hwcap.h: New file.
* sysdeps/x86/dl-procinfo.h: Likewise.
* sysdeps/x86/dl-procinfo.c (_dl_x86_hwcap_flags): New.
(_dl_x86_platforms): Likewise.

7 years agoTweak realloc/MREMAP comment to be more accurate.
DJ Delorie [Wed, 3 May 2017 20:25:15 +0000 (16:25 -0400)] 
Tweak realloc/MREMAP comment to be more accurate.

MMap'd memory isn't shrunk without MREMAP, but IIRC this is intentional for
performance reasons.  Regardless, this patch tweaks the existing comment to
be more accurate wrt the existing code.

[BZ #21411]
* malloc/malloc.c: Tweak realloc/MREMAP comment to be more accurate.

7 years agoCorrect misplaced comments in struct ip_mreq_source
Phil Blundell [Wed, 3 May 2017 19:35:35 +0000 (20:35 +0100)] 
Correct misplaced comments in struct ip_mreq_source

7 years agoBug 20686: Add el_GR@euro support.
Carlos O'Donell [Wed, 3 May 2017 19:37:04 +0000 (15:37 -0400)] 
Bug 20686: Add el_GR@euro support.

Despite the fact that el_GR is ISO-8859-7:2003 which contains the euro
symobl, it is not possible to know this apriori to selecting the el_GR
locale. Therefore you don't know if el_GR can possibly have the 2003
ammendments which include the euro symbol. This is resolved by creating
an el_GR@euro locale similar to all the other @euro locales for non-UTF8
charsets.

7 years agoBug 20116: Clarify behaviour of PD->lock.
Carlos O'Donell [Wed, 3 May 2017 19:24:43 +0000 (15:24 -0400)] 
Bug 20116: Clarify behaviour of PD->lock.

Add comments to the concurrency notes to clarify the semaphore-like and
mutex-like behaviours of PD->lock.

7 years agoConsolidate Linux epoll_wait syscall
Adhemerval Zanella [Mon, 21 Nov 2016 19:40:19 +0000 (17:40 -0200)] 
Consolidate Linux epoll_wait syscall

This patch consolidates the epoll_wait Linux syscall generation on
sysdeps/unix/sysv/linux/epoll_wait.c.  The implementation tries to
use __NR_epoll_wait if defined, otherwise calls epoll_pwait.

Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.

* sysdeps/unix/sysv/linux/epoll_wait.c: New file.
* sysdeps/unix/sysv/linux/generic/epoll_wait.c: Remove file.
* sysdeps/unix/sysv/linux/syscalls.list: Remove epoll_wait from
auto-generation list.

7 years agoConsolidate Linux select implementation
Adhemerval Zanella [Fri, 18 Nov 2016 16:27:03 +0000 (14:27 -0200)] 
Consolidate Linux select implementation

This patch consolidates the select Linux syscall implementation on
sysdeps/unix/sysv/linux/select.c.  The changes are:

  1. Remove select from auto-generation syscalls.list on the architecture
     that uses __NR_select.
  2. Remove generic implementation add a default one that handle all
     current cases (with the expection of alpha)
     The new default implementation will either use __NR_select if
     available of fallback to __NR_pselect6 otherwise.
  3. Add a alpha outlier implementation which requires old compatibility
     symbols.

Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.

* sysdeps/unix/sysv/linux/alpha/Makefile (sysdep_routines): Add
osf_select.
* sysdeps/unix/sysv/linux/alpha/select.c: New file.
* sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove select and
osf_select from auto-generation list.
* sysdeps/unix/sysv/linux/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/generic/select.c: Remove file.
* sysdeps/unix/sysv/linux/select.c: New file.

7 years agoConsolidate Linux poll implementation
Adhemerval Zanella [Fri, 18 Nov 2016 15:56:05 +0000 (13:56 -0200)] 
Consolidate Linux poll implementation

This patch consolidates the poll Linux syscall implementation on
sysdeps/unix/sysv/linux/poll.c.  It basically removes poll from
auto-generation list and add a default implementation that either
call __NR_poll directly (if the kernel headers defines it) or
ppoll adjusting the timeout argument (as the generic implementation).

Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.

* sysdeps/unix/sysv/linux/generic/poll.c: Remove file.
* sysdeps/unix/sysv/linux/poll.c: New file.
* sysdeps/unix/sysv/linux/syscalls.list: Remove poll from
auto-generation list.

7 years agoAdd HWCAP_ASIMDRDM from Linux 4.11 to AArch64 bits/hwcap.h.
Joseph Myers [Wed, 3 May 2017 11:04:07 +0000 (11:04 +0000)] 
Add HWCAP_ASIMDRDM from Linux 4.11 to AArch64 bits/hwcap.h.

This patch adds the HWCAP_ASIMDRDM macro from Linux 4.11 to the
AArch64 bits/hwcap.h.

Tested (compilation only) with build-many-glibcs.py.

* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_ASIMDRDM):
New macro.

7 years agosparc: handle R_SPARC_DISP64 and R_SPARC_REGISTER relocs
Vladimir Mezentsev [Tue, 2 May 2017 19:55:48 +0000 (16:55 -0300)] 
sparc: handle R_SPARC_DISP64 and R_SPARC_REGISTER relocs

The Studio compiler generates relocation types which are not supported
in glibc. Handle these relocs.

Tested in sparc64-linux-gnu. No regressions.

BZ #21179]
* sysdeps/sparc/sparc64/dl-machine.h: Handle R_SPARC_DISP64 and
R_SPARC_REGISTER relocations.

7 years agoposix: Fix internal p{read,write} plt usage
Adhemerval Zanella [Wed, 26 Apr 2017 21:34:47 +0000 (18:34 -0300)] 
posix: Fix internal p{read,write} plt usage

This patch adds internal alias for __pread, __pread64, and __pwrite
following the already in place one for __pwrite64.  This is not used
in any implementation but on microblaze on preadv/pwritev fallback
(since it does not define __ASSUME_PREADV).

In fact it was signaled by commit c35db50ff5 which update the expected
localptl.data for the architecture based on resulted value.  This patch
updates the plt for microblaze now that p{read,write}{64} are correctly
routed to use internal alias.

Checked on x86_64-linux-gnu and a build for all supported architectures
(no all variants although).

* include/unistd.h (__pread): Add libc_hidden_proto.
(__pread64): Likewise.
(__pwrite): Likewise.
* sysdeps/unix/sysv/linux/microblaze/localplt.data [libc.so]
(__pread64): Remove.
* sysdeps/unix/sysv/linux/pread.c (__pread64): Add libc_hidden_weak.
* sysdeps/unix/sysv/linux/pread64.c (__pread64): Likewise.
* sysdeps/unix/sysv/linux/pwrite.c (__pwrite): Likewise.

7 years agopowerpc: Update powerpc-fpu libm-test-ulps
Tulio Magno Quites Machado Filho [Tue, 2 May 2017 16:38:29 +0000 (13:38 -0300)] 
powerpc: Update powerpc-fpu libm-test-ulps

* sysdeps/powerpc/fpu/libm-test-ulps: Update.

7 years agonptl: Using libsupport for tst-cancel4*
Adhemerval Zanella [Tue, 25 Apr 2017 21:56:46 +0000 (18:56 -0300)] 
nptl: Using libsupport for tst-cancel4*

Checked on x86_64-linux-gnu.

* nptl/tst-cancel4-common.c: Use libsupport.
* nptl/tst-cancel4-common.h: Likewise.
* nptl/tst-cancel4.c (tf_read): Likewise.
(tf_readv): Likewise.
(tf_write): Likewise.
(tf_writev): Likewise.
(tf_sleep): Likewise.
(tf_usleep): Likewise.
(tf_nanosleep): Likewise.
(tf_select): Likewise.
(tf_pselect): Likewise.
(tf_poll): Likewise.
(tf_ppoll): Likewise.
(tf_wait): Likewise.
(tf_waitpid): Likewise.
(tf_waitid): Likewise.
(tf_sigpause): Likewise.
(tf_sigsuspend): Likewise.
(tf_sigwait): Likewise.
(tf_sigwaitinfo): Likewise.
(tf_sigtimedwait): Likewise.
(tf_pause): Likewise.
(tf_accept): Likewise.
(tf_send): Likewise.
(tf_recv): Likewise.
(tf_recvfrom): Likewise.
(tf_recvmsg): Likewise.
(tf_open): Likewise.
(tf_close): Likewise.
(tf_pread): Likewise.
(tf_pwrite): Likewise.
(tf_preadv): Likewise.
(tf_pwritev): Likewise.
(tf_fsync): Likewise.
(tf_fdatasync): Likewise.
(tf_msync): Likewise.
(tf_sendto): Likewise.
(tf_sendmsg): Likewise.
(tf_creat): Likewise.
(tf_connect): Likewise.
(tf_tcdrain): Likewise.
(tf_msgrcv): Likewise.
(tf_msgsnd): Likewise.
* nptl/tst-cancel4_1.c (tf_sendmmsg): Likewise.
* nptl/tst-cancel4_2.c (tf_recvmmsg): Likewise.

7 years agoposix: Using libsupport for p{write,read}v tests
Adhemerval Zanella [Fri, 21 Apr 2017 21:45:27 +0000 (18:45 -0300)] 
posix: Using libsupport for p{write,read}v tests

Checked on x86_64-linux-gnu.

* misc/tst-preadvwritev-common.c (do_prepare): Use libsupport
expected arguments.
(do_test): Adapt to use libsupport.

7 years agoAdd TCP_FASTOPEN_CONNECT from Linux 4.11 to netinet/tcp.h.
Joseph Myers [Mon, 1 May 2017 16:18:31 +0000 (16:18 +0000)] 
Add TCP_FASTOPEN_CONNECT from Linux 4.11 to netinet/tcp.h.

This patch adds the TCP_FASTOPEN_CONNECT macro from Linux 4.11 to
sysdeps/gnu/netinet/tcp.h.

Tested for x86-64.

* sysdeps/gnu/netinet/tcp.h (TCP_FASTOPEN_CONNECT): New macro.

7 years agoAdd PF_SMC, AF_SMC from Linux 4.11 to bits/socket.h.
Joseph Myers [Mon, 1 May 2017 15:11:33 +0000 (15:11 +0000)] 
Add PF_SMC, AF_SMC from Linux 4.11 to bits/socket.h.

This patch adds the PF_SMC / AF_SMC macros from Linux 4.11 to
sysdeps/unix/sysv/linux/bits/socket.h.

Tested for x86_64.

* sysdeps/unix/sysv/linux/bits/socket.h (PF_SMC): New macro.
(PF_MAX): Set to 44.
(AF_SMC): New macro.

7 years agoDefault Linux kernel version in build-many-glibcs.py to 4.11.
Joseph Myers [Mon, 1 May 2017 11:15:43 +0000 (11:15 +0000)] 
Default Linux kernel version in build-many-glibcs.py to 4.11.

* scripts/build-many-glibcs.py (Context.checkout): Default Linux
kernel version to 4.11.

7 years agopowerpc: Fix logbl on power7 [BZ# 21280]
Tulio Magno Quites Machado Filho [Fri, 28 Apr 2017 22:45:52 +0000 (19:45 -0300)] 
powerpc: Fix logbl on power7 [BZ# 21280]

 1. Fix the results for negative subnormals by ignoring the signal when
    normalizing the value.
 2. Fix the output when the high part is a power of 2 and the low part
    is a nonzero number with opposite sign.  This fix is based on commit
    380bd0fd2418f8988217de950f8b8ff18af0cb2b.

After applying this patch, logbl() tests pass cleanly on POWER >= 7.

Tested on powerpc, powerpc64 and powerpc64le

[BZ #21280]
* sysdeps/powerpc/power7/fpu/s_logbl.c (__logbl): Ignore the
signal of subnormals and adjust the exponent of power of 2 down
when low part has opposite sign.

7 years agopowerpc64le: Create divergent sysdep directory for powerpc64le.
Paul E. Murphy [Fri, 15 Jul 2016 23:04:40 +0000 (18:04 -0500)] 
powerpc64le: Create divergent sysdep directory for powerpc64le.

float128 on powerpc64le requires the addition of the ieee754/float128
sysdep, whereas powerpc64 doesn't.  This requires creating a bunch of
submachine and cpu directories and Implies files which just point
towards their powerpc64 equivalent.

Tested on P7, P8, and generic powerpc64le targets with and without
multiarch.

* sysdeps/powerpc/powerpc64le/Implies: New file.
* sysdeps/powerpc/powerpc64le/fpu/Implies: New file.
* sysdeps/powerpc/powerpc64le/fpu/multiarch/Implies: New file.
* sysdeps/powerpc/powerpc64le/multiarch/Implies: New file.
* sysdeps/powerpc/powerpc64le/power7/Implies: New file.
* sysdeps/powerpc/powerpc64le/power7/fpu/Implies: New file.
* sysdeps/powerpc/powerpc64le/power7/fpu/multiarch/Implies: New file.
* sysdeps/powerpc/powerpc64le/power7/multiarch/Implies: New file.
* sysdeps/powerpc/powerpc64le/power8/Implies: New file.
* sysdeps/powerpc/powerpc64le/power8/fpu/Implies: New file.
* sysdeps/powerpc/powerpc64le/power8/fpu/multiarch/Implies: New file.
* sysdeps/powerpc/powerpc64le/power8/multiarch/Implies: New file.
* sysdeps/powerpc/powerpc64le/power9/Implies: New file.
* sysdeps/powerpc/powerpc64le/power9/fpu/Implies: New file.
* sysdeps/powerpc/powerpc64le/power9/fpu/multiarch/Implies: New file.
* sysdeps/powerpc/powerpc64le/power9/multiarch/Implies: New file.
* sysdeps/powerpc/preconfigure: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64le/Implies: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64le/fpu/Implies: New file.

7 years agoconformtest: Allow time.h inclusion from semaphore.h for XOPEN2K.
Joseph Myers [Fri, 28 Apr 2017 16:52:16 +0000 (16:52 +0000)] 
conformtest: Allow time.h inclusion from semaphore.h for XOPEN2K.

POSIX.1:2001 added sem_timedwait, but said nothing about defining
struct timespec in semaphore.h.  The 2008 edition added a
corresponding permission to include <time.h> from <semaphore.h>.
Since this is the normal POSIX approach in such cases, it seems
appropriate to consider this a bug fix, and so this patch makes the
conform/ tests allow that inclusion for POSIX.1:2001 as well.

Tested for x86_64.

* conform/data/semaphore.h-data [XOPEN2K] (time.h): Allow header
inclusion.
* conform/Makefile (test-xfail-XOPEN2K/semaphore.h/conform):
Remove.

7 years agoconformtest: Fix XPG standard naming.
Joseph Myers [Thu, 27 Apr 2017 20:29:35 +0000 (20:29 +0000)] 
conformtest: Fix XPG standard naming.

The conform/ tests test -D_XOPEN_SOURCE under the name "XPG3", and
-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED under the name "XPG4".

That naming is misleading.  _XOPEN_SOURCE_EXTENDED actually means
XPG4.2, including UX-shaded interfaces.  _XOPEN_SOURCE actually means
XPG4, or XPG4.2 without UX-shaded interfaces.  (Prior XPG versions
also used _XOPEN_SOURCE, but without any versioning of the values of
the macro, so XPG4.2 without UX-shaded interfaces is the only sensible
set of interfaces for glibc to expose given _XOPEN_SOURCE=1 without
_XOPEN_SOURCE_EXTENDED defined.)

This patch fixes the naming in the conform/ tests, so that what is now
called XPG4 is changed to XPG42, and what is now called XPG3 is
changed to XPG4.

Tested for x86_64 (and verified the complete set of expectations is
unchanged by the patch beyond the intended renaming).

* conform/GlibcConform.pm (XPG4): Rename standard to XPG42.
(XPG3): Rename standard to XPG4.
* conform/Makefile: Likewise.
* conform/list-header-symbols.pl: Likewise.
* conform/data/aio.h-data: Likewise.
* conform/data/arpa/inet.h-data: Likewise.
* conform/data/complex.h-data: Likewise.
* conform/data/ctype.h-data: Likewise.
* conform/data/dlfcn.h-data: Likewise.
* conform/data/fcntl.h-data: Likewise.
* conform/data/fenv.h-data: Likewise.
* conform/data/float.h-data: Likewise.
* conform/data/fmtmsg.h-data: Likewise.
* conform/data/ftw.h-data: Likewise.
* conform/data/grp.h-data: Likewise.
* conform/data/inttypes.h-data: Likewise.
* conform/data/iso646.h-data: Likewise.
* conform/data/langinfo.h-data: Likewise.
* conform/data/libgen.h-data: Likewise.
* conform/data/limits.h-data: Likewise.
* conform/data/locale.h-data: Likewise.
* conform/data/math.h-data: Likewise.
* conform/data/mqueue.h-data: Likewise.
* conform/data/ndbm.h-data: Likewise.
* conform/data/net/if.h-data: Likewise.
* conform/data/netdb.h-data: Likewise.
* conform/data/netinet/in.h-data: Likewise.
* conform/data/poll.h-data: Likewise.
* conform/data/pthread.h-data: Likewise.
* conform/data/pwd.h-data: Likewise.
* conform/data/sched.h-data: Likewise.
* conform/data/search.h-data: Likewise.
* conform/data/semaphore.h-data: Likewise.
* conform/data/signal.h-data: Likewise.
* conform/data/spawn.h-data: Likewise.
* conform/data/stdbool.h-data: Likewise.
* conform/data/stdint.h-data: Likewise.
* conform/data/stdio.h-data: Likewise.
* conform/data/stdlib.h-data: Likewise.
* conform/data/string.h-data: Likewise.
* conform/data/strings.h-data: Likewise.
* conform/data/stropts.h-data: Likewise.
* conform/data/sys/mman.h-data: Likewise.
* conform/data/sys/resource.h-data: Likewise.
* conform/data/sys/select.h-data: Likewise.
* conform/data/sys/socket.h-data: Likewise.
* conform/data/sys/stat.h-data: Likewise.
* conform/data/sys/statvfs.h-data: Likewise.
* conform/data/sys/time.h-data: Likewise.
* conform/data/sys/timeb.h-data: Likewise.
* conform/data/sys/types.h-data: Likewise.
* conform/data/sys/uio.h-data: Likewise.
* conform/data/sys/un.h-data: Likewise.
* conform/data/sys/wait.h-data: Likewise.
* conform/data/syslog.h-data: Likewise.
* conform/data/termios.h-data: Likewise.
* conform/data/tgmath.h-data: Likewise.
* conform/data/time.h-data: Likewise.
* conform/data/ucontext.h-data: Likewise.
* conform/data/unistd.h-data: Likewise.
* conform/data/utmpx.h-data: Likewise.
* conform/data/varargs.h-data: Likewise.
* conform/data/wchar.h-data: Likewise.
* conform/data/wctype.h-data: Likewise.

7 years agoDefault build-many-glibcs.py to GCC 7 branch.
Joseph Myers [Wed, 26 Apr 2017 15:26:47 +0000 (15:26 +0000)] 
Default build-many-glibcs.py to GCC 7 branch.

Now there is a GCC 7 release branch, this patch makes
build-many-glibcs.py default to using it instead of GCC 6.

Relative to GCC 6, this fixes the MicroBlaze build but introduces ICEs
building glibc testcases for SH (GCC PRs 78459, 78460; the latter is
an out-of-memory issue so you may want to set memory limits when
running build-many-glibcs.py).

* scripts/build-many-glibcs.py (Context.checkout): Default gcc
version to 7 branch.

7 years agoAdd earlyclobber to sqrtt/sqrtf insns.
Uros Bizjak [Fri, 14 Apr 2017 12:30:57 +0000 (14:30 +0200)] 
Add earlyclobber to sqrtt/sqrtf insns.

When using software completions, we have to prevent assembler to match
input and output operands of sqrtt/sqrtf insn. Add earlyclobber to
output operand to avoid unwanted operand matching.

2017-04-14  Uros Bizjak  <ubizjak@gmail.com>

    * sysdeps/alpha/fpu/math_private.h (__ieee754_sqrt): Add
    earlyclobber to output operand of sqrt insn.
    (__ieee754_sqrtf): Ditto.

7 years agoFix sys/socket.h namespace issues from sys/uio.h inclusion (bug 21426).
Joseph Myers [Tue, 25 Apr 2017 17:52:47 +0000 (17:52 +0000)] 
Fix sys/socket.h namespace issues from sys/uio.h inclusion (bug 21426).

sys/socket.h includes sys/uio.h to get the definition of the iovec
structure.

POSIX allows sys/socket.h to make all sys/uio.h symbols visible.
However, all of sys/uio.h is XSI-shaded, so for non-XSI POSIX this
results in conformtest failures (for sys/socket.h and other headers
that include it):

    Namespace violation: "UIO_MAXIOV"
    Namespace violation: "readv"
    Namespace violation: "writev"

Now, there is some ambiguity in POSIX about what namespace
reservations apply in this case - see
http://austingroupbugs.net/view.php?id=1127 - but glibc convention
would still avoid declaring readv and writev, for example, for feature
test macros that don't include them (if only headers from the relevant
standard are included), even if such declarations are permitted, so
there is a bug here according to glibc conventions.

This patch moves the struct iovec definition to a new
bits/types/struct_iovec.h header and includes that from sys/socket.h
instead of including the whole of sys/uio.h.  This fixes the namespace
issue; however, three files in glibc that were relying on the implicit
inclusion needed to be updated to include sys/uio.h explicitly.  So
there is a question of whether sys/socket.h should continue to include
sys/uio.h under some conditions, such as __USE_XOPEN or __USE_MISC or
__USE_XOPEN || __USE_MISC, for greater compatibility with code that
(wrongly) expects this optional inclusion to be present there.  (I
think the three affected files in glibc should still have explicit
sys/uio.h inclusions added in any case, however.)

Tested for x86_64.

[BZ #21426]
* misc/bits/types/struct_iovec.h: New file.
* misc/Makefile (headers): Add bits/types/struct_iovec.h.
* include/bits/types/struct_iovec.h: New file.
* bits/uio.h (struct iovec): Replace by inclusion of
<bits/types/struct_iovec.h>.
* sysdeps/unix/sysv/linux/bits/uio.h (struct iovec): Likewise.
* socket/sys/socket.h: Include <bits/types/struct_iovec.h> instead
of <sys/uio.h>.
* nptl/tst-cancel4.c: Include <sys/uio.h>
* posix/test-errno.c: Likewise.
* support/resolv_test.c: Likewise.
* conform/Makefile (test-xfail-POSIX2008/arpa/inet.h/conform):
Remove.
(test-xfail-POSIX2008/netdb.h/conform): Likewise.
(test-xfail-POSIX2008/netinet/in.h/conform): Likewise.
(test-xfail-POSIX2008/sys/socket.h/conform): Likewise.

7 years agoconformtest: Allow *_t in sys/socket.h.
Joseph Myers [Tue, 25 Apr 2017 16:00:28 +0000 (16:00 +0000)] 
conformtest: Allow *_t in sys/socket.h.

The conformtest expectations in sys/socket.h are missing the standard
POSIX allowance for all headers to define *_t names.  For XSI standard
versions that allowance comes in via the permission to include
<sys/uio.h> (for which the expectations properly allow *_t), but for
non-XSI POSIX nothing brings in that allowance and spurious namespace
failures occur.  This patch adds the required permission to the
expectations to remove the spurious failures (by itself this does not
allow any XFAILs to be removed).

Tested for x86_64.

* conform/data/sys/socket.h-data (*_t): Allow.

7 years agoposix: Remove ununsed posix_spawn internal assignment
Adhemerval Zanella [Mon, 24 Apr 2017 12:43:41 +0000 (09:43 -0300)] 
posix: Remove ununsed posix_spawn internal assignment

The internal 'ret' variable in '__spawni_child' function is not
used after assignment in most cases.

Checked on x86_64-linux-gnu.

* sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Remove ununsed
assignment.

7 years ago[BZ 21340] add support for POSIX_SPAWN_SETSID
Adhemerval Zanella [Fri, 21 Apr 2017 13:40:56 +0000 (10:40 -0300)] 
[BZ 21340] add support for POSIX_SPAWN_SETSID

This patch adds support for the POSIX_SPAWN_SETSID flag.

It was recently accepted by the Austin Group:
http://austingroupbugs.net/view.php?id=1044

Checked on x86_64

Daurnimator  <quae@daurnimator.com>
Adhemerval Zanella  <adhemerval.zanella@linaro.org>

[BZ #21340]
* posix/Makefile (tests): Add tst-posix_spawn-setsid to list of tests.
* posix/spawn.h: define POSIX_SPAWN_SETSID flag.
* posix/spawnattr_setflags.c (ALL_FLAGS): Add POSIX_SPAWN_SETSID to
valid flags.
* posix/tst-posix_spawn-setsid.c: Add test for POSIX_SPAWN_SETSID.
* sysdeps/mach/hurd/spawni.c (__spawni): Implementation of
POSIX_SPAWN_SETSID.
* sysdeps/posix/spawni.c (__spawni): Likewise.
* sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Likewise.
* NEWS: Add note about POSIX_SPAWN_SETSID support.

7 years agoMacroize function declarations in math_private.h
Gabriel F. T. Gomes [Tue, 28 Mar 2017 12:48:42 +0000 (09:48 -0300)] 
Macroize function declarations in math_private.h

This patch moves the declaration of many floating-point functions from
math_private.h to math_private_calls.h and macroize the declaration to
be dependent on floating-point type.  For each of float, double, and
long double, the new header file is included once.  This reduces the
amount of repetitive boilerplate that will be required when adding
float128 versions of these functions.

Tested for powerpc64le and s390x.

* sysdeps/generic/math_private.h: Move the declaration of many
functions to sysdeps/generic/math_private_calls.h.
* sysdeps/generic/math_private_calls.h: New file with the
declarations of the functions removed from math_private.h
macroized by floating-point type.

7 years agoS390: Move utf8-utf32-z9.c to multiarch folder and use s390_libc_ifunc_expr macro.
Stefan Liebler [Fri, 21 Apr 2017 13:30:00 +0000 (15:30 +0200)] 
S390: Move utf8-utf32-z9.c to multiarch folder and use s390_libc_ifunc_expr macro.

The utf8-utf32-z9.c iconv module is using ifunc and thus the ifunc part should
be in multiarch folder.  Otherwise ifunc is used even if you configure
with --disable-multi-arch.

This patch moves the ifunc resolvers to the new file
sysdeps/s390/multiarch/utf8-utf32-z9.c. The resolvers are now implemented
with s390_libc_ifunc_expr macro instead of using gcc attribute ifunc directly.

The ifunc versions are implemented in sysdeps/s390/utf8-utf32-z9.c.
Each version is only implemented if needed or supported.  Therefore there is
a block at beginning of the file which selects the versions which should be
defined depending on support for multiarch, vector-support and used minimum
architecture level.  This block defines HAVE_[FROM|TO]_[C|CU|VX] to 1 or 0.
The code below is rearranged and surrounded
by #if HAVE_[FROM|TO]_[C|CU|VX] == 1.  There is no functional change.

The cu instructions are z9 zarch instructions.  As the major distros are
already using the newer z196 as architecture level set, those instructions
can be used as fallback version instead of the c-code.  This behaviour is
decided at compile time via HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT.

ChangeLog:

* sysdeps/s390/multiarch/utf8-utf32-z9.c: New File.
* sysdeps/s390/utf8-utf32-z9.c: Move ifunc resolvers to multiarch
folder and define ifunc versions depending on HAVE_[FROM|TO]_[C|CU|VX].
(HAVE_FROM_C, HAVE_FROM_CU, HAVE_FROM_VX, HAVE_TO_C, HAVE_TO_VX,
FROM_LOOP_DEFAULT, FROM_LOOP_C, FROM_LOOP_CU, FROM_LOOP_VX,
TO_LOOP_DEFAULT, TO_LOOP_C, TO_LOOP_VX): New Define.

7 years agoS390: Move utf16-utf32-z9.c to multiarch folder and use s390_libc_ifunc_expr macro.
Stefan Liebler [Fri, 21 Apr 2017 13:30:00 +0000 (15:30 +0200)] 
S390: Move utf16-utf32-z9.c to multiarch folder and use s390_libc_ifunc_expr macro.

The utf16-utf32-z9.c iconv module is using ifunc and thus the ifunc part should
be in multiarch folder.  Otherwise ifunc is used even if you configure
with --disable-multi-arch.

This patch moves the ifunc resolvers to the new file
sysdeps/s390/multiarch/utf16-utf32-z9.c. The resolvers are now implemented
with s390_libc_ifunc_expr macro instead of using gcc attribute ifunc directly.

The ifunc versions are implemented in sysdeps/s390/utf16-utf32-z9.c.
Each version is only implemented if needed or supported.  Therefore there is
a block at beginning of the file which selects the versions which should be
defined depending on support for multiarch, vector-support and used minimum
architecture level.  This block defines HAVE_[FROM|TO]_[C|VX] to 1 or 0.
The code below is rearranged and surrounded
by #if HAVE_[FROM|TO]_[C|VX] == 1.  There is no functional change.

ChangeLog:

* sysdeps/s390/multiarch/utf16-utf32-z9.c: New File.
* sysdeps/s390/utf16-utf32-z9.c: Move ifunc resolvers to multiarch
folder and define ifunc versions depending on HAVE_[FROM|TO]_[C|VX].
(HAVE_FROM_C, HAVE_FROM_VX, HAVE_TO_C, HAVE_TO_VX, FROM_LOOP_DEFAULT,
FROM_LOOP_C, FROM_LOOP_VX, TO_LOOP_DEFAULT, TO_LOOP_C, TO_LOOP_VX):
New Define.

7 years agoS390: Move utf8-utf16-z9.c to multiarch folder and use s390_libc_ifunc_expr macro.
Stefan Liebler [Fri, 21 Apr 2017 13:30:00 +0000 (15:30 +0200)] 
S390: Move utf8-utf16-z9.c to multiarch folder and use s390_libc_ifunc_expr macro.

The utf8-utf16-z9.c iconv module is using ifunc and thus the ifunc part should
be in multiarch folder.  Otherwise ifunc is used even if you configure
with --disable-multi-arch.

This patch moves the ifunc resolvers to the new file
sysdeps/s390/multiarch/utf8-utf16-z9.c. The resolvers are now implemented
with s390_libc_ifunc_expr macro instead of using gcc attribute ifunc directly.

The ifunc versions are implemented in sysdeps/s390/utf8-utf16-z9.c.
Each version is only implemented if needed or supported.  Therefore there is
a block at beginning of the file which selects the versions which should be
defined depending on support for multiarch, vector-support and used minimum
architecture level.  This block defines HAVE_[FROM|TO]_[C|CU|VX] to 1 or 0.
The code below is rearranged and surrounded
by #if HAVE_[FROM|TO]_[C|CU|VX] == 1.  There is no functional change.

The cu instructions are z9 zarch instructions.  As the major distros are
already using the newer z196 as architecture level set, those instructions
can be used as fallback version instead of the c-code.  This behaviour is
decided at compile time via HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT.

ChangeLog:

* sysdeps/s390/multiarch/utf8-utf16-z9.c: New File.
* sysdeps/s390/utf8-utf16-z9.c: Move ifunc resolvers to multiarch
folder and define ifunc versions depending on HAVE_[FROM|TO]_[C|CU|VX].
(HAVE_FROM_C, HAVE_FROM_CU, HAVE_FROM_VX, HAVE_TO_C, HAVE_TO_VX,
FROM_LOOP_DEFAULT, FROM_LOOP_C, FROM_LOOP_CU, FROM_LOOP_VX,
TO_LOOP_DEFAULT, TO_LOOP_C, TO_LOOP_VX): New Define.

7 years agoS390: Use new s390_libc_ifunc_expr macro in s390 8bit-generic.c.
Stefan Liebler [Fri, 21 Apr 2017 13:30:00 +0000 (15:30 +0200)] 
S390: Use new s390_libc_ifunc_expr macro in s390 8bit-generic.c.

This patch adds s390_libc_ifunc_expr macro which uses the __ifunc base macro
in include/libc-symbols.h and lets the user define a generic expression to
choose the correct ifunc variant.  Furthermore as the base macro is used,
the ifunc resolver functions are now also using inhibit_stack_protector.
S390 needs its own version due to the hwcap argument of the ifunc resolver.

This new macro is now used in iconv code in 8bit-generic.c instead of using
gcc attribute ifunc directly.

ChangeLog:

* sysdeps/s390/multiarch/ifunc-resolve.h
(s390_libc_ifunc_expr_init, s390_libc_ifunc_expr): New Define.
* sysdeps/s390/multiarch/8bit-generic.c
(__to_generic, __from_generic): Use s390_libc_ifunc_expr to
define ifunc resolvers.

7 years agomanual: Document replacing malloc [BZ #20424]
Florian Weimer [Fri, 21 Apr 2017 08:28:37 +0000 (10:28 +0200)] 
manual: Document replacing malloc [BZ #20424]

7 years agoDo not use wildcard symbol names for public versions in Versions files.
Joseph Myers [Thu, 20 Apr 2017 20:35:21 +0000 (20:35 +0000)] 
Do not use wildcard symbol names for public versions in Versions files.

As noted in
<https://sourceware.org/ml/libc-alpha/2012-12/msg00240.html>,
stdlib/Versions and wcsmbs/Versions list some functions as
__strto*_internal and __wcsto*_internal rather than explicitly listing
the symbols to be exported (so any new internal function matching one
of those patterns would be wrongly added to version GLIBC_2.0), which
seems like a bad idea.  This patch changes those files to list the
exported symbols explicitly.  There are still entries in
sysdeps/nacl/Versions for __nacl_irt_*, but as GLIBC_PRIVATE symbols
that seems less significant.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by the patch.

* stdlib/Versions (__strtod_internal): List explicitly, not as
wildcard.
(__strtof_internal): Likewise.
(__strtold_internal): Likewise.
(__strtol_internal): Likewise.
(__strtoll_internal): Likewise.
(__strtoul_internal): Likewise.
(__strtoull_internal): Likewise.
(__strtoq_internal): Likewise.
(__strtouq_internal): Likewise.
* wcsmbs/Versions (__wcstod_internal): Likewise.
(__wcstof_internal): Likewise.
(__wcstold_internal): Likewise.
(__wcstol_internal): Likewise.
(__wcstoll_internal): Likewise.
(__wcstoul_internal): Likewise.
(__wcstoull_internal): Likewise.

7 years agoFix missing timespec definition for sys/stat.h (BZ #21371)
Adhemerval Zanella [Mon, 17 Apr 2017 13:38:53 +0000 (10:38 -0300)] 
Fix missing timespec definition for sys/stat.h (BZ #21371)

As indicated by the bug report, the 'struct timespec' definition
is not defined for '_XOPEN_SOURCE=700' and '_POSIX_C_SOURCE=200112L'.

It is because current code only includes its definition if __USE_ATFILE
is defined and the define is only set with:

  1. _GNU_SOURCE and/or _ATFILE_SOURCE definition.
  2. _POSIX_C_SOURCE >= 200809L

However, the 'st_*' fields in 'struct stat' are defined if __USE_XOPEN2K8.
This patch uses the same logic for 'struct timespec' inclusion.

Tested on x86_64-linux-gnu.

* io/sys/stat.h: Use __USE_XOPEN2K8 insteaf of __USE_ATFILE for
struct timespec definition.

7 years agonss_dns: Correct parentheses for the __glibc_unlikely argument
Florian Weimer [Wed, 19 Apr 2017 17:34:42 +0000 (19:34 +0200)] 
nss_dns: Correct parentheses for the __glibc_unlikely argument

This fixes commit bee05c9d58a34ec5886faf3b56ecaa56355d94bf.

7 years agorcmd/rexec: Fix typo in comment
Florian Weimer [Wed, 19 Apr 2017 17:30:18 +0000 (19:30 +0200)] 
rcmd/rexec: Fix typo in comment

7 years agoA third round of inclusion fixes for _ISOMAC testsuite.
Zack Weinberg [Wed, 19 Apr 2017 18:39:04 +0000 (14:39 -0400)] 
A third round of inclusion fixes for _ISOMAC testsuite.

* posix/tst-mmap-offset.c: Include stdint.h.
* resolv/tst-ns_name_compress.c: Include string.h.
* resolv/tst-resolv-edns.c: Include resolv.h.

7 years agoresolv: Replace __builtin_expect with __glibc_unlikely/__glibc_likely
Florian Weimer [Wed, 19 Apr 2017 12:29:11 +0000 (14:29 +0200)] 
resolv: Replace __builtin_expect with __glibc_unlikely/__glibc_likely

7 years agoBug 21399: Fix CP1254 comment for U+00EC
Christopher Chittleborough [Wed, 19 Apr 2017 12:09:40 +0000 (08:09 -0400)] 
Bug 21399: Fix CP1254 comment for U+00EC

7 years agoCreate more sockets with SOCK_CLOEXEC [BZ #15722]
Florian Weimer [Wed, 19 Apr 2017 05:45:04 +0000 (07:45 +0200)] 
Create more sockets with SOCK_CLOEXEC [BZ #15722]

7 years agoAssume that accept4 is always available and works
Florian Weimer [Wed, 19 Apr 2017 05:44:48 +0000 (07:44 +0200)] 
Assume that accept4 is always available and works

Simplify the Linux accept4 implementation based on the assumption
that it is available in some way.  __ASSUME_ACCEPT4_SOCKETCALL was
previously unused, so remove it.

For ia64, the accept4 system call (and socket call) were backported
in kernel version 3.2.18.  Reflect this in the installation
instructions.

7 years agoconformtest: Enable tests when cross compiling.
Joseph Myers [Tue, 18 Apr 2017 23:51:35 +0000 (23:51 +0000)] 
conformtest: Enable tests when cross compiling.

This patch enables the compilation part of the conformtest tests (the
vast bulk of them) when cross compiling, so making it easy to run them
across many configurations with build-many-glibcs.py.

Tested with build-many-glibcs.py.

* conform/Makefile (tests-special): Do not make addition of
$(conformtest-header-tests) conditional on [$(cross-compiling) = no].
(generated): Do not make addition of $(conformtest-header-base)
conditional on [$(cross-compiling) = no].

7 years agoFix bits/socket.h IOC* namespace issues (bug 21267).
Joseph Myers [Tue, 18 Apr 2017 21:22:51 +0000 (21:22 +0000)] 
Fix bits/socket.h IOC* namespace issues (bug 21267).

sysdeps/unix/sysv/linux/bits/socket.h includes asm/socket.h.  That
includes asm/sockios.h, which on MIPS includes asm/ioctl.h, resulting
in namespace violations from IOC* macros.

bits/socket.h already has code to handle asm/socket.h unconditionally
defining macros that are only wanted for __USE_MISC.  This patch
extends it to handle the IOC* macros as well (always undefining them
if not defined when bits/socket.h was included, as I don't think they
are part of the intended API even for __USE_MISC).

It's possible there should also be a kernel fix - it's not clear to me
that IOC* belong in the uapi headers, and even if they do they might
best be split out into another header to avoid getting defined by this
particular path.  But since glibc needs to deal with existing kernel
headers, it also seems appropriate to extend the existing workaround
to these macros.

Tested (compilation only) with build-many-glibcs.py.

[BZ #21267]
* sysdeps/unix/sysv/linux/bits/socket.h (IOCSIZE_MASK): Undefine
if defined by <asm/socket.h> and not previously defined.
(IOCSIZE_SHIFT): Likewise.
(IOC_IN): Likewise.
(IOC_INOUT): Likewise.
(IOC_OUT): Likewise.

7 years agox86: Use AVX2 memcpy/memset on Skylake server [BZ #21396]
H.J. Lu [Tue, 18 Apr 2017 21:01:45 +0000 (14:01 -0700)] 
x86: Use AVX2 memcpy/memset on Skylake server [BZ #21396]

On Skylake server, AVX512 load/store instructions in memcpy/memset may
lead to lower CPU turbo frequency in certain situations.  Use of AVX2
in memcpy/memset has been observed to have improved overall performance
in many workloads due to the higher frequency.

Since AVX512ER is unique to Xeon Phi, this patch sets Prefer_No_AVX512
if AVX512ER isn't available so that AVX2 versions of memcpy/memset are
used on Skylake server.

[BZ #21396]
* sysdeps/x86/cpu-features.c (init_cpu_features): Set
Prefer_No_AVX512 if AVX512ER isn't available.
* sysdeps/x86/cpu-features.h (bit_arch_Prefer_No_AVX512): New.
(index_arch_Prefer_No_AVX512): Likewise.
* sysdeps/x86_64/multiarch/memcpy.S (__new_memcpy): Don't use
AVX512 version if Prefer_No_AVX512 is set.
* sysdeps/x86_64/multiarch/memcpy_chk.S (__memcpy_chk):
Likewise.
* sysdeps/x86_64/multiarch/memmove.S (__libc_memmove): Likewise.
* sysdeps/x86_64/multiarch/memmove_chk.S (__memmove_chk):
Likewise.
* sysdeps/x86_64/multiarch/mempcpy.S (__mempcpy): Likewise.
* sysdeps/x86_64/multiarch/mempcpy_chk.S (__mempcpy_chk):
Likewise.
* sysdeps/x86_64/multiarch/memset.S (memset): Likewise.
* sysdeps/x86_64/multiarch/memset_chk.S (__memset_chk):
Likewise.

7 years agox86: Set Prefer_No_VZEROUPPER if AVX512ER is available
H.J. Lu [Tue, 18 Apr 2017 15:27:22 +0000 (08:27 -0700)] 
x86: Set Prefer_No_VZEROUPPER if AVX512ER is available

AVX512ER won't be implemented in any Xeon processors and will be in
all Xeon Phi processors.  Don't check CPU model number when setting
Prefer_No_VZEROUPPER for Xeon Phi.  Instead, set Prefer_No_VZEROUPPER
if AVX512ER is available.  It works with current and future Xeon Phi
and non-Xeon Phi processors.

* sysdeps/x86/cpu-features.c (init_cpu_features): Set
Prefer_No_VZEROUPPER if AVX512ER is available.
* sysdeps/x86/cpu-features.h
(bit_cpu_AVX512PF): New.
(bit_cpu_AVX512ER): Likewise.
(bit_cpu_AVX512CD): Likewise.
(bit_cpu_AVX512BW): Likewise.
(bit_cpu_AVX512VL): Likewise.
(index_cpu_AVX512PF): Likewise.
(index_cpu_AVX512ER): Likewise.
(index_cpu_AVX512CD): Likewise.
(index_cpu_AVX512BW): Likewise.
(index_cpu_AVX512VL): Likewise.
(reg_AVX512PF): Likewise.
(reg_AVX512ER): Likewise.
(reg_AVX512CD): Likewise.
(reg_AVX512BW): Likewise.
(reg_AVX512VL): Likewise.

7 years agoAssume that O_CLOEXEC is always defined and works
Florian Weimer [Tue, 18 Apr 2017 12:56:51 +0000 (14:56 +0200)] 
Assume that O_CLOEXEC is always defined and works

7 years agoAssume that dup3 is available
Florian Weimer [Tue, 18 Apr 2017 12:42:19 +0000 (14:42 +0200)] 
Assume that dup3 is available

7 years agoAssume that pipe2 is always available
Florian Weimer [Tue, 18 Apr 2017 12:09:01 +0000 (14:09 +0200)] 
Assume that pipe2 is always available

The Debian patches for Hurd (which are already required to build
glibc before this commit) contain an implementation of pipe2.

7 years agomalloc: Turn cfree into a compatibility symbol
Florian Weimer [Tue, 18 Apr 2017 09:50:58 +0000 (11:50 +0200)] 
malloc: Turn cfree into a compatibility symbol

7 years agopowerpc64: strrchr optimization for power8
Rajalakshmi Srinivasaraghavan [Tue, 18 Apr 2017 05:58:56 +0000 (11:28 +0530)] 
powerpc64: strrchr optimization for power8

P7 code is used for <=32B strings and for > 32B vectorized loops are used.
This shows as an average 25% improvement depending on the position of search
character.  The performance is same for shorter strings.
Tested on ppc64 and ppc64le.

7 years ago[BZ 21357] unwind-dw2-fde: Call free() outside of unwind mutex
Rabin Vincent [Mon, 17 Apr 2017 15:03:44 +0000 (12:03 -0300)] 
[BZ 21357] unwind-dw2-fde: Call free() outside of unwind mutex

__deregister_frame_info_bases() calls free() while holding a mutex which
is also used from _Unwind_Find_FDE().  This leads to a deadlock if
AddressSanitizer uses _Unwind_Backtrace() from its free()
implementation.

Checked on mips-linux-gnu and x86_64-linux-gnu.

[BZ #21357]
* sysdeps/generic/unwind-dw2-fde.c (__deregister_frame_info_bases):
Call free() outside of mutex.

7 years agoAssume that O_NOFOLLOW is always defined
Florian Weimer [Thu, 13 Apr 2017 19:28:18 +0000 (21:28 +0200)] 
Assume that O_NOFOLLOW is always defined

7 years agoresolv: Remove EDNS fallback [BZ #21369]
Florian Weimer [Thu, 13 Apr 2017 11:22:51 +0000 (13:22 +0200)] 
resolv: Remove EDNS fallback [BZ #21369]

EDNS is disabled by default (so there is interoperability issue), and
the fallback code is problematic because it prevents an application
from obtaining DNSSEC data after a FORMERR response.

7 years agoresolv: Reduce EDNS payload size to 1200 bytes [BZ #21361]
Florian Weimer [Thu, 13 Apr 2017 11:09:38 +0000 (13:09 +0200)] 
resolv: Reduce EDNS payload size to 1200 bytes [BZ #21361]

This hardens the stub resolver against fragmentation-based attacks.

7 years agoresolv: Support an exactly sized buffer in ns_name_pack [BZ #21359]
Florian Weimer [Thu, 13 Apr 2017 09:56:28 +0000 (11:56 +0200)] 
resolv: Support an exactly sized buffer in ns_name_pack [BZ #21359]

This bug did not affect name resolution because those functions
indirectly call ns_name_pack with a buffer which is always larger
than the generated query packet, even in the case of the
longest-possible domain name.

7 years agoresolv: Remove internal and unused definitions from <resolv.h>
Florian Weimer [Thu, 13 Apr 2017 08:52:27 +0000 (10:52 +0200)] 
resolv: Remove internal and unused definitions from <resolv.h>

The RES_F_* constants are only used with the private _res._flags
member.  RES_EXHAUSTIVE is unused.  The removed function
declarations refer to functions not actually exported by glibc,
so they are unusable by applications.

7 years agopowerpc: Optimized strncat for POWER8
Rajalakshmi Srinivasaraghavan [Thu, 13 Apr 2017 05:59:20 +0000 (11:29 +0530)] 
powerpc: Optimized strncat for POWER8

With new optimized strnlen for POWER8 [1], this patch adds
strncat for power8 to make use of optimized strlen and strnlen.
This is faster than POWER7 current implementation for larger strings.

Tested on powerpc64 and powerpc64le.

[1] https://sourceware.org/ml/libc-alpha/2017-03/msg00491.html

* sysdeps/powerpc/powerpc64/multiarch/Makefile (sysdep_routines): Add
strncat-power8.
* sysdeps/powerpc/powerpc64/multiarch/strncat.c (strncat): Add
__strncat_power8 to ifunc list.
* sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
(strncat): Add __strncat_power8 to list of strncat functions.
* sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c: New file.

7 years agoConsolidate Linux mmap implementation (BZ#21270)
Adhemerval Zanella [Thu, 6 Apr 2017 20:01:56 +0000 (17:01 -0300)] 
Consolidate Linux mmap implementation (BZ#21270)

This patch consolidates all Linux mmap implementations on default
sysdeps/unix/sysv/linux/mmap{64}.c one.  To accomodate all required
architecture specific requeriments a new internal header is created
(mmap_internal.h) where each architecture add its specific code
requirements.  Currently only x86_64 (to define MMAP_PREPARE to add
MAP_32BITS), s390 (which have a different kernel ABI for mmap), m68k
(which have variable minimum page sizes), and MIPS n32 (which zero
extend the offset to handle negative one correctly) redefine the new
header.

The patch also fixes BZ#21270 where default mmap64 on architectures
which uses mmap2 silent truncates large offsets value (larger than
1 << (page shift + 8 * sizeof (off_t)) or 1<<44 on architectures with
4096 bytes page size).  The new consolidate implementation returns
EINVAL as allowed by POSIX.

It also adds a tests for on current tst-mmap-offset one.  I have run
a full make check on x86_64, x86_64-32, i686, aarch64, armhf, powerpc,
powerpc64le, sparc64, and sparcv9 without any regressions.  I also ran
some basic tests (tst-mmap-offset) on sh4, m68k, and on qemu simulated
MIPS32 and MIPS64.

[BZ #21270]
* posix/tst-mmap-offset.c (do_prepare): New function.
(do_test): Rename to do_test_bz18877 and use FAIL_RET.
(do_test_bz21270): New function.
* sysdeps/unix/sysv/linux/aarch64/mmap.c: Remove file.
* sysdeps/unix/sysv/linux/arm/mmap.c: Remove file.
* sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c: Likewise.
* sysdeps/unix/sysv/linux/hppa/mmap.c: Likewise.
* sysdeps/unix/sysv/linux/i386/mmap.c: Likewise.
* sysdeps/unix/sysv/linux/m68k/mmap.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/mmap64.c: Likewise.
* sysdeps/unix/sysv/linux/microblaze/mmap.S: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/mmap.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/mmap.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/mmap64.c: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/mmap.S: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/mmap.S: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/mmap.c: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/mmap64.c: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/mmap.c: Likewise.
* sysdeps/unix/sysv/linux/mmap_internal.h: New file.
* sysdeps/unix/sysv/linux/m68k/mmap_internal.h: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/mmap_internal.h: Likewise.
* sysdeps/unix/sysv/linux/s390/mmap_internal.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/mmap_internal.h: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: Remove mmap
from auto-generation list.
* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/mmap.c: New file.
* sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Add check for invalid
offsets and support for mmap2 syscall.

7 years agoposix: Add cleanup on the trap list for globtest.sh
Adhemerval Zanella [Tue, 11 Apr 2017 18:08:02 +0000 (15:08 -0300)] 
posix: Add cleanup on the trap list for globtest.sh

This patch prevents lingering files for SIGSEGV failures by adding
a cleanup handler on trap handler.  Checked on x86_64-linux-gnu.

* posix/globtest.sh: Add cleanup routine on trap 0.

7 years agopowerpc: refactor memcmp and memmove IFUNC.
Wainer dos Santos Moschetta [Tue, 11 Apr 2017 17:18:36 +0000 (14:18 -0300)] 
powerpc: refactor memcmp and memmove IFUNC.

Clean up the IFUNC implementations for powerpc in order to remove
unneeded macro definitions.

Tested on ppc64le with and without --disable-multi-arch flag.

* sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S: Define the
implementation-specific function name and remove unneeded
macros definition.
* sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/power4/memcmp.S: Set a default function
name if not defined and pass as parameter to macros accordingly.
* sysdeps/powerpc/powerpc64/power7/memcmp.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/memmove.S: Likewise.

7 years agopowerpc: refactor memcpy and mempcpy IFUNC.
Wainer dos Santos Moschetta [Tue, 11 Apr 2017 17:18:35 +0000 (14:18 -0300)] 
powerpc: refactor memcpy and mempcpy IFUNC.

Clean up the IFUNC implementations for powerpc in order to remove
unneeded macro definitions.

Tested on ppc64le with and without --disable-multi-arch flag.

* sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S: Define the
implementation-specific function name and remove unneeded
macros definition.
* sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/a2/memcpy.S: Set a default function
name if not defined and pass as parameter to macros accordingly.
* sysdeps/powerpc/powerpc64/cell/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/power4/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/power6/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/mempcpy.S: Likewise.

7 years agopowerpc: refactor memchr, memrchr, and rawmemchr IFUNC.
Wainer dos Santos Moschetta [Tue, 11 Apr 2017 17:18:35 +0000 (14:18 -0300)] 
powerpc: refactor memchr, memrchr, and rawmemchr IFUNC.

Clean up the IFUNC implementations for powerpc in order to remove
unneeded macro definitions.

Tested on ppc64le with and without --disable-multi-arch flag.

* sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S: Define the
implementation-specific function name and remove unneeded macros
definition.
* sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/memchr.S: Set a default
function name if not defined and pass as parameter to macros
accordingly.
* sysdeps/powerpc/powerpc64/power7/memrchr.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/rawmemchr.S: Likewise.

7 years agopowerpc: refactor memset IFUNC.
Wainer dos Santos Moschetta [Tue, 11 Apr 2017 17:18:35 +0000 (14:18 -0300)] 
powerpc: refactor memset IFUNC.

Clean up the IFUNC implementations for powerpc in order to remove
unneeded macro definitions.

Tested on ppc64le with and without --disable-multi-arch flag.

* sysdeps/powerpc/powerpc64/multiarch/memset-power4.S: Define the
implementation-specific function name and remove unneeded macros
definition.
* sysdeps/powerpc/powerpc64/multiarch/memset-power6.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/memset-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/memset-power8.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/memset.S: Set a default function name if
not defined and pass as parameter to macros accordingly.
* sysdeps/powerpc/powerpc64/power4/memset.S: Likewise.
* sysdeps/powerpc/powerpc64/power6/memset.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/memset.S: Likewise.
* sysdeps/powerpc/powerpc64/power8/memset.S: Likewise.

7 years agopowerpc: refactor strcasestr and strstr IFUNC.
Wainer dos Santos Moschetta [Tue, 11 Apr 2017 17:18:35 +0000 (14:18 -0300)] 
powerpc: refactor strcasestr and strstr IFUNC.

Clean up the IFUNC implementations for powerpc in order to remove
unneeded macro definitions.

Tested on ppc64le with and without --disable-multi-arch flag.

* sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S: Define the
strcasestr implementation name and remove unneeded macros definition.
* sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S: Define
strstr implementation name and remove unneeded macros definition.
* sysdeps/powerpc/powerpc64/power7/strstr.S: Set a default function
name if not defined and pass as parameter to macros accordingly.
* sysdeps/powerpc/powerpc64/power8/strcasestr.S: Likewise.

7 years agopowerpc: refactor strchr, strchrnul, and strrchr IFUNC.
Wainer dos Santos Moschetta [Tue, 11 Apr 2017 17:18:35 +0000 (14:18 -0300)] 
powerpc: refactor strchr, strchrnul, and strrchr IFUNC.

Clean up the IFUNC implementations for powerpc in order to remove
unneeded macro definitions.

Tested on ppc64le with and without --disable-multi-arch flag.

* sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S: Define the
implementation-specific function name and remove unneeded macros
definition.
* sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/strchr.S: Set a default
function name if not defined and pass as parameter to macros
accordingly.
* sysdeps/powerpc/powerpc64/power7/strchrnul.S: Likewise.
* sysdeps/powerpc/powerpc64/power7/strrchr.S: Likewise.
* sysdeps/powerpc/powerpc64/power8/strchr.S: Likewise.
* sysdeps/powerpc/powerpc64/strchr.S: Likewise.

7 years agopowerpc: refactor strnlen and strlen IFUNC.
Wainer dos Santos Moschetta [Tue, 11 Apr 2017 17:18:35 +0000 (14:18 -0300)] 
powerpc: refactor strnlen and strlen IFUNC.

Clean up the IFUNC implementations for powerpc in order to remove
unneeded macro definitions.

Tested on ppc64le with and without --disable-multi-arch flag.

* sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S: Define
the strlen implementation name and remove unneeded macros definition.
* sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S: Define
the strnlen implementation name and remove unneeded macros definition.
* sysdeps/powerpc/powerpc64/power7/strlen.S: Set a default function
name if not defined and pass as parameter to macros accordingly.
* sysdeps/powerpc/powerpc64/power7/strnlen.S: Likewise.
* sysdeps/powerpc/powerpc64/power8/strlen.S: Likewise.
* sysdeps/powerpc/powerpc64/strlen.S: Likewise.