Commit Graph

36942 Commits

Author SHA1 Message Date
Lukasz Majewski
bff3019afc tst: Provide test for select
This change adds new test to assess select()'s timeout related
functionality (the rdfs set provides valid fd - stderr - but during
normal program operation there is no data to be read, so one just
waits for timeout).

To be more specific - two use cases are checked:
- if select() times out immediately when passed struct timeval has
  zero values of tv_usec and tv_sec.
- if select() times out after timeout specified in passed argument

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-23 12:23:33 +01:00
Lukasz Majewski
d816bb448b tst: Add test for ntp_gettimex
This test is a wrapper on tst-ntp_gettime test.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-23 12:23:33 +01:00
Lukasz Majewski
c0c926d00d tst: Add test for ntp_gettime
This code provides test to check if time on target machine is properly
read via ntp_gettime syscall.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-23 12:23:33 +01:00
Lukasz Majewski
3989bcb5e3 fix: Always export ntp_gettimex function
After this patch applied the ntp_gettimex function is always declared
in the sys/timex.h header. Currently it is not when __REDIRECT_NTH is
defined (i.e. in ARM 32 bit port).
2021-03-23 12:23:03 +01:00
H.J. Lu
3e2f285c5f nptl: Remove MULTI_PAGE_ALIASING [BZ #23554]
MULTI_PAGE_ALIASING was introduced to mitigate an aliasing issue on
Pentium 4.  It is no longer needed for processors after Pentium 4.
2021-03-19 15:04:17 -07:00
H.J. Lu
9cbe4ed14e elf: Add EM_INTELGT for Intel Graphics Technology
Add EM_INTELGT (205) for Intel Graphics Technology which has been added
to gABI:

https://groups.google.com/g/generic-abi/c/ofBevXA48dM
2021-03-19 11:09:18 -07:00
Adhemerval Zanella
48593b505b support: Use syscall function instead of INLINE_SYSCALL_CALL
It fixes the build on ARM in thumb mode that requires an out of the
line helper (__libc_do_syscall) to issue the syscall.
2021-03-18 17:52:09 -03:00
Adhemerval Zanella
a894053318 signal: Add __libc_sigaction
The generic implementation basically handle the system agnostic logic
(filtering out the invalid signals) while the __libc_sigaction is
the function with implements the system and architecture bits.

Checked on x86_64-linux-gnu and i686-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
d5ddd583da nptl: Move system to libc
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
9cf242997d nptl: Move fcntl 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
729cb5a2a7 nptl: Remove sendmsg 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
0cf67de816 nptl: Remove recvmsg 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
2d6f4ebd65 nptl: Remove sigwait 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
1e157b9cb4 nptl: Remove tcdrain 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
c29386fd50 nptl: Remove pause 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
0c9d4925fe nptl: Remove msync 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
fc495dc4e9 nptl: Remove fsync 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
6f2e00cac5 nptl: Remove sendto 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
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
6cf1911122 benchtests: Add ilogb* tests
Add a benchtest to ilogb, ilogbf and ilogbf128 based on the logb* benchtests.
2021-03-16 12:19:09 -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
3977477d48 glibcymbols.read_abilist: Add check for duplicate symbols
This detects some bogus abilist files.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-16 15:57:16 +01:00
Florian Weimer
b9e2903712 scripts/glibcsymbols.py: Extract from scripts/move-symbol-to-libc.py
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-16 15:57:04 +01: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
Siddhesh Poyarekar
e958490f8c support: Pass environ to child process
Pass environ to posix_spawn so that the child process can inherit
environment of the test.
2021-03-16 19:06:36 +05:30
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
8b8f13b60d Build libc-start with stack protector for SHARED
This does not change the emitted code since __libc_start_main does not
return, but is important for formal flags compliance.

This also cleans up the cosmetic inconsistency in the stack protector
flags in csu, especially the incorrect value of STACK_PROTECTOR_LEVEL.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-15 20:25:00 +05:30
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
David Hughes
03f42a56eb Add inhibit_stack_protector to ifuncmain9 [BZ #25680]
Enabling --enable-stack-protector=all causes the following tests to fail:

    FAIL: elf/ifuncmain9picstatic
    FAIL: elf/ifuncmain9static

Nick Alcock (who committed the stack protector code) marked the IFUNC
resolvers with inhibit_stack_protector when he done the original work and
suggested doing so again @ BZ #25680. This patch adds
inhibit_stack_protector to ifuncmain9.

After patch is applied, --enable-stack-protector=all does not fail the
above tests.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-15 20:23:39 +05:30
Siddhesh Poyarekar
95c68080a3 support: Typo and formatting fixes
- Add a newline to the end of error messages in transfer().
- Fixed the name of support_subprocess_init().
2021-03-15 20:16:27 +05:30
Florian Weimer
4e6db99c66 elf: ld.so --help calls _dl_init_paths without a main map [BZ #27577]
In this case, use the link map of the dynamic loader itself as
a replacement.  This is more than just a hack: if we ever support
DT_RUNPATH/DT_RPATH for the dynamic loader, reporting it for
ld.so --help (without further command line arguments) would be the
right thing to do.

Fixes commit 3324213125 ("elf: Always
set l in _dl_init_paths (bug 23462)").
2021-03-15 14:43:13 +01:00
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
Carlos O'Donell
3324213125 elf: Always set l in _dl_init_paths (bug 23462)
After d1d5471579 ("Remove dead
DL_DST_REQ_STATIC code.") we always setup the link map l to make the
static and shared cases the same.  The bug is that in elf/dl-load.c
(_dl_init_paths) we conditionally set l only in the #ifdef SHARED
case, but unconditionally use it later.  The simple solution is to
remove the #ifdef SHARED conditional, because it's no longer needed,
and unconditionally setup l for both the static and shared cases. A
regression test is added to run a static binary with
LD_LIBRARY_PATH='$ORIGIN' which crashes before the fix and runs after
the fix.

Co-Authored-By: Florian Weimer <fweimer@redhat.com>
2021-03-12 16:44:47 +01: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
0280b390fb support: Add xpthread_kill
Checked on x86_64-linux-gnu.
2021-03-12 10:20:18 -03: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
DJ Delorie
20bee71348 test-container: Always copy test-specific support files [BZ #27537]
There's a small chance that a fresh checkout will result in some of
the test-specific container files will have the same timestamp and
size, which breaks the rsync logic in test-container, resulting in
tests running with the wrong support files.

This patch changes the rsync logic to always copy the test-specific
files, which normally would always be copied anyway.  The rsync logic
for the testroot itself is unchanged.
2021-03-11 17:04:12 -05: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