]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
7 months agoCheck if TEST_CC supports -Wno-restrict before using it
Adhemerval Zanella [Thu, 27 Jul 2023 18:49:52 +0000 (15:49 -0300)] 
Check if TEST_CC supports -Wno-restrict before using it

Check if TEST_CC supports -Wno-restrict before using it to avoid Clang
error:

error: unknown warning option '-Wno-restrict' [-Werror,-Wunknown-warning-option]

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agohppa: Simplify handling of sanity check errors in clone.S.
John David Anglin [Sun, 22 Dec 2024 14:58:02 +0000 (09:58 -0500)] 
hppa: Simplify handling of sanity check errors in clone.S.

This simplifies the handling of sanity check errors in clone.S.
Adjusted a couple of comments to reflect current code.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
7 months agohppa: add cacheflush() syscall wrapper
John David Anglin [Sun, 22 Dec 2024 14:51:54 +0000 (09:51 -0500)] 
hppa: add cacheflush() syscall wrapper

The hppa Linux kernel supports the cacheflush() syscall
since version 6.5. This adds the glibc syscall wrapper.

Signed-off-by: Helge Deller <deller@gmx.de>
---
v2: This patch was too late in release cycle for GLIBC_2.40,
    so update now to GLIBC_2.41 instead.

7 months agohppa: Update libm-test-ulps
John David Anglin [Sun, 22 Dec 2024 14:45:34 +0000 (09:45 -0500)] 
hppa: Update libm-test-ulps

Signed-off-by: John David Anglin <dave.anglin@bell.net>
7 months agohurd: make mprotect translate KERN_PROTECTION_FAILURE to EACCESS
Samuel Thibault [Sun, 22 Dec 2024 10:40:18 +0000 (11:40 +0100)] 
hurd: make mprotect translate KERN_PROTECTION_FAILURE to EACCESS

Suggested-by: Sergey Bugaev <bugaevc@gmail.com>
7 months agoCompile tst-deadline.c with -Wno-ignored-attributes for Clang
H.J. Lu [Thu, 19 Dec 2024 21:52:56 +0000 (05:52 +0800)] 
Compile tst-deadline.c with -Wno-ignored-attributes for Clang

Since tst-deadline.c is an internal test, compile tst-deadline.c with
-Wno-ignored-attributes for Clang to silence -Werror,-Wunknown-attributes
errors.  Also suppress -Wmaybe-uninitialized only for GCC in net-internal.h.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agomalloc: Only enable -Waggressive-loop-optimizations suppression for gcc
Adhemerval Zanella [Fri, 25 Mar 2022 12:00:12 +0000 (09:00 -0300)] 
malloc: Only enable -Waggressive-loop-optimizations suppression for gcc

Reviewed-by: Sam James <sam@gentoo.org>
7 months agoSuppress -Wmaybe-uninitialized only for GCC
H.J. Lu [Thu, 19 Dec 2024 21:02:14 +0000 (05:02 +0800)] 
Suppress -Wmaybe-uninitialized only for GCC

Clang doesn't support -Wmaybe-uninitialized.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoSuppress Clang -Wgnu-folding-constant warnings
H.J. Lu [Thu, 19 Dec 2024 20:51:03 +0000 (04:51 +0800)] 
Suppress Clang -Wgnu-folding-constant warnings

Suppress Clang -Wgnu-folding-constant warnings, like

tst-freopen.c:44:13: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
   44 |   char temp[strlen (test) + 1];
      |             ^~~~~~~~~~~~~~~~~

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agostdio: Suppress clang warnings for tst-vprintf-width-i18n.c
Adhemerval Zanella [Fri, 3 Jun 2022 13:43:42 +0000 (10:43 -0300)] 
stdio: Suppress clang warnings for tst-vprintf-width-i18n.c

Clang issues the following warning:

  tst-vfprintf-width-i18n.c:51:34: error: invalid conversion specifier '1'
  [-Werror,-Wformat-invalid-specifier]
    TEST_COMPARE (sprintf (buf, "%I16d", 12345), 16);
                                 ~~^

since it does not how to handle %I.
Reviewed-by: Sam James <sam@gentoo.org>
7 months agostdio: Fix clang warnings on tests
Adhemerval Zanella [Thu, 27 Jul 2023 18:27:08 +0000 (15:27 -0300)] 
stdio: Fix clang warnings on tests

clang does not support 'I' specifier and handles it as a 'length
modifier'.
Reviewed-by: Sam James <sam@gentoo.org>
7 months agomath: Fix clang warnings for math/test-tgmath-ret.c
Adhemerval Zanella [Tue, 15 Mar 2022 18:33:02 +0000 (15:33 -0300)] 
math: Fix clang warnings for math/test-tgmath-ret.c

clang warns that since the global variables are only used to function
calls (without being actually used), they are not needed and will
not be emitted.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoSuppress Clang warning on adding an integer to a string
Adhemerval Zanella [Fri, 25 Mar 2022 14:23:35 +0000 (11:23 -0300)] 
Suppress Clang warning on adding an integer to a string

Suppress Clang warning on adding an integer to a string, like:

tst-iconv-sticky-input-error.c:125:42: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
  125 |                 expected_output = "ABXY" + skip;
      |                                   ~~~~~~~^~~~~~
tst-iconv-sticky-input-error.c:125:42: note: use array indexing to silence this warning
  125 |                 expected_output = "ABXY" + skip;
      |                                          ^
      |                                   &      [     ]

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agostdio: Suppress %Z format for clang
Adhemerval Zanella [Thu, 1 Sep 2022 12:29:23 +0000 (09:29 -0300)] 
stdio: Suppress %Z format for clang

clang does not handle %Z on print, and just suppressing
-Wformat-invalid-specifier might trigger another warning for extra
arguments (since %Z is ignored).  So suppress -Wformat-extra-args
as well.

For tst-fphex.c a heavy hammer is used since the printf is more
complex and clang throws a more generic warning.
Reviewed-by: Sam James <sam@gentoo.org>
7 months agostdio: Suppress clang warnings for tst-unlockedio.c
Adhemerval Zanella [Thu, 24 Mar 2022 19:03:16 +0000 (16:03 -0300)] 
stdio: Suppress clang warnings for tst-unlockedio.c

Suppress the following -Wgnu-folding-constant and -Wliteral-conversion
warnings from Clang:

  tst-unlockedio.c:35:12: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
   35 |   char buf[strlen (blah) + 1];
      |            ^~~~~~~~~~~~~~~~~

  tst-unlockedio.c:63:36: error: implicit conversion from 'double' to
  'size_t' (aka 'unsigned long') changes value from -0 to 0
  [-Werror,-Wliteral-conversion]
        || fwrite_unlocked (blah, 0, -0.0, fp) != 0
           ~~~~~~~~~~~~~~~           ^~~~
  tst-unlockedio.c:61:33: error: implicit conversion from 'double' to
  'size_t' (aka 'unsigned long') changes value from 0.25 to 0
  [-Werror,-Wliteral-conversion]
        || fwrite_unlocked (--cp, 0.25, 16, fp) != 0
           ~~~~~~~~~~~~~~~        ^~~~
  tst-unlockedio.c:59:37: error: implicit conversion from 'double' to
  'size_t' (aka 'unsigned long') changes value from 0.25 to 0
  [-Werror,-Wliteral-conversion]
        || fwrite_unlocked (cp++, 16, 0.25, fp) != 0
           ~~~~~~~~~~~~~~~            ^~~~
  tst-unlockedio.c:116:34: error: implicit conversion from 'double' to
  'size_t' (aka 'unsigned long') changes value from -0 to 0
  [-Werror,-Wliteral-conversion]
        || fread_unlocked (buf, 0, -0.0, fp) != 0
           ~~~~~~~~~~~~~~          ^~~~
  tst-unlockedio.c:114:32: error: implicit conversion from 'double' to
  'size_t' (aka 'unsigned long') changes value from 0.25 to 0
  [-Werror,-Wliteral-conversion]
        || fread_unlocked (--wp, 0.25, 16, fp) != 0
           ~~~~~~~~~~~~~~        ^~~~
  tst-unlockedio.c:112:36: error: implicit conversion from 'double' to
  'size_t' (aka 'unsigned long') changes value from 0.25 to 0
  [-Werror,-Wliteral-conversion]
        || fread_unlocked (wp++, 16, 0.25, fp) != 0
           ~~~~~~~~~~~~~~            ^~~~

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agolocaledata: Fix clang warnings on tests
Adhemerval Zanella [Tue, 15 Mar 2022 18:29:47 +0000 (15:29 -0300)] 
localedata: Fix clang warnings on tests

clang does not support 'I' specifier and handles it as a 'length
modifier'.
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoelf: Suppress clang warning on tst-unique4
Adhemerval Zanella [Fri, 25 Mar 2022 14:21:33 +0000 (11:21 -0300)] 
elf: Suppress clang warning on tst-unique4

clang warns that the instantiation of the variable is required,
but no definition is available.  They are implemented on
tst-unique4lib.so.

Checked on x86_64-linux-gnu.
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoelf: Enable tst-dlopen-nodelete-reloc if TEST_CXX supports STB_GNU_UNIQUE
H.J. Lu [Thu, 19 Dec 2024 20:32:49 +0000 (04:32 +0800)] 
elf: Enable tst-dlopen-nodelete-reloc if TEST_CXX supports STB_GNU_UNIQUE

tst-dlopen-nodelete-reloc requires STB_GNU_UNIQUE support so that NODELETE
is propagated by do_lookup_unique.  Enable it only if TEST_CXX supports
STB_GNU_UNIQUE,

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoelf: Check PDE load address with non-empty text section
H.J. Lu [Sun, 22 Dec 2024 00:31:25 +0000 (08:31 +0800)] 
elf: Check PDE load address with non-empty text section

Check PDE load address with non-empty text section:

.globl _start
_start:
.globl __start
.byte 0

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agox86: Define __HAVE_FLOAT128 for Clang and use __builtin_*f128 code path
Fangrui Song [Sun, 10 Oct 2021 21:38:00 +0000 (14:38 -0700)] 
x86: Define __HAVE_FLOAT128 for Clang and use __builtin_*f128 code path

Clang supports __builtin_fabsf128 (despite not supporting _Float128) but
it does not support __builtin_fabsq.  Fallback to back to
`typedef __float128 _Float128;` it clang is used.

Originally developed by Fangrui Song <maskray@google.com>.
Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoAdd clang specific warning suppression macros
Adhemerval Zanella [Tue, 12 Sep 2023 18:45:24 +0000 (15:45 -0300)] 
Add clang specific warning suppression macros

Four new macros are added:

  * DIAG_{PUSH,POP}_NEEDS_COMMENT_CLANG are similar to
    DIAG_{PUSH,POP}_NEEDS_COMMENT, but enable clang specific pragmas to
    handle warnings for options only supported by clang.

  * DIAG_IGNORE_NEEDS_COMMENT_{CLANG,GCC} are similar to
    DIAG_IGNORE_NEEDS_COMMENT, but enable the warning suppression only
    for the referenced compiler.

Reviewed-by: Sam James <sam@gentoo.org>
7 months agox86: Use inhibit_stack_protector on tst-ifunc-isa.h
Adhemerval Zanella [Thu, 25 Aug 2022 12:48:57 +0000 (09:48 -0300)] 
x86: Use inhibit_stack_protector on tst-ifunc-isa.h

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoelf: Compile test modules with -fsemantic-interposition
H.J. Lu [Tue, 17 Dec 2024 23:24:38 +0000 (07:24 +0800)] 
elf: Compile test modules with -fsemantic-interposition

Compiler may default to -fno-semantic-interposition. But some elf test
modules must be compiled with -fsemantic-interposition to function properly.
Add a TEST_CC check for -fsemantic-interposition and use it on elf test
modules.  This fixed

FAIL: elf/tst-dlclose-lazy
FAIL: elf/tst-pie1
FAIL: elf/tst-plt-rewrite1
FAIL: elf/unload4

when Clang 19 is used to test glibc.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agotst-printf-bz18872.sh: stdio: Use __attribute__ ((optnone)) for Clang
Adhemerval Zanella [Thu, 24 Mar 2022 18:54:10 +0000 (15:54 -0300)] 
tst-printf-bz18872.sh: stdio: Use __attribute__ ((optnone)) for Clang

Use

__attribute__ ((optnone))

instead of

__attribute__ ((optimize ("-O0")))

to disable optimization for Clang.

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoHandle pragma GCC optimize for clang
Adhemerval Zanella [Thu, 24 Mar 2022 19:17:59 +0000 (16:17 -0300)] 
Handle pragma GCC optimize for clang

Reviewed-by: Sam James <sam@gentoo.org>
7 months agodirent: Remove variable length array structure for tst-getdents64.c
Adhemerval Zanella [Fri, 25 Mar 2022 12:03:03 +0000 (09:03 -0300)] 
dirent: Remove variable length array structure for tst-getdents64.c

Clang emits the following warnings:

  ../sysdeps/unix/sysv/linux/tst-getdents64.c:111:18: error: fields must
  have a constant size: 'variable length array in structure' extension
  will never be supported
              char buffer[buffer_size];
                   ^

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoAdd include/libc-misc.h
H.J. Lu [Thu, 19 Dec 2024 21:31:05 +0000 (05:31 +0800)] 
Add include/libc-misc.h

Add include/libc-misc.h to provide miscellaneous definitions for both
glibc build and test:

1. Move inhibit_stack_protector to libc-misc.h and add Clang support.
2. Add test_inhibit_stack_protector for glibc testing.
3. Move inhibit_loop_to_libcall to libc-misc.h.
4. Add test_cc_inhibit_loop_to_libcall to handle TEST_CC != CC and
replace inhibit_loop_to_libcall with test_cc_inhibit_loop_to_libcall
in glibc tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Co-Authored-By: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoAdd test-config-cflags-float-store for -ffloat-store
H.J. Lu [Sun, 15 Dec 2024 13:24:14 +0000 (21:24 +0800)] 
Add test-config-cflags-float-store for -ffloat-store

Clang doesn't support -ffloat-store:

clang: error: optimization flag '-ffloat-store' is not supported [-Werror,-Wignored-optimization-argument]

Define test-config-cflags-float-store for -ffloat-store and use it in
math/Makefile for testing.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agolocaledata: Use hexadecimal character escape on tests
Adhemerval Zanella [Mon, 28 Mar 2022 18:50:07 +0000 (15:50 -0300)] 
localedata: Use hexadecimal character escape on tests

Instead of latin1 ones.

Reviewed-by: Sam James <sam@gentoo.org>
7 months agotst-atomic.c: Mark as UNSUPPORTED when compiled with Clang
H.J. Lu [Mon, 16 Dec 2024 10:56:55 +0000 (18:56 +0800)] 
tst-atomic.c: Mark as UNSUPPORTED when compiled with Clang

Since Clang can't remove the dead statement and issues an error:

tst-atomic.c:463:7: error: unsupported inline asm: input with type 'int64_t' (aka 'long') matching output with type 'typeof (*&mem)' (aka 'int')
  463 |   if (catomic_exchange_and_add (&mem, 11) != 2
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sysdeps/x86/atomic-machine.h:213:3: note: expanded from macro 'catomic_exchange_and_add'
  213 |   __arch_exchange_and_add_body (__arch_exchange_and_add_cprefix, __arch_c,    \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  214 |                                 mem, value)
      |                                 ~~~~~~~~~~~
../sysdeps/x86/atomic-machine.h:199:12: note: expanded from macro '__arch_exchange_and_add_body'
  198 |                          : "=r" (__result), "=m" (*mem)                       \
      |                                  ~~~~~~~~
  199 |                          : "0" ((int64_t) cast_to_integer (__addval)),     \
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tst-atomic.c:487:7: error: unsupported inline asm: input with type 'int64_t' (aka 'long') matching output with type 'typeof (*(&mem))' (aka 'int')
  487 |   if (catomic_increment_val (&mem) != 3)
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/atomic.h:313:38: note: expanded from macro 'catomic_increment_val'
  313 | # define catomic_increment_val(mem) (catomic_exchange_and_add ((mem), 1) + 1)
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sysdeps/x86/atomic-machine.h:213:3: note: expanded from macro 'catomic_exchange_and_add'
  213 |   __arch_exchange_and_add_body (__arch_exchange_and_add_cprefix, __arch_c,    \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  214 |                                 mem, value)
      |                                 ~~~~~~~~~~~
../sysdeps/x86/atomic-machine.h:199:12: note: expanded from macro '__arch_exchange_and_add_body'
  198 |                          : "=r" (__result), "=m" (*mem)                       \
      |                                  ~~~~~~~~
  199 |                          : "0" ((int64_t) cast_to_integer (__addval)),     \
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tst-atomic.c:501:7: error: unsupported inline asm: input with type 'int64_t' (aka 'long') matching output with type 'typeof (*(&mem))' (aka 'int')
  501 |   if (catomic_decrement_val (&mem) != 15)
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/atomic.h:340:38: note: expanded from macro 'catomic_decrement_val'
  340 | # define catomic_decrement_val(mem) (catomic_exchange_and_add ((mem), -1) - 1)
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sysdeps/x86/atomic-machine.h:213:3: note: expanded from macro 'catomic_exchange_and_add'
  213 |   __arch_exchange_and_add_body (__arch_exchange_and_add_cprefix, __arch_c,    \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  214 |                                 mem, value)
      |                                 ~~~~~~~~~~~
../sysdeps/x86/atomic-machine.h:199:12: note: expanded from macro '__arch_exchange_and_add_body'
  198 |                          : "=r" (__result), "=m" (*mem)                       \
      |                                  ~~~~~~~~
  199 |                          : "0" ((int64_t) cast_to_integer (__addval)),     \
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

mark tst-atomic.c as UNSUPPORTED when compiled with Clang.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoEnable execstack tests only if compiler supports trampoline
H.J. Lu [Mon, 16 Dec 2024 11:20:54 +0000 (19:20 +0800)] 
Enable execstack tests only if compiler supports trampoline

Since trampoline is required to test execstack, enable execstack tests
only if compiler supports trampoline.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agox86: Include test-flt-eval-method-387 if -mfpmath=387 works
H.J. Lu [Thu, 19 Dec 2024 04:08:00 +0000 (12:08 +0800)] 
x86: Include test-flt-eval-method-387 if -mfpmath=387 works

Since Clang doesn't support -mfpmath=387 on x86-64, on x86, include
test-flt-eval-method-387 only if -mfpmath=387 works.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agox86-64: Disable libmvec ABI test for Clang
H.J. Lu [Sun, 15 Dec 2024 21:11:26 +0000 (05:11 +0800)] 
x86-64: Disable libmvec ABI test for Clang

Unlike GCC, libmvec support in Clang is hard-coded.  Clang doesn't use
macros defined in <bits/libm-simd-decl-stubs.h> to support new libmvec
functions added to glibc and can't vectorize all test loops to test
libmvec ABI:

https://github.com/llvm/llvm-project/issues/120868

disable libmvec ABI test for Clang.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoRemove Clang /usr/include/tgmath.h dependency
H.J. Lu [Sun, 15 Dec 2024 23:30:44 +0000 (07:30 +0800)] 
Remove Clang /usr/include/tgmath.h dependency

Remove the /usr/include/tgmath.h dependency generated by Clang even though
Clang never reads /usr/include/tgmath.h.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoDon't redefine INFINITY nor NAN
H.J. Lu [Sun, 15 Dec 2024 01:56:34 +0000 (09:56 +0800)] 
Don't redefine INFINITY nor NAN

Since math/math.h isn't a system header, clang issues errors:

In file included from test-flt-eval-method.c:20:
In file included from ../include/math.h:7:
../math/math.h:91:11: error: 'INFINITY' macro redefined [-Werror,-Wmacro-redefined]
   91 | #  define INFINITY (__builtin_inff ())
      |           ^
/usr/bin/../lib/clang/19/include/float.h:173:11: note: previous definition is here
  173 | #  define INFINITY (__builtin_inff())
      |           ^
In file included from test-flt-eval-method.c:20:
In file included from ../include/math.h:7:
../math/math.h:98:11: error: 'NAN' macro redefined [-Werror,-Wmacro-redefined]
   98 | #  define NAN (__builtin_nanf (""))
      |           ^
/usr/bin/../lib/clang/19/include/float.h:174:11: note: previous definition is here
  174 | #  define NAN (__builtin_nanf(""))

Don't define INFINITY nor NAN if they are defined.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoCheck Clang 12 for __builtin_complex
H.J. Lu [Sun, 22 Dec 2024 00:04:27 +0000 (08:04 +0800)] 
Check Clang 12 for __builtin_complex

Since __builtin_complex was added to Clang 12, support __builtin_complex
for Clang 12.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoUse -finput-charset=ascii only if supported
H.J. Lu [Sun, 22 Dec 2024 00:04:25 +0000 (08:04 +0800)] 
Use -finput-charset=ascii only if supported

Check if -finput-charset=ascii is supported before using it in
check-installed-headers.sh.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoconform: Use -dD instead of -dN on compiler invocation
Adhemerval Zanella [Sun, 22 Dec 2024 00:04:24 +0000 (08:04 +0800)] 
conform: Use -dD instead of -dN on compiler invocation

clang does not support -dN.
Reviewed-by: Sam James <sam@gentoo.org>
7 months agomath: Exclude tgmath3-macro-tests for Clang
H.J. Lu [Sun, 15 Dec 2024 23:21:43 +0000 (07:21 +0800)] 
math: Exclude tgmath3-macro-tests for Clang

tgmath3-macro-tests won't compile with <float.h> and <tgmath.h> from
Clang due to missing C23 support:

https://github.com/llvm/llvm-project/issues/97335

Disable them for now when Clang is used for testing so that "make check"
can finish.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
7 months agoCheck if -mamx-tile works for testing
H.J. Lu [Wed, 18 Dec 2024 10:56:14 +0000 (18:56 +0800)] 
Check if -mamx-tile works for testing

Since -mamx-tile is used only for testing, use LIBC_TRY_TEST_CC_COMMAND,
instead of LIBC_TRY_CC_AND_TEST_CC_COMMAND to check it and don't check
__builtin_ia32_ldtilecfg for Clang.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoassert: Sort tests in Makefile
H.J. Lu [Sat, 21 Dec 2024 21:55:39 +0000 (05:55 +0800)] 
assert: Sort tests in Makefile

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
7 months agoassert: ensure posix compliance, add tests for such
DJ Delorie [Thu, 14 Nov 2024 20:12:57 +0000 (15:12 -0500)] 
assert: ensure posix compliance, add tests for such

Fix assert.c so that even the fallback
case conforms to POSIX, although not exactly the same as
the default case so a test can tell the difference.

Add a test that verifies that abort is called, and that the
message printed to stderr has all the info that POSIX requires.
Verify this even when malloc isn't usable.

Reviewed-by: Paul Eggert <eggert@cs.ucla.edu>
7 months agocet: Drop '#pragma GCC target' in tst-cet-legacy-10a[-static].c
Adhemerval Zanella [Fri, 20 Dec 2024 22:16:58 +0000 (06:16 +0800)] 
cet: Drop '#pragma GCC target' in tst-cet-legacy-10a[-static].c

After

commit 215447f5cbcf1a494cded57734f68d7f9c2b0dc0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Dec 17 06:18:55 2024 +0800

    cet: Pass -mshstk to compiler for tst-cet-legacy-10a[-static].c

we can remove '#pragma GCC target' in tst-cet-legacy-10a[-static].c.

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
7 months agoposix: fix system when a child cannot be created [BZ #32450]
Aurelien Jarno [Thu, 19 Dec 2024 22:55:15 +0000 (23:55 +0100)] 
posix: fix system when a child cannot be created [BZ #32450]

POSIX states that "if a child process cannot be created, or if the
termination status for the command language interpreter cannot be
obtained, system() shall return -1 and set errno to indicate the error."

In the glibc implementation it could happen when posix_spawn fails,
which happens when the underlying fork, vfork, or clone call fails. They
could fail with EAGAIN and ENOMEM.

Resolves: BZ #32450
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agoDon't use glibc <tgmath.h> when testing with Clang
H.J. Lu [Wed, 18 Dec 2024 10:58:34 +0000 (18:58 +0800)] 
Don't use glibc <tgmath.h> when testing with Clang

Clang has its own <tgmath.h> and doesn't use <tgmath.h> from glibc.  Pass
"-I." to compiler only if $($(<F)-no-include-dot) are undefined.  Define
it to yes for tgmath tests when testing with Clang.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agostdio-common: Exclude bug28 when clang is used
H.J. Lu [Wed, 18 Dec 2024 18:21:27 +0000 (02:21 +0800)] 
stdio-common: Exclude bug28 when clang is used

Clang 19 takes a very long time, it ran more than 27 minutes on Intel Core
i7-1195G7 before the process was killed, to compile bug28.c:

https://github.com/llvm/llvm-project/issues/120462

Exclude it when Clang is used for testing.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
7 months agoFix elf: Introduce is_rtld_link_map [BZ #32488]
H.J. Lu [Fri, 20 Dec 2024 20:21:55 +0000 (04:21 +0800)] 
Fix elf: Introduce is_rtld_link_map [BZ #32488]

Also use is_rtld_link_map in dl-cet.c.  This fixes BZ #32488.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
7 months agomath: xfail some tanpi tests for ibm128-libgcc
Adhemerval Zanella [Thu, 19 Dec 2024 14:40:50 +0000 (11:40 -0300)] 
math: xfail some tanpi tests for ibm128-libgcc

On powerpc math/test-ibm128-tanpi shows multiple failures:

testing long double (without inline functions)
Failure: tanpi_downward (0xfffffffffffffffdp-1): Exception "Divide by zero" not set
Failure: tanpi_downward (0xfffffffffffffffdp-1): errno set to 0, expected 34 (ERANGE)
Failure: Test: tanpi_downward (0xfffffffffffffffdp-1)
Result:
 is:          4.68843873182857939141363635204365e+28   0x1.2efbb6629d1d59b032520400df8p+95
 should be:   inf   inf
Failure: tanpi_downward (0x3fffffffffffffffffffffffffdp-1): Exception "Divide by zero" not set
Failure: tanpi_downward (0x3fffffffffffffffffffffffffdp-1): errno set to 0, expected 34 (ERANGE)
Failure: Test: tanpi_downward (0x3fffffffffffffffffffffffffdp-1)
Result:
 is:          1.41444453325831960404472183124793e+16   0x1.9202627cbf98e052d5fdbeee1f8p+53
 should be:   inf   inf
Failure: tanpi_downward (-0xf.ffffffffffffbffffffffffffcp+1020): Exception "Invalid operation" set
Failure: tanpi_downward (-0xf.ffffffffffffbffffffffffffcp+1020): Exception "Overflow" set
Failure: tanpi_downward (-0xf.ffffffffffffbffffffffffffcp+1020): errno set to 33, expected 0 (unchanged)
Failure: Test: tanpi_downward (-0xf.ffffffffffffbffffffffffffcp+1020)
Result:
 is:         qNaN
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
Failure: Test: tanpi_downward (0x3.fffffffffffffffcp+108)
Result:
 is:          2.91356019227449116879287504834896e-15   0x1.a3e365fee24d4632f95a2235698p-49
 should be:   0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 difference:  2.91356019227449116879287504834896e-15   0x1.a3e365fee24d4632f95a2235698p-49
 ulp       :  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321
 max.ulp   :  8.0000
Failure: Test: tanpi_downward (0x3.ffffffffffffffffffffffffffp+108)
Result:
 is:          7.94911926685664643005642781870827e-16   0x1.ca3c4b83eb5688e1474146dc338p-51
 should be:   0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 difference:  7.94911926685664643005642781870827e-16   0x1.ca3c4b83eb5688e1474146dc338p-51
 ulp       :  160891965142034222272327839154722485473479235229008379884749401713481320342777314570400076204240982703218835644458374555276642
 max.ulp   :  8.0000
Failure: tanpi_towardzero (0xfffffffffffffffdp-1): Exception "Divide by zero" not set
Failure: tanpi_towardzero (0xfffffffffffffffdp-1): errno set to 0, expected 34 (ERANGE)
Failure: Test: tanpi_towardzero (0xfffffffffffffffdp-1)
Result:
 is:          2.14718475310122677917055904836884e+28   0x1.1584624c14882fff76592b4ec10p+94
 should be:   inf   inf
Failure: tanpi_towardzero (-0xfffffffffffffffdp-1): Exception "Divide by zero" not set
Failure: tanpi_towardzero (-0xfffffffffffffffdp-1): errno set to 0, expected 34 (ERANGE)
Failure: Test: tanpi_towardzero (-0xfffffffffffffffdp-1)
Result:
 is:         -2.14718475310122677917055904836884e+28  -0x1.1584624c14882fff76592b4ec10p+94
 should be:  -inf  -inf
Failure: tanpi_towardzero (0x3fffffffffffffffffffffffffdp-1): Exception "Divide by zero" not set
Failure: tanpi_towardzero (0x3fffffffffffffffffffffffffdp-1): errno set to 0, expected 34 (ERANGE)
Failure: Test: tanpi_towardzero (0x3fffffffffffffffffffffffffdp-1)
Result:
 is:          6.60739946234609289593176521179840e+15   0x1.7796511d79d6ce55bc8bf083fe0p+52
 should be:   inf   inf
Failure: tanpi_towardzero (-0x3fffffffffffffffffffffffffdp-1): Exception "Divide by zero" not set
Failure: tanpi_towardzero (-0x3fffffffffffffffffffffffffdp-1): errno set to 0, expected 34 (ERANGE)
Failure: Test: tanpi_towardzero (-0x3fffffffffffffffffffffffffdp-1)
Result:
 is:         -6.60739946234609289593176521179840e+15  -0x1.7796511d79d6ce55bc8bf083fe0p+52
 should be:  -inf  -inf
Failure: Test: tanpi_towardzero (-0x3.fffffffffffffffcp+108)
Result:
 is:         -1.17953443892757434921819283936141e-14  -0x1.a8f8d97fb893518cbe5688935c0p-47
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  1.17953443892757434921819283936141e-14   0x1.a8f8d97fb893518cbe5688935c0p-47
 ulp       :  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321
 max.ulp   :  8.0000
Failure: Test: tanpi_towardzero (-0x3.ffffffffffffffffffffffffffp+108)
Result:
 is:         -1.85584803206881692897837494734542e-14  -0x1.4e51e25c1f5ab4470a3a0a42c24p-46
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  1.85584803206881692897837494734542e-14   0x1.4e51e25c1f5ab4470a3a0a42c24p-46
 ulp       :  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321
 max.ulp   :  8.0000
Failure: Test: tanpi_towardzero (0x3.fffffffffffffffcp+108)
Result:
 is:          1.17953443892757434921819283936141e-14   0x1.a8f8d97fb893518cbe5688935c0p-47
 should be:   0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 difference:  1.17953443892757434921819283936141e-14   0x1.a8f8d97fb893518cbe5688935c0p-47
 ulp       :  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321
 max.ulp   :  8.0000
Failure: Test: tanpi_towardzero (0x3.ffffffffffffffffffffffffffp+108)
Result:
 is:          1.85584803206881692897837494734542e-14   0x1.4e51e25c1f5ab4470a3a0a42c24p-46
 should be:   0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 difference:  1.85584803206881692897837494734542e-14   0x1.4e51e25c1f5ab4470a3a0a42c24p-46
 ulp       :  179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321
 max.ulp   :  8.0000
Failure: tanpi_upward (-0xfffffffffffffffdp-1): Exception "Divide by zero" not set
Failure: tanpi_upward (-0xfffffffffffffffdp-1): errno set to 0, expected 34 (ERANGE)
Failure: Test: tanpi_upward (-0xfffffffffffffffdp-1)
Result:
 is:         -2.14718475310122677917055904836884e+28  -0x1.1584624c14882fff76592b4ec10p+94
 should be:  -inf  -inf
Failure: tanpi_upward (-0x3fffffffffffffffffffffffffdp-1): Exception "Divide by zero" not set
Failure: tanpi_upward (-0x3fffffffffffffffffffffffffdp-1): errno set to 0, expected 34 (ERANGE)
Failure: Test: tanpi_upward (-0x3fffffffffffffffffffffffffdp-1)
Result:
 is:         -6.60739946234609289593176521179829e+15  -0x1.7796511d79d6ce55bc8bf083fdbp+52
 should be:  -inf  -inf
Failure: Test: tanpi_upward (-0x3.fffffffffffffffcp+108)
Result:
 is:         -1.17953443892757434921819283936138e-14  -0x1.a8f8d97fb893518cbe5688935b0p-47
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  1.17953443892757434921819283936139e-14   0x1.a8f8d97fb893518cbe5688935b0p-47
 ulp       :  inf
 max.ulp   :  8.0000
Failure: Test: tanpi_upward (-0x3.ffffffffffffffffffffffffffp+108)
Result:
 is:         -1.85584803206881692897837494734542e-14  -0x1.4e51e25c1f5ab4470a3a0a42c24p-46
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  1.85584803206881692897837494734543e-14   0x1.4e51e25c1f5ab4470a3a0a42c24p-46
 ulp       :  inf
 max.ulp   :  8.0000
Failure: tanpi_upward (0xf.ffffffffffffbffffffffffffcp+1020): Exception "Invalid operation" set
Failure: tanpi_upward (0xf.ffffffffffffbffffffffffffcp+1020): Exception "Overflow" set
Failure: tanpi_upward (0xf.ffffffffffffbffffffffffffcp+1020): errno set to 33, expected 0 (unchanged)
Failure: Test: tanpi_upward (0xf.ffffffffffffbffffffffffffcp+1020)
Result:
 is:         qNaN
 should be:   0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0

7 months agoelf: Reorder audit events in dlcose to match _dl_fini (bug 32066)
Florian Weimer [Tue, 3 Sep 2024 15:57:46 +0000 (17:57 +0200)] 
elf: Reorder audit events in dlcose to match _dl_fini (bug 32066)

This was discovered after extending elf/tst-audit23 to cover
dlclose of the dlmopen namespace.

Auditors already experience the new order during process
shutdown (_dl_fini), so no LAV_CURRENT bump or backwards
compatibility code seems necessary.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agoelf: Call la_objclose for proxy link maps in _dl_fini (bug 32065)
Florian Weimer [Fri, 9 Aug 2024 14:06:40 +0000 (16:06 +0200)] 
elf: Call la_objclose for proxy link maps in _dl_fini (bug 32065)

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agoelf: Signal la_objopen for the proxy link map in dlmopen (bug 31985)
Florian Weimer [Fri, 9 Aug 2024 13:31:18 +0000 (15:31 +0200)] 
elf: Signal la_objopen for the proxy link map in dlmopen (bug 31985)

Previously, the ld.so link map was silently added to the namespace.
This change produces an auditing event for it.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agoelf: Add the endswith function to <endswith.h>
Florian Weimer [Fri, 29 Nov 2024 14:36:40 +0000 (15:36 +0100)] 
elf: Add the endswith function to <endswith.h>

And include <stdbool.h> for a definition of bool.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agoelf: Update DSO list, write audit log to elf/tst-audit23.out
Florian Weimer [Tue, 3 Sep 2024 15:52:47 +0000 (17:52 +0200)] 
elf: Update DSO list, write audit log to elf/tst-audit23.out

After commit 1d5024f4f052c12e404d42d3b5bfe9c3e9fd27c4
("support: Build with exceptions and asynchronous unwind tables
[BZ #30587]"), libgcc_s is expected to show up in the DSO
list on 32-bit Arm.  Do not update max_objs because vdso is not
tracked (and which is the reason why the test currently passes
even with libgcc_s present).

Also write the log output from the auditor to standard output,
for easier test debugging.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agoelf: Move _dl_rtld_map, _dl_rtld_audit_state out of GL
Florian Weimer [Fri, 20 Dec 2024 14:52:57 +0000 (15:52 +0100)] 
elf: Move _dl_rtld_map, _dl_rtld_audit_state out of GL

This avoids immediate GLIBC_PRIVATE ABI issues if the size of
struct link_map or struct auditstate changes.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agoelf: Introduce is_rtld_link_map
Florian Weimer [Fri, 20 Dec 2024 14:52:57 +0000 (15:52 +0100)] 
elf: Introduce is_rtld_link_map

Unconditionally define it to false for static builds.

This avoids the awkward use of weak_extern for _dl_rtld_map
in checks that cannot be possibly true on static builds.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agoAdd F_CREATED_QUERY from Linux 6.12 to bits/fcntl-linux.h
Joseph Myers [Fri, 20 Dec 2024 11:47:33 +0000 (11:47 +0000)] 
Add F_CREATED_QUERY from Linux 6.12 to bits/fcntl-linux.h

Linux 6.12 adds a new constant F_CREATED_QUERY.  Add it to glibc's
bits/fcntl-linux.h.

Tested for x86_64.

7 months agoAdd HWCAP_LOONGARCH_LSPW from Linux 6.12 to bits/hwcap.h
Joseph Myers [Fri, 20 Dec 2024 11:47:03 +0000 (11:47 +0000)] 
Add HWCAP_LOONGARCH_LSPW from Linux 6.12 to bits/hwcap.h

Add the new Linux 6.12 HWCAP_LOONGARCH_LSPW to the corresponding
bits/hwcap.h.

Tested with build-many-glibcs.py for loongarch64-linux-gnu-lp64d.

7 months agoAdd MSG_SOCK_DEVMEM from Linux 6.12 to bits/socket.h
Joseph Myers [Fri, 20 Dec 2024 11:45:45 +0000 (11:45 +0000)] 
Add MSG_SOCK_DEVMEM from Linux 6.12 to bits/socket.h

Linux 6.12 adds a constant MSG_SOCK_DEVMEM (recall that various
constants such as this one are defined in the non-uapi linux/socket.h
but still form part of the kernel/userspace interface, so that
non-uapi header is one that needs checking each release for new such
constants).  Add it to glibc's bits/socket.h.

Tested for x86_64.

7 months agoi386: Regenerate ulps
Florian Weimer [Fri, 20 Dec 2024 11:40:17 +0000 (12:40 +0100)] 
i386: Regenerate ulps

As seen on an Intel i9-9900K CPU, with glibc built with GCC 11.5,
configured with and without --disable-multi-arch.

7 months agox86_64: Regenerate ulps
Florian Weimer [Fri, 20 Dec 2024 06:21:48 +0000 (07:21 +0100)] 
x86_64: Regenerate ulps

As seen with an AMD 7950X CPU, on a glibc built with GCC 11.5.

7 months agoaarch64: Regenerate ulps
Florian Weimer [Fri, 20 Dec 2024 06:12:30 +0000 (07:12 +0100)] 
aarch64: Regenerate ulps

Results from running on Neoverse-V2, built with GCC 11.5.

7 months agoelf: Remove code dependent on __rtld_lock_default_lock_recursive macro
Florian Weimer [Thu, 19 Dec 2024 20:28:50 +0000 (21:28 +0100)] 
elf: Remove code dependent on __rtld_lock_default_lock_recursive macro

Neither NPTL nor Hurd define this macro anymore.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agoLinux: Accept null arguments for utimensat pathname
Florian Weimer [Thu, 19 Dec 2024 19:56:44 +0000 (20:56 +0100)] 
Linux: Accept null arguments for utimensat pathname

This matches kernel behavior.  With this change, it is possible
to use utimensat as a replacement for the futimens interface,
similar to what glibc does internally.

Reviewed-by: Paul Eggert <eggert@cs.ucla.edu>
7 months agox86_64: Remove unused padding from tcbhead_t
Florian Weimer [Thu, 19 Dec 2024 19:56:44 +0000 (20:56 +0100)] 
x86_64: Remove unused padding from tcbhead_t

This padding is difficult to use for preserving the internal
GLIBC_PRIVATE ABI.  The comment is misleading.  Current Address
Sanitizer uses heuristics to determine struct pthread size.
It does not depend on its precise layout.  It merely scans for
pointers allocated using malloc.

Due to the removal of the padding, the assert for its start
is no longer required.

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
7 months agoAdd further DSO dependency sorting tests
Joseph Myers [Thu, 19 Dec 2024 18:56:04 +0000 (18:56 +0000)] 
Add further DSO dependency sorting tests

The current DSO dependency sorting tests are for a limited number of
specific cases, including some from particular bug reports.

Add tests that systematically cover all possible DAGs for an
executable and the shared libraries it depends on, directly or
indirectly, up to four objects (an executable and three shared
libraries).  (For this kind of DAG - ones with a single source vertex
from which all others are reachable, and an ordering on the edges from
each vertex - there are 57 DAGs on four vertices, 3399 on five
vertices and 1026944 on six vertices; see
https://arxiv.org/pdf/2303.14710 for more details on this enumeration.
I've tested that the 3399 cases with five vertices do all pass if
enabled.)

These tests are replicating the sorting logic from the dynamic linker
(thereby, for example, asserting that it doesn't accidentally change);
I'm not claiming that the logic in the dynamic linker is in some
abstract sense optimal.  Note that these tests do illustrate how in
some cases the two sorting algorithms produce different results for a
DAG (I think all the existing tests for such differences are ones
involving cycles, and the motivation for the new algorithm was also to
improve the handling of cycles):

  tst-dso-ordering-all4-44: a->[bc];{}->[cba]
  output(glibc.rtld.dynamic_sort=1): c>b>a>{}<a<b<c
  output(glibc.rtld.dynamic_sort=2): b>c>a>{}<a<c<b

They also illustrate that sometimes the sorting algorithms do not
follow the order in which dependencies are listed in DT_NEEDED even
though there is a valid topological sort that does follow that, which
might be counterintuitive considering that the DT_NEEDED ordering is
followed in the simplest cases:

  tst-dso-ordering-all4-56: {}->[abc]
  output: c>b>a>{}<a<b<c

shows such a simple case following DT_NEEDED order for destructor
execution (the reverse of it for constructor execution), but

  tst-dso-ordering-all4-41: a->[cb];{}->[cba]
  output: c>b>a>{}<a<b<c

shows that c and b are in the opposite order to what might be expected
from the simplest case, though there is no dependency requiring such
an opposite order to be used.

(I'm not asserting that either of those things is a problem, simply
observing them as less obvious properties of the sorting algorithms
shown up by these tests.)

Tested for x86_64.

7 months agoAdd NT_X86_XSAVE_LAYOUT and NT_ARM_POE from Linux 6.12 to elf.h
Joseph Myers [Thu, 19 Dec 2024 17:09:19 +0000 (17:09 +0000)] 
Add NT_X86_XSAVE_LAYOUT and NT_ARM_POE from Linux 6.12 to elf.h

Linux 6.12 adds new ELF note types NT_X86_XSAVE_LAYOUT and NT_ARM_POE.
Add these to glibc's elf.h.

Tested for x86_64.

7 months agoAdd SCHED_EXT from Linux 6.12 to bits/sched.h
Joseph Myers [Thu, 19 Dec 2024 17:08:38 +0000 (17:08 +0000)] 
Add SCHED_EXT from Linux 6.12 to bits/sched.h

Linux 6.12 adds the SCHED_EXT constant.  Add it to glibc's
bits/sched.h and update the kernel version in tst-sched-consts.py.

Tested for x86_64.

7 months agohppa: Fix strace detach-vfork test
John David Anglin [Thu, 19 Dec 2024 16:30:09 +0000 (11:30 -0500)] 
hppa: Fix strace detach-vfork test

This change implements vfork.S for direct support of the vfork
syscall.  clone.S is revised to correct child support for the
vfork case.

The main bug was creating a frame prior to the clone syscall.
This was done to allow the rp and r4 registers to be saved and
restored from the stack frame.  r4 was used to save and restore
the PIC register, r19, across the system call and the call to
set errno.  But in the vfork case, it is undefined behavior
for the child to return from the function in which vfork was
called.  It is surprising that this usually worked.

Syscalls on hppa save and restore rp and r19, so we don't need
to create a frame prior to the clone syscall.  We only need a
frame when __syscall_error is called.  We also don't need to
save and restore r19 around the call to $$dyncall as r19 is not
used in the code after $$dyncall.

This considerably simplifies clone.S.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
7 months agoUpdate kernel version to 6.12 in header constant tests
Joseph Myers [Thu, 19 Dec 2024 15:38:59 +0000 (15:38 +0000)] 
Update kernel version to 6.12 in header constant tests

There are no new constants covered by tst-mman-consts.py,
tst-mount-consts.py or tst-pidfd-consts.py in Linux 6.12 that need any
header changes, so update the kernel version in those tests.
(tst-sched-consts.py will need updating separately along with adding
SCHED_EXT.)

Tested with build-many-glibcs.py.

7 months agoadded url of CORE-MATH project
Paul Zimmermann [Thu, 12 Dec 2024 10:05:23 +0000 (11:05 +0100)] 
added url of CORE-MATH project

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agomath: Use tanhf from CORE-MATH
Adhemerval Zanella [Tue, 19 Nov 2024 19:30:16 +0000 (16:30 -0300)] 
math: Use tanhf from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows slight better performance to the generic tanhf.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

Latency                      master        patched   improvement
x86_64                      51.5273        41.0951        20.25%
x86_64v2                    47.7021        39.1526        17.92%
x86_64v3                    45.0373        34.2737        23.90%
i686                       133.9970        83.8596        37.42%
aarch64 (Neoverse)          21.5439        14.7961        31.32%
power10                     13.3301         8.4406        36.68%

reciprocal-throughput        master        patched   improvement
x86_64                      24.9493        12.8547        48.48%
x86_64v2                    20.7051        12.7761        38.29%
x86_64v3                    19.2492        11.0851        42.41%
i686                        78.6498        29.8211        62.08%
aarch64 (Neoverse)          11.6026        7.11487        38.68%
power10                      6.3328         2.8746        54.61%

Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Use sinhf from CORE-MATH
Adhemerval Zanella [Tue, 19 Nov 2024 17:26:17 +0000 (14:26 -0300)] 
math: Use sinhf from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows slight better performance to the generic sinhf.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

Latency                      master        patched   improvement
x86_64                      52.6819        49.1489         6.71%
x86_64v2                    49.1162        42.9447        12.57%
x86_64v3                    46.9732        39.9157        15.02%
i686                       141.1470       129.6410         8.15%
aarch64 (Neoverse)          20.8539        17.1288        17.86%
power10                     14.5258        9.1906         36.73%

reciprocal-throughput        master        patched   improvement
x86_64                      27.5553        23.9395        13.12%
x86_64v2                    21.6423        20.3219         6.10%
x86_64v3                    21.4842        16.0224        25.42%
i686                        87.9709        86.1626         2.06%
aarch64 (Neoverse)          15.1919        12.2744        19.20%
power10                      7.2188         5.2611        27.12%

Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Use coshf from CORE-MATH
Adhemerval Zanella [Tue, 19 Nov 2024 13:40:07 +0000 (10:40 -0300)] 
math: Use coshf from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode),
although it should worse performance than current one.  The current
implementation performance comes mainly from the internal usage of
the optimize expf implementation, and shows a maximum ULPs of 2 for
FE_TONEAREST and 3 for other rounding modes.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

Latency                      master        patched   improvement
x86_64                      40.6995        49.0737       -20.58%
x86_64v2                    40.5841        44.3604        -9.30%
x86_64v3                    39.3879        39.7502        -0.92%
i686                       112.3380       129.8570       -15.59%
aarch64 (Neoverse)          18.6914        17.0946         8.54%
power10                     11.1343        9.3245         16.25%

reciprocal-throughput        master        patched   improvement
x86_64                      18.6471        24.1077       -29.28%
x86_64v2                    17.7501        20.2946       -14.34%
x86_64v3                    17.8262        17.1877         3.58%
i686                        64.1454        86.5645       -34.95%
aarch64 (Neoverse)          9.77226        12.2314       -25.16%
power10                      4.0200        5.3316        -32.63%

Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Use atanhf from CORE-MATH
Adhemerval Zanella [Tue, 19 Nov 2024 16:31:14 +0000 (13:31 -0300)] 
math: Use atanhf from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows slight better performance to the generic atanhf.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

Latency                      master        patched   improvement
x86_64                      59.4930        45.8568        22.92%
x86_64v2                    59.5705        45.5804        23.48%
x86_64v3                    53.1838        37.7155        29.08%
i686                        169.354       133.5940        21.12%
aarch64 (Neoverse)          26.0781        16.9829        34.88%
power10                     15.6591        10.7623        31.27%

reciprocal-throughput        master        patched   improvement
x86_64                      23.5903        18.5766        21.25%
x86_64v2                    22.6489        18.2683        19.34%
x86_64v3                    19.0401        13.9474        26.75%
i686                        97.6034       107.3260        -9.96%
aarch64 (Neoverse)          15.3664        9.57846        37.67%
power10                      6.8877        4.6242         32.86%

Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Use atan2f from CORE-MATH
Adhemerval Zanella [Mon, 18 Nov 2024 20:57:31 +0000 (17:57 -0300)] 
math: Use atan2f from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows slight better performance to the generic atan2f.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

Latency                      master        patched   improvement
x86_64                      68.1175        69.2014        -1.59%
x86_64v2                    66.9884        66.0081         1.46%
x86_64v3                    57.7034        61.6407        -6.82%
i686                       189.8690        152.7560       19.55%
aarch64 (Neoverse)          32.6151        24.5382        24.76%
power10                     21.7282        17.1896        20.89%

reciprocal-throughput        master        patched   improvement
x86_64                      34.5202        31.6155         8.41%
x86_64v2                    32.6379        30.3372         7.05%
x86_64v3                    34.3677        23.6455        31.20%
i686                       157.7290        75.8308        51.92%
aarch64 (Neoverse)          27.7788        16.2671        41.44%
power10                     15.5715         8.1588        47.60%

Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Use atanf from CORE-MATH
Adhemerval Zanella [Mon, 18 Nov 2024 11:45:16 +0000 (08:45 -0300)] 
math: Use atanf from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows slight better performance to the generic atanf.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

Latency                      master        patched   improvement
x86_64                      56.8265        53.6842         5.53%
x86_64v2                    54.8177        53.6842         2.07%
x86_64v3                    46.2915        48.7034        -5.21%
i686                       158.3760        108.9560       31.20%
aarch64 (Neoverse)           21.687        20.5893         5.06%
power10                     13.1903        13.5012        -2.36%

reciprocal-throughput        master        patched   improvement
x86_64                      16.6787        16.7601        -0.49%
x86_64v2                    16.6983        16.7601        -0.37%
x86_64v3                    16.2268        12.1391        25.19%
i686                       138.6840        36.0640        74.00%
aarch64 (Neoverse)          11.8012        10.3565        12.24%
power10                      5.3212         4.2894        19.39%

Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Use asinhf from CORE-MATH
Adhemerval Zanella [Thu, 14 Nov 2024 14:07:11 +0000 (11:07 -0300)] 
math: Use asinhf from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows slight better performance to the generic asinhf.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

Latency                      master        patched   improvement
x86_64                      64.5128        56.9717        11.69%
x86_64v2                    63.3065        57.2666         9.54%
x86_64v3                    62.8719        51.4170        18.22%
i686                       189.1630        137.635        27.24%
aarch64 (Neoverse)          25.3551        20.5757        18.85%
power10                     17.9712        13.3302        25.82%

reciprocal-throughput        master        patched   improvement
x86_64                      20.0844        15.4731        22.96%
x86_64v2                    19.2919        15.4000        20.17%
x86_64v3                    18.7226        11.9009        36.44%
i686                       103.7670        80.2681        22.65%
aarch64 (Neoverse)          12.5005        8.68969        30.49%
power10                      7.2220        5.03617        30.27%

Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>:
Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Use asinf from CORE-MATH
Adhemerval Zanella [Wed, 13 Nov 2024 16:48:14 +0000 (13:48 -0300)] 
math: Use asinf from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows slight better performance to the generic asinf.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

Latency                      master        patched   improvement
x86_64                      42.8237        35.2460        17.70%
x86_64v2                    43.3711        35.9406        17.13%
x86_64v3                    35.0335        30.5744        12.73%
i686                       213.8780        104.4710       51.15%
aarch64 (Neoverse)          17.2937        13.6025        21.34%
power10                     12.0227        7.4241         38.25%

reciprocal-throughput        master        patched   improvement
x86_64                      13.6770        15.5231       -13.50%
x86_64v2                    13.8722        16.0446       -15.66%
x86_64v3                    13.6211        13.2753         2.54%
i686                       186.7670        45.4388        75.67%
aarch64 (Neoverse)          9.96089        9.39285         5.70%
power10                      4.9862        3.7819         24.15%

Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Use acoshf from CORE-MATH
Adhemerval Zanella [Mon, 21 Oct 2024 13:51:09 +0000 (10:51 -0300)] 
math: Use acoshf from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows slight better performance to the generic acoshf.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

Latency                      master        patched   improvement
x86_64                      61.2471        58.7742         4.04%
x86_64-v2                   62.6519        59.0523         5.75%
x86_64-v3                   58.7408        50.1393        14.64%
aarch64                     24.8580        21.3317        14.19%
power10                     17.0469        13.1345        22.95%

reciprocal-throughput        master        patched   improvement
x86_64                      16.1618        15.1864         6.04%
x86_64-v2                   15.7729        14.7563         6.45%
x86_64-v3                   14.1669        11.9568        15.60%
aarch64                      10.911        9.5486         12.49%
power10                     6.38196        5.06734        20.60%

Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Use acosf from CORE-MATH
Adhemerval Zanella [Fri, 18 Oct 2024 19:04:30 +0000 (16:04 -0300)] 
math: Use acosf from CORE-MATH

The CORE-MATH implementation is correctly rounded (for any rounding mode)
and shows slight better performance to the generic acosf.

The code was adapted to glibc style and to use the definition of
math_config.h (to handle errno, overflow, and underflow).

Benchtest on x64_64 (Ryzen 9 5900X, gcc 14.2.1), aarch64 (Neoverse-N1,
gcc 13.3.1), and powerpc (POWER10, gcc 13.2.1):

Latency                      master        patched   improvement
x86_64                      52.5098        36.6312        30.24%
x86_64v2                    53.0217        37.3091        29.63%
x86_64v3                    42.8501        32.3977        24.39%
i686                       207.3960       109.4000        47.25%
aarch64                     21.3694        13.7871        35.48%
power10                     14.5542         7.2891        49.92%

reciprocal-throughput        master        patched   improvement
x86_64                      14.1487        15.9508       -12.74%
x86_64v2                    14.3293        16.1899       -12.98%
x86_64v3                    13.6563        12.6161         7.62%
i686                       158.4060        45.7354        71.13%
aarch64                     12.5515        9.19233        26.76%
power10                      5.7868         3.3487        42.13%

Signed-off-by: Alexei Sibidanov <sibid@uvic.ca>
Signed-off-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Fix the expected carg (inf) results
Adhemerval Zanella [Wed, 4 Dec 2024 15:55:42 +0000 (12:55 -0300)] 
math: Fix the expected carg (inf) results

The pi defined constants are not the expected value for carg
on non-default rounding modes (similar to atan).  Instead use
autogenerated value.

7 months agomath: Fix the expected atan2f (inf) results
Adhemerval Zanella [Wed, 20 Nov 2024 18:50:22 +0000 (15:50 -0300)] 
math: Fix the expected atan2f (inf) results

The pi defined constants are not the expected value for atan2
on non-default rounding modes.  Instead use the autogenerated value.

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agomath: Fix the expected atanf (inf) results
Adhemerval Zanella [Wed, 20 Nov 2024 17:21:56 +0000 (14:21 -0300)] 
math: Fix the expected atanf (inf) results

The M_PI_2 (lit_pi_2_d) constant is not the expected value for atanf
on non-default rounding modes.  Instead use the autogenerated value.

7 months agomath: Add inf support on gen-auto-libm-tests.c
Adhemerval Zanella [Wed, 20 Nov 2024 18:44:58 +0000 (15:44 -0300)] 
math: Add inf support on gen-auto-libm-tests.c

For some correctly rounded inputs where infinity might generate
a number (like atanf), comparing to a pre-defined constant does not
yield the expected result in all rounding modes.

The most straightforward way to handle it would be to get the expected
result from mpfr, where it handles all the rounding modes.

7 months agomath: Fix spurious-divbyzero flag name
Adhemerval Zanella [Wed, 4 Dec 2024 13:05:05 +0000 (10:05 -0300)] 
math: Fix spurious-divbyzero flag name

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agobenchtests: Add tanhf benchmark
Adhemerval Zanella [Tue, 19 Nov 2024 19:09:11 +0000 (16:09 -0300)] 
benchtests: Add tanhf benchmark

Random inputs in the range [-10,10].

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agobenchtests: Add sinhf benchmark
Adhemerval Zanella [Tue, 19 Nov 2024 16:47:15 +0000 (13:47 -0300)] 
benchtests: Add sinhf benchmark

Random inputs in the range [-10,10].

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agobenchtests: Add coshf benchmark
Adhemerval Zanella [Tue, 19 Nov 2024 12:46:22 +0000 (09:46 -0300)] 
benchtests: Add coshf benchmark

Random inputs in the range [-10,10].

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agobenchtests: Add atanhf benchmark
Adhemerval Zanella [Tue, 19 Nov 2024 14:11:05 +0000 (11:11 -0300)] 
benchtests: Add atanhf benchmark

The input is based on acosf one (random inputs in [-1,1]).

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agobenchtests: Add atan2f benchmark
Adhemerval Zanella [Mon, 18 Nov 2024 13:12:06 +0000 (10:12 -0300)] 
benchtests: Add atan2f benchmark

Random inputs in the range [-10,10].

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agobenchtests: Add atanf benchmark
Adhemerval Zanella [Thu, 14 Nov 2024 17:56:20 +0000 (14:56 -0300)] 
benchtests: Add atanf benchmark

Random inputs in the range [-10,10].

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agobenchtests: Add asinhf benchmark
Adhemerval Zanella [Thu, 14 Nov 2024 12:55:35 +0000 (09:55 -0300)] 
benchtests: Add asinhf benchmark

Random inputs in the range [-10,10].

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agobenchtests: Add asinf benchmark
Adhemerval Zanella [Wed, 13 Nov 2024 16:29:41 +0000 (13:29 -0300)] 
benchtests: Add asinf benchmark

The input is based on acosf one (random inputs in [-1,1]).

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agobenchtests: Add acoshf benchmark
Adhemerval Zanella [Mon, 21 Oct 2024 12:08:01 +0000 (09:08 -0300)] 
benchtests: Add acoshf benchmark

Random inputs in the range [1,21].

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agobenchtests: Add acosf benchmark
Adhemerval Zanella [Fri, 18 Oct 2024 18:27:25 +0000 (15:27 -0300)] 
benchtests: Add acosf benchmark

The input is based on acos one (random inputs in [-1,1]).

Reviewed-by: DJ Delorie <dj@redhat.com>
7 months agonptl: Add <thread_pointer.h> for sparc
Michael Jeanson [Wed, 31 Jul 2024 21:04:10 +0000 (17:04 -0400)] 
nptl: Add <thread_pointer.h> for sparc

This will be required by the rseq extensible ABI implementation on all
Linux architectures exposing the '__rseq_size' and '__rseq_offset'
symbols to set the initial value of the 'cpu_id' field which can be used
by applications to test if rseq is available and registered. As long as
the symbols are exposed it is valid for an application to perform this
test even if rseq is not yet implemented in libc for this architecture.

Compile tested with build-many-glibcs.py but I don't have access to any
hardware to run the tests.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7 months agopowerpc: Update libm-test-ulps
Adhemerval Zanella [Wed, 18 Dec 2024 18:43:09 +0000 (15:43 -0300)] 
powerpc: Update libm-test-ulps

Regen to add new functions acospi, asinpi, atan2pi, atanpi, and
tanpi.

7 months agoarm: Update libm-test-ulps
Adhemerval Zanella [Wed, 18 Dec 2024 17:19:36 +0000 (14:19 -0300)] 
arm: Update libm-test-ulps

Regen to add new functions acospi, asinpi, atan2pi, atanpi, cospi,
sinpi, and tanpi.

7 months agoi386: Update libm-test-ulps
Adhemerval Zanella [Wed, 18 Dec 2024 17:16:06 +0000 (14:16 -0300)] 
i386: Update libm-test-ulps

Regen to add new functions acospi, asinpi, atan2pi, atanpi, cospi,
sinpi, and tanpi.

7 months agoUpdate syscall lists for Linux 6.12
Joseph Myers [Wed, 18 Dec 2024 15:12:36 +0000 (15:12 +0000)] 
Update syscall lists for Linux 6.12

Linux 6.12 has no new syscalls.  Update the version number in
syscall-names.list to reflect that it is still current for 6.12.

Tested with build-many-glibcs.py.