Commit Graph

13808 Commits

Author SHA1 Message Date
Adhemerval Zanella
643a88a9c1 nptl: Remove recvfrom from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
494c3beec9 nptl: Remove recv from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
3ddf9bc185 nptl: Remove connect from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
c59f716993 nptl: Remove accept from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:38 -03:00
Adhemerval Zanella
bdfed2e2cd nptl: Remove close from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:24 -03:00
Adhemerval Zanella
baab50cfb9 nptl: Remove read from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 08:21:29 -03:00
Adhemerval Zanella
173e0ab081 nptl: Remove write from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 08:20:43 -03:00
Raphael Moreira Zinsly
a7d88506c2 powerpc: Add optimized llogb* for POWER9
The POWER9 builtins used to improve the ilogb* functions can be
used in the llogb* functions as well.
2021-03-16 12:19:09 -03:00
Raphael Moreira Zinsly
56c81132cc powerpc: Add optimized ilogb* for POWER9
The instructions xsxexpdp and xsxexpqp introduced on POWER9 extract
the exponent from a double-precision and quad-precision floating-point
respectively, thus they can be used to improve ilogb, ilogbf and ilogbf128.
2021-03-16 12:19:09 -03:00
Florian Weimer
4b7259555c Legacy unwinder: Remove definition of _Unwind_GetCFA
It is not actually used by the legacy unwinder linked into
libc.so, and it conflicts with the unwind-link functionality
in libpthread.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-16 15:33:09 +01:00
Matheus Castanho
c82e691c56 powerpc: Update libm-test-ulps
Generated with 'make regen-ulps' on POWER8.

Tested on powerpc, powerpc64, and powerpc64le
2021-03-16 09:23:41 -03:00
Siddhesh Poyarekar
941ea10f80 Build get-cpuid-feature-leaf.c without stack-protector [BZ #27555]
__x86_get_cpuid_feature_leaf is called during early startup, before
the stack check guard is initialized and is hence not safe to build
with stack-protector.

Additionally, IFUNC resolvers for static tst-ifunc-isa tests get
called too early for stack protector to be useful, so fix them to
disable stack protector for the resolver functions.

This fixes all failures seen with --enable-stack-protector=all
configuration.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-15 20:24:45 +05:30
H.J. Lu
f53ffc9b90 x86: Handle _SC_LEVEL1_ICACHE_LINESIZE [BZ #27444]
commit 2d651eb926
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Sep 18 07:55:14 2020 -0700

    x86: Move x86 processor cache info to cpu_features

missed _SC_LEVEL1_ICACHE_LINESIZE.

1. Add level1_icache_linesize to struct cpu_features.
2. Initialize level1_icache_linesize by calling handle_intel,
handle_zhaoxin and handle_amd with _SC_LEVEL1_ICACHE_LINESIZE.
3. Return level1_icache_linesize for _SC_LEVEL1_ICACHE_LINESIZE.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-03-15 05:43:26 -07:00
Stefan Liebler
08a0ebb20e s390x: Regenerate ULPs.
Updates needed after recent commit:
db3f7bb558
"math: Remove slow paths from asin and acos [BZ #15267]"
Compre to the required ulps update for x86_64.
2021-03-12 14:31:49 +01:00
Adhemerval Zanella
7384193b71 nptl: Move fork into libc
This is part of the libpthread removal project:

   <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Checked on x86_64-linux-gnu.
2021-03-12 10:19:58 -03:00
Adhemerval Zanella
2883de0720 linux: Use __libc_single_threaded on fork
Checked on x86_64-linux-gnu.
2021-03-12 10:19:49 -03:00
Adhemerval Zanella
2b47727c68 posix: Consolidate register-atfork
Both htl and nptl uses a different data structure to implement atfork
handlers.  The nptl one was refactored by 27761a1042 to use a dynarray
which simplifies the code.

This patch moves the nptl one to be the generic implementation and
replace Hurd linked one.  Different than previous NPTL, Hurd also uses
a global lock, so performance should be similar.

Checked on x86_64-linux-gnu, i686-linux-gnu, and with a build for
i686-gnu.
2021-03-12 10:19:22 -03:00
Adhemerval Zanella
cdba937662 nptl: Move Linux pthread_kill to nptl
The nptl already expects a Linux syscall internally.  Also
__is_internal_signal is used and the DEBUGGING_P check is removed.

Checked on x86_64-linux-gnu.
2021-03-12 10:19:03 -03:00
Adhemerval Zanella
b2970919ba io: Return UNSUPPORTED if filesystem do not support 64 bit timestamps
Some Linux filesystems might not fully support 64 bit timestamps [1],
which make some Linux specific tests to fail when they check for the
functionality.

This patch adds a new libsupport function, support_path_support_time64,
that returns whether the target file supports or not 64 bit timestamps.
The support is checked by issuing a utimensat and verifying both the
last access and last modification time against a statx call.

The tests that might fail are also adjusted to check the file support
as well:

  $ dd if=/dev/zero of=loopbackfile.img bs=100M count=1
  1+0 records in
  1+0 records out
  104857600 bytes (105 MB, 100 MiB) copied, 0,0589568 s, 1,8 GB/s
  $ sudo losetup -fP loopbackfile.img
  $ mkfs.xfs loopbackfile.img
  meta-data=loopbackfile.img       isize=512    agcount=4, agsize=6400 blks
           =                       sectsz=512   attr=2, projid32bit=1
           =                       crc=1        finobt=1, sparse=1, rmapbt=0
           =                       reflink=1
  data     =                       bsize=4096   blocks=25600, imaxpct=25
           =                       sunit=0      swidth=0 blks
  naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
  log      =internal log           bsize=4096   blocks=1368, version=2
           =                       sectsz=512   sunit=0 blks, lazy-count=1
  realtime =none                   extsz=4096   blocks=0, rtextents=0
  $ mkdir loopfs
  $ sudo mount -o loop /dev/loop0 loopfs/
  $ sudo chown -R azanella:azanella loopfs
  $ TMPDIR=loopfs/ ./testrun.sh misc/tst-utimes
  error: ../sysdeps/unix/sysv/linux/tst-utimes.c:55: File loopfs//utimesfECsK1 does not support 64-bit timestamps

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1795576
2021-03-12 10:17:31 -03:00
Wilco Dijkstra
92cfc9ad82 math: Remove mpa files (part 2) [BZ #15267]
Previous commit was missing deleted files in sysdeps/ieee754/dbl-64.

Finally remove all mpa related files, headers, declarations, probes, unused
tables and update makefiles.

Reviewed-By: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2021-03-11 15:45:19 +00:00
Wilco Dijkstra
47ad14d789 math: Remove mpa files [BZ #15267]
Finally remove all mpa related files, headers, declarations, probes, unused
tables and update makefiles.

Reviewed-By: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2021-03-11 14:26:36 +00:00
Wilco Dijkstra
4e1a870b9a math: Remove slow paths from atan2 [BZ #15267]
Remove slow paths from atan2. Add ULP annotations.

Reviewed-By: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2021-03-11 14:26:36 +00:00
Wilco Dijkstra
e898cd1593 math: Remove slow paths from atan [BZ #15267]
Remove slow paths from atan. Add ULP annotations.

Reviewed-By: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2021-03-11 14:26:36 +00:00
Wilco Dijkstra
476d692e8a math: Remove slow paths in tan [BZ #15267]
Remove slow paths in tan. Add ULP annotations. Merge 'number' into 'mynumber'.
Remove unused entries from tan constants.

Reviewed-By: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2021-03-11 14:26:36 +00:00
Wilco Dijkstra
db3f7bb558 math: Remove slow paths from asin and acos [BZ #15267]
This patch series removes all remaining slow paths and related code.
First asin/acos, tan, atan, atan2 implementations are updated, and the final
patch removes the unused mpa files, headers and probes. Passes buildmanyglibc.

Remove slow paths from asin/acos. Add ULP annotations based on previous slow
path checks (which are approximate). Update AArch64 and x86_64 libm-test-ulps.

Reviewed-By: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2021-03-11 14:26:36 +00:00
Adhemerval Zanella
94caafa040 io: Return EBAFD for negative file descriptor on fstat (BZ #27559)
Now that fstat is implemented on top fstatat we need to handle negative
inputs.  The implementation now rejects AT_FDCWD, which would otherwise
be accepted by the kernel.

Checked on x86_64-linux-gnu and on i686-linux-gnu.
2021-03-11 10:51:55 -03:00
Joseph Myers
d891f55562 Update kernel version to 5.11 in tst-mman-consts.py.
This patch updates the kernel version in the test tst-mman-consts.py
to 5.11.  (There are no new MAP_* constants covered by this test in
5.11 that need any other header changes.)

Tested with build-many-glibcs.py.
2021-03-10 14:26:57 +00:00
Florian Weimer
a6917c82b3 Linux: misc/tst-ofdlocks-compat can be a regular test
Now that compat_symbol_reference works in non-internal tests.
Also do not build and run the test at all on architectures which
do not have the pre-2.28 symbol version of fcntl.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-09 21:07:24 +01:00
Florian Weimer
15e50e6c96 Linux: dirent/tst-readdir64-compat can be a regular test
compat_symbol_reference works in non-internal tests now.  Also
avoid building the test for unsupported configurations at all.
I verified by building with build-many-glibcs.py that GLIBC_2.1.3
works as the predecessor of GLIBC_2.2.  (Symbol versions in
the early days are complex.)

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-09 21:07:24 +01:00
DJ Delorie
9b456c5da9 nss: fix nss_database_lookup2's alternate handling [BZ #27416]
__nss_database_lookup2's extra arguments were left unused in the
nsswitch reloading patch set; this broke compat (default config
ignored) and shadow files (secondary name ignored) which relies on
these fallbacks.

This patch adds in the previous behavior by correcting the
initialization of the database list to reflect the fallbacks.  This
means that the nss_database_lookup2 interface no longer needs to be
passed the fallback info, so API and callers were adjusted.

Since all callers needed to be edited anyway, the calls were changed
from __nss_database_lookup2 to the faster __nss_database_get.  This
was an intended optimization which was deferred during the initial
lookup changes to avoid touching so many files.

The test case verifies that compat targets work (passwd) and that the
default configuration works (group).  Tested on x86-64.
2021-03-09 14:34:50 -05:00
Lukasz Majewski
6b6a151c77 tst: Add test for ntp_adjtime
This test is a wrapper on tst-clock_adjtime test.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-08 22:41:41 +01:00
Lukasz Majewski
39f39cade3 tst: Add test for adjtimex
This test is a wrapper on tst-clock_adjtime test.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-08 22:41:41 +01:00
Lukasz Majewski
4de01867dc tst: Modify tst-clock_adjtime to allow reuse of its code
The tst-clock_adjtime can be adjusted to be reused for also testing
adjtimex.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-08 22:41:41 +01:00
Lukasz Majewski
b4effffde8 tst: Add test for clock_adjtime
This code privides test to check if time on target machine is properly
adjusted.
The time is altered only when cross-test-ssh.sh is executed with
--allow-time-setting flag.
As the delta added to CLOCK_REALTIME is only 1 sec the original time is
not restored and further tests are executed with this bias.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-08 22:41:41 +01:00
John David Anglin
60167dc24b Update hppa libm-test-ulps 2021-03-07 17:23:34 +00:00
H.J. Lu
339bf918ea x86: Set minimum x86-64 level marker [BZ #27318]
Since the full ISA set used in an ELF binary is unknown to compiler,
an x86-64 ISA level marker indicates the minimum, not maximum, ISA set
required to run such an ELF binary.  We never guarantee a library with
an x86-64 ISA level v3 marker doesn't contain other ISAs beyond x86-64
ISA level v3, like AVX VNNI.  We check the x86-64 ISA level marker for
the minimum ISA set.  Since -march=sandybridge enables only some ISAs
in x86-64 ISA level v3, we should set the needed ISA marker to v2.
Otherwise, libc is compiled with -march=sandybridge will fail to run on
Sandy Bridge:

$ ./elf/ld.so ./libc.so
./libc.so: (p) CPU ISA level is lower than required: needed: 7; got: 3

Set the minimum, instead of maximum, x86-64 ISA level marker should have
no impact on the glibc-hwcaps directory assignment logic in ldconfig nor
ld.so.
2021-03-06 07:49:30 -08:00
Adhemerval Zanella
4b9bedbc90 linux: Fix __thrd_sleep64 hidden definition
The symbol is exported by libc.
2021-03-05 08:35:50 -03:00
Adhemerval Zanella
6990a72679 Update arm libm-test-ulps 2021-03-05 08:35:24 -03:00
Adhemerval Zanella
1a1c854338 Update sparc libm-test-ulps 2021-03-05 08:34:40 -03:00
Jakub Jelinek
f0419e6a10 [PATCH] pthread_once hangs when init routine throws an exception [BZ #18435]
This is another attempt at making pthread_once handle throwing exceptions
from the init routine callback.  As the new testcases show, just switching
to the cleanup attribute based cleanup does fix the tst-once5 test, but
breaks the new tst-oncey3 test.  That is because when throwing exceptions,
only the unwind info registered cleanups (i.e. C++ destructors or cleanup
attribute), when cancelling threads and there has been unwind info from the
cancellation point up to whatever needs cleanup both unwind info registered
cleanups and THREAD_SETMEM (self, cleanup, ...) registered cleanups are
invoked, but once we hit some frame with no unwind info, only the
THREAD_SETMEM (self, cleanup, ...) registered cleanups are invoked.
So, to stay fully backwards compatible (allow init routines without
unwind info which encounter cancellation points) and handle exception throwing
we actually need to register the pthread_once cleanups in both unwind info
and in the THREAD_SETMEM (self, cleanup, ...) way.
If an exception is thrown, only the former will happen and we in that case
need to also unregister the THREAD_SETMEM (self, cleanup, ...) registered
handler, because otherwise after catching the exception the user code could
call deeper into the stack some cancellation point, get cancelled and then
a stale cleanup handler would clobber stack and probably crash.
If a thread calling init routine is cancelled and unwind info ends before
the pthread_once frame, it will be cleaned up through self->cleanup as
before.  And if unwind info is present, unwind_stop first calls the
self->cleanup registered handler for the frame, then it will call the
unwind info registered handler but that will already see __do_it == 0
and do nothing.
2021-03-04 15:15:33 +01:00
Florian Weimer
82215c1e25 powerpc: Regenerate ulps
This time on a POWER8 machine.
2021-03-03 18:39:17 +01:00
Arjun Shankar
86b9d5a475 s390x: Regenerate ulps
For new test cases in commit 5a051454a9.
2021-03-03 12:44:21 +01:00
Lukasz Majewski
dd1776e327 tst: Fix tst-timerfd test
There were following problems discovered for tst-timerfd test:

1. Do not set the struct itimerspec's it_interval tv_sec to 2 seconds.
After this change the timerfd will trigger only once (the it_value is
only set in this case).

2. The 'val1' variable (including the call to timerfd_gettime) is not
needed anymore, as it is just enough to read the struct itimerspec
after sleep. As a consequence the 'val2' has been renamed to 'val'.

3. After calling timerfd_gettime, the value of struct itimerspec time,
when timer is running, is the remaining time. In the case of this test
it would be less than 1 second.
As a result the TEST_COMPARE macro logic had to be adjusted.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-02 16:55:05 +01:00
Florian Weimer
f01a61e138 i386: Regenerate ulps 2021-03-02 15:41:29 +01:00
Florian Weimer
01a5746b6c x86: Add CPU-specific diagnostics to ld.so --list-diagnostics 2021-03-02 15:01:10 +01:00
Florian Weimer
e4933c8a92 x86: Automate generation of PREFERRED_FEATURE_INDEX_1 bitfield
Use a .def file to define the bitfield layout, so that it is possible
to iterate over field members using the preprocessor.
2021-03-02 15:01:06 +01:00
Florian Weimer
851f32cf7b ld.so: Implement the --list-diagnostics option 2021-03-02 14:39:24 +01:00
Matheus Castanho
40d055a2dd powerpc: Update libm-test-ulps
Generated with 'make regen-ulps'

Tested on powerpc, powerpc64, and powerpc64le
2021-03-02 10:08:07 -03:00
Lukasz Majewski
9871ae0ab4 tst: Add test for utimes
This patch provides test for utimes. It uses wrapper to read
access and modification times to compare them with ones written by
utimes.

Moreover, access and modification times beyond the Y2038 threshold
date (i.e. 32 bit time_t overflow) are also checked.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-02 13:31:13 +01:00
Lukasz Majewski
dec445d40d tst: Add test for utime
This patch provides test for utime. It uses wrapper to read access
and modification times to compare them with ones written by utime.

Moreover, access and modification times beyond the Y2038 threshold
date (i.e. 32 bit time_t overflow) are also checked.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-02 13:31:13 +01:00