platform/upstream/glibc.git
4 years agort: avoid PLT setup in timer_[sg]ettime
Andreas Schwab [Mon, 27 Jan 2020 09:05:53 +0000 (10:05 +0100)]
rt: avoid PLT setup in timer_[sg]ettime

The functions __timer_gettime64 and __timer_settime64 live in librt, not
libc.  Use proper hidden aliases so that the callers do not need to set up
the PLT register.

Fixes commits cae1635a70 ("y2038: linux: Provide __timer_settime64
implementation") and 562cdc19c7 ("y2038: linux: Provide __timer_gettime64
implementation").

4 years agoUpdate or_IN collation [BZ #22525]
Mike FABIAN [Thu, 5 Dec 2019 13:21:21 +0000 (14:21 +0100)]
Update or_IN collation [BZ #22525]

- Add a test file or_IN.UTF-8.in.
- Make the collation agree with CLDR.

4 years agoFix ckb_IQ [BZ #9809]
Mike FABIAN [Mon, 13 Jan 2020 09:12:07 +0000 (10:12 +0100)]
Fix ckb_IQ [BZ #9809]

Add ckb_IQ to SUPPORTED file.
Add ckb_IQ.UTF-8.in collation test file.
Mention new ckb_IQ locale in NEWS.

4 years agoAdd new locale: ckb_IQ (Kurdish/Sorani spoken in Iraq) [BZ #9809]
Jwtiyar Nariman [Mon, 13 Jan 2020 09:06:06 +0000 (10:06 +0100)]
Add new locale: ckb_IQ (Kurdish/Sorani spoken in Iraq) [BZ #9809]

4 years agolist-fixed-bugs.py: Wrap at 72 chars
Siddhesh Poyarekar [Sat, 1 Feb 2020 13:49:02 +0000 (19:19 +0530)]
list-fixed-bugs.py: Wrap at 72 chars

Wrap the bug list output at 72 chars to make it easy to paste into
emails.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
4 years agoy2038: linux: Provide __sched_rr_get_interval64 implementation
Lukasz Majewski [Mon, 6 Jan 2020 12:52:00 +0000 (13:52 +0100)]
y2038: linux: Provide __sched_rr_get_interval64 implementation

This patch replaces auto generated wrapper (as described in
sysdeps/unix/sysv/linux/syscalls.list) for sched_rr_get_interval with one which
adds extra support for reading 64 bit time values on machines with
__TIMESIZE != 64.
There is no functional change for architectures already supporting 64 bit
time ABI.

The sched_rr_get_interval declaration in ./include/sched.h is not followed by
corresponding libc_hidden_proto(), so it has been assumed that newly introduced
syscall wrapper doesn't require libc_hidden_def() (which has been added by
template used with auto generation script).

Moreover, the code for building sched_rr_gi.c file is already placed in
./posix/Makefiles, so there was no need to add it elsewhere.

Performed tests and validation are the same as for timer_gettime() conversion
(sysdeps/unix/sysv/linux/timer_gettime.c).

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoy2038: linux: Provide __timerfd_settime64 implementation
Lukasz Majewski [Fri, 6 Dec 2019 15:20:33 +0000 (16:20 +0100)]
y2038: linux: Provide __timerfd_settime64 implementation

This patch replaces auto generated wrapper (as described in
sysdeps/unix/sysv/linux/syscalls.list) for timerfd_settime with one which
adds extra support for reading and writing from Linux kernel 64 bit time
values on machines with __TIMESIZE != 64.
There is no functional change for archs already supporting 64 bit time ABI.

This patch is conceptually identical to timer_settime conversion already
done in sysdeps/unix/sysv/linux/timer_settime.c.
Please refer to corresponding commit message for detailed description of
introduced functions and the testing procedure.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
---
Changes for v4:
- Update date from 2019 to 2020

Changes for v3:
- Add missing libc_hidden_def()

Changes for v2:
- Remove "Contributed by" from the file header
- Remove early check for (fd < 0) in __timerfd_settime64 as the fd
  correctness check is already done in Linux kernel
- Add single descriptive comment line to provide concise explanation
  of the code

4 years agoy2038: linux: Provide __timerfd_gettime64 implementation
Lukasz Majewski [Fri, 6 Dec 2019 09:41:50 +0000 (10:41 +0100)]
y2038: linux: Provide __timerfd_gettime64 implementation

This patch replaces auto generated wrapper (as described in
sysdeps/unix/sysv/linux/syscalls.list) for timerfd_gettime with one which
adds extra support for reading 64 bit time values on machines with
__TIMESIZE != 64.
There is no functional change for architectures already supporting 64 bit
time ABI.

This patch is conceptually identical to timer_gettime conversion already
done in sysdeps/unix/sysv/linux/timer_gettime.c.
Please refer to corresponding commit message for detailed description of
introduced functions and the testing procedure.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
---
Changes for v4:
- Update date from 2019 to 2020

Changes for v3:
- Add missing libc_hidden_def()

Changes for v2:
- Remove "Contributed by" from the file header
- Remove early check for (fd < 0) in __timerfd_gettime64 as the fd
  correctness check is already done in Linux kernel
- Add single descriptive comment line to provide concise explanation
  of the code

4 years agoi386: Remove _exit.S
H.J. Lu [Sat, 1 Feb 2020 13:44:56 +0000 (05:44 -0800)]
i386: Remove _exit.S

The generic implementation is suffice since __NR_exit_group is always
support and i386 does define ABORT_INSTRUCTION.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoi386: Use ENTRY/END in assembly codes
H.J. Lu [Sat, 1 Feb 2020 13:44:55 +0000 (05:44 -0800)]
i386: Use ENTRY/END in assembly codes

Use ENTRY and END in assembly codes so that ENDBR32 will be added at
function entries when CET is enabled.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoi386-mcount.S: Add _CET_ENDBR to _mcount and __fentry__
H.J. Lu [Sat, 1 Feb 2020 13:44:55 +0000 (05:44 -0800)]
i386-mcount.S: Add _CET_ENDBR to _mcount and __fentry__

Since _mcount and __fentry__ don't use ENTRY, we need to add _CET_ENDBR
by hand.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoi386/sub_n.S: Add a missing _CET_ENDBR to indirect jump target
H.J. Lu [Sat, 1 Feb 2020 13:44:55 +0000 (05:44 -0800)]
i386/sub_n.S: Add a missing _CET_ENDBR to indirect jump target

Add a missing _CET_ENDBR to indirect jump targe in sysdeps/i386/sub_n.S.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoi386: Don't unnecessarily save and restore EAX, ECX and EDX [BZ# 25262]
H.J. Lu [Sat, 1 Feb 2020 13:44:55 +0000 (05:44 -0800)]
i386: Don't unnecessarily save and restore EAX, ECX and EDX [BZ# 25262]

On i386, since EAX, ECX and EDX are caller-saved, there are no need
to save and restore EAX, ECX and EDX in getcontext, setcontext and
swapcontext.  They just need to clear EAX on success.  The extra
scratch registers are needed to enable CET.

Tested on i386.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agox86: Don't make 2 calls to dlerror () in a row
H.J. Lu [Sat, 1 Feb 2020 13:43:34 +0000 (05:43 -0800)]
x86: Don't make 2 calls to dlerror () in a row

We shouldn't make 2 calls to dlerror () in a row since the first call
will clear the error.  We should just use the return value from the
first call.

Tested on Linux/x86-64.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 years agoOpen master for 2.32 development
Siddhesh Poyarekar [Sat, 1 Feb 2020 11:38:55 +0000 (17:08 +0530)]
Open master for 2.32 development

happy hacking!

4 years agoGenerate ChangeLog.old/ChangeLog.20 for 2.31
Siddhesh Poyarekar [Sat, 1 Feb 2020 10:56:33 +0000 (16:26 +0530)]
Generate ChangeLog.old/ChangeLog.20 for 2.31

We're ready to tag!

4 years agoUpdate version numbers for 2.31 release
Siddhesh Poyarekar [Sat, 1 Feb 2020 10:52:59 +0000 (16:22 +0530)]
Update version numbers for 2.31 release

4 years agoAdd bugs fixed in 2.31 in NEWS
Siddhesh Poyarekar [Sat, 1 Feb 2020 10:46:55 +0000 (16:16 +0530)]
Add bugs fixed in 2.31 in NEWS

4 years agoUpdate newest tested versions of dependencies in install.texi
Siddhesh Poyarekar [Sat, 1 Feb 2020 10:44:37 +0000 (16:14 +0530)]
Update newest tested versions of dependencies in install.texi

Updated versions of gcc, binutils, awk, bison and perl.

4 years agoAdd more contributors to the manual
Siddhesh Poyarekar [Sat, 1 Feb 2020 09:56:44 +0000 (15:26 +0530)]
Add more contributors to the manual

4 years agoAdd note to NEWS about kernel headers dependency on risc-v
Siddhesh Poyarekar [Sat, 1 Feb 2020 09:21:50 +0000 (14:51 +0530)]
Add note to NEWS about kernel headers dependency on risc-v

It was discovered that RISC-V 64-bit still needs kernel headers >= 5.0
to be installed to build correctly:

https://gitlab.com/kubu93/toolchains-builder/-/jobs/422726962

Fix up the NEWS item to make that clear.

4 years agoAdd Portuguese (Portugal) translation
Siddhesh Poyarekar [Sat, 1 Feb 2020 11:45:38 +0000 (17:15 +0530)]
Add Portuguese (Portugal) translation

4 years agoAdd NEWS entry about 64-bit time_t syscall use on 32-bit targets
Szabolcs Nagy [Thu, 30 Jan 2020 10:40:01 +0000 (10:40 +0000)]
Add NEWS entry about 64-bit time_t syscall use on 32-bit targets

This internal change ideally should not affect the public API or ABI,
but there is a widespread use of seccomp sandboxes, even on 32-bit
targets, that don't handle new Linux syscall usage well, so it's
worth mentioning in the NEWS.

Co-authored-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agonptl: Avoid using PTHREAD_MUTEX_DEFAULT in macro definition [BZ #25271]
Florian Weimer [Thu, 30 Jan 2020 14:54:49 +0000 (15:54 +0100)]
nptl: Avoid using PTHREAD_MUTEX_DEFAULT in macro definition [BZ #25271]

Commit 1c3f9acf1f1f75faa7a28bf39af64afd ("nptl: Add struct_mutex.h")
replaced a zero constant with the identifier PTHREAD_MUTEX_DEFAULT
in the macro PTHREAD_MUTEX_INITIALIZER.  However, that constant
is not available in ISO C11 mode:

In file included from /usr/include/bits/thread-shared-types.h:74,
                 from /usr/include/bits/pthreadtypes.h:23,
                 from /usr/include/pthread.h:26,
                 from bug25271.c:1:
bug25271.c:3:21: error: ‘PTHREAD_MUTEX_DEFAULT’ undeclared here (not in a function)
    3 | pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~

This commit change the constant to the equivalent
PTHREAD_MUTEX_TIMED_NP, which is in the POSIX extension namespace
and thus always available.

4 years agoBuild raise with -fasynchronous-unwind-tables.
Joseph Myers [Fri, 24 Jan 2020 17:23:47 +0000 (17:23 +0000)]
Build raise with -fasynchronous-unwind-tables.

In testing glibc for Arm and MIPS, I see:

FAIL: misc/tst-sigcontext-get_pc

If this test - backtracing through a call to raise - is valid, then
raise needs to be built with -fasynchronous-unwind-tables (as the test
itself is) to have the required unwind information for that
backtracing to work.  Adding that option, which this patch does,
causes the test for pass for Arm.  For MIPS, the test still does not
pass (the backtrace has an address that is 2 bytes after the "address
in signal handler", for unknown reasons), although the patch allows a
longer backtrace to be produced.

4 years agoFix locale/tst-locale-locpath cross-testing when sshd sets LANG.
Joseph Myers [Fri, 24 Jan 2020 17:23:07 +0000 (17:23 +0000)]
Fix locale/tst-locale-locpath cross-testing when sshd sets LANG.

The locale/tst-locale-locpath test unsets LANG, then runs a test with
test_wrapper_env and expects LANG to remain unset for that test.  This
does not work for cross-testing with cross-test-ssh.sh when sshd (on
the system specified as an argument to cross-test-ssh.sh) is
configured to have a default LANG setting.

The general design used in cross testing, after commit
8540f6d2a74fe9d67440535ebbcfa252180a3172 ("Don't require test wrappers
to preserve environment variables, use more consistent environment.",
6 June 2014), is that environment settings required by tests should be
passed explicitly to $(test-wrapper-env).  This patch changes
tst-locale-locpath.sh to pass an explicit LANG= rather than expecting
"unset LANG" to be in effect for the program run under
test_wrapper_env.  Note that this does slightly change the environment
in which the test is run natively (empty LANG instead of unset LANG)
but that difference does not appear relevant to what it is trying to
test.

Tested for Arm that this fixes the failure seen for that test in
cross-testing.

4 years agoFix elf/tst-rtld-preload cross-testing.
Joseph Myers [Fri, 24 Jan 2020 17:22:13 +0000 (17:22 +0000)]
Fix elf/tst-rtld-preload cross-testing.

As noted in
<https://sourceware.org/ml/libc-alpha/2019-06/msg00824.html>,
elf/tst-rtld-preload fails when cross-testing because it attempts to
run the test wrapper with itself.  Unfortunately, that thread never
resulted in a complete and correct patch for that test.

This patch addresses the issues with that test more thoroughly.  The
test is changed not to use the wrapper twice, including updating the
message it prints about the command it runs to be more complete and
accurate after the change; the Makefile is changed not to pass the
redundant '$(test-wrapper)' argument.

Tested for Arm that this fixes the failure seen for that test in
cross-testing.

4 years agoFix cross-testing of tst-ifunc-fault-* tests.
Joseph Myers [Thu, 23 Jan 2020 14:34:16 +0000 (14:34 +0000)]
Fix cross-testing of tst-ifunc-fault-* tests.

The tests elf/tst-ifunc-fault-bindnow and elf/tst-ifunc-fault-lazy
fail in cross-testing because they run the dynamic linker directly
without using the test wrapper.  This patch fixes them to use the test
wrapper instead.

Tested that this fixes the failure of those two tests for powerpc
soft-float.

4 years agogitlog-to-changelog: Drop scripts in favour of gnulib version
Siddhesh Poyarekar [Fri, 17 Jan 2020 03:41:49 +0000 (09:11 +0530)]
gitlog-to-changelog: Drop scripts in favour of gnulib version

The ChangeLog automation scripts were incorporated in gnulib as
vcs-to-changelog for a while now since other projects expressed the
desire to use and extend this script.  In the interest of avoiding
duplication of code, drop the glibc version of gitlog-to-changelog and
use the gnulib one directly.

The only file that remains is vcstocl_quirks.py, which specifies
properties and quirks of the glibc project source code.  This patch
also drops the shebang at the start of vcstocl_quirks.py since the
file is not intended to be directly executable.

4 years agoAdd NEWS entry about the change in handling of PT_GNU_STACK on MIPS
Dragan Mladjenovic [Wed, 22 Jan 2020 17:14:23 +0000 (17:14 +0000)]
Add NEWS entry about the change in handling of PT_GNU_STACK on MIPS

The change was introduced in:

commit 33bc9efd91de1b14354291fc8ebd5bce96379f12
Author: Dragan Mladjenovic <dmladjenovic@wavecomp.com>
Date:   Fri Aug 23 16:38:04 2019 +0000

    mips: Force RWX stack for hard-float builds that can run on pre-4.8 kernels

and probably requires a small explanation.

Co-authored-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoFix array overflow in backtrace on PowerPC (bug 25423)
Andreas Schwab [Mon, 20 Jan 2020 16:01:50 +0000 (17:01 +0100)]
Fix array overflow in backtrace on PowerPC (bug 25423)

When unwinding through a signal frame the backtrace function on PowerPC
didn't check array bounds when storing the frame address.  Fixes commit
d400dcac5e ("PowerPC: fix backtrace to handle signal trampolines").

4 years agogetaddrinfo: Fix resource leak after strdup failure in gethosts [BZ #25425]
Florian Weimer [Mon, 20 Jan 2020 17:37:13 +0000 (18:37 +0100)]
getaddrinfo: Fix resource leak after strdup failure in gethosts [BZ #25425]

Filip Ochnik spotted that one of the error jumps in gethosts fails to
call __resolv_context_put to release the resolver context.

Fixes commit 352f4ff9a268b81ef5d4b2413f582565806e4790 ("resolv:
Introduce struct resolv_context [BZ #21668]") and commit
964263bb8d650f1681665c55704fb01a8e725621 ("getaddrinfo: Release
resolver context on error in gethosts [BZ #21885]").

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoRun bench-timing-type with newly built libc.
Joseph Myers [Mon, 20 Jan 2020 11:29:41 +0000 (11:29 +0000)]
Run bench-timing-type with newly built libc.

benchtests/timing-type is built with the newly built libc, so should
be run with it like actual tests and benchmarks.

4 years agoGet rid of Werror=maybe-uninitialized in res_send.c.
Stefan Liebler [Mon, 20 Jan 2020 09:55:55 +0000 (10:55 +0100)]
Get rid of Werror=maybe-uninitialized in res_send.c.

The commit 446997ff1433d33452b81dfa9e626b8dccf101a4 introduced
this new usage of resplen. If build with gcc 9 -march>=z13 on s390x,
the following warning occurs:
res_send.c: In function ‘__res_context_send’:
res_send.c:539:6: error: ‘resplen’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  539 |   if (resplen > HFIXEDSZ)
      |      ^

Therefore this patch adds a further DIAG_IGNORE_NEEDS_COMMENT in the
same way as it was previously done for usages of resplen or n.
See commit d1bc2cbbed9aea2017ef941f63c8786571da5b4f.

4 years agotranslations: Update translations
Siddhesh Poyarekar [Sun, 19 Jan 2020 05:13:26 +0000 (10:43 +0530)]
translations: Update translations

Update translations after adding msgattrib to the update-translations
makefile target.

4 years agotranslations: Trim po files using msgattrib
Siddhesh Poyarekar [Fri, 17 Jan 2020 17:19:33 +0000 (22:49 +0530)]
translations: Trim po files using msgattrib

The translation project coordinator Benno Schulenberg suggested that
we could save space in our tarball by trimming the generated po files
by using msgattrib and dropping all untranslated, fuzzy and obsolete
messages.  This patch updates the update-translations target to do
that.  Testing indicates that the current po files reduce by over 65K
lines due to this trimming.

4 years agoUpdate translations
Siddhesh Poyarekar [Sun, 19 Jan 2020 04:51:35 +0000 (10:21 +0530)]
Update translations

Update translations from the translation project.

4 years agotranslations: Run msgmerge when downloading translations
Siddhesh Poyarekar [Fri, 17 Jan 2020 16:36:01 +0000 (22:06 +0530)]
translations: Run msgmerge when downloading translations

The latest translations in the translationproject URL need to be
merged in using msgmerge for the po files to be correctly updated,
otherwise we may end up getting odd results, such as the previous
translations update.  This patch adds another step to the
update-translations Makefile target which does a msgmerge of the
downloaded po file with libc.pot and then uses that as the final
result.

4 years agoFix maybe-uninitialized error on powerpc
Matheus Castanho [Fri, 17 Jan 2020 14:44:54 +0000 (11:44 -0300)]
Fix maybe-uninitialized error on powerpc

The build has been failing on powerpc64le-linux-gnu with GCC 10
due to a maybe-uninitialized error:

../sysdeps/ieee754/dbl-64/mpa.c:875:6: error: ‘w.e’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
  875 |   EY -= EX;
      |      ^~

The warning is thrown because when __inv is called by __dvd *y is not
initialized and if t == 0 before calling __dbl_mp, EY will stay
uninitialized, as the function does not touch it in this case.

However, since t will be set to 1/t before calling __dbl_mp, t == 0 will
never happen, so we can instruct the compiler to ignore this case, which
suppresses the warning.

Tested on powerpc64le.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
4 years agopowerpc32: Fix syntax error in __GLRO macro
Andreas Schwab [Fri, 17 Jan 2020 23:17:05 +0000 (00:17 +0100)]
powerpc32: Fix syntax error in __GLRO macro

4 years agoRemove incorrect alloc_size attribute from pvalloc [BZ #25401]
Florian Weimer [Fri, 17 Jan 2020 14:05:34 +0000 (15:05 +0100)]
Remove incorrect alloc_size attribute from pvalloc [BZ #25401]

pvalloc is guarantueed to round up the allocation size to the page
size, so applications can assume that the memory region is larger
than the passed-in argument.  The alloc_size attribute cannot express
that.

The test case is based on a suggestion from Jakub Jelinek.

This fixes commit 9bf8e29ca136094f73f69f725f15c51facc97206 ("malloc:
make malloc fail with requests larger than PTRDIFF_MAX (BZ#23741)").

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoFix tst-pkey.c pkey_alloc return checks and manual
Lucas A. M. Magalhaes [Thu, 16 Jan 2020 13:39:12 +0000 (10:39 -0300)]
Fix tst-pkey.c pkey_alloc return checks and manual

This test was failing in some powerpc systems as it was not checking
for ENOSPC return.

As said on the Linux man-pages and can be observed by the implementation
at mm/mprotect.c in the Linux Kernel source.  The syscall pkey_alloc can
return EINVAL or ENOSPC.  ENOSPC will indicate either that all keys are
in use or that the kernel does not support pkeys.

Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.net.br>
4 years agopowerpc: Move cache line size to rtld_global_ro
Tulio Magno Quites Machado Filho [Fri, 10 Jan 2020 22:14:56 +0000 (19:14 -0300)]
powerpc: Move cache line size to rtld_global_ro

GCC 10.0 enabled -fno-common by default and this started to point that
__cache_line_size had been implemented in 2 different places: loader and
libc.

In order to avoid this duplication, the libc variable has been removed
and the loader variable is moved to rtld_global_ro.

File sysdeps/unix/sysv/linux/powerpc/dl-auxv.h has been added in order
to reuse code for both static and dynamic linking scenarios.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 years agopowerpc: Initialize rtld_global_ro for static dlopen [BZ #20802]
Tulio Magno Quites Machado Filho [Fri, 10 Jan 2020 22:14:56 +0000 (19:14 -0300)]
powerpc: Initialize rtld_global_ro for static dlopen [BZ #20802]

Initialize dl_auxv, dl_hwcap and dl_hwcap2 in rtld_global_ro for DSOs
that have been statically dlopen'ed.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 years agoRevert outdated translations
Siddhesh Poyarekar [Fri, 17 Jan 2020 04:12:24 +0000 (09:42 +0530)]
Revert outdated translations

The update-translation target seems to have downloaded outdated
translations for these languages.  Revert them and try to figure out
if this is a problem with the target or an error in translations.

4 years agovcs-to-changelog: Add quirk for __nonnull
Siddhesh Poyarekar [Thu, 16 Jan 2020 14:49:07 +0000 (20:19 +0530)]
vcs-to-changelog: Add quirk for __nonnull

The parser cannot identify the __nonnull off the bat and confuses
__typeof in the change db25266c9 to be a function declaration.

4 years agoelf: Add elf/tst-dlopenfail-2 [BZ #25396]
Florian Weimer [Thu, 16 Jan 2020 15:53:58 +0000 (16:53 +0100)]
elf: Add elf/tst-dlopenfail-2 [BZ #25396]

Without CET, a jump into a newly loaded object through an overwritten
link map often does not crash, it just executes some random code.
CET detects this in some cases because the function pointer does not
point to the start of a function in the replacement shared object,
so there is no ENDBR instruction.

The new test uses a small shared object and the existing dangling
link map to trigger the bug.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoClear GL(dl_initfirst) when freeing its link_map memory [BZ# 25396]
H.J. Lu [Thu, 16 Jan 2020 14:45:36 +0000 (06:45 -0800)]
Clear GL(dl_initfirst) when freeing its link_map memory [BZ# 25396]

We should clear GL(dl_initfirst) when freeing its link_map memory.

Tested on Fedora 31/x86-64 with CET.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 years agoUpdate Translations
Siddhesh Poyarekar [Thu, 16 Jan 2020 14:12:35 +0000 (19:42 +0530)]
Update Translations

Update translations from translationproject.org for 2.30.9000.

4 years agohtl: Add internal version of __pthread_mutex_timedlock
Samuel Thibault [Mon, 13 Jan 2020 19:41:07 +0000 (20:41 +0100)]
htl: Add internal version of __pthread_mutex_timedlock

The C11 threads implementation will need it.

4 years agohtl: Avoid crashing when passed invalid pthread_t values
Samuel Thibault [Mon, 13 Jan 2020 18:41:57 +0000 (19:41 +0100)]
htl: Avoid crashing when passed invalid pthread_t values

4 years agoUpdate build-many-glibcs.py for GCC move to git.
Joseph Myers [Mon, 13 Jan 2020 16:32:57 +0000 (16:32 +0000)]
Update build-many-glibcs.py for GCC move to git.

This patch updates build-many-glibcs.py for the move of GCC to git,
teaching it to do the initial checkout from git, to replace an SVN
checkout with a git one if --replace-sources is used, and to get the
commit identifier from a git checkout after updating it.

4 years agoFix "elf: Add tst-ldconfig-ld_so_conf-update test" on 32bit.
Stefan Liebler [Mon, 13 Jan 2020 10:06:41 +0000 (11:06 +0100)]
Fix "elf: Add tst-ldconfig-ld_so_conf-update test" on 32bit.

This new test was introduced with recent commit
591236f1a33f11cc65ccf009d997071ba853e186.
If run on 32bit, it fails while renaming tst-ldconfig-ld-mod.so as there is no
/usr/lib64 directory. This patch is constructing the file name with help of
support_libdir_prefix.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agohtl: Avoid exposing unixoid functions
Samuel Thibault [Mon, 13 Jan 2020 00:33:21 +0000 (01:33 +0100)]
htl: Avoid exposing unixoid functions

C11 threads should not expose them.

4 years agohtl: Add type sizes in bits/pthreadtypes-arch.h and check them
Samuel Thibault [Mon, 13 Jan 2020 00:17:07 +0000 (01:17 +0100)]
htl: Add type sizes in bits/pthreadtypes-arch.h and check them

4 years agohtl: Add internal versions of functions used by C11 threads
Samuel Thibault [Sun, 12 Jan 2020 23:47:19 +0000 (00:47 +0100)]
htl: Add internal versions of functions used by C11 threads

The C11 threads implementation needs to call pthread_join and
pthread_key_delete without exposing them.

4 years agoUpdate timezone/README
Paul Eggert [Fri, 10 Jan 2020 07:00:25 +0000 (23:00 -0800)]
Update timezone/README

* timezone/version: New file, also taken from tzcode2018i.
* timezone/README: Reword so that people needn't paw through
old ChangeLog files to see which version we're using, a process
that is error-prone.  Update an obsolescent URL.

4 years ago elf: Add tst-ldconfig-ld_so_conf-update test
Alexandra Hájková [Thu, 9 Jan 2020 19:44:34 +0000 (20:44 +0100)]
 elf: Add tst-ldconfig-ld_so_conf-update test

 Test ldconfig after /etc/ld.so.conf update and verify a running process
 observes changes to /etc/ld.so.cache.
 The test uses the test-in-container framework.

Reviewed-by: Arjun Shankar <arjun@redhat.com>
4 years agoRevise NEWS description of changes to gettimeofday etc.
Zack Weinberg [Wed, 8 Jan 2020 20:23:12 +0000 (15:23 -0500)]
Revise NEWS description of changes to gettimeofday etc.

Mostly English grammar and style improvements.  The bullet list is
reorganized a little for clarity.  The details of exactly which
Linux-based ports still report system-wide time zone information
from gettimeofday has been removed, as this is not intended to be
something people should rely on.

Also clarify the deprecation of older SPARC ISAs, based on the fact
that “SPARC version 7” is actually the very first version of the SPARC
ISA (Sun Microsystems was very fond of letting the marketing
department pick version numbers).

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoDrop dependency of dist target on ChangeLog
Siddhesh Poyarekar [Wed, 8 Jan 2020 08:48:49 +0000 (14:18 +0530)]
Drop dependency of dist target on ChangeLog

We no longer write manual ChangeLog entries since they are
auto-generated at release time.  Drop dependency of the `make dist`
target on the file and document the fact that the latest ChangeLog
entries can be read in the highest numbered ChangeLog.N file in
ChangeLog.old.

The ChangeLog.old/ChangeLog.20 file for 2.31 will thus be generated
just before tagging a release.

Reviewed-by: Paul Eggert <eggert@cs.ucla.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoMIPS: Fix circular definition of __LDBL_MANT_DIG__ in ieee754.h
Zack Weinberg [Wed, 8 Jan 2020 19:28:23 +0000 (14:28 -0500)]
MIPS: Fix circular definition of __LDBL_MANT_DIG__ in ieee754.h

In commit aa706e13f4bfdf32a27c498902edf4f6006e433e,
sysdeps/mips/ieee754/ieee754.h was changed to use GCC’s predefined
macro __LDBL_MANT_DIG__, instead of including <float.h> and using
LDBL_MANT_DIG (and therefore polluting the user namespace with all of
the macros defined in float.h).  In order to support compilers that
don’t provide __LDBL_MANT_DIG__, there is a fallback #if block which
was supposed to include <float.h> and then define __LDBL_MANT_DIG__ to
LDBL_MANT_DIG.  However, at some point during the development of the
patch, a typo was introduced, causing the fallback block to define
__LDBL_MANT_DIG__ to expand to __LDBL_MANT_DIG__.

Correct this typo.

4 years agosl_SI locale: Use "." as the thousands separator (bug 25233)
Rafał Lużyński [Fri, 3 Jan 2020 11:11:20 +0000 (12:11 +0100)]
sl_SI locale: Use "." as the thousands separator (bug 25233)

This is correct according to CLDR [1] and Florian Weimer's quick
research. [2]

[1] https://st.unicode.org/cldr-apps/v#/sl/Symbols/
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=25233#c0

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoFix formatting of ChangeLog ouput
Siddhesh Poyarekar [Tue, 7 Jan 2020 04:25:03 +0000 (09:55 +0530)]
Fix formatting of ChangeLog ouput

Add another newline when the number of files differing is too large.
This is typical for across-the-board changes such as the copyright
year update that happened recently.

4 years agohurd: Fix message reception for timer_thread
Samuel Thibault [Sun, 5 Jan 2020 17:09:13 +0000 (18:09 +0100)]
hurd: Fix message reception for timer_thread

Without a proper size, we get MACH_RCV_TOO_LARGE instead of MACH_MSG_SUCCESS.

* sysdeps/mach/hurd/setitimer.c (timer_thread): Add return_code_type
field to received message, and set the receive size in __mach_msg call.

4 years agohtl: Add __errno_location and __h_errno_location
Samuel Thibault [Sat, 4 Jan 2020 18:37:53 +0000 (19:37 +0100)]
htl: Add __errno_location and __h_errno_location

As explained on
https://sourceware.org/ml/libc-alpha/2020-01/msg00049.html
the presence of __errno_location in libpthread.so on GNU/Linux makes
libpthread getting linked in for libstdc++. This aligns on that behavior, to
avoid issues that only GNU/Hurd would get.

4 years agohtl: Move pthread_atfork to libc_nonshared.a
Samuel Thibault [Sat, 4 Jan 2020 17:53:23 +0000 (18:53 +0100)]
htl: Move pthread_atfork to libc_nonshared.a

This follows bd60ce86520b ('nptl: Move pthread_atfork to libc_nonshared.a')
with the same rationale: there is no non-libpthread equivalent to be used
for making linking against libpthread optional.

libpthread_nonshared.a is unused after this, so remove it from the
build.

There is no ABI impact because pthread_atfork was implemented using
__register_atfork in libc even before this change.

pthread_atfork has to be a weak alias because pthread_* names are not
reserved in libc.

4 years agohtl: Drop common tcbhead_t definition
Samuel Thibault [Sat, 4 Jan 2020 17:52:00 +0000 (18:52 +0100)]
htl: Drop common tcbhead_t definition

This would conflict when including pt-internal.h outside libpthread, while
we can actually just include <tls.h>

4 years agohtl: Use dso_handle.h
Samuel Thibault [Sat, 4 Jan 2020 16:21:22 +0000 (17:21 +0100)]
htl: Use dso_handle.h

4 years agolinux: Optimize fallback 32-bit clock_getres
Adhemerval Zanella [Mon, 16 Dec 2019 16:50:57 +0000 (13:50 -0300)]
linux: Optimize fallback 32-bit clock_getres

This patch avoid probing the __NR_clock_getttime64 syscall each time
__clock_gettime64 is issued on a kernel without 64 bit time support.
Once ENOSYS is obtained, only 32-bit clock_gettime are used.

The following snippet:

  clock_getres (CLOCK_REALTIME, &(struct timespec) { 0 });
  clock_getres (CLOCK_MONOTONIC, &(struct timespec) { 0 });
  clock_getres (CLOCK_BOOTTIME, &(struct timespec) { 0 });
  clock_getres (20, &(struct timespec) { 0 });

On a kernel without 64 bit time support issues the syscalls:

  syscall_0x196(0, 0xffb83330, [...]) = -1 ENOSYS (Function not implemented)
  clock_getres(CLOCK_REALTIME, {tv_sec=0, tv_nsec=1}) = 0
  clock_getres(CLOCK_MONOTONIC, {tv_sec=0, tv_nsec=1}) = 0
  clock_getres(CLOCK_BOOTTIME, {tv_sec=0, tv_nsec=1}) = 0

Checked on i686-linux-gnu on 4.15 kernel.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Add support for clock_getres64 vDSO
Adhemerval Zanella [Wed, 11 Dec 2019 19:39:01 +0000 (16:39 -0300)]
linux: Add support for clock_getres64 vDSO

No architecture currently defines the vDSO symbol.  On archictures
with 64-bit time_t the HAVE_CLOCK_GETRES_VSYSCALL is renamed to
HAVE_CLOCK_GETRES64_VSYSCALL, it simplifies clock_gettime code.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Enable vDSO clock_gettime64 for mips
Adhemerval Zanella [Wed, 11 Dec 2019 14:19:41 +0000 (11:19 -0300)]
linux: Enable vDSO clock_gettime64 for mips

It was added on Linux 5.4 (commit 1f66c45db3302).

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Enable vDSO clock_gettime64 for arm
Adhemerval Zanella [Wed, 11 Dec 2019 14:17:12 +0000 (11:17 -0300)]
linux: Enable vDSO clock_gettime64 for arm

It was added on Linux 5.5 (commit 74d06efb9c2f9).

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Enable vDSO clock_gettime64 for i386
Adhemerval Zanella [Wed, 11 Dec 2019 14:15:21 +0000 (11:15 -0300)]
linux: Enable vDSO clock_gettime64 for i386

It was added on Linux 5.3 (commit 22ca962288c0a).

Checked on i686-linux-gnu with 5.3.0 kernel.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Optimize fallback 32-bit clock_gettime
Adhemerval Zanella [Sat, 14 Dec 2019 13:05:44 +0000 (10:05 -0300)]
linux: Optimize fallback 32-bit clock_gettime

This patch avoid probing the __NR_clock_getttime64 syscall each time
__clock_gettime64 is issued on a kernel without 64 bit time support.
Once ENOSYS is obtained, only 32-bit clock_gettime are used.

The following snippet:

  clock_gettime (CLOCK_REALTIME, &(struct timespec) { 0 });
  clock_gettime (CLOCK_MONOTONIC, &(struct timespec) { 0 });
  clock_gettime (CLOCK_BOOTTIME, &(struct timespec) { 0 });
  clock_gettime (20, &(struct timespec) { 0 });

On a kernel without 64 bit time support and with vDSO support results
on the following syscalls:

  syscall_0x193(0, 0xff87ba30, [...]) = -1 ENOSYS (Function not implemented)
  clock_gettime(CLOCK_BOOTTIME, {tv_sec=927082, tv_nsec=474382032}) = 0
  clock_gettime(0x14 /* CLOCK_??? */, 0xff87b9f8) = -1 EINVAL (Invalid argument)

While on a kernel without vDSO support:

  syscall_0x193(0, 0xbec95550, 0xb6ed2000, 0x1, 0xbec95550, 0) = -1 (errno 38)
  clock_gettime(CLOCK_REALTIME, {tv_sec=1576615930, tv_nsec=638250162}) = 0
  clock_gettime(CLOCK_MONOTONIC, {tv_sec=1665478, tv_nsec=638779620}) = 0
  clock_gettime(CLOCK_BOOTTIME, {tv_sec=1675418, tv_nsec=292932704}) = 0
  clock_gettime(0x14 /* CLOCK_??? */, 0xbec95530) = -1 EINVAL (Invalid argument)

Checked on i686-linux-gnu on 4.15 kernel and on a 5.3 kernel.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Add support for clock_gettime64 vDSO
Adhemerval Zanella [Wed, 11 Dec 2019 14:13:50 +0000 (11:13 -0300)]
linux: Add support for clock_gettime64 vDSO

No architecture currently defines the vDSO symbol.  On architectures
with 64-bit time_t the HAVE_CLOCK_GETTIME_VSYSCALL is renamed to
HAVE_CLOCK_GETTIME64_VSYSCALL, it simplifies clock_gettime code.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoelf: Move vDSO setup to rtld (BZ#24967)
Adhemerval Zanella [Fri, 29 Nov 2019 13:44:59 +0000 (10:44 -0300)]
elf: Move vDSO setup to rtld (BZ#24967)

This patch moves the vDSO setup from libc to loader code, just after
the vDSO link_map setup.  For static case the initialization
is moved to _dl_non_dynamic_init instead.

Instead of using the mangled pointer, the vDSO data is set as
attribute_relro (on _rtld_global_ro for shared or _dl_vdso_* for
static).  It is read-only even with partial relro.

It fixes BZ#24967 now that the vDSO pointer is setup earlier than
malloc interposition is called.

Also, vDSO calls should not be a problem for static dlopen as
indicated by BZ#20802.  The vDSO pointer would be zero-initialized
and the syscall will be issued instead.

Checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu,
arm-linux-gnueabihf, powerpc64le-linux-gnu, powerpc64-linux-gnu,
powerpc-linux-gnu, s390x-linux-gnu, sparc64-linux-gnu, and
sparcv9-linux-gnu.  I also run some tests on mips.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoelf: Enable relro for static build
Adhemerval Zanella [Fri, 29 Nov 2019 13:26:30 +0000 (10:26 -0300)]
elf: Enable relro for static build

The code is similar to the one at elf/dl-reloc.c, where it checks for
the l_relro_size from the link_map (obtained from PT_GNU_RELRO header
from program headers) and calls_dl_protected_relro.

For testing I will use the ones proposed by Florian's patch
'elf: Add tests for working RELRO protection' [1].

Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu,
aarch64-linux-gnu, s390x-linux-gnu, and sparc64-linux-gnu.  I also
check with --enable-static pie on x86_64-linux-gnu, i686-linux-gnu,
and aarch64-linux-gnu which seems the only architectures where
static PIE is actually working (as per 9d7a3741c9e, on
arm-linux-gnueabihf, powerpc64{le}-linux-gnu, and s390x-linux-gnu
I am seeing runtime issues not related to my patch).

[1] https://sourceware.org/ml/libc-alpha/2019-10/msg00059.html

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Consolidate time implementation
Adhemerval Zanella [Mon, 16 Dec 2019 12:58:32 +0000 (09:58 -0300)]
linux: Consolidate time implementation

The IFUNC bypass to vDSO is used when USE_IFUNC_TIME is set.
Currently powerpc and x86 defines it.  Otherwise the generic
implementation is used, which calls clock_gettime.

Checked on powerpc64le-linux-gnu, powerpc64-linux-gnu,
powerpc-linux-gnu-power4, x86_64-linux-gnu, and i686-linux-gnu.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Consolidate Linux gettimeofday
Adhemerval Zanella [Mon, 16 Dec 2019 12:45:55 +0000 (09:45 -0300)]
linux: Consolidate Linux gettimeofday

The IFUNC bypass to vDSO is used when USE_IFUNC_GETTIMEOFDAY is set.
Currently aarch64, powerpc*, and x86 defines it.  Otherwise the
generic implementation is used, which calls clock_gettime.

Checked on aarch64-linux-gnu, powerpc64le-linux-gnu,
powerpc64-linux-gnu, powerpc-linux-gnu-power4, x86_64-linux-gnu,
and i686-linux-gnu.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Update mips vDSO symbols
Adhemerval Zanella [Fri, 29 Nov 2019 12:22:50 +0000 (09:22 -0300)]
linux: Update mips vDSO symbols

The clock_getres is a new implementation added on Linux 5.4
(abed3d826f2f).

Checked with a build against mips-linux-gnu and mips64-linux-gnu.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Update x86 vDSO symbols
Adhemerval Zanella [Fri, 29 Nov 2019 12:14:08 +0000 (09:14 -0300)]
linux: Update x86 vDSO symbols

Add the missing time and clock_getres vDSO symbol names on x86.
For time, the iFUNC already uses expected name so it affects only
the static build.

The clock_getres is a new implementation added on Linux 5.3
(f66501dc53e72).

Checked on x86-linux-gnu and i686-linux-gnu.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoRemove vDSO support from make-syscall.sh
Adhemerval Zanella [Fri, 29 Nov 2019 19:28:46 +0000 (16:28 -0300)]
Remove vDSO support from make-syscall.sh

The auto-generated vDSO call shows some issues:

  - It requires sync the auto-generated C file with current glibc
    implementation;
  - It still uses symbol redirections hacks where libc-symbols.h
    provide macros that uses compiler builtins
    (libc_ifunc_redirected for instance);
  - It does not handle all required compiler handling
    (inhibit_stack_protector on iFUNC resolver).
  - No architecure uses it.

Checked with a build against all major ABIs.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agox86: Make x32 use x86 time implementation
Adhemerval Zanella [Fri, 29 Nov 2019 14:44:30 +0000 (11:44 -0300)]
x86: Make x32 use x86 time implementation

This is the only use of auto-generation syscall which uses a vDSO
plus IFUNC and the current x86 generic implementation already covers
the expected semantic.

Checked on x86_64-linux-gnu-x32.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agolinux: Fix vDSO macros build with time64 interfaces
Adhemerval Zanella [Fri, 13 Dec 2019 20:30:15 +0000 (17:30 -0300)]
linux: Fix vDSO macros build with time64 interfaces

As indicated on libc-help [1] the ec138c67cb commit broke 32-bit
builds when configured with --enable-kernel=5.1 or higher.  The
scenario 10 from [2] might also occur in this configuration and
INLINE_VSYSCALL will try to use the vDSO symbol and
HAVE_CLOCK_GETTIME64_VSYSCALL does not set HAVE_VSYSCALL prior its
usage.

Also, there is no easy way to just enable the code to use one
vDSO symbol since the macro INLINE_VSYSCALL is redefined if
HAVE_VSYSCALL is set.

Instead of adding more pre-processor handling and making the code
even more convoluted, this patch removes the requirement of defining
HAVE_VSYSCALL before including sysdep-vdso.h to enable vDSO usage.

The INLINE_VSYSCALL is now expected to be issued inside a
HAVE_*_VSYSCALL check, since it will try to use the internal vDSO
pointers.

Both clock_getres and clock_gettime vDSO code for time64_t were
removed since there is no vDSO setup code for the symbol (an
architecture can not set HAVE_CLOCK_GETTIME64_VSYSCALL).

Checked on i686-linux-gnu (default and with --enable-kernel=5.1),
x86_64-linux-gnu, aarch64-linux-gnu, and powerpc64le-linux-gnu.
I also checked against a build to mips64-linux-gnu and
sparc64-linux-gnu.

[1] https://sourceware.org/ml/libc-help/2019-12/msg00014.html
[2] https://sourceware.org/ml/libc-alpha/2019-12/msg00142.html

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoLinux: Fix clock_nanosleep time64 check
Adhemerval Zanella [Thu, 2 Jan 2020 18:39:12 +0000 (15:39 -0300)]
Linux: Fix clock_nanosleep time64 check

The result of INTERNAL_SYSCALL_CANCEL should be checked with
macros INTERNAL_SYSCALL_ERROR_P and INTERNAL_SYSCALL_ERRNO instead
of comparing the result directly.

Checked on powerpc-linux-gnu.

4 years agoAdd libm_alias_finite for _finite symbols
Wilco Dijkstra [Tue, 16 Jul 2019 15:17:22 +0000 (12:17 -0300)]
Add libm_alias_finite for _finite symbols

This patch adds a new macro, libm_alias_finite, to define all _finite
symbol.  It sets all _finite symbol as compat symbol based on its first
version (obtained from the definition at built generated first-versions.h).

The <fn>f128_finite symbols were introduced in GLIBC 2.26 and so need
special treatment in code that is shared between long double and float128.
It is done by adding a list, similar to internal symbol redifinition,
on sysdeps/ieee754/float128/float128_private.h.

Alpha also needs some tricky changes to ensure we still emit 2 compat
symbols for sqrt(f).

Passes buildmanyglibc.

Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoUpdate libc.pot for 2.31 release
Siddhesh Poyarekar [Thu, 2 Jan 2020 14:41:36 +0000 (20:11 +0530)]
Update libc.pot for 2.31 release

4 years agoMultiple locales: Add date_fmt (bug 24054)
Rafał Lużyński [Mon, 30 Dec 2019 10:58:18 +0000 (11:58 +0100)]
Multiple locales: Add date_fmt (bug 24054)

It is not specified what should be the content of d_t_fmt and date_fmt
but in the built-in C locale those fields have only one difference:
date_fmt contains "%Z" (the current time zone) while d_t_fmt does not.

For most of the locales this commit does the following operation:
copy d_t_fmt to date_fmt, and then remove "%Z" from d_t_fmt.
If "%Z" was originally missing from d_t_fmt add it to date_fmt.
It also corrects comments where necessary.

Exceptions:

* In bo_CN, dz_BT, and km_KH "%Z" has not been added to date_fmt because
  it was too difficult.  In these locales date_fmt has been set to the
  copy of d_t_fmt.
* In en_DK "%Z" has not been removed from d_t_fmt in order to preserve
  the conformance with the standard mentioned in the comment.

The command to identify and initially edit the locales that need the
update was:

    for i in `grep -lw d_t_fmt *`
    do
        if ! grep -qw date_fmt $i ; then
            awk '/d_t_fmt/ { print $0; gsub("d_t_fmt", "date_fmt"); } //{ print $0 }' < $i > $i.next
            mv $i.next $i
        fi
    done

and then each file was further edited manually.

4 years agobuild-many-glibcs.py: Fix “glibcs i686-gnu --strip”
Florian Weimer [Thu, 2 Jan 2020 09:18:42 +0000 (10:18 +0100)]
build-many-glibcs.py: Fix “glibcs i686-gnu --strip”

Hurd uses an empty prefix, so the linker scripts end up in /lib, the
find command picked them up, and stripping them failed because they
are not ELF files.

4 years agoLinux: Remove pread/pread64, pwrite/pwrite64 kludges from <sysdep.h>
Florian Weimer [Thu, 2 Jan 2020 09:18:37 +0000 (10:18 +0100)]
Linux: Remove pread/pread64, pwrite/pwrite64 kludges from <sysdep.h>

Since the switch away from auto-generated wrappers for these system
calls, the kludge is already included in the C source file of the
system call wrapper.

4 years agobuild-many-glibcs.py: Implement update-syscalls command
Florian Weimer [Thu, 2 Jan 2020 09:18:34 +0000 (10:18 +0100)]
build-many-glibcs.py: Implement update-syscalls command

This command uses pre-built compilers to re-install the Linux headers
from the current sources into a temporary location and runs glibc's
“make update-syscalls-lists” against that.  This updates the glibc
source tree with the current system call numbers.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agobuild-many-glibcs.py: Introduce glibc build policy classes
Florian Weimer [Thu, 2 Jan 2020 09:18:31 +0000 (10:18 +0100)]
build-many-glibcs.py: Introduce glibc build policy classes

The new classes GlibcPolicyForCompiler and GlibcPolicyForBuild allow
customization of the Glibc.build_glibc method, replacing the existing
for_compiler flag.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agobuild-many-glibcs.py: Introduce LinuxHeadersPolicyForBuild
Florian Weimer [Thu, 2 Jan 2020 09:18:26 +0000 (10:18 +0100)]
build-many-glibcs.py: Introduce LinuxHeadersPolicyForBuild

And move install_linux_headers to the top level.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoLinux: Use system call tables during build
Florian Weimer [Thu, 2 Jan 2020 09:18:22 +0000 (10:18 +0100)]
Linux: Use system call tables during build

Use <arch-syscall.h> instead of <asm/unistd.h> to obtain the system
call numbers.  A few direct includes of <asm/unistd.h> need to be
removed (if the system call numbers are already provided indirectly
by <sysdep.h>) or replaced with <sys/syscall.h>.

Current Linux headers for alpha define the required system call names,
so most of the _NR_* hacks are no longer needed.  For the 32-bit arm
architecture, eliminate the INTERNAL_SYSCALL_ARM macro, now that we
have regular system call names for cacheflush and set_tls.  There are
more such cleanup opportunities for other architectures, but these
cleanups are required to avoid macro redefinition errors during the
build.

For ia64, it is desirable to use <asm/break.h> directly to obtain
the break number for system calls (which is not a system call number
itself).  This requires replacing __BREAK_SYSCALL with
__IA64_BREAK_SYSCALL because the former is defined as an alias in
<asm/unistd.h>, but not in <asm/break.h>.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoLinux: Add tables with system call numbers
Florian Weimer [Thu, 2 Jan 2020 09:18:10 +0000 (10:18 +0100)]
Linux: Add tables with system call numbers

The new tables are currently only used for consistency checks
with the installed kernel headers and the architecture-independent
system call names table.  They are based on Linux 5.4.

The goal is to use these architecture-specific tables to ensure
that system call wrappers are available irrespective of the version
of the installed kernel headers.

The tables are formatted in the form of C header files so that they
can be used directly in an #include directive, without external
preprocessing.  (External preprocessing of a plain table file
would introduce cross-subdirectory dependency issues.)  However,
the intent is that they can still be treated as tables and can be
processed by simple tools.

The irregular system call names on 32-bit arm add a complication.
The <fixup-asm-unistd.h> header is introduced to work around that,
and the system calls are listed under regular names in the
<arch-syscall.h> file.

A make target, update-syscalls-list, is added to patch the glibc
sources with data from the current kernel headers.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
4 years agoUpdate copyright dates not handled by scripts/update-copyrights.
Joseph Myers [Wed, 1 Jan 2020 00:21:22 +0000 (00:21 +0000)]
Update copyright dates not handled by scripts/update-copyrights.

I've updated copyright dates in glibc for 2020.  This is the patch for
the changes not generated by scripts/update-copyrights and subsequent
build / regeneration of generated files.  As well as the usual annual
updates, mainly dates in --version output (minus libc.texinfo which
previously had to be handled manually but is now successfully updated
by update-copyrights), there is a fix to
sysdeps/unix/sysv/linux/powerpc/bits/termios-c_lflag.h where a typo in
the copyright notice meant it failed to be updated automatically.

Please remember to include 2020 in the dates for any new files added
in future (which means updating any existing uncommitted patches you
have that add new files to use the new copyright dates in them).

4 years agoUpdate copyright dates with scripts/update-copyrights.
Joseph Myers [Wed, 1 Jan 2020 00:14:33 +0000 (00:14 +0000)]
Update copyright dates with scripts/update-copyrights.

4 years agoalpha: Set wait4 as cancellation entrypoint
Adhemerval Zanella [Fri, 27 Dec 2019 20:21:56 +0000 (17:21 -0300)]
alpha: Set wait4 as cancellation entrypoint

Since both wait and waitpid are implemented on top of wait4.  It fixes
nptl/tst-cancel{x}{4,5,7}.

Checked on alpha-linux-gnu.

4 years agolv_LV locale: Correct the time part of d_t_fmt (bug 25324)
Rafał Lużyński [Mon, 30 Dec 2019 10:42:46 +0000 (11:42 +0100)]
lv_LV locale: Correct the time part of d_t_fmt (bug 25324)

Currently d_t_fmt formats time as "plkst. %H un %M".  A quick Google
search says that "plkst." means "o’clock" and "un" means "and".
Also this format does not display seconds.

CLDR does not mention anything like that.  We have no reason to use
anything different than "%H:%M:%S".

4 years agokm_KH locale: Use "%M" instead of "m" in d_t_fmt (bug 25323)
Rafał Lużyński [Mon, 30 Dec 2019 10:28:37 +0000 (11:28 +0100)]
km_KH locale: Use "%M" instead of "m" in d_t_fmt (bug 25323)

A quick analysis suggests that the original author meant "%M" (minutes
format specifier) instead of "m" which is just a literal "m" letter.