]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
7 years agoUse custom x86 feature selection in libm fw/libm-noprivate-2.27
Florian Weimer [Thu, 10 May 2018 09:50:00 +0000 (11:50 +0200)] 
Use custom x86 feature selection in libm

7 years agoAvoid use GLIBC_PRIVATE symbols in the implementation of nan* functions
Florian Weimer [Thu, 10 May 2018 09:49:03 +0000 (11:49 +0200)] 
Avoid use GLIBC_PRIVATE symbols in the implementation of nan* functions

7 years agoUse __errno_location in libm
Florian Weimer [Thu, 10 May 2018 09:48:19 +0000 (11:48 +0200)] 
Use __errno_location in libm

7 years agoAdd tst-sigaction.c to test BZ #23069
Aurelien Jarno [Thu, 26 Apr 2018 20:21:13 +0000 (22:21 +0200)] 
Add tst-sigaction.c to test BZ #23069

This simple test uses sigaction to define a signal handler. It then
uses sigaction again to fetch the information about the same signal
handler, and check that they are consistent. This is enough to detect
mismatches between struct kernel_sigaction and the kernel version of
struct sigaction, like in BZ #23069.

Changelog:
       * signal/tst-sigaction.c: New file to test BZ #23069.
       * signal/Makefile (tests): Fix indentation. Add tst-sigaction.

(cherry picked from commit 7a6f74787132aca8e3809cae8d9e7bc7bfd55ce1)

7 years agoRISC-V: fix struct kernel_sigaction to match the kernel version [BZ #23069]
Aurelien Jarno [Sat, 28 Apr 2018 11:13:43 +0000 (13:13 +0200)] 
RISC-V: fix struct kernel_sigaction to match the kernel version [BZ #23069]

The RISC-V kernel doesn't define SA_RESTORER, hence the kernel version
of struct sigaction doesn't have the sa_restorer field. The default
kernel_sigaction.h therefore can't be used.

This patch adds a RISC-V specific version of kernel_sigaction.h to fix
the issue. This fixes for example the libnih testsuite.

Note that this patch is not needed in master as the bug has been fixed
by commit b4a5d26d8835 ("linux: Consolidate sigaction implementation").

7 years agoLinux i386: tst-bz21269 triggers SIGBUS on some kernels
Florian Weimer [Thu, 29 Mar 2018 09:42:24 +0000 (11:42 +0200)] 
Linux i386: tst-bz21269 triggers SIGBUS on some kernels

In addition to SIGSEGV and SIGILL, SIGBUS is also a possible signal
generated by the kernel.

(cherry picked from commit 4d76d3e59d31aa690f148fc0c95cc0c581aed3e8)

7 years agoFix i386 memmove issue (bug 22644).
Andrew Senkevich [Fri, 23 Mar 2018 15:19:45 +0000 (16:19 +0100)] 
Fix i386 memmove issue (bug 22644).

[BZ #22644]
* sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S: Fixed
branch conditions.
* string/test-memmove.c (do_test2): New testcase.

(cherry picked from commit cd66c0e584c6d692bc8347b5e72723d02b8a8ada)

7 years agoUpdate ChangeLog for BZ 22884 - riscv fmax/fmin
DJ Delorie [Fri, 23 Feb 2018 21:08:08 +0000 (16:08 -0500)] 
Update ChangeLog for BZ 22884 - riscv fmax/fmin

(cherry picked from commit 7e04eb2932d3126c721ee2bc0d664a5bbea2f41f)

7 years agoRISC-V: fmax/fmin: Handle signalling NaNs correctly.
Andrew Waterman [Thu, 22 Feb 2018 19:31:54 +0000 (14:31 -0500)] 
RISC-V: fmax/fmin: Handle signalling NaNs correctly.

RISC-V's fmax(sNAN,4) returns 4 but glibc expects it to return qNAN.

* sysdeps/riscv/rvd/s_fmax.c (__fmax): Handle sNaNs correctly.
* sysdeps/riscv/rvd/s_fmin.c (__fmin): Likewise.
* sysdeps/riscv/rvf/s_fmaxf.c (__fmaxf): Likewise.
* sysdeps/riscv/rvf/s_fminf.c (__fminf): Likewise.

(cherry picked from commit fdcc625376505eacb1125a6aeba57501407a30ec)

7 years agoRISC-V: Do not initialize $gp in TLS macros.
DJ Delorie [Thu, 22 Feb 2018 19:28:47 +0000 (14:28 -0500)] 
RISC-V: Do not initialize $gp in TLS macros.

RISC-V TLS doesn't require GP to be initialized, and doing so breaks
TLS in a shared object.

(cherry picked from commit 8090720a87e42fddc31396f6126112d4b8014d8e)

7 years agoNEWS: Add entries for bugs: 22848, 22932, 22937, 22963.
Rafal Luzynski [Thu, 15 Mar 2018 02:29:07 +0000 (03:29 +0100)] 
NEWS: Add entries for bugs: 22848, 22932, 22937, 22963.

Alternative (nominative/genitive) month names have been added to the
Catalan and Czech locale data and the abbreviated alternative names to
Catalan and Greek.

(cherry picked from commit c553cd6f7e939ae4ef62b52b3c55fbe76dddecee)

7 years agocs_CZ locale: Add alternative month names (bug 22963).
Rafal Luzynski [Mon, 17 Oct 2016 20:06:11 +0000 (22:06 +0200)] 
cs_CZ locale: Add alternative month names (bug 22963).

Add alternative month names, primary month names are genitive now.

[BZ #22963]
* localedata/locales/cs_CZ (mon): Rename to...
(alt_mon): This.
(mon): Import from CLDR (genitive case).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 807fee29d2c967e24e3fe05e2182ba53e96e9178)

7 years agoGreek (el_CY, el_GR) locales: Introduce ab_alt_mon (bug 22937).
Rafal Luzynski [Wed, 7 Mar 2018 23:45:04 +0000 (00:45 +0100)] 
Greek (el_CY, el_GR) locales: Introduce ab_alt_mon (bug 22937).

As spotted by GNOME translation team, Greek language has the actually
visible difference between the abbreviated nominative and the abbreviated
genitive case for some month names.  Examples:

May:

abbreviated nominative: "Μάι" -> abbreviated genitive: "Μαΐ"

July:

abbreviated nominative: "Ιούν" -> abbreviated genitive: "Ιουλ"

and more month names with similar differences.

Original discussion: https://bugzilla.gnome.org/show_bug.cgi?id=793645#c21

[BZ #22937]
* localedata/locales/el_CY (abmon): Rename to...
(ab_alt_mon): This.
(abmon): Import from CLDR (abbreviated genitive case).
* localedata/locales/el_GR (abmon): Rename to...
(ab_alt_mon): This.
(abmon): Import from CLDR (abbreviated genitive case).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit e7155a28ef61f240da156e1cea410b61afca14ad)

7 years agolt_LT locale: Update abbreviated month names (bug 22932).
Rafal Luzynski [Wed, 7 Mar 2018 23:38:18 +0000 (00:38 +0100)] 
lt_LT locale: Update abbreviated month names (bug 22932).

A GNOME translator asked to use the same abbreviated month names
as provided by CLDR.  This sounds reasonable.  See the discussion:
https://bugzilla.gnome.org/show_bug.cgi?id=793645#c27

[BZ #22932]
* localedata/locales/lt_LT (abmon): Synchronize with CLDR.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 71d7b121686f6d91cd5a630dcfb72197b5d8284a)

7 years agoca_ES locale: Update LC_TIME (bug 22848).
Robert Buj [Tue, 6 Mar 2018 21:51:29 +0000 (22:51 +0100)] 
ca_ES locale: Update LC_TIME (bug 22848).

Add/fix alternative month names, long & short formats, am_pm,
abday settings, and improve indentation for Catalan.

[BZ #22848]
* localedata/locales/ca_ES (abmon): Rename to...
(ab_alt_mon): This, then synchronize with CLDR (nominative case).
(mon): Rename to...
(alt_mon): This.
(abmon): Import from CLDR (genitive case, month names preceded by
"de" or "d’").
(mon): Likewise.
(abday): Synchronize with CLDR.
(d_t_fmt): Likewise.
(d_fmt): Likewise.
(am_pm): Likewise.

(LC_TIME): Improve indentation.
(LC_TELEPHONE): Likewise.
(LC_NAME): Likewise.
(LC_ADDRESS): Likewise.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit a00bffe8b531693d3b26c1e87afe4b9eac84474c)

7 years agoUpdate translations from the Translation Project
Dmitry V. Levin [Mon, 12 Mar 2018 13:24:46 +0000 (13:24 +0000)] 
Update translations from the Translation Project

* po/pt_BR.po: Update translations.

(cherry picked from commit 778f1974863d63e858b6d0105e41d6f0c30732d3)

7 years agoi386: Fix i386 sigaction sa_restorer initialization (BZ#21269)
Adhemerval Zanella [Fri, 17 Nov 2017 18:04:29 +0000 (16:04 -0200)] 
i386: Fix i386 sigaction sa_restorer initialization (BZ#21269)

This patch fixes the i386 sa_restorer field initialization for sigaction
syscall for kernel with vDSO.  As described in bug report, i386 Linux
(and compat on x86_64) interprets SA_RESTORER clear with nonzero
sa_restorer as a request for stack switching if the SS segment is 'funny'.
This means that anything that tries to mix glibc's signal handling with
segmentation (for instance through modify_ldt syscall) is randomly broken
depending on what values lands in sa_restorer.

The testcase added  is based on Linux test tools/testing/selftests/x86/ldt_gdt.c,
more specifically in do_multicpu_tests function.  The main changes are:

  - C11 atomics instead of plain access.

  - Remove x86_64 support which simplifies the syscall handling and fallbacks.

  - Replicate only the test required to trigger the issue.

Checked on i686-linux-gnu.

[BZ #21269]
* sysdeps/unix/sysv/linux/i386/Makefile (tests): Add tst-bz21269.
* sysdeps/unix/sysv/linux/i386/sigaction.c (SET_SA_RESTORER): Clear
sa_restorer for vDSO case.
* sysdeps/unix/sysv/linux/i386/tst-bz21269.c: New file.

(cherry picked from commit 68448be208ee06e76665918b37b0a57e3e00c8b4)

7 years agoFix multiple definitions of __nss_*_database (bug 22918)
Andreas Schwab [Fri, 2 Mar 2018 22:07:14 +0000 (23:07 +0100)] 
Fix multiple definitions of __nss_*_database (bug 22918)

(cherry picked from commit eaf6753f8aac33a36deb98c1031d1bad7b593d2d)

7 years ago[BZ #22342] Fix netgroup cache keys.
DJ Delorie [Fri, 2 Mar 2018 04:20:45 +0000 (23:20 -0500)] 
[BZ #22342] Fix netgroup cache keys.

Unlike other nscd caches, the netgroup cache contains two types of
records - those for "iterate through a netgroup" (i.e. setnetgrent())
and those for "is this user in this netgroup" (i.e. innetgr()),
i.e. full and partial records.  The timeout code assumes these records
have the same key for the group name, so that the collection of records
that is "this netgroup" can be expired as a unit.

However, the keys are not the same, as the in-netgroup key is generated
by nscd rather than being passed to it from elsewhere, and is generated
without the trailing NUL.  All other keys have the trailing NUL, and as
noted in the linked BZ, debug statements confirm that two keys for the
same netgroup are added to the cache with two different lengths.

The result of this is that as records in the cache expire, the purge
code only cleans out one of the two types of entries, resulting in
stale, possibly incorrect, and possibly inconsistent cache data.

The patch simply includes the existing NUL in the computation for the
key length ('key' points to the char after the NUL, and 'group' to the
first char of the group, so 'key-group' includes the first char to the
NUL, inclusive).

[BZ #22342]
* nscd/netgroupcache.c (addinnetgrX): Include trailing NUL in
key value.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 1c81d55fc4b07b51adf68558ba74ce975153e580)

7 years agolinux/powerpc: sync sys/ptrace.h with Linux 4.15 [BZ #22433, #22807]
Dmitry V. Levin [Sat, 10 Feb 2018 23:19:32 +0000 (23:19 +0000)] 
linux/powerpc: sync sys/ptrace.h with Linux 4.15 [BZ #22433, #22807]

Tested with strace.

* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h (__ptrace_request): Add
PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS,
PTRACE_GETVRREGS, PTRACE_SETVRREGS, PTRACE_GETEVRREGS,
PTRACE_SETEVRREGS, PTRACE_GETREGS64, PTRACE_SETREGS64,
PTRACE_GET_DEBUGREG, PTRACE_SET_DEBUGREG, PTRACE_GETVSRREGS,
PTRACE_SETVSRREGS, and PTRACE_SINGLEBLOCK.

(cherry picked from commit f5f473a9d0e8fdbede858fa1ef0d01d12142367b)

7 years agopowerpc: Undefine Linux ptrace macros that conflict with __ptrace_request
Tulio Magno Quites Machado Filho [Mon, 26 Feb 2018 13:40:17 +0000 (10:40 -0300)] 
powerpc: Undefine Linux ptrace macros that conflict with __ptrace_request

Linux ptrace headers define macros whose tokens conflict with the
constants of enum __ptrace_request causing build errors when
asm/ptrace.h or linux/ptrace.h are included before sys/ptrace.h.

* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Undefine Linux
macros used in __ptrace_request.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
(cherry picked from commit 398c6fddafcee2dc4c2b2574417a2d0cfccaeec1)

7 years agoAdd missing “reorder-end” in LC_COLLATE of et_EE [BZ #22517]
Mike FABIAN [Mon, 19 Feb 2018 20:59:30 +0000 (21:59 +0100)] 
Add missing “reorder-end” in LC_COLLATE of et_EE [BZ #22517]

[BZ #22517]
* localedata/locales/et_EE (LC_COLLATE): add missing “reorder-end”

(cherry picked from commit 7ec5f9465e732e668d0dc94ac078ba68056d6d0a)

7 years agoFix a typo in a comment.
Rical Jasan [Wed, 21 Feb 2018 12:00:03 +0000 (04:00 -0800)] 
Fix a typo in a comment.

* io/fcntl.h: Fix a typo in a comment.

(cherry picked from commit 0d217f4082473e5fdca87831df928dd525a02f72)

7 years agomanual: Update the _ISOC99_SOURCE description.
Rical Jasan [Mon, 19 Feb 2018 12:32:35 +0000 (04:32 -0800)] 
manual: Update the _ISOC99_SOURCE description.

The current description refers to ISO C99 not being widely adopted,
which it is believed to be now.

* manual/creature.texi (_ISOC99_SOURCE): Update the dated
description.

(cherry picked from commit e8d190b9ed81a1b342f0969bc2b5505403183bce)

7 years agomanual: Document missing feature test macros.
Rical Jasan [Mon, 19 Feb 2018 11:30:06 +0000 (03:30 -0800)] 
manual: Document missing feature test macros.

Several feature test macros are documented in features.h but absent in
the manual, and some documented macros accept undocumented values.
This commit updates the manual to mention all the accepted macros,
along with any values that hold special meaning.

* manual/creature.texi (_POSIX_C_SOURCE): Document special
values of 199606L, 200112L, and 200809L.
(_XOPEN_SOURCE): Document special values of 600 and 700.
(_ISOC11_SOURCE): Document macro.
(_ATFILE_SOURCE): Likewise.
(_FORTIFY_SOURCE): Likewise.

(cherry picked from commit 6a3962c4a408e8cbc305d2433711196107374e89)
(cherry picked from commit da81ae645d8ee89052f109c814a68a9489f562e6)

7 years agoNEWS: add entries for bugs 22919 and 22926
Dmitry V. Levin [Thu, 8 Mar 2018 23:30:56 +0000 (23:30 +0000)] 
NEWS: add entries for bugs 22919 and 22926

7 years agosparc32: Add nop before __startcontext to stop unwinding [BZ #22919]
Aurelien Jarno [Thu, 8 Mar 2018 23:14:27 +0000 (00:14 +0100)] 
sparc32: Add nop before __startcontext to stop unwinding [BZ #22919]

On sparc32 tst-makecontext fails, as backtrace called within a context
created by makecontext to yield infinite backtrace.

Fix that the same way than nios2 by adding a nop just before
__startcontext. This is needed as otherwise FDE lookup just repeatedly
finds __setcontext's FDE in an infinite loop, due to the convention of
using 'address - 1' for FDE lookup.

Changelog:
[BZ #22919]
* sysdeps/unix/sysv/linux/sparc/sparc32/setcontext.S (__startcontext):
Add nop before __startcontext, add explaining comments.

(cherry picked from commit 9aa5c222b9e0409143410a02b6364a3b25dbf028)

7 years agopowerpc: Fix TLE build for SPE (BZ #22926)
Adhemerval Zanella [Mon, 5 Mar 2018 17:46:24 +0000 (14:46 -0300)] 
powerpc: Fix TLE build for SPE (BZ #22926)

Some SPE opcodes clashes with some recent PowerISA opcodes and
until recently gas did not complain about it.  However binutils
recently changed it and now VLE configured gas does not support to
assembler some instruction that might class with VLE (HTM for
instance).  It also does not help that glibc build hardware lock
elision support as default (regardless of assembler support).

Although runtime will not actually enables TLE on SPE hardware
(since kernel will not advertise it), I see little advantage on
adding HTM support on SPE built glibc.  SPE uses an incompatible
ABI which does not allow share the same build with default
powerpc and HTM code slows down SPE without any benefict.

This patch fixes it by only building HTM when SPE configuration
is not used.

Checked with a powerpc-linux-gnuspe build. I also did some sniff
tests on a e500 hardware without any issue.

[BZ #22926]
* sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION_IMPL): Define
empty for __SPE__.
* sysdeps/powerpc/sysdep.h (ABORT_TRANSACTION): Likewise.
* sysdeps/unix/sysv/linux/powerpc/elision-lock.c (__lll_lock_elision):
Do not build hardware transactional code for __SPE__.
* sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
(__lll_trylock_elision): Likewise.
* sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
(__lll_unlock_elision): Likewise.

Cherry-pick from e921c89e01389161c036ec09112da6e18aeaa688.

7 years agomanual: Improve documentation of get_current_dir_name. [BZ #6889]
Rical Jasan [Fri, 16 Feb 2018 16:47:20 +0000 (08:47 -0800)] 
manual: Improve documentation of get_current_dir_name. [BZ #6889]

This is a minor rewording to clarify the behaviour of
get_current_dir_name.  Additionally, the @vindex is moved above the
@deftypefun so that following links give a better result with regard
to context.

[BZ #6889]
* manual/filesys.texi (get_current_dir_name): Clarify
behaviour.

(cherry picked from commit 7d15ef84f50a80cb170f8ce3457010f59e221cb8)

7 years agomanual: Fix a syntax error.
Rical Jasan [Fri, 16 Feb 2018 16:21:47 +0000 (08:21 -0800)] 
manual: Fix a syntax error.

The opening parenthesis for function arguments in an @deftypefun need
to be separated from the function name.  This isn't just a matter of
the GNU coding style---it causes the "(void" (in this case) to be
rendered as a part of the function name, causing a visual defect, and
also results in a warning to the following effect during `make pdf':

  Warning: unbalanced parentheses in @def...)

* manual/platform.texi (__riscv_flush_icache): Fix @deftypefun
syntax.

(cherry picked from commit 16efad5171ac1ac2c8728405f2703045f08c494b)

7 years agomanual: Fix Texinfo warnings about improper node names.
Rical Jasan [Wed, 24 Jan 2018 09:03:38 +0000 (01:03 -0800)] 
manual: Fix Texinfo warnings about improper node names.

A number of cross-references to the GCC info manual cause Texinfo
warnings; e.g.:

  ./creature.texi:11: warning: @xref node name should not contain `.'

This is due to "gcc.info" being used in the INFO-FILE-NAME (fourth)
argument.  Changing it to "gcc" removes these warnings.  (Manually
confirmed equivalent behaviour for make info, html, and pdf.)

* manual/creature.texi: Convert references to gcc.info to gcc.
* manual/stdio.texi: Likewise.
* manual/string.texi: Likewise.

(cherry picked from commit 1f6676d7da1b7c864e9a5d59fe9162a88bd21952)

7 years agoFix posix/tst-glob_lstat_compat on alpha [BZ #22818]
Aurelien Jarno [Sun, 18 Feb 2018 17:23:14 +0000 (18:23 +0100)] 
Fix posix/tst-glob_lstat_compat on alpha [BZ #22818]

The tst-glob_lstat_compat test needs to run tests on the previous
version of glob. On alpha, there are three versions of glob, GLIBC_2.0,
GLIBC_2.1 and GLIBC_2.27, while on other architectures there are only
the GLIBC_2.0 and GLIBC_2.27 version. Therefore on alpha the previous
version is GLIBC_2.1 and not GLIBC_2.0.

Changelog:
[BZ #22818]
* posix/tst-glob_lstat_compat.c [__alpha__] (glob): Access
the GLIBC_2.1 version.

(cherry picked from commit f8d79582896c52cc2b50bdd030a3ec27ef23b587)

7 years agotime: Reference CLOCKS_PER_SEC in clock comment [BZ #22735]
Sean McKean [Fri, 2 Feb 2018 10:59:31 +0000 (11:59 +0100)] 
time: Reference CLOCKS_PER_SEC in clock comment [BZ #22735]

(cherry picked from commit 09e56b9e18f987105e39768f907db800e9330930)

7 years agolinux/aarch64: sync sys/ptrace.h with Linux 4.15 [BZ #22433]
Dmitry V. Levin [Fri, 29 Dec 2017 23:19:32 +0000 (23:19 +0000)] 
linux/aarch64: sync sys/ptrace.h with Linux 4.15 [BZ #22433]

Remove compat-specific constants that were never exported by kernel
headers under these names.  Before linux commit v3.7-rc1~16^2~1 they
were exported with COMPAT_ prefix, and since that commit they are not
exported at all.

* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h (__ptrace_request):
Remove arm-specific PTRACE_GET_THREAD_AREA, PTRACE_GETHBPREGS,
and PTRACE_SETHBPREGS.

(cherry picked from commit 2fd4bbaa1446f1be700e10c526cf585a796c4991)

7 years agoNEWS: add an entry for bug 22827
Dmitry V. Levin [Tue, 6 Feb 2018 09:31:30 +0000 (09:31 +0000)] 
NEWS: add an entry for bug 22827

7 years agoUpdate SH libm-tests-ulps
Adhemerval Zanella [Wed, 14 Feb 2018 16:03:13 +0000 (14:03 -0200)] 
Update SH libm-tests-ulps

* sysdeps/sh/libm-test-ulps: Update.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 years ago[RISC-V] Fix parsing flags in ELF64 files.
DJ Delorie [Fri, 9 Feb 2018 23:37:15 +0000 (18:37 -0500)] 
[RISC-V] Fix parsing flags in ELF64 files.

When ldconfig reads Elf64 files to determine the ABI, it used the
Elf32 type, so read the wrong location, and stored the wrong ABI
type in the cache, making the cache useless.  This patch uses
an Elf64 type for Elf64 objects instead.

Note that pre-patch caches might need to be manually removed and
regenerated to get the correct ABIs stored.

[BZ #22827]
* sysdeps/unix/sysv/linux/riscv/readelflib.c (process_elf_file): Use
64-bit ELF type for 64-bit ELF objects.

(cherry picked from commit 6a1ff640dcec04905d8518983ad6252d38b7a733)

7 years agoLinux: use reserved name __key in pkey_get [BZ #22797]
Igor Gnatenko [Wed, 7 Feb 2018 12:53:10 +0000 (13:53 +0100)] 
Linux: use reserved name __key in pkey_get [BZ #22797]

_key is not reserved name and we should avoid using that. It seems that
it was simple typo when pkey_* was implemented.

(cherry picked from commit 388ff7bd0d57d7061fdd39a2f26f65687e8058da)

7 years agoAdd a missing ChangeLog item in commit 371b220f620
H.J. Lu [Mon, 5 Feb 2018 14:17:18 +0000 (06:17 -0800)] 
Add a missing ChangeLog item in commit 371b220f620

(cherry picked from commit 658050164df9bce9ef8f2ccb1b74ba9ee2b2f4af)

7 years agoNEWS: add an entry for bug 22638
Dmitry V. Levin [Tue, 6 Feb 2018 09:31:30 +0000 (09:31 +0000)] 
NEWS: add an entry for bug 22638

7 years agosparc: Check PIC instead of SHARED in start.S [BZ #22638]
H.J. Lu [Mon, 5 Feb 2018 13:46:38 +0000 (05:46 -0800)] 
sparc: Check PIC instead of SHARED in start.S [BZ #22638]

Since start.o may be compiled as PIC, we should check PIC instead of
SHARED.

[BZ #22638]
* sysdeps/sparc/sparc32/start.S (_start): Check PIC instead of
SHARED.
* sysdeps/sparc/sparc64/start.S (_start): Likewise.

(cherry picked from commit 371b220f6208968d5f4bffc9f66bf885930a42a5)

7 years agoRecord CVE-2018-6551 in NEWS and ChangeLog [BZ #22774]
Florian Weimer [Tue, 6 Feb 2018 08:19:03 +0000 (09:19 +0100)] 
Record CVE-2018-6551 in NEWS and ChangeLog [BZ #22774]

(cherry picked from commit 71aa429b029fdb6f9e65d44050388b51eca460d6)

7 years agoUpdate for 2.27 release glibc-2.27
Dmitry V. Levin [Thu, 1 Feb 2018 16:17:18 +0000 (16:17 +0000)] 
Update for 2.27 release

7 years agoFix ChangeLog formatting
Dmitry V. Levin [Thu, 1 Feb 2018 16:17:18 +0000 (16:17 +0000)] 
Fix ChangeLog formatting

7 years agoNEWS: add the list of bugs fixed in 2.27
Dmitry V. Levin [Thu, 1 Feb 2018 16:17:18 +0000 (16:17 +0000)] 
NEWS: add the list of bugs fixed in 2.27

7 years agoRecord CVE-2018-6485 in ChangeLog and NEWS [BZ #22343]
Florian Weimer [Thu, 1 Feb 2018 14:00:44 +0000 (15:00 +0100)] 
Record CVE-2018-6485 in ChangeLog and NEWS [BZ #22343]

7 years agostdlib: Fixing test-*atexit*-race tests on ia64
Adhemerval Zanella [Thu, 1 Feb 2018 12:31:57 +0000 (10:31 -0200)] 
stdlib: Fixing test-*atexit*-race tests on ia64

These tests require a new thread stack size set to a value (0x20000)
lower than the architecture minimum (0x30000).  Set the stack size
to PTHREAD_STACK_MIN in this case.

Checked on ia64-linux-gnu.

* stdlib/test-atexit-race-common.c (do_test): Check stack size
against PTHREAD_STACK_MIN.

7 years agoUpdate contributions in the manual
Dmitry V. Levin [Thu, 1 Feb 2018 13:07:39 +0000 (13:07 +0000)] 
Update contributions in the manual

* manual/contrib.texi (Palmer Dabbelt, Arjun Shankar, Florian Weimer):
New entries.
(Rafal Luzynski, Andreas Schwab): Update.

7 years agoNEWS: List the languages which use the alternative months.
Rafal Luzynski [Thu, 1 Feb 2018 00:45:43 +0000 (01:45 +0100)] 
NEWS: List the languages which use the alternative months.

[BZ #10871]
* NEWS: List the languages which actually use the alternative
months feature in this release.  Also explain that "alt_mon" and
"ab_alt_mon" are optional.

7 years agocrypt: Fix badsalttest test (Bug 22765)
Il'ya Malakhov [Wed, 31 Jan 2018 22:32:19 +0000 (14:32 -0800)] 
crypt: Fix badsalttest test (Bug 22765)

The value of 'cd.initialized' is left uninitialized before the
first invocation of 'crypt_r ()' in this test despite the fact
that it should be set to zero according to the API.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
7 years agoFix typo in the previous commit
Dmitry V. Levin [Wed, 31 Jan 2018 23:13:00 +0000 (23:13 +0000)] 
Fix typo in the previous commit

The version of GCC was 7.3, not 7.3.1.

7 years agoUpdate information about the newest versions of tools used to build glibc
Dmitry V. Levin [Wed, 31 Jan 2018 14:20:10 +0000 (14:20 +0000)] 
Update information about the newest versions of tools used to build glibc

* manual/install.texi (Tools for Compilation): Update the newest
versions of gcc, binutils, texinfo, gawk, bison, and sed.
* INSTALL: Regenerated.

7 years agoallocalim.h: use __glibc_likely instead of __builtin_expect
Samuel Thibault [Tue, 30 Jan 2018 20:42:21 +0000 (21:42 +0100)] 
allocalim.h: use __glibc_likely instead of __builtin_expect

* sysdeps/pthread/allocalim.h (__libc_use_alloca): Use __glibc_likely
instead of __builtin_expect.

7 years agohurd: Fix ChangeLog date
Samuel Thibault [Tue, 30 Jan 2018 18:56:07 +0000 (19:56 +0100)] 
hurd: Fix ChangeLog date

7 years agonss: Adjust tests to use nss_files only
Florian Weimer [Tue, 30 Jan 2018 05:28:49 +0000 (06:28 +0100)] 
nss: Adjust tests to use nss_files only

7 years agohr_HR: Add alternative month names (bug 10871).
Rafal Luzynski [Tue, 30 Jan 2018 11:33:14 +0000 (12:33 +0100)] 
hr_HR: Add alternative month names (bug 10871).

[BZ #10871]
* localedata/locales/hr_HR (mon): Rename to...
(alt_mon): This.
(mon): Import from CLDR (genitive case).
(d_t_fmt): Update the comment.

7 years agohurd: include generic's hp-timing.h instead of copying it
Samuel Thibault [Tue, 30 Jan 2018 00:17:51 +0000 (01:17 +0100)] 
hurd: include generic's hp-timing.h instead of copying it

* sysdeps/mach/hurd/hp-timing.h: include <sysdeps/generic/hp-timing.h>
instead of copying it.

7 years agohurd: Add tlsdesc.sym
Samuel Thibault [Mon, 29 Jan 2018 23:52:48 +0000 (00:52 +0100)] 
hurd: Add tlsdesc.sym

* sysdeps/mach/hurd/i386/tlsdesc.sym: New file.

7 years agohurd: disable hp timing
Samuel Thibault [Mon, 29 Jan 2018 23:47:31 +0000 (00:47 +0100)] 
hurd: disable hp timing

We don't have support for hp timing for now, even the i686 variant, which needs
to know the CPU speed.
Copied from sysdeps/generic/hp-timing.h

* sysdeps/mach/hurd/hp-timing.h: New file.

7 years agohurd: Fix comments for FREAD and FWRITE
Samuel Thibault [Mon, 29 Jan 2018 21:56:03 +0000 (22:56 +0100)] 
hurd: Fix comments for FREAD and FWRITE

* bits/fcntl.h: Fix comment for FREAD and FWRITE.
* sysdeps/mach/hurd/bits/fcntl.h: Likewise.

7 years agomalloc: Use assert.h's assert macro
Samuel Thibault [Mon, 29 Jan 2018 21:49:45 +0000 (22:49 +0100)] 
malloc: Use assert.h's assert macro

This avoids assert definition conflicts if some of the headers used by
malloc.c happens to include assert.h.  Malloc still needs a malloc-avoiding
implementation, which we get by redirecting __assert_fail to malloc's
__malloc_assert.

* malloc/malloc.c: Include <assert.h>.
(assert): Do not define.
[!defined NDEBUG] (__assert_fail): Define to __malloc_assert.

7 years agolibio: Rename _FWRITE to FWRITE_FUNC
Samuel Thibault [Mon, 29 Jan 2018 21:44:46 +0000 (22:44 +0100)] 
libio: Rename _FWRITE to FWRITE_FUNC

_FWRITE would be in the reserved-namespace.

* libio/tst-memstream3.c (_FWRITE): Rename to FWRITE_FUNC.
(do_test_bz20181): Rename accordingly.

7 years agoallocalim.h: Fix codestyle
Samuel Thibault [Mon, 29 Jan 2018 21:21:46 +0000 (22:21 +0100)] 
allocalim.h: Fix codestyle

* sysdeps/pthread/allocalim.h (__libc_use_alloca): Commute operands of
|| to respect codestyle.

7 years agohurd: Fix ChangeLog date
Samuel Thibault [Mon, 29 Jan 2018 21:19:14 +0000 (22:19 +0100)] 
hurd: Fix ChangeLog date

7 years agohurd: Fix preprocessor indentation
Samuel Thibault [Mon, 29 Jan 2018 21:17:11 +0000 (22:17 +0100)] 
hurd: Fix preprocessor indentation

7 years agoReject invalid definitions of _POSIX_CHOWN_RESTRICTED, _POSIX_NO_TRUNC, _POSIX_VDISABLE
Andreas Schwab [Sun, 28 Jan 2018 17:48:04 +0000 (18:48 +0100)] 
Reject invalid definitions of _POSIX_CHOWN_RESTRICTED, _POSIX_NO_TRUNC, _POSIX_VDISABLE

POSIX requires that the constants _POSIX_CHOWN_RESTRICTED,
_POSIX_NO_TRUNC, and _POSIX_VDISABLE are always defined to a value other
than -1.

7 years agohurd: Add expected ABI lists
Samuel Thibault [Sun, 28 Jan 2018 22:30:15 +0000 (23:30 +0100)] 
hurd: Add expected ABI lists

* hurd/Versions: Fix version when _hurd_exec_paths was added.
* mach/Versions: Fix version when __mach_host_self_ was added.
* sysdeps/mach/hurd/i386/ld.abilist: New file.
* sysdeps/mach/hurd/i386/libBrokenLocale.abilist: New file.
* sysdeps/mach/hurd/i386/libanl.abilist: New file.
* sysdeps/mach/hurd/i386/libc.abilist: New file.
* sysdeps/mach/hurd/i386/libcrypt.abilist: New file.
* sysdeps/mach/hurd/i386/libdl.abilist: New file.
* sysdeps/mach/hurd/i386/libm.abilist: New file.
* sysdeps/mach/hurd/i386/libnsl.abilist: New file.
* sysdeps/mach/hurd/i386/libresolv.abilist: New file.
* sysdeps/mach/hurd/i386/librt.abilist: New file.
* sysdeps/mach/hurd/i386/libutil.abilist: New file.

7 years agoRISC-V: Add ipc_priv.h
Palmer Dabbelt [Mon, 29 Jan 2018 17:32:37 +0000 (09:32 -0800)] 
RISC-V: Add ipc_priv.h

This contains a definition of __IPC_64 that matches the RISC-V Linux
ABI.

2018-01-29  Darius Rad  <darius@bluespec.com>

        * sysdeps/unix/sysv/linux/riscv/ipc_priv.h: New file.

7 years agoAdd RISC-V to build-many-glibcs.py
Palmer Dabbelt [Mon, 29 Jan 2018 18:30:51 +0000 (10:30 -0800)] 
Add RISC-V to build-many-glibcs.py

For full disclosure, I've only run build-many-glibcs.py with the
additional diff below.

    diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
    index 1c7b85050b57..22cc7b427041 100755
    --- a/scripts/build-many-glibcs.py
    +++ b/scripts/build-many-glibcs.py
    @@ -706,7 +706,7 @@ class Context(object):
                                 'gcc': 'vcs-7',
                                 'glibc': 'vcs-mainline',
                                 'gmp': '6.1.2',
    -                            'linux': '4.14',
    +                            'linux': '4.15-rc8',
                                 'mpc': '1.0.3',
                                 'mpfr': '3.1.6'}
             use_versions = {}
    @@ -841,7 +841,7 @@ class Context(object):
             url_map = {'binutils':
    'https://ftp.gnu.org/gnu/binutils/binutils-%(version)s.tar.bz2',
                        'gcc':
    'https://ftp.gnu.org/gnu/gcc/gcc-%(version)s/gcc-%(version)s.tar.bz2',
                        'gmp':
    'https://ftp.gnu.org/gnu/gmp/gmp-%(version)s.tar.xz',
    -                   'linux':
                        'https://www.kernel.org/pub/linux/kernel/v4.x/linux-%(version)s.tar.xz',
    +                   'linux':
    'https://git.kernel.org/torvalds/t/linux-%(version)s.tar.gz',
                        'mpc':
    'https://ftp.gnu.org/gnu/mpc/mpc-%(version)s.tar.gz',
                        'mpfr':
    'https://ftp.gnu.org/gnu/mpfr/mpfr-%(version)s.tar.xz'}
             if component not in url_map:

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * scripts/build-many-glibcs.py (Context): Add RISC-V targets.
        (Config): Likewise.

7 years agoRISC-V: Build Infastructure
Palmer Dabbelt [Mon, 29 Jan 2018 18:30:24 +0000 (10:30 -0800)] 
RISC-V: Build Infastructure

This patch lays out the top-level orginazition of the RISC-V port.  It
contains all the Implies files as well as various other fragments of
build infastructure for the RISC-V port.  This contains the only change
to a shared file: config.h.in.

RISC-V is a family of base ISAs with optional extensions.  The base ISAs
are RV32I and RV64I, which are 32-bit and 64-bit integer-only ISAs, but
this port currently only supports RV64I based systems.  Support for
RISC-V lives in in sysdeps/riscv.  In addition to these ISAs, our glibc
port supports most of the currently-defined extensions: the A extension
for atomics, the M extension for multiplication, the C extension for
compressed instructions, and the F/D extensions for single/double
precision IEEE floating-point.  Most of these extensions are handled by
GCC, but glibc defines various floating-point wrappers and emulation
routines as well as some atomic wrappers.

We support running glibc-based programs on Linux, the support for which
lives in sysdeps/unix/sysv/linux/riscv.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/riscv/Implies: New file.
        * sysdeps/riscv/Makefile: Likewise.
        * sysdeps/riscv/configure: Likewise.
        * sysdeps/riscv/configure.ac: Likewise.
        * sysdeps/riscv/nptl/Makefile: Likewise.
        * sysdeps/riscv/preconfigure: Likewise.
        * sysdeps/riscv/rv64/Implies-after: Likewise.
        * sysdeps/riscv/rv64/rvd/Implies: Likewise.
        * sysdeps/riscv/rv64/rvf/Implies: Likewise.
        * sysdeps/unix/sysv/linux/riscv/Implies: Likewise.
        * sysdeps/unix/sysv/linux/riscv/Makefile: Likewise.
        * sysdeps/unix/sysv/linux/riscv/Versions: Likewise.
        * sysdeps/unix/sysv/linux/riscv/configure: Likewise.
        * sysdeps/unix/sysv/linux/riscv/configure.ac: Likewise.
        * sysdeps/unix/sysv/linux/riscv/ldd-rewrite.sed: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/Implies: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/Makefile: Likewise.
        * sysdeps/unix/sysv/linux/riscv/shlib-versions: Likewise.

7 years agoRISC-V: Add ABI Lists
Palmer Dabbelt [Mon, 29 Jan 2018 18:29:57 +0000 (10:29 -0800)] 
RISC-V: Add ABI Lists

I started with the aarch64 ABI lists and manually went through each
difference, ensuring that the missing entries had been deprecated along
the line.  Darius generated the ulps files by running the test cases on QEMU.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/riscv/nofpu/libm-test-ulps: New file.
        * sysdeps/riscv/nofpu/libm-test-ulps-name: Likewise.
        * sysdeps/riscv/rv64/rvd/libm-test-ulps: Likewise.
        * sysdeps/riscv/rv64/rvd/libm-test-ulps-name: Likewise.
        * sysdeps/unix/sysv/linux/riscv/localplt.data: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/c++-types.data: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/libanl.abilist: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/libdl.abilist: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/libnsl.abilist: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/librt.abilist: Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist: Likewise.

7 years agoRISC-V: Linux Startup and Dynamic Loading Code
Palmer Dabbelt [Mon, 29 Jan 2018 18:29:13 +0000 (10:29 -0800)] 
RISC-V: Linux Startup and Dynamic Loading Code

This contains the Linux-specific code for loading programs on RISC-V.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/unix/sysv/linux/riscv/dl-static.c: New file.
        * sysdeps/unix/sysv/linux/riscv/ldconfig.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/ldsodefs.h: Likewise.

7 years agoRISC-V: Linux ABI
Palmer Dabbelt [Mon, 29 Jan 2018 18:28:32 +0000 (10:28 -0800)] 
RISC-V: Linux ABI

Linux-specific code that is required for maintaining ABI compatibility.
This doesn't contain the actual system call interface, that is split out
in order to avoid having a patch that's too big.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/riscv/nptl/pthread-offsets.h: New file.
        * sysdeps/riscv/nptl/pthreaddef.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/bits/fcntl.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/bits/mman.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/dl-cache.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/flush-icache.c: Likewise.
        * sysdeps/unix/sysv/linux/riscv/getcontext.S: Likewise.
        * sysdeps/unix/sysv/linux/riscv/init-first.c: Likewise.
        * sysdeps/unix/sysv/linux/riscv/libc-vdso.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/makecontext.c: Likewise.
        * sysdeps/unix/sysv/linux/riscv/readelflib.c: Likewise.
        * sysdeps/unix/sysv/linux/riscv/register-dump.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/setcontext.S: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/swapcontext.S: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sys/cachectl.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sys/procfs.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sys/ucontext.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sys/user.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/ucontext-macros.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/ucontext_i.sym: Likewise.

7 years agoRISC-V: Linux Syscall Interface
Palmer Dabbelt [Mon, 29 Jan 2018 18:27:52 +0000 (10:27 -0800)] 
RISC-V: Linux Syscall Interface

Contains the Linux system call interface, as well as the definitions of
a handful of system calls.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/riscv/nptl/nptl-sysdep.S: New file.
        * sysdeps/unix/sysv/linux/riscv/arch-fork.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/clone.S: Likewise.
        * sysdeps/unix/sysv/linux/riscv/profil-counter.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/pt-vfork.S: Likewise.
        * sysdeps/unix/sysv/linux/riscv/syscall.c: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sysdep.S: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sysdep.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/vfork.S: Likewise.

7 years agoRISC-V: Atomic and Locking Routines
Palmer Dabbelt [Mon, 29 Jan 2018 18:27:17 +0000 (10:27 -0800)] 
RISC-V: Atomic and Locking Routines

This patch implements various atomic and locking routines on RISC-V.  We
mandate the A extension on Linux-capable RISC-V systems, so this can
rely on always having the various atomic instructions availiable.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/riscv/nptl/bits/pthreadtypes-arch.h: New file.
        * sysdeps/riscv/nptl/bits/semaphore.h: Likewise.
        * sysdeps/riscv/nptl/libc-lowlevellock.c: Likewise.
        * sysdeps/unix/sysv/linux/riscv/atomic-machine.h: Likewise.

7 years agoRISC-V: Hard Float Support
Palmer Dabbelt [Mon, 29 Jan 2018 17:27:10 +0000 (09:27 -0800)] 
RISC-V: Hard Float Support

This patch contains hardware floating-point support for the RISC-V ISA.
While we currently only support hard-float systems with both the F and D
extensions, I've left the F-specific code split out into seperate
folders in order to ease adding support for F-only and RV32I-based
systems in the future.  I gave this a quick once-over and believe I've
removed all the code that implements RV32IF, RV32IFD, and RV64IF
targets.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/riscv/rv64/rvd/s_ceil.c: New file.
        * sysdeps/riscv/rv64/rvd/s_floor.c: Likewise.
        * sysdeps/riscv/rv64/rvd/s_llrint.c: Likewise.
        * sysdeps/riscv/rv64/rvd/s_llround.c: Likewise.
        * sysdeps/riscv/rv64/rvd/s_lrint.c: Likewise.
        * sysdeps/riscv/rv64/rvd/s_lround.c: Likewise.
        * sysdeps/riscv/rv64/rvd/s_nearbyint.c: Likewise.
        * sysdeps/riscv/rv64/rvd/s_rint.c: Likewise.
        * sysdeps/riscv/rv64/rvd/s_round.c: Likewise.
        * sysdeps/riscv/rv64/rvd/s_roundeven.c: Likewise.
        * sysdeps/riscv/rv64/rvd/s_trunc.c: Likewise.
        * sysdeps/riscv/rv64/rvf/s_llrintf.c: Likewise.
        * sysdeps/riscv/rv64/rvf/s_llroundf.c: Likewise.
        * sysdeps/riscv/rv64/rvf/s_lrintf.c: Likewise.
        * sysdeps/riscv/rv64/rvf/s_lroundf.c: Likewise.
        * sysdeps/riscv/rvd/e_sqrt.c: Likewise.
        * sysdeps/riscv/rvd/s_copysign.c: Likewise.
        * sysdeps/riscv/rvd/s_finite.c: Likewise.
        * sysdeps/riscv/rvd/s_fma.c: Likewise.
        * sysdeps/riscv/rvd/s_fmax.c: Likewise.
        * sysdeps/riscv/rvd/s_fmin.c: Likewise.
        * sysdeps/riscv/rvd/s_fpclassify.c: Likewise.
        * sysdeps/riscv/rvd/s_isinf.c: Likewise.
        * sysdeps/riscv/rvd/s_isnan.c: Likewise.
        * sysdeps/riscv/rvd/s_issignaling.c: Likewise.
        * sysdeps/riscv/rvf/e_sqrtf.c: Likewise.
        * sysdeps/riscv/rvf/fclrexcpt.c: Likewise.
        * sysdeps/riscv/rvf/fegetenv.c: Likewise.
        * sysdeps/riscv/rvf/fegetmode.c: Likewise.
        * sysdeps/riscv/rvf/fegetround.c: Likewise.
        * sysdeps/riscv/rvf/feholdexcpt.c: Likewise.
        * sysdeps/riscv/rvf/fesetenv.c: Likewise.
        * sysdeps/riscv/rvf/fesetexcept.c: Likewise.
        * sysdeps/riscv/rvf/fesetmode.c: Likewise.
        * sysdeps/riscv/rvf/fesetround.c: Likewise.
        * sysdeps/riscv/rvf/feupdateenv.c: Likewise.
        * sysdeps/riscv/rvf/fgetexcptflg.c: Likewise.
        * sysdeps/riscv/rvf/fraiseexcpt.c: Likewise.
        * sysdeps/riscv/rvf/fsetexcptflg.c: Likewise.
        * sysdeps/riscv/rvf/ftestexcept.c: Likewise.
        * sysdeps/riscv/rvf/get-rounding-mode.h: Likewise.
        * sysdeps/riscv/rvf/math_private.h: Likewise.
        * sysdeps/riscv/rvf/s_ceilf.c: Likewise.
        * sysdeps/riscv/rvf/s_copysignf.c: Likewise.
        * sysdeps/riscv/rvf/s_finitef.c: Likewise.
        * sysdeps/riscv/rvf/s_floorf.c: Likewise.
        * sysdeps/riscv/rvf/s_fmaf.c: Likewise.
        * sysdeps/riscv/rvf/s_fmaxf.c: Likewise.
        * sysdeps/riscv/rvf/s_fminf.c: Likewise.
        * sysdeps/riscv/rvf/s_fpclassifyf.c: Likewise.
        * sysdeps/riscv/rvf/s_isinff.c: Likewise.
        * sysdeps/riscv/rvf/s_isnanf.c: Likewise.
        * sysdeps/riscv/rvf/s_issignalingf.c: Likewise.
        * sysdeps/riscv/rvf/s_nearbyintf.c: Likewise.
        * sysdeps/riscv/rvf/s_rintf.c: Likewise.
        * sysdeps/riscv/rvf/s_roundevenf.c: Likewise.
        * sysdeps/riscv/rvf/s_roundf.c: Likewise.
        * sysdeps/riscv/rvf/s_truncf.c: Likewise.

7 years agoRISC-V: Generic <math.h> and soft-fp Routines
Palmer Dabbelt [Mon, 29 Jan 2018 18:26:35 +0000 (10:26 -0800)] 
RISC-V: Generic <math.h> and soft-fp Routines

This patch contains the miscellaneous math routines and headers we have
implemented for RISC-V.  This includes things from <math.h> that aren't
completely ISA-generic, floating-point bit manipulation, and soft-fp
hooks.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/riscv/bits/fenv.h: New file.
        * sysdeps/riscv/e_sqrtl.c: Likewise.
        * sysdeps/riscv/fpu_control.h: Likewise.
        * sysdeps/riscv/math-tests.h: Likewise.
        * sysdeps/riscv/nofpu/Implies: Likewise.
        * sysdeps/riscv/sfp-machine.h: Likewise.
        * sysdeps/riscv/tininess.h: Likewise.

7 years agoRISC-V: Thread-Local Storage Support
Palmer Dabbelt [Mon, 29 Jan 2018 18:25:58 +0000 (10:25 -0800)] 
RISC-V: Thread-Local Storage Support

This patch implements TLS support for RISC-V.  We support all four
standard TLS addressing modes (LE, IE, LD, and GD) when running on
Linux via NPTL.  There is a draft psABI document that defines our TLS
ABI here

  https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#thread-local-storage

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/riscv/dl-tls.h: New file.
        * sysdeps/riscv/libc-tls.c: Likewise.
        * sysdeps/riscv/nptl/tcb-offsets.sym: Likewise.
        * sysdeps/riscv/nptl/tls.h: Likewise.
        * sysdeps/riscv/stackinfo.h: Likewise.

7 years agoRISC-V: ABI Implementation
Palmer Dabbelt [Wed, 27 Dec 2017 04:51:24 +0000 (20:51 -0800)] 
RISC-V: ABI Implementation

This patch contains code that needs to directly know about the RISC-V
ABI, which is specified in a work-in-progress psABI document:

  https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md

This is meant to contain all the RISC-V code that needs to explicitly
name registers or manage in-memory structure layout.  This does not
contain any of the Linux-specific code.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/riscv/__longjmp.S: New file.
        * sysdeps/riscv/backtrace.c: Likewise.
        * sysdeps/riscv/bits/endian.h: Likewise.
        * sysdeps/riscv/bits/setjmp.h: Likewise.
        * sysdeps/riscv/bits/wordsize.h: Likewise.
        * sysdeps/riscv/bsd-_setjmp.c: Likewise.
        * sysdeps/riscv/bsd-setjmp.c: Likewise.
        * sysdeps/riscv/dl-trampoline.S: Likewise.
        * sysdeps/riscv/gccframe.h: Likewise.
        * sysdeps/riscv/jmpbuf-offsets.h: Likewise.
        * sysdeps/riscv/jmpbuf-unwind.h: Likewise.
        * sysdeps/riscv/machine-gmon.h: Likewise.
        * sysdeps/riscv/memusage.h: Likewise.
        * sysdeps/riscv/setjmp.S: Likewise.
        * sysdeps/riscv/sys/asm.h: Likewise.
        * sysdeps/riscv/tls-macros.h: Likewise.

7 years agoAdd documentation for __riscv_flush_icache
Palmer Dabbelt [Mon, 29 Jan 2018 18:25:23 +0000 (10:25 -0800)] 
Add documentation for __riscv_flush_icache

This function is used by GCC to enforce ordering between data writes and
instruction fetches, and while we'd prefer that users rely on the GCC
intrinsic when possible this is user visible in case that's not
possible.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * manual/platform.texi: Add RISC-V documenation for
        __riscv_flush_icache.

7 years agoAdd RISC-V entries to config.h.in
Palmer Dabbelt [Mon, 29 Jan 2018 16:59:03 +0000 (08:59 -0800)] 
Add RISC-V entries to config.h.in

These were autogenerated.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * config.h.in: Regenerate.

7 years agoSkeleton documentation for the RISC-V port
Palmer Dabbelt [Wed, 27 Dec 2017 04:55:44 +0000 (20:55 -0800)] 
Skeleton documentation for the RISC-V port

During the upstreaming process it was suggested that I add a handful of
small documentation entries about the RISC-V port, which I've collected
here.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * manual/math.texi: RISC-V supports _Float128 and _Float64x.

7 years agosysdeps/init_array: Add PREINIT_FUNCTION to crti.S
Palmer Dabbelt [Thu, 25 Jan 2018 18:33:18 +0000 (10:33 -0800)] 
sysdeps/init_array: Add PREINIT_FUNCTION to crti.S

The RISC-V port contains a crti.S that simply contains a link to
PREINIT_FUNCTION (when defined).  As this should be entirely generic,
Joseph Myers suggested that we update the generic init_array version to
contain this.  Since RISC-V is the only user of init_array this won't
break any existing ports.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/init_array/crti.S (.section .init_array): Add
        PREINIT_FUNCTION when defined.

7 years agolibnsl: Turn remaining symbols into compat symbols [BZ #22701]
Florian Weimer [Mon, 29 Jan 2018 16:00:14 +0000 (17:00 +0100)] 
libnsl: Turn remaining symbols into compat symbols [BZ #22701]

7 years agomicroblaze: don't use copy_file_range syscall with kernel headers < 4.10
Romain Naour [Mon, 29 Jan 2018 16:12:08 +0000 (16:12 +0000)] 
microblaze: don't use copy_file_range syscall with kernel headers < 4.10

copy_file_range syscall was added for microblaze in 4.10.

This patch makes the MicroBlaze kernel-features.h undefine
__ASSUME_COPY_FILE_RANGE for toolchains built with kernel headers < 4.10.

* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
(__ASSUME_COPY_FILE_RANGE) [__LINUX_KERNEL_VERSION < 0x040A00]: Undef.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=7181e5590e5ba898804aef3ee6be7f27606e6f8b

Signed-off-by: Romain Naour <romain.naour@gmail.com>
7 years agoMake build-many-glibcs.py clean git source directories.
Joseph Myers [Mon, 29 Jan 2018 13:59:33 +0000 (13:59 +0000)] 
Make build-many-glibcs.py clean git source directories.

With the git checkouts of Hurd components in build-many-glibcs.py
involving running autoreconf, there's a risk that generated files
could be left behind by an old autoreconf run (if an old version of
the sources generates those files in the source directory but a new
version does not).

This patch avoids that by using git clean -dxfq when updating git
checkouts.  In this patch, that's conditional on --replace-sources, to
avoid removing any local not-checked-in files someone may have in
their checkout unless the option has been specifically passed that
says it's OK to blow old checkouts away, complete with any local
changes to them.

* scripts/build-many-glibcs.py (Context.git_checkout): Use git
clean -dxfq for git updates when replacing sources.

7 years agoClean up build-many-glibcs.py libcilkrts disabling.
Joseph Myers [Mon, 29 Jan 2018 13:49:21 +0000 (13:49 +0000)] 
Clean up build-many-glibcs.py libcilkrts disabling.

The disabling of libcilkrts in build-many-glibcs.py has some
peculiarities.  It's only for the final GCC build, not the initial
bootstrap one, whereas normally anything disabled for the final build
should be disabled for the bootstrap one as well.  And it's only for
Hurd, when it's more natural by analogy with the libsanitizer
disabling to disable this library unconditionally, not only for
targets where it's known to break.  This patch cleans up that
disabling accordingly, adding a comment so it's obvious it can be
removed once GCC 7 is too old to build glibc.

* scripts/build-many-glibcs.py (Config.build_gcc): Use
--disable-libcilkrts unconditionally, not just for the final GCC
build for Hurd.

7 years agoUse Linux 4.15 in build-many-glibcs.py.
Joseph Myers [Mon, 29 Jan 2018 13:38:21 +0000 (13:38 +0000)] 
Use Linux 4.15 in build-many-glibcs.py.

This patch makes build-many-glibcs.py use Linux 4.15.  Other glibc
updates for Linux 4.15 can wait until after the 2.27 release.

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

7 years agolt_LT: Add alternative month names (bug 10871).
Rafal Luzynski [Mon, 29 Jan 2018 12:00:43 +0000 (13:00 +0100)] 
lt_LT: Add alternative month names (bug 10871).

[BZ #10871]
* localedata/locales/lt_LT (alt_mon): Import from CLDR (nominative
case).

7 years agobe_BY, be_BY@latin: Add alternative month names (bug 10871).
Rafal Luzynski [Sun, 28 Jan 2018 00:23:45 +0000 (01:23 +0100)] 
be_BY, be_BY@latin: Add alternative month names (bug 10871).

This patch also fixes spelling of lang_name in be_BY@latin, as reported
by Ihar Hrachyshka.

[BZ #10871]
* localedata/locales/be_BY (mon): Rename to...
(alt_mon): This, then synchronize with CLDR (nominative case).
(abmon): Rename to...
(ab_alt_mon): This, then synchronize with CLDR (nominative case).
(mon): Import from CLDR (genitive case).
(abmon): Likewise.
* localedata/locales/be_BY@latin (mon): Rename to...
(alt_mon): This.
(mon): Add, proper genitive forms provided by Viktar Siarheichyk.

* localedata/locales/be_BY@latin (lang_name): Reworded to
"biełaruskaja mova".

7 years agoel_CY, el_GR: Add alternative month names (bug 10871).
Rafal Luzynski [Sat, 27 Jan 2018 00:33:38 +0000 (01:33 +0100)] 
el_CY, el_GR: Add alternative month names (bug 10871).

[BZ #10871]
* localedata/locales/el_CY (mon): Renamed to...
(alt_mon): This.
(mon): Import from CLDR (genitive case).
* localedata/locales/el_GR: Likewise.

7 years agoru_RU, ru_UA: Add alternative month names (bug 10871).
Rafal Luzynski [Tue, 5 Jan 2016 02:04:41 +0000 (03:04 +0100)] 
ru_RU, ru_UA: Add alternative month names (bug 10871).

[BZ #10871]
* localedata/locales/ru_RU (mon): Rename to...
(alt_mon): This.
(abmon): Rename to...
(ab_alt_mon): This.
(mon): Import from CLDR (genitive case).
(abmon): Copy from the old content except the 5th month which is
now in the genitive case, even when abbreviated.
* localedata/locales/ru_UA: Likewise.
* time/tst-strptime.c (day_tests): Add an actual example of
a difference between %b and %Ob in Russian.

7 years agohurd: Fix includes
Samuel Thibault [Mon, 29 Jan 2018 00:48:24 +0000 (01:48 +0100)] 
hurd: Fix includes

* sysdeps/mach/hurd/net/ethernet.h: Include <stdint.h>.
* sysdeps/mach/hurd/net/if_arp.h: Include <stdint.h>.
* sysdeps/mach/hurd/net/if_ppp.h: Do not include non-existing
<net/ppp_defs.h>.

7 years agohurd: Fix _POSIX_VDISABLE value
Samuel Thibault [Sun, 28 Jan 2018 23:05:20 +0000 (00:05 +0100)] 
hurd: Fix _POSIX_VDISABLE value

* sysdeps/mach/hurd/bits/posix_opt.h (_POSIX_VDISABLE): Set to '\0'
instead of invalid -1.

7 years agohurd: Build stubs for new gnumach.defs
Samuel Thibault [Sun, 28 Jan 2018 18:38:09 +0000 (19:38 +0100)] 
hurd: Build stubs for new gnumach.defs

* mach/Makefile (user-interfaces): Add mach/gnumach.
* sysdeps/mach/configure.ac (mach_interface_list): Add gnumach.
* sysdeps/mach/configure (mach_interface_list): Regenerate.

7 years agohurd: Include <sigsetops.h> from hurd/hurd/signal.h
Samuel Thibault [Sun, 28 Jan 2018 18:36:29 +0000 (19:36 +0100)] 
hurd: Include <sigsetops.h> from hurd/hurd/signal.h

* hurd/hurd/signal.h [__USE_EXTERN_INLINES][_LIBC][IS_IN(libc) ||
IS_IN(libpthread)]: Include <sigsetops.h>.

7 years agohurd: Fix allocalim build
Samuel Thibault [Sun, 28 Jan 2018 18:33:37 +0000 (19:33 +0100)] 
hurd: Fix allocalim build

* sysdeps/pthread/allocalim.h [!defined PTHREAD_STACK_MIN]: Do not
check size against PTHREAD_STACK_MIN.

7 years agohurd: fix typo
Samuel Thibault [Sun, 28 Jan 2018 18:27:19 +0000 (19:27 +0100)] 
hurd: fix typo

7 years agohurd: Fix posix options
Samuel Thibault [Sun, 28 Jan 2018 18:13:55 +0000 (19:13 +0100)] 
hurd: Fix posix options

_POSIX_CHOWN_RESTRICTED and _POSIX_NO_TRUNC should be always defined.

* sysdeps/mach/hurd/bits/posix_opt.h (_POSIX_CHOWN_RESTRICTED,
_POSIX_NO_TRUNC): Define to 0.

7 years agoRevert "hurd: Fix building io/tst-fchownat.c"
Samuel Thibault [Sun, 28 Jan 2018 18:13:20 +0000 (19:13 +0100)] 
Revert "hurd: Fix building io/tst-fchownat.c"

This reverts commit fc221145a734d128d8f56f40d40fd4bb70a1d151.