Chris Metcalf [Mon, 5 Jan 2015 17:06:15 +0000 (12:06 -0500)]
tile: check error properly for vDSO calls
The tile vDSO vsyscalls were not properly setting the error value.
Conventionally, tile returns the same "non-negative success, negative
errno" value that x86 does (in r0), but it also returns "zero or positive
errno" in r1, which is what the regular syscall code checks. This change
uses that convention for the vDSO calls as well.
Chris Metcalf [Mon, 5 Jan 2015 16:59:32 +0000 (11:59 -0500)]
lround: provide cast for wordsize-64 version if needed
Platforms with 64-bit registers where 32-bit values need to have the
high 32 bits set in a particular way need to have an explicit cast
when using the 64-bit sysdeps/ieee754/dbl-64/wordsize-64 version
of llround() as lround(). This includes tilegx32, and likely MIPS.
x32 does not need this, and AArch64 ILP32 will not either. Require
it to be specified in sysdep.h to be explicit.
Joseph Myers [Mon, 5 Jan 2015 16:05:34 +0000 (16:05 +0000)]
Fix ARM posix_fadvise64 namespace (bug 17793).
ARM posix_fadvise calls __posix_fadvise64_l64, to which
posix_fadvise64 is a strong alias, but posix_fadvise is a POSIX
function and posix_fadvise64 isn't. This patch changes it into a weak
alias.
Tested for ARM that this fixes the corresponding linknamespace test
failures.
[BZ #17793]
* sysdeps/unix/sysv/linux/arm/posix_fadvise64.c (posix_fadvise64):
Define as weak alias not strong alias.
Joseph Myers [Mon, 5 Jan 2015 15:06:57 +0000 (15:06 +0000)]
Fix isblank / isascii / toascii namespace (bug 17635).
Use of isblank brings in isascii and toascii, but isblank is a C99
function and the other two aren't; similarly, isascii and toascii are
UNIX98 functions and bring in isblank, which isn't. (Not a
conformance issue because of the is* and to* reservation, but still
contrary to glibc practice.) This patch fixes this by splitting
isblank out of ctype-extn.c to a separate ctype-c99.c. isblank_l is
also moved to a separate file, ctype-c99_l.c (non-XSI POSIX.1-2008 has
isblank_l, but isascii / toascii are marked OB XSI). (In principle
all these functions could go in separate files - that's optimal for
static linking - but they are also all very small, and splitting them
all out is not needed to fix the present bug.)
Tested for x86_64 (testsuite, and that installed stripped shared
libraries are unchanged by the patch - the ordering in which new and
existing sources are listed in ctype/Makefile is arranged so functions
go in the same order so that this comparison works).
[BZ #17635]
* ctype/ctype-c99.c: New file. isblank implementation moved from
...
* ctype/ctype-extn.c: ... here.
(__isblank_l): Move to ...
* ctype/ctype-c99_l.c: ... here. New file.
* ctype/Makefile (routines): Add ctype-c99 and ctype-c99_l.
* conform/Makefile (test-xfail-ISO99/ctype.h/linknamespace):
Remove variable.
(test-xfail-ISO11/ctype.h/linknamespace): Likewise.
(test-xfail-XPG3/ctype.h/linknamespace): Likewise.
(test-xfail-XPG4/ctype.h/linknamespace): Likewise.
(test-xfail-UNIX98/ctype.h/linknamespace): Likewise.
(test-xfail-POSIX2008/ctype.h/linknamespace): Likewise.
Joseph Myers [Mon, 5 Jan 2015 14:37:07 +0000 (14:37 +0000)]
Fix wordsize-64 posix_fadvise64, posix_fallocate64 namespace (bug 17777).
On systems using sysdeps/unix/sysv/linux/wordsize-64, posix_fadvise64
and posix_fallocate64 (non-POSIX) are strong aliases for posix_fadvise
and posix_fallocate (POSIX), meaning references to the latter wrongly
bring in definitions of the former. They should be weak aliases; this
patch makes them so.
Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).
[BZ #17777]
* sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise.c
(posix_fadvise64): Define as weak alias not strong alias.
* sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
(posix_fallocate64): Likewise.
* conform/Makefile (test-xfail-XOPEN2K/fcntl.h/linknamespace):
Remove variable.
(test-xfail-XOPEN2K/mqueue.h/linknamespace): Likewise.
(test-xfail-POSIX2008/fcntl.h/linknamespace): Likewise.
(test-xfail-POSIX2008/mqueue.h/linknamespace): Likewise.
(test-xfail-XOPEN2K8/fcntl.h/linknamespace): Likewise.
(test-xfail-XOPEN2K8/mqueue.h/linknamespace): Likewise.
Matthew Fortune [Mon, 5 Jan 2015 13:34:41 +0000 (13:34 +0000)]
Fix MIPS variable PAGE_SIZE bug (16191)
MIPS supports a variable page size but glibc defines a constant.
This causes at least two glibc tests to fail when the page size
does not match the hard-coded size:
inet/test-ifaddrs
inet/test_ifindex
[BZ #16191]
* NEWS: Mention bug fix.
* sysdeps/unix/sysv/linux/mips/sys/user.h (PAGE_SHIFT): Remove.
(PAGE_SIZE, PAGE_MASK, NBPG, UPAGES): Likewise.
(HOST_TEXT_START_ADDR, HOST_DATA_START_ADDR): Likewise.
(HOST_STACK_END_ADDR): Likewise.
Joseph Myers [Fri, 2 Jan 2015 20:44:42 +0000 (20:44 +0000)]
Fix libm fegetround namespace (bug 17748).
Continuing the fixes for C90 libm functions calling C99 fe* functions,
this patch fixes the case of fegetround by making it a weak alias of
__fegetround and making the affected code call __fegetround.
Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch). Also tested for ARM
(soft-float) that fegetround failures disappear from the linknamespace
test failures (feholdexcept, fesetenv, fesetround and feupdateenv
remain to be addressed before bug 17748 is fully fixed, although this
patch may suffice to fix the failures in some cases, when the libc_fe*
functions are implemented but there is no architecture-specific sqrt
implementation in use so there were failures from fegetround used by
sqrt but no other such failures).
[BZ #17748]
* include/fenv.h (__fegetround): Declare. Use libm_hidden_proto.
* math/fegetround.c (fegetround): Rename to __fegetround and
define as weak alias of __fegetround. Use libm_hidden_weak.
* sysdeps/aarch64/fpu/fegetround.c (fegetround): Likewise.
* sysdeps/alpha/fpu/fegetround.c (fegetround): Likewise.
* sysdeps/arm/fegetround.c (fegetround): Likewise.
* sysdeps/hppa/fpu/fegetround.c (fegetround): Likewise.
* sysdeps/i386/fpu/fegetround.c (fegetround): Likewise.
* sysdeps/ia64/fpu/fegetround.c (fegetround): Likewise.
* sysdeps/m68k/fpu/fegetround.c (fegetround): Likewise.
* sysdeps/mips/fpu/fegetround.c (fegetround): Likewise.
* sysdeps/powerpc/fpu/fegetround.c (fegetround): Likewise.
Undefine after rather than before function definition; use
parentheses around function name in definition.
(__fegetround): Also undefine macro after function definition.
* sysdeps/powerpc/nofpu/fegetround.c (fegetround): Rename to
__fegetround and define as weak alias of __fegetround. Use
libm_hidden_weak. Do not undefine as macro.
* sysdeps/powerpc/powerpc32/e500/nofpu/fegetround.c (fegetround):
Likewise.
* sysdeps/s390/fpu/fegetround.c (fegetround): Rename to
__fegetround and define as weak alias of __fegetround. Use
libm_hidden_weak.
* sysdeps/sh/sh4/fpu/fegetround.c (fegetround): Likewise.
* sysdeps/sparc/fpu/fegetround.c (fegetround): Likewise.
* sysdeps/tile/math_private.h (__fegetround): New inline function.
* sysdeps/x86_64/fpu/fegetround.c (fegetround): Rename to
__fegetround and define as weak alias of __fegetround. Use
libm_hidden_weak.
* sysdeps/ieee754/dbl-64/e_sqrt.c (__ieee754_sqrt): Use
__fegetround instead of fegetround.
Joseph Myers [Fri, 2 Jan 2015 18:31:41 +0000 (18:31 +0000)]
Fix MIPS TIOCSER_TEMT namespace (bug 17782).
sysdeps/unix/sysv/linux/mips/bits/termios.h defines TIOCSER_TEMT
unconditionally, but it's in the user's namespace. This patch
conditions it on __USE_MISC, as on powerpc. I've filed bug 17783 for
the residual inconsistency in conditions on this macro (sparc defines
it for __USE_GNU only).
[BZ #17782]
* sysdeps/unix/sysv/linux/mips/bits/termios.h (TIOCSER_TEMT):
Condition macro definition on [__USE_MISC].
Joseph Myers [Fri, 2 Jan 2015 18:30:32 +0000 (18:30 +0000)]
Fix MIPS sa_flags type (bug 17781).
sysdeps/unix/sysv/linux/mips/bits/sigaction.h gives sa_flags type
unsigned int, but POSIX says it should be signed int. This patch
gives it the correct type (the layout is unchanged, so there are no
ABI issues involved).
[BZ #17781]
* sysdeps/unix/sysv/linux/mips/bits/sigaction.h
(struct sigaction): Change type of sa_flags field to int.
Joseph Myers [Fri, 2 Jan 2015 18:29:24 +0000 (18:29 +0000)]
Fix MIPS bits/fcntl.h namespace (bug 17780).
sysdeps/unix/sysv/linux/mips/bits/fcntl.h has a structure field called
pad, which is in the user's namespace. This patch changes it to
__glibc_reserved0.
[BZ #17780]
* sysdeps/unix/sysv/linux/mips/bits/fcntl.h (struct flock)
[!__USE_FILE_OFFSET64 && _MIPS_SIM != _ABI64]: Rename pad field to
__glibc_reserved0.
Joseph Myers [Fri, 2 Jan 2015 17:45:48 +0000 (17:45 +0000)]
Use single year in copyright notice in banner in ntpl/version.c.
* nptl/version.c (banner): Use single year in copyright notice.
Joseph Myers [Fri, 2 Jan 2015 16:53:06 +0000 (16:53 +0000)]
Update copyright dates not handled by scripts/update-copyrights.
I've updated copyright dates in glibc for 2015. This is the patch for
the changes not generated by scripts/update-copyrights and subsequent
build / regeneration of generated files. Apart from the files updated
last time (of which sotruss.ksh had moved to sotruss.sh during the
year) this also updates nptl/version.c (missed from 2006 until
October) and sysdeps/unix/sysv/linux/lddlibc4.c (missed since 2009).
* NEWS: Update copyright dates.
* catgets/gencat.c (print_version): Likewise.
* csu/version.c (banner): Likewise.
* debug/catchsegv.sh: Likewise.
* debug/pcprofiledump.c (print_version): Likewise.
* debug/xtrace.sh (do_version): Likewise.
* elf/ldconfig.c (print_version): Likewise.
* elf/ldd.bash.in: Likewise.
* elf/pldd.c (print_version): Likewise.
* elf/sotruss.sh: Likewise.
* elf/sprof.c (print_version): Likewise.
* iconv/iconv_prog.c (print_version): Likewise.
* iconv/iconvconfig.c (print_version): Likewise.
* locale/programs/locale.c (print_version): Likewise.
* locale/programs/localedef.c (print_version): Likewise.
* login/programs/pt_chown.c (print_version): Likewise.
* malloc/memusage.sh (do_version): Likewise.
* malloc/memusagestat.c (print_version): Likewise.
* malloc/mtrace.pl: Likewise.
* manual/libc.texinfo: Likewise.
* nptl/version.c (banner): Likewise.
* nscd/nscd.c (print_version): Likewise.
* nss/getent.c (print_version): Likewise.
* nss/makedb.c (print_version): Likewise.
* posix/getconf.c (main): Likewise.
* scripts/test-installation.pl: Likewise.
* sysdeps/unix/sysv/linux/lddlibc4.c (main): Likewise.
Will Newton [Fri, 2 Jan 2015 12:42:13 +0000 (12:42 +0000)]
ARM: Remove configure check for binutils 2.21 for ARMv7
The default required version of binutils has been increased to 2.22
making this check redundant.
ChangeLog:
2015-01-02 Will Newton <will.newton@linaro.org>
* sysdeps/arm/armv7/configure: Removed.
* sysdeps/arm/armv7/configure.ac: Likewise.
Joseph Myers [Fri, 2 Jan 2015 16:28:19 +0000 (16:28 +0000)]
Update copyright dates with scripts/update-copyrights.
Siddhesh Poyarekar [Fri, 2 Jan 2015 05:46:35 +0000 (11:16 +0530)]
Remove uses of sprintf in gen-posix-conf-vars.awk
Simply some code by replacing sprintf in the awk script.
Joseph Myers [Wed, 31 Dec 2014 22:07:52 +0000 (22:07 +0000)]
Fix libm fegetenv namespace (bug 17748).
Some C90 libm functions call fegetenv via libc_feholdsetround*
functions in math_private.h. This patch makes them call __fegetenv
instead, making fegetenv into a weak alias for __fegetenv as needed.
Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch). Also tested for ARM
(soft-float) that fegetenv failures disappear from the linknamespace
test failures (however, similar fixes will also be needed for
fegetround, feholdexcept, fesetenv, fesetround and feupdateenv before
this set of namespace issues covered by bug 17748 is fully fixed and
those linknamespace tests start passing).
[BZ #17748]
* include/fenv.h (__fegetenv): Use libm_hidden_proto.
* math/fegetenv.c (__fegetenv): Use libm_hidden_def.
* sysdeps/aarch64/fpu/fegetenv.c (fegetenv): Rename to __fegetenv
and define as weak alias of __fegetenv. Use libm_hidden_weak.
* sysdeps/alpha/fpu/fegetenv.c (__fegetenv): Use libm_hidden_def.
* sysdeps/arm/fegetenv.c (fegetenv): Rename to __fegetenv and
define as weak alias of __fegetenv. Use libm_hidden_weak.
* sysdeps/hppa/fpu/fegetenv.c (fegetenv): Likewise.
* sysdeps/i386/fpu/fegetenv.c (__fegetenv): Use libm_hidden_def.
* sysdeps/ia64/fpu/fegetenv.c (fegetenv): Rename to __fegetenv and
define as weak alias of __fegetenv. Use libm_hidden_weak.
* sysdeps/m68k/fpu/fegetenv.c (__fegetenv): Use libm_hidden_def.
* sysdeps/mips/fpu/fegetenv.c (fegetenv): Rename to __fegetenv and
define as weak alias of __fegetenv. Use libm_hidden_weak.
* sysdeps/powerpc/fpu/fegetenv.c (__fegetenv): Use
libm_hidden_def.
* sysdeps/powerpc/nofpu/fegetenv.c (__fegetenv): Likewise.
* sysdeps/powerpc/powerpc32/e500/nofpu/fegetenv.c (__fegetenv):
Likewise.
* sysdeps/s390/fpu/fegetenv.c (fegetenv): Rename to __fegetenv and
define as weak alias of __fegetenv. Use libm_hidden_weak.
* sysdeps/sh/sh4/fpu/fegetenv.c (fegetenv): Likewise.
* sysdeps/sparc/fpu/fegetenv.c (__fegetenv): Use libm_hidden_def.
* sysdeps/tile/math_private.h (__fegetenv): New inline function.
* sysdeps/x86_64/fpu/fegetenv.c (fegetenv): Rename to __fegetenv
and define as weak alias of __fegetenv. Use libm_hidden_weak.
* sysdeps/generic/math_private.h (libc_feholdsetround_ctx): Use
__fegetenv instead of fegetenv.
(libc_feholdsetround_noex_ctx): Likewise.
Matthew Fortune [Sat, 31 May 2014 23:16:25 +0000 (00:16 +0100)]
Add support for MIPS O32 FPXX and .MIPS.abiflags
* elf/elf.h (PT_MIPS_ABIFLAGS): Define.
(Elf_MIPS_ABIFlags_v0): New structure.
(EF_MIPS_FP64): Define.
(MIPS_AFL_REG_NONE, MIPS_AFL_REG_32, MIPS_AFL_REG_64): Likewise.
(MIPS_AFL_REG_128, MIPS_AFL_ASE_DSP, MIPS_AFL_ASE_DSP64): Likewise.
(MIPS_AFL_ASE_DSPR2, MIPS_AFL_ASE_EVA, MIPS_AFL_ASE_MCU): Likewise.
(MIPS_AFL_ASE_MDMX, MIPS_AFL_ASE_MIPS3D, MIPS_AFL_ASE_MT): Likewise.
(MIPS_AFL_ASE_SMARTMIPS, MIPS_AFL_ASE_VIRT): Likewise.
(MIPS_AFL_ASE_VIRT64, MIPS_AFL_ASE_MSA, MIPS_AFL_ASE_MSA64): Likewise.
(MIPS_AFL_ASE_MIPS16, MIPS_AFL_ASE_MICROMIPS): Likewise.
(MIPS_AFL_ASE_XPA, MIPS_AFL_EXT_XLR, MIPS_AFL_EXT_OCTEON2): Likewise.
(MIPS_AFL_EXT_OCTEONP, MIPS_AFL_EXT_LOONGSON_3A): Likewise.
(MIPS_AFL_EXT_OCTEON, MIPS_AFL_EXT_5900, MIPS_AFL_EXT_4010): Likewise.
(MIPS_AFL_EXT_4100, MIPS_AFL_EXT_3900, MIPS_AFL_EXT_10000): Likewise.
(MIPS_AFL_EXT_SB1, MIPS_AFL_EXT_4111, MIPS_AFL_EXT_4120): Likewise.
(MIPS_AFL_EXT_5400, MIPS_AFL_EXT_5500): Likewise.
(MIPS_AFL_EXT_LOONGSON_2E, MIPS_AFL_EXT_LOONGSON_2F): Likewise.
(Val_GNU_MIPS_ABI_FP_ANY, Val_GNU_MIPS_ABI_FP_DOUBLE): New enum values.
(Val_GNU_MIPS_ABI_FP_SINGLE, Val_GNU_MIPS_ABI_FP_SOFT): Likewise.
(Val_GNU_MIPS_ABI_FP_OLD_64, Val_GNU_MIPS_ABI_FP_XX): Likewise.
(Val_GNU_MIPS_ABI_FP_64, Val_GNU_MIPS_ABI_FP_64A): Likewise.
(Val_GNU_MIPS_ABI_FP_MAX): Likewise.
* sysdeps/mips/Makefile [subdir=elf]: Add tst-abi-interlink,
tst-mode-switch-1, tst-mode-switch-2, tst-mode-switch-3 tests.
* sysdeps/mips/bits/linkmap.h (struct link_map_machine): Add fpmode
field.
* sysdeps/mips/dl-machine.h (elf_machine_matches_host): Reject
EF_MIPS_FP64.
* sysdeps/mips/dl-machine-reject-phdr.h: New file.
* sysdeps/mips/tst-abi-fp32mod.c: Likewise.
* sysdeps/mips/tst-abi-fpxxmod.c: Likewise.
* sysdeps/mips/tst-abi-fpxxomod.c: Likewise.
* sysdeps/mips/tst-abi-fp64mod.c: Likewise.
* sysdeps/mips/tst-abi-fp64amod.c: Likewise.
* sysdeps/mips/tst-abi-interlink.c: Likewise.
* sysdeps/mips/tst-mode-switch-1.c: Likewise.
* sysdeps/mips/tst-mode-switch-2.c: Likewise.
* sysdeps/mips/tst-mode-switch-3.c: Likewise.
* sysdeps/unix/sysv/linux/mips/configure.ac (o32-fpabi): Define to
record the current FP ABI extension.
(mips-mode-switch): Define to show if kernel headers support mode
switching.
* sysdeps/unix/sysv/linux/mips/configure: Regenerate.
* sysdeps/unix/sysv/linux/mips/ldsodefs.h: Increase maximum
supported SYSV ABI version to 3.
* sysdeps/unix/sysv/linux/mips/libc-abis: Add new MIPS_O32_FP64
feature.
Rajalakshmi Srinivasaraghavan [Wed, 31 Dec 2014 19:05:00 +0000 (14:05 -0500)]
powerpc: POWER7 strcpy optimization for unaligned strings
This patch optimizes strcpy for ppc64/power7 for unaligned source or
destination address. The source or destination address is aligned
to doubleword and data is shifted based on the alignment and
added with the previous loaded data to be written as a doubleword.
For each load, cmpb instruction is used for faster null check.
The word aligned optimization is also removed, since the new unaligned
code path shows better results handling word-aligned strings.
More combination of unaligned inputs is also added in benchtest
to measure the improvement.The new optimization shows 2 to 80% of
performance improvement for longer string though it does not show
big difference on string size less than 16 due to additional checks.
Joseph Myers [Wed, 31 Dec 2014 19:16:34 +0000 (19:16 +0000)]
Clean up powerpc fegetround / __fegetround inlines.
The natural fix for some linknamespace test failures, where C90 libm
functions call C99 <fenv.h> functions, is to make fe* into weak
aliases for __fe* and call __fe* from within libm as needed.
To do this, the __fe* names need to be available for that purpose -
that is, they must not be used for something other than aliases of
fe*. On powerpc, however, __fegetround is an inline function in
fenv_libc.h, with no corresponding fegetround inline function;
fegetround has an equivalent macro expansion in bits/fenvinline.h, but
that is disabled if __NO_MATH_INLINES (which is defined for building
libm).
I see no need for that disabling; it's not even clear that
__NO_MATH_INLINES should affect <fenv.h>, and the results of
fegetround are completely defined so there is no semantic effect of
that disabling at all outside glibc. The x86 inline feraiseexcept is
conditioned on __USE_EXTERN_INLINES not __NO_MATH_INLINES (but that's
an inline function rather than a macro).
This patch removes the __NO_MATH_INLINES conditional on that
fegetround macro, so resulting in it being expanded inline inside
glibc. In turn, this means that direct calls to __fegetround from C99
functions in ldbl-128ibm can be changed to calls to fegetround, so
that nofpu fenv_libc.h files don't need to define __fegetround at all
and, by changing ldbl-128ibm files to use <fenv.h> not <fenv_libc.h>,
non-e500 nofpu no longer needs an fenv_libc.h file.
The other macros in fenvinline.h are left conditional on
__NO_MATH_INLINES, although since the only case where this should make
a difference is one involving undefined behavior (if the argument to
the function is not a valid exception macro).
The out-of-line definition for fegetround uses __fegetround (the
inline function removed by this patch). So this continues to work,
the fenvinline.h header is made to define __fegetround, and then to
define fegetround to call __fegetround.
Tested for powerpc32 (hard float) that installed stripped shared
libraries are unchanged by this patch; also tested that powerpc-nofpu
build still works. (This patch does not itself fix any bugs; it
simply cleans things up in preparation for separate bug fixes.)
* sysdeps/powerpc/bits/fenvinline.h (fegetround): Rename macro to
__fegetround and redefine to call __fegetround. Remove condition
on [!__NO_MATH_INLINES].
* sysdeps/powerpc/fpu/fenv_libc.h (__fegetround): Remove inline
function.
* sysdeps/powerpc/nofpu/fenv_libc.h: Remove file.
* sysdeps/powerpc/powerpc32/e500/nofpu/fenv_libc.h (__fegetround):
Remove macro.
* sysdeps/ieee754/ldbl-128ibm/s_llrintl.c: Include <fenv.h>
instead of <fenv_libc.h>.
(__llrintl): Call fegetround instead of __fegetround.
* sysdeps/ieee754/ldbl-128ibm/s_llroundl.c: Include <fenv.h>
instead of <fenv_libc.h>.
* sysdeps/ieee754/ldbl-128ibm/s_lrintl.c: Likewise.
(__lrintl): Call fegetround instead of __fegetround.
* sysdeps/ieee754/ldbl-128ibm/s_lroundl.c: Include <fenv.h>
instead of <fenv_libc.h>.
* sysdeps/ieee754/ldbl-128ibm/s_rintl.c: Likewise.
(__rintl): Call fegetround instead of __fegetround.
Siddhesh Poyarekar [Wed, 31 Dec 2014 07:52:58 +0000 (13:22 +0530)]
Use one-dimension arrays in gen-posix-conf-vars.awk
True multi-dimensional arrays were introduced in awk 4.0 and we
support awk versions as early as 3.12. Use a single subscript of the
form prefix_conf instead of two dimensions to work around this
limitation. We also need one additional array of just the conf names
subscripted by the prefix_conf to print the names for the
specifications.
* scripts/gen-posix-conf-vars.awk: Don't use multi-dimensional
arrays.
H.J. Lu [Tue, 30 Dec 2014 22:30:37 +0000 (14:30 -0800)]
Don't check PI_STATIC_AND_HIDDEN in i386 dl-machine.h
PI_STATIC_AND_HIDDEN is always defined for i386. There is no need to
check PI_STATIC_AND_HIDDEN in sysdeps/i386/dl-machine.h.
[BZ #17775]
* sysdeps/i386/dl-machine.h (PI_STATIC_AND_HIDDEN): Removed.
(elf_machine_dynamic) [!PI_STATIC_AND_HIDDEN]: Likewise.
(elf_machine_load_address) [!PI_STATIC_AND_HIDDEN]: Likewise.
Andrew Senkevich [Tue, 30 Dec 2014 19:34:53 +0000 (11:34 -0800)]
i386: Fix build by GCC 5.0
Fixed 3 "make check" failures on glibc 32bit built by gcc 5.0 due to EBX
was enabled for allocation:
https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00892.html
Tests elf/tst-tls3, elf/tst-execstack-needed, elf/tst-execstack-prog
were failed because EBX was used as PIC register.
* sysdeps/i386/tls-macros.h: Include <features.h>.
(TLS_LE): Use non-PIC version for GCC >= 5.0.
(TLS_IE): Likewise.
(TLS_LD): Likewise.
(TLS_GD): Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep.h (check_consistency): Don't
define for GCC >= 5.0.
Chris Metcalf [Tue, 30 Dec 2014 19:11:13 +0000 (14:11 -0500)]
Fix some warnings in the absence of FP round/exception support
Due to tile missing a bunch of FP exception and rounding
support, the tests generate warnings. These changes fix the
warnings by just not compiling some unused functions, and
adding some attribute ((unused)) tags.
H.J. Lu [Tue, 30 Dec 2014 17:32:50 +0000 (09:32 -0800)]
Mention i386 memcpy with SSE2 unaligned load/store
Joseph Myers [Tue, 30 Dec 2014 17:08:09 +0000 (17:08 +0000)]
Fix libm feraiseexcept namespace (bug 17723).
Various C90 and UNIX98 libm functions call feraiseexcept, which is not
in those standards. This causes linknamespace test failures - except
on x86 / x86_64, where feraiseexcept is inline (for the relevant
constant arguments) in bits/fenv.h.
This patch fixes this by making those functions call __feraiseexcept
instead. All changes are applied to all architectures rather than
considering the possibility that some might not be needed in some
cases (e.g. x86) as it seems most maintainable to keep architectures
consistent.
Where __feraiseexcept does not exist, it is added, with feraiseexcept
made a weak alias; where it is a strong alias, it is made weak.
libm_hidden_def / libm_hidden_proto are used with __feraiseexcept
(this might in some cases improve code generation for existing calls
to __feraiseexcept in some code on some architectures). Where there
are dummy feraiseexcept macros (on architectures without
floating-point exceptions support, to avoid compile errors from
references to undefined FE_* macros), corresponding dummy
__feraiseexcept macros are added. And on x86, to ensure
__feraiseexcept calls still get inlined, the inline function in
bits/fenv.h is refactored so that most of it can be reused in an
inline __feraiseexcept in a separate include/bits/fenv.h.
Calls are changed in C90/UNIX98 functions, but generally not in
functions missing from those standards. They are also changed in
libc_fe* functions (on the basis that those might be used in any libm
function), and in feupdateenv (on the same basis - may be used, via
default libc_*, in any libm function - of course feupdateenv will need
changing to __feupdateenv in a subsequent patch to make that fully
namespace-clean).
No __feraiseexcept is added corresponding to the feraiseexcept in
powerpc bits/fenvinline.h, because that macro definition is
conditional on !defined __NO_MATH_INLINES, and glibc libm is built
with -D__NO_MATH_INLINES, so changing internal calls to use
__feraiseexcept should make no difference.
Tested for x86_64 (testsuite; the only change in disassembly of
installed shared libraries is a slight code reordering in clog10, of
no apparent significance). Also tested for MIPS, where (in the
configuration tested) it eliminates math.h linknamespace failures for
n32 and n64 (some for o32 remain because of other issues).
[BZ #17723]
* include/fenv.h (__feraiseexcept): Use libm_hidden_proto.
* math/fraiseexcpt.c (__feraiseexcept): Use libm_hidden_def.
* sysdeps/aarch64/fpu/fraiseexcpt.c (feraiseexcept): Rename to
__feraiseexcept and define as weak alias of __feraiseexcept. Use
libm_hidden_weak.
* sysdeps/arm/fraiseexcpt.c (feraiseexcept): Likewise.
* sysdeps/hppa/fpu/fraiseexcpt.c (feraiseexcept): Likewise.
* sysdeps/i386/fpu/fraiseexcpt.c (__feraiseexcept): Use
libm_hidden_def.
* sysdeps/ia64/fpu/fraiseexcpt.c (feraiseexcept): Rename to
__feraiseexcept and define as weak alias of __feraiseexcept. Use
libm_hidden_weak.
* sysdeps/m68k/coldfire/fpu/fraiseexcpt.c (feraiseexcept):
Likewise.
* sysdeps/microblaze/math_private.h (__feraiseexcept): New macro.
* sysdeps/mips/fpu/fraiseexcpt.c (feraiseexcept): Rename to
__feraiseexcept and define as weak alias of __feraiseexcept. Use
libm_hidden_weak.
* sysdeps/powerpc/fpu/fraiseexcpt.c (__feraiseexcept): Use
libm_hidden_def.
* sysdeps/powerpc/nofpu/fraiseexcpt.c (__feraiseexcept): Likewise.
* sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcpt.c
(__feraiseexcept): Likewise.
* sysdeps/s390/fpu/fraiseexcpt.c (feraiseexcept): Rename to
__feraiseexcept and define as weak alias of __feraiseexcept. Use
libm_hidden_weak.
* sysdeps/sh/sh4/fpu/fraiseexcpt.c (feraiseexcept): Likewise.
* sysdeps/sparc/fpu/fraiseexcpt.c (__feraiseexcept): Use
libm_hidden_def.
* sysdeps/tile/math_private.h (__feraiseexcept): New macro.
* sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S (__feraiseexcept):
Use libm_hidden_def.
* sysdeps/x86_64/fpu/fraiseexcpt.c (__feraiseexcept): Use
libm_hidden_def.
(feraiseexcept): Define as weak not strong alias. Use
libm_hidden_weak.
* sysdeps/x86/fpu/bits/fenv.h (__feraiseexcept_invalid_divbyzero):
New inline function. Factored out of ...
(feraiseexcept): ... here. Use __feraiseexcept_invalid_divbyzero.
* sysdeps/x86/fpu/include/bits/fenv.h: New file.
* math/e_scalb.c (invalid_fn): Call __feraiseexcept instead of
feraiseexcept.
* math/w_acos.c (__acos): Likewise.
* math/w_asin.c (__asin): Likewise.
* math/w_ilogb.c (__ilogb): Likewise.
* math/w_j0.c (y0): Likewise.
* math/w_j1.c (y1): Likewise.
* math/w_jn.c (yn): Likewise.
* math/w_log.c (__log): Likewise.
* math/w_log10.c (__log10): Likewise.
* sysdeps/aarch64/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/aarch64/fpu/math_private.h
(libc_feupdateenv_test_aarch64): Likewise.
* sysdeps/alpha/fpu/feupdateenv.c (__feupdateenv): Likewise.
* sysdeps/arm/fenv_private.h (libc_feupdateenv_test_vfp): Likewise.
* sysdeps/arm/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/m68k/fpu/feupdateenv.c (__feupdateenv): Likewise.
* sysdeps/mips/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/powerpc/fpu/e_sqrt.c (__slow_ieee754_sqrt): Likewise.
* sysdeps/s390/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/sh/sh4/fpu/feupdateenv.c (feupdateenv): Likewise.
* sysdeps/sparc/fpu/feupdateenv.c (__feupdateenv): Likewise.
H.J. Lu [Tue, 30 Dec 2014 16:12:42 +0000 (08:12 -0800)]
Mention fix for BZ #17732
H.J. Lu [Fri, 19 Dec 2014 22:05:35 +0000 (14:05 -0800)]
Replace %ld with %jd and cast to intmax_t
H.J. Lu [Fri, 19 Dec 2014 22:04:35 +0000 (14:04 -0800)]
Replace %ld with %jd and cast to intmax_t
H.J. Lu [Fri, 19 Dec 2014 22:02:58 +0000 (14:02 -0800)]
Replace %ld with %jd and cast to intmax_t
H.J. Lu [Fri, 19 Dec 2014 22:01:40 +0000 (14:01 -0800)]
Replace %ld with %jd and cast to intmax_t
H.J. Lu [Fri, 19 Dec 2014 22:00:59 +0000 (14:00 -0800)]
Replace %ld/%lu with %jd/%ju and cast to intmax_t/uintmax_t
H.J. Lu [Fri, 19 Dec 2014 21:52:08 +0000 (13:52 -0800)]
Replace %ld with %jd and cast to intmax_t
H.J. Lu [Fri, 19 Dec 2014 21:51:13 +0000 (13:51 -0800)]
Replace %ld with %jd and cast to intmax_t
H.J. Lu [Fri, 19 Dec 2014 21:49:58 +0000 (13:49 -0800)]
Replace %ld with %jd and cast to intmax_t
H.J. Lu [Fri, 19 Dec 2014 21:48:40 +0000 (13:48 -0800)]
Replace %ld with %jd and cast to intmax_t
Andrew Senkevich [Mon, 29 Dec 2014 11:39:46 +0000 (14:39 +0300)]
i386: memcpy functions with SSE2 unaligned load/store
These new memcpy functions are the 32-bit version of x86_64 SSE2 unaligned
memcpy. Memcpy average performace benefit is 18% on Silvermont, other
platforms also improved about 35%, benchmarked on Silvermont, Haswell, Ivy
Bridge, Sandy Bridge and Westmere, performance results attached in
https://sourceware.org/ml/libc-alpha/2014-07/msg00157.html
* sysdeps/i386/i686/multiarch/bcopy-sse2-unaligned.S: New file.
* sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S: Likewise.
* sysdeps/i386/i686/multiarch/memmove-sse2-unaligned.S: Likewise.
* sysdeps/i386/i686/multiarch/mempcpy-sse2-unaligned.S: Likewise.
* sysdeps/i386/i686/multiarch/bcopy.S: Select the sse2_unaligned
version if bit_Fast_Unaligned_Load is set.
* sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
* sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
* sysdeps/i386/i686/multiarch/memmove.S: Likewise.
* sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
* sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
* sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
* sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Add
bcopy-sse2-unaligned, memcpy-sse2-unaligned,
memmove-sse2-unaligned and mempcpy-sse2-unaligned.
* sysdeps/i386/i686/multiarch/ifunc-impl-list.c (MAX_IFUNC): Set
to 4.
(__libc_ifunc_impl_list): Test __bcopy_sse2_unaligned,
__memmove_chk_sse2_unaligned, __memmove_sse2_unaligned,
__memcpy_chk_sse2_unaligned, __memcpy_sse2_unaligned,
__mempcpy_chk_sse2_unaligned, and __mempcpy_sse2_unaligned.
Chris Metcalf [Tue, 30 Dec 2014 04:14:38 +0000 (23:14 -0500)]
Fix a couple of -Wundef warnings.
Chris Metcalf [Tue, 30 Dec 2014 00:48:43 +0000 (19:48 -0500)]
tile: prefer inlines to macros in math_private.h.
Chris Metcalf [Mon, 29 Dec 2014 15:58:25 +0000 (10:58 -0500)]
posix/Makefile: use $(objpfx) for files in before-compile.
This fixes a build failure with a separate build tree where
posix-conf-vars-def.h wasn't being built.
Siddhesh Poyarekar [Mon, 29 Dec 2014 12:13:19 +0000 (17:43 +0530)]
Make type for spec variable size as size_t
Siddhesh Poyarekar [Mon, 29 Dec 2014 12:10:47 +0000 (17:40 +0530)]
Use posix-conf-vars.list to generate spec array
This patch adds support to generate the spec array in getconf from the
conf.list. The generated code is mostly unchanged. the only changes
are due to the change in layout of the spec and val arrays in the ELF.
The val array can also be auto-generated from posix-conf-vars.list
once the remaining macros are added to it.
* posix/posix-conf-vars.list (SPEC:XBS5): Add sysconf prefix.
* posix/confstr.c: Define NEED_SPEC_ARRAY to 0.
* posix/posix-envs.def: Likewise.
* sysdeps/posix/sysconf.c: Likewise.
* posix/getconf.c: Define NEED_SPEC_ARRAY to 1.
(specs): Remove array.
* scripts/gen-posix-conf-vars.awk: Support generation of specs
array.
Siddhesh Poyarekar [Mon, 29 Dec 2014 12:09:30 +0000 (17:39 +0530)]
Add _POSIX namespace SYSCONF macros to posix-conf-vars.list
This fixes the remaining -Wundef warnings. Tested on x86_64.
* posix/posix-conf-vars.list: Add _POSIX sysconf namespace.
* sysdeps/posix/sysconf.c: Include posix-conf-vars.h.
(__sysconf): Use CONF_IS_* macros.
Siddhesh Poyarekar [Mon, 29 Dec 2014 12:07:54 +0000 (17:37 +0530)]
Remove Wundef warnings for specification macros
This patch adds a file posix-conf-vars.list that is used to generate
macros to determine if a macro is defined as set, unset or not
defined. gen-posix-conf-vars.awk processes this file and generates a
header (posix-conf-vars-def.h) with these macros. A new header
posix-conf-vars.h includes this generated header and defines accessor
macros for the generated macros.
Tested on x86_64.
* posix/Makefile (before-compile): Add posix-conf-vars-def.h.
($(objpfx)posix-conf-vars-def.h): New target.
* posix/posix-conf-vars.list: New file.
* posix/posix-conf-vars.h: New file.
* posix/confstr.c: Include posix-conf-vars.h.
(confstr): Use CONF_IS_* macros.
* posix/posix-envs.def: Include posix-conf-vars.h. Use
CONF_IS_* macros.
* scripts/gen-posix-conf-vars.awk: New file.
Chris Metcalf [Fri, 26 Dec 2014 23:39:47 +0000 (18:39 -0500)]
tile: add no-op fe*() routines for libc internal use
These avoid having tile generate real calls to the no-op
functions, which then causes linknamespace test failures.
It might make sense to factor all of these out into a common
header that can be shared by tile, microblaze, etc., but for
now just fix the test failures.
Chris Metcalf [Fri, 26 Dec 2014 21:34:02 +0000 (16:34 -0500)]
linux/clock_settime: remove unnecessary vDSO definitions
These definitions were added back before __ASSUME_POSIX_CPU_TIMERS
was removed. There used to be a vsyscall to clock_getres() in
maybe_syscall_settime_cpu(), but that function was removed in commit
26889eac. The presence of the vsyscall definitions means that platforms
that don't provide clock_getres as a vsyscall hit a symbol redefinition
warning in this file, becoming fatal with -Werror. Removing the
vsyscall definitions is the obvious fix.
No change to generated code on x86_64.
Chris Metcalf [Fri, 26 Dec 2014 21:22:28 +0000 (16:22 -0500)]
tilegx: fix sysdep.h to avoid a redefinition warning
The symbol for HAVE_CLOCK_GETTIME_VSYSCALL was being
only conditionally defined under [SHARED]. However, it turns
out this causes a preprocessor symbol redefinition warning
when building clock_gettime.o. Move the symbol definition
down to make it unconditional, like other platforms do.
Chris Metcalf [Fri, 26 Dec 2014 21:18:40 +0000 (16:18 -0500)]
tilegx32: avoid a a -Werror warning from unwinding
The _Unwind_GetCFA() routine returns a 64-bit value,
which we interpret as a pointer. Add an intermediate
cast to long so that in ILP32 mode we don't get a warning
about casting a wrong-sized integer to a pointer.
Chris Metcalf [Tue, 23 Dec 2014 19:04:35 +0000 (14:04 -0500)]
tilegx: enable wordsize-64 support for ieee745 dbl-64.
I missed this during the initial port. Some testing shows that
enabling this mode does, unsurprisingly, yield some nice speedups
on the math functions in question.
Richard Earnshaw [Tue, 23 Dec 2014 16:57:07 +0000 (08:57 -0800)]
* string/stpcpy.c (__stpcpy): Rewrite using strlen and memcpy.
Florian Weimer [Tue, 23 Dec 2014 15:16:32 +0000 (16:16 +0100)]
iconvdata/run-iconv-test.sh: Actually test iconv modules
Arjun Shankar noticed that this test case was not testing anything
because iconv was invoked without the required arguments.
Joseph Myers [Mon, 22 Dec 2014 21:42:03 +0000 (21:42 +0000)]
Make __ASSUME_UTIMES hppa-specific.
This patch makes __ASSUME_UTIMES hppa-specific, removing mentions of
the macro from architecture-independent code and code for other
architectures. (All other architectures either have the utimes
syscall in all relevant kernel versions, or use the asm-generic
interface so only have utimensat and won't get the utimes syscall.) A
similar approach is used to that used for futimesat for MicroBlaze: if
the kernel is recent enough that the utimes syscall can be assumed to
be present, use the implementation in terms of the utimes syscall, and
otherwise use the linux/generic implementation in terms of utimensat.
Tested x86_64 that the disassembly of installed shared libraries is
unchanged by the patch. Not tested for hppa.
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_UTIMES): Do
not define.
* sysdeps/unix/sysv/linux/utimes.c: Do not include
<kernel-features.h>.
(__utimes) [__NR_utimes]: Make code unconditional.
(__utimes) [!__ASSUME_UTIMES]: Remove conditional code.
* sysdeps/unix/sysv/linux/aarch64/kernel-features.h
(__ASSUME_UTIMES): Do not undefine.
* sysdeps/unix/sysv/linux/tile/kernel-features.h
(__ASSUME_UTIMES): Likewise.
* sysdeps/unix/sysv/linux/hppa/kernel-features.h
(__ASSUME_UTIMES): Define for [__LINUX_KERNEL_VERSION >= 0x030e00]
instead of undefining for [__LINUX_KERNEL_VERSION < 0x030e00].
* sysdeps/unix/sysv/linux/hppa/utimes.c: New file.
Steve Ellcey [Mon, 22 Dec 2014 21:29:20 +0000 (13:29 -0800)]
Fix preprocessor indentation in sysdeps/mips/memcpy.S.
Checked in as obvious.
Chris Metcalf [Mon, 22 Dec 2014 21:24:32 +0000 (16:24 -0500)]
NEWS: mention bug fix for 17747.
Chris Metcalf [Mon, 22 Dec 2014 20:24:17 +0000 (15:24 -0500)]
Fix namespace conformance issue with Bessel functions.
[BZ #17747]
The y0/y1/yn and j0/j1/jn functions provided a strong_alias
to the "l"-suffixed variants when no long double support is
being compiled. This breaks namespace conformance when the
basename versions conform but the l-suffixed ones don't.
Fixed by making them weak aliases instead.
Chris Metcalf [Mon, 22 Dec 2014 19:50:26 +0000 (14:50 -0500)]
tilegx: remove implicit boolean conversion in strstr.
[BZ #17746]
The __builtin_expect() truncated a uint64_t to a 32-bit long
in ILP32 mode, discarding the high 32 bits, and potentially
missing the NUL terminator that we were searching for with SIMD
operations. Explicitly compare to zero to fix the problem.
Chris Metcalf [Mon, 22 Dec 2014 19:45:02 +0000 (14:45 -0500)]
Update NEWS and ChangeLog with two tile bug fixes.
I committed fixes without references to bug numbers.
Bug 17744: commit
95dee05f.
Bug 17745: commit
e969965a.
Steve Ellcey [Mon, 22 Dec 2014 18:49:56 +0000 (10:49 -0800)]
2014-12-22 Steve Ellcey <sellcey@imgtec.com>
* sysdeps/unix/mips/sysdep.h (__mips_isa_rev): Set
to zero if not already defined.
Joseph Myers [Mon, 22 Dec 2014 18:45:50 +0000 (18:45 +0000)]
Split __kernel_standard* functions (fixes bug 17724).
Bug 17724 reports references to fesetround being brought in by
ldbl-128ibm rintl via references to __rintl from __kernel_standard_l.
Because all three __kernel_standard* functions are in the same file,
this gets brought in even though only the long double version
__kernel_standard_l needs __rintl, and the C90 functions use only
__kernel_standard.
This patch fixes this by splitting the three versions into separate
files; it's fine for long double functions to refer to fe* functions
directly, unless they get called by C90 double functions.
Tested for x86_64 (testsuite; the reordering of code means disassembly
of shared libraries can't usefully be compared). Tested for powerpc
that the relevant issue disappears from the linknamespace test
output.
[BZ #17724]
* sysdeps/ieee754/k_standard.c: Don't include <float.h>.
(__kernel_standard_f): Remove. Moved to k_standardf.c.
(__kernel_standard_l): Remove. Moved to k_standardl.c with
(char *) casts added.
* sysdeps/ieee754/k_standardf.c: New file.
* sysdeps/ieee754/k_standardl.c: Likewise.
* math/Makefile (libm-support): Remove k_standard.
(libm-calls): Add k_standard.
Steve Ellcey [Mon, 22 Dec 2014 18:36:49 +0000 (10:36 -0800)]
Remove trailing whitespace.
Steve Ellcey [Mon, 22 Dec 2014 18:35:32 +0000 (10:35 -0800)]
Add missing ChangeLog entries from Friday (Dec 19, 2014).
Wilco Dijkstra [Mon, 22 Dec 2014 17:11:18 +0000 (17:11 +0000)]
Optimize to avoid an unnecessary FPCR read.
Wilco Dijkstra [Mon, 22 Dec 2014 17:07:16 +0000 (17:07 +0000)]
Optimize to reduce FPCR/FPSR accesses.
Wilco Dijkstra [Mon, 22 Dec 2014 17:01:33 +0000 (17:01 +0000)]
Call libc_fetestexcept_aarch64.
Wilco Dijkstra [Mon, 22 Dec 2014 16:57:41 +0000 (16:57 +0000)]
Call libc_fesetround_aarch64.
Joseph Myers [Mon, 22 Dec 2014 12:46:27 +0000 (12:46 +0000)]
Fix resolver bind, getsockname namespace (bug 17733).
On Linux architectures using socketcall, the resolver ends up bringing
in strong symbols for bind and getsockname, which are not in
POSIX.1-1996. This causes linknamespace test failures:
FAIL: conform/POSIX/pthread.h/linknamespace
FAIL: conform/POSIX/sched.h/linknamespace
FAIL: conform/POSIX/time.h/linknamespace
These functions are defined as strong symbols with __bind and
__getsockname as weak aliases. This patch switches this to the other
way round by removing the NO_WEAK_ALIAS definitions and so letting the
default case in socket.S act; I see no reason for the existing
arrangements.
Tested for x86 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).
[BZ #17733]
* sysdeps/unix/sysv/linux/bind.S (NO_WEAK_ALIAS): Do not define.
(__bind): Do not define as weak alias.
* sysdeps/unix/sysv/linux/getsockname.S (NO_WEAK_ALIAS): Do not
define.
(__getsockname): Do not define as weak alias.
Will Newton [Thu, 11 Dec 2014 17:27:34 +0000 (17:27 +0000)]
Require bison 2.7 or newer for regenerating intl/plural.y
The merge of the latest gettext code introduced changes to the yacc
parser source that are incompatible with versions of bison older
than 2.7. Add a configure check for the appropriate versions and
document the requirement in INSTALL.
ChangeLog:
2014-12-22 Will Newton <will.newton@linaro.org>
* manual/install.texi: Document that we require bison 2.7
or above.
* INSTALL: Regenerate.
* configure.ac: Use AC_CHECK_PROG_VER instead of
AC_PATH_PROG when checking for bison and check for
version 2.7 or above.
* configure: Regenerate.
Chris Metcalf [Sun, 21 Dec 2014 21:11:39 +0000 (16:11 -0500)]
tile: separate ffsll from ffs
This avoids a linknamespace failure when ffs is legal
but ffsll is not.
Chris Metcalf [Sun, 21 Dec 2014 21:09:36 +0000 (16:09 -0500)]
tile: remove localplt.data and use generic one again.
With the __tls_get_addr removed, it works for tile.
H.J. Lu [Sun, 21 Dec 2014 17:12:04 +0000 (09:12 -0800)]
Add hidden __tls_get_addr/___tls_get_addr alias
__tls_get_addr/___tls_get_addr is always defined in ld.so. There is
no need to call them via PLT inside ld.so. This patch adds the hidden
__tls_get_addr/___tls_get_addr aliases and calls them directly from
_dl_tlsdesc_dynamic. There is no need to set up the EBX register in
i386 _dl_tlsdesc_dynamic when calling the hidden ___tls_get_addr.
* elf/dl-tls.c (__tls_get_addr): Provide the hidden definition
if not defined.
* sysdeps/i386/dl-tls.h (___tls_get_addr): Provide the hidden
definition.
* sysdeps/i386/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Call the
hidden ___tls_get_addr.
* sysdeps/x86_64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Call the
hidden __tls_get_addr.
* sysdeps/generic/localplt.data (__tls_get_addr): Removed.
* sysdeps/unix/sysv/linux/i386/localplt.data (___tls_get_addr):
Likewise.
Andreas Schwab [Sun, 21 Dec 2014 14:06:27 +0000 (15:06 +0100)]
m68k: remove @PLTPC from _dl_init call
Andreas Schwab [Sun, 21 Dec 2014 14:05:09 +0000 (15:05 +0100)]
Fix changelog typo
H.J. Lu [Sun, 21 Dec 2014 13:27:31 +0000 (05:27 -0800)]
Remove @PLT from "call _dl_init@PLT" in _dl_start_user
_dl_start_user in ld.so calls the local function _dl_init. There is no
need to go through PLT.
* sysdeps/i386/dl-machine.h (_dl_start_user): Remove @PLT
from "call _dl_init@PLT".
* sysdeps/x86_64/dl-machine.h (_dl_start_user): Likewise.
from "call _dl_init@PLT".
Anders Kaseorg [Thu, 11 Dec 2014 10:33:22 +0000 (05:33 -0500)]
manual: Correct guarantee about pointers compared by qsort()
C99, C11, POSIX, and the glibc implementation do guarantee that the
pointers passed to the qsort comparison function lie within the array.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Chris Metcalf [Sat, 20 Dec 2014 18:56:57 +0000 (13:56 -0500)]
tile: provide localplt.data with __tls_get_addr optional
Chris Metcalf [Sat, 20 Dec 2014 03:46:52 +0000 (22:46 -0500)]
tilegx: fix strstr to build and link better
The two_way_short_needle() routine included from str-two-way.h
is not used, so mark it so to avoid compiler warnings.
Calling strnlen() breaks linknamespace tests, so change it
to __strnlen().
Steve Ellcey [Fri, 19 Dec 2014 22:40:29 +0000 (14:40 -0800)]
Remove trailing white space.
Steve Ellcey [Fri, 19 Dec 2014 22:39:18 +0000 (14:39 -0800)]
2014-12-19 Steve Ellcey <sellcey@imgtec.com>
* sysdeps/mips/addmul_1.S (__mpn_addmul_1): Use mulu/muhu instead
of multu on MIPSr6.
* sysdeps/mips/mul_1.S (__mpn_mul_1): Ditto.
* sysdeps/mips/submul_1.S (__mpn_submul_1): Ditto.
* sysdeps/mips/mips64/addmul_1.S (__mpn_addmul_1): Ditto.
* sysdeps/mips/mips64/mul_1.S (__mpn_mul_1): Ditto.
* sysdeps/mips/mips64/submul_1.S (__mpn_submul_1): Ditto.
Steve Ellcey [Fri, 19 Dec 2014 22:37:44 +0000 (14:37 -0800)]
2014-12-19 Steve Ellcey <sellcey@imgtec.com>
* sysdeps/mips/sys/asm.h (PTR_ADDU): Use addu on mips32r6/mips64r6.
(PTR_ADDIU): Use addiu for mips32r6/mips64r6.
(PTR_SUBU): Use subu for mips32r6/mips64r6.
(PTR_SUBIU): Use subu for mips32r6/mips64r6 (subiu does not exist).
* sysdeps/mips/machine-gmon.h (PTR_ADDU_STRING) Use addu for
mips32r6/mips64r6.
(PTR_SUBU_STRING) Use subu for mips32r6/mips64r6.
Ondřej Bílka [Fri, 19 Dec 2014 22:09:40 +0000 (23:09 +0100)]
Simplify strncat.
We rewrite strncat to use strnlen and malloc calls which simplifies code
an is faster as these functions are better optimized than original code.
David S. Miller [Fri, 19 Dec 2014 21:34:30 +0000 (13:34 -0800)]
Fix soft-fp build warning on sparc about strict aliasing.
* sysdeps/sparc/sparc32/soft-fp/q_neg.c (_Q_neg): Use a union to
access the quad as both a long double and as a series of 4 words.
David S. Miller [Fri, 19 Dec 2014 21:23:40 +0000 (13:23 -0800)]
Fix array bounds warnings in elf_get_dyanmic_info() on sparc with gcc-4.6
* get-dynamic-info.h (elf_get_dynamic_info): Ignore -Warray-bounds for a
link_map->l_info array access.
Chris Metcalf [Fri, 19 Dec 2014 21:36:00 +0000 (16:36 -0500)]
iconvdata/tst-loading: bump up timeout to 10s
Chris Metcalf [Fri, 19 Dec 2014 20:11:04 +0000 (15:11 -0500)]
math: increase timeout for math/atest-*.c
These tests run in the 2-5 second range on tilegx, so just bump
up the timeout to 10 seconds generically.
H.J. Lu [Fri, 19 Dec 2014 16:32:05 +0000 (08:32 -0800)]
Replace -Wno-error with -fno-builtin-lround
Torvald Riegel [Wed, 17 Dec 2014 18:09:04 +0000 (19:09 +0100)]
i386: Move futex functions from lowlevellock.h to lowlevellock-futex.h.
Torvald Riegel [Wed, 17 Dec 2014 17:55:19 +0000 (18:55 +0100)]
Use generic lowlevellock-futex.h in x86_64 lowlevellock.h.
Torvald Riegel [Wed, 17 Dec 2014 22:28:38 +0000 (23:28 +0100)]
sh: Remove custom lowlevellock, barrier, condvar, and rwlock implementations.
H.J. Lu [Fri, 19 Dec 2014 13:37:29 +0000 (05:37 -0800)]
Compile s_llround.c with -Wno-error for x32 build
Since x32 returns 32-bit long int and 64-bit long long int in the
same 64-bit register, we make the 32b-bit lround an alias of the
64-bit llround. Add -Wno-error for x32 build to silence the compiler.
H.J. Lu [Fri, 19 Dec 2014 13:28:06 +0000 (05:28 -0800)]
Replace 1L with (mp_limb_t) 1
X86-64 and x32 use sysdeps/i386/ldbl2mpn.c. res_ptr is a pointer
to mp_limb_t, which is long for i386 and x86-64 and long long for
x32. On x32, I got
../sysdeps/x86_64/../i386/ldbl2mpn.c: In function ‘__mpn_extract_long_double’:
../sysdeps/x86_64/../i386/ldbl2mpn.c:72:4: error: left shift count >= width of type [-Werror]
res_ptr[N - 1] &= ~(1L << ((LDBL_MANT_DIG - 1) % BITS_PER_MP_LIMB));
^
cc1: all warnings being treated as errors
This patch replaces 1L with (mp_limb_t) 1. Verified on x32, i686 and
x86-64 with GCC 4.8.3.
Allan McRae [Thu, 18 Dec 2014 01:01:43 +0000 (11:01 +1000)]
Label CVE-2014-9402 in NEWS
Roland McGrath [Wed, 17 Dec 2014 22:33:28 +0000 (14:33 -0800)]
NPTL: Move fork state variables to initializer files.
Roland McGrath [Wed, 17 Dec 2014 22:07:18 +0000 (14:07 -0800)]
NPTL: Remove gratuitous Linuxisms from gai_misc.h.
Roland McGrath [Wed, 17 Dec 2014 21:22:41 +0000 (13:22 -0800)]
Fix stub __if_freenameindex build error.
Roland McGrath [Wed, 17 Dec 2014 18:41:28 +0000 (10:41 -0800)]
Remove explicit inline on malloc perturb functions.
Joseph Myers [Wed, 17 Dec 2014 18:10:37 +0000 (18:10 +0000)]
Fix profil_counter namespace (bug 17725).
On ARM, where profil_counter is not static, it is brought in by
references to various standard functions, as noted in
<https://sourceware.org/ml/libc-alpha/2014-11/msg00890.html>, although
it is not a standard function itself. I don't know if this also
causes test failures on SPARC, although I see no reason for it not to
do so.
This patch fixes this namespace issue. profil_counter is renamed to
__profil_counter and made a weak alias on ARM and SPARC. Because of
the uses in profil.c / sprofil.c it seems simplest to make the rename
globally, including on the other architectures for which
profil_counter was static and so the change is of no substance. The
variant names profil_counter_* used in sprofil.c are also renamed to
start with __ so that undesired function names do not get exported in
static libc.
As I noted in bug 17726, profil_counter should probably be a compat
symbol on ARM and SPARC, so it wouldn't exist at all in static libc
even as a weak alias. Since defining a compat symbol still requires
an internal name as a target of an alias, this patch still seems
reasonable as an intermediate step towards that goal: it wouldn't be
possible for the function simply to be static profil_counter on ARM
and SPARC with profil_counter also being the exported compat symbol
name, so profil.c / sprofil.c would still need to be prepared to call
the function under another name (here, __profil_counter).
Tested for x86_64 (testsuite, and that stripped installed shared
libraries are unchanged by the patch) and ARM (ABI and linknamespace
tests - this patch reduces the number of linknamespace failures I see
on ARM from 227 to 5, the residue being math.h failures for fe*
functions and for j0l/j1n/jnl/y0l/y1l/ynl aliases).
2014-12-17 Joseph Myers <joseph@codesourcery.com>
[BZ #17725]
* sysdeps/generic/profil-counter.h (profil_counter): Rename to
__profil_counter.
* sysdeps/unix/sysv/linux/hppa/profil-counter.h (profil_counter):
Likewise.
* sysdeps/unix/sysv/linux/i386/profil-counter.h (profil_counter):
Likewise.
* sysdeps/unix/sysv/linux/ia64/profil-counter.h (profil_counter):
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h
(profil_counter): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h
(profil_counter): Likewise.
* sysdeps/unix/sysv/linux/sh/profil-counter.h (profil_counter):
Likewise.
* sysdeps/unix/sysv/linux/tile/profil-counter.h (profil_counter):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/profil-counter.h
(profil_counter): Likewise.
* sysdeps/unix/sysv/linux/arm/profil-counter.h (profil_counter):
Likewise.
[!__profil_counter] (profil_counter): Define as weak alias of
__profil_counter.
* sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h
(profil_counter): Rename to __profil_counter.
[!__profil_counter] (profil_counter): Define as weak alias of
__profil_counter.
* sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h
(profil_counter): Rename to __profil_counter.
[!__profil_counter] (profil_counter): Define as weak alias of
__profil_counter.
* sysdeps/posix/profil.c: Update comment referring to
profil_counter.
(__profil): Use __profil_counter instead of profil_counter.
* sysdeps/posix/sprofil.c (profil_counter): Rename to
__profil_counter. Use __profil_counter_ushort and
__profil_counter_uint in definitions.
(__sprofil): Use __profil_counter_uint and __profil_counter_ushort
instead of profil_counter_uint and profil_counter_ushort.
Joseph Myers [Wed, 17 Dec 2014 18:09:11 +0000 (18:09 +0000)]
Fix resolver inet_* namespace (bug 17722).
Parts of the resolver brought in by pthreads (at least) use inet_*
functions that aren't in the 1995/6 edition of POSIX that introduced
pthreads (or in one case, use __inet_aton which is then defined in the
same file as non-weak inet_addr). This patch fixes this by making the
affected functions into weak alias for __inet_* and using those names
in the problematic resolver code.
Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).
[BZ #17722]
* inet/inet_mkadr.c (inet_makeaddr): Rename to __inet_makeaddr and
define as weak alias of __inet_makeaddr.
* resolv/inet_addr.c (inet_addr): Rename to __inet_addr and define
as weak alias of __inet_addr.
* resolv/inet_pton.c (inet_pton): Rename to __inet_pton and define
as weak alias of __inet_pton. Use libc_hidden_weak.
* include/arpa/inet.h (__inet_pton): Declare. Use
libc_hidden_proto.
(inet_makeaddr): Don't use libc_hidden_proto.
(__inet_makeaddr): Declare. Use libc_hidden_proto.
* resolv/res_init.c (__res_vinit): Use __inet_pton instead of
inet_pton. Use __inet_makeaddr instead of inet_makeaddr.
* conform/Makefile (test-xfail-POSIX/pthread.h/linknamespace):
Remove variable.
(test-xfail-POSIX/sched.h/linknamespace): Likewise.
(test-xfail-POSIX/time.h/linknamespace): Likewise.
Steve Ellcey [Wed, 17 Dec 2014 18:00:37 +0000 (10:00 -0800)]
2014-12-17 Steve Ellcey <sellcey@imgtec.com>
* inet/getnetgrent_r.c: Move while loop to be inside if statement.
Stefan Liebler [Wed, 17 Dec 2014 15:43:34 +0000 (16:43 +0100)]
Get rid of format warning in bug-vfprintf-nargs.c.
Stefan Liebler [Wed, 17 Dec 2014 15:42:51 +0000 (16:42 +0100)]
Get rid of format warning in tst-widetext.c.
Andreas Schwab [Wed, 17 Dec 2014 12:04:07 +0000 (13:04 +0100)]
Fix printf format error