Commit Graph

41864 Commits

Author SHA1 Message Date
Adhemerval Zanella
601b3d5db2 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>
2024-12-22 17:45:24 +08:00
Adhemerval Zanella
f6cf084155 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>
2024-12-22 17:43:11 +08:00
Adhemerval Zanella
03962d17c9 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>
2024-12-22 17:40:33 +08:00
Adhemerval Zanella
27a4b6421f 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>
2024-12-22 17:35:33 +08:00
Adhemerval Zanella
77c1128bd3 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>
2024-12-22 17:29:28 +08:00
Adhemerval Zanella
69c181f2b3 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>
2024-12-22 17:27:35 +08:00
Adhemerval Zanella
cdcd551d82 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>
2024-12-22 17:26:19 +08:00
Adhemerval Zanella
46a813466e 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>
2024-12-22 17:24:16 +08:00
H.J. Lu
8d25b9f2c8 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>
2024-12-22 17:20:15 +08:00
H.J. Lu
bce70034b1 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>
2024-12-22 16:16:45 +08:00
Fangrui Song
d773aff467 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>
2024-12-22 16:07:11 +08:00
Adhemerval Zanella
b2556550a0 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>
2024-12-22 13:29:20 +08:00
Adhemerval Zanella
6412d8cc46 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>
2024-12-22 13:19:12 +08:00
H.J. Lu
03feea74dc 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>
2024-12-22 13:15:43 +08:00
Adhemerval Zanella
d085db5b57 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>
2024-12-22 13:08:51 +08:00
Adhemerval Zanella
a69a0bb619 Handle pragma GCC optimize for clang
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22 13:07:27 +08:00
Adhemerval Zanella
799e686c88 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>
2024-12-22 13:06:02 +08:00
H.J. Lu
494eb254c3 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>
2024-12-22 13:03:46 +08:00
H.J. Lu
56cdc529fb 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>
2024-12-22 13:02:30 +08:00
Adhemerval Zanella
90edd56c01 localedata: Use hexadecimal character escape on tests
Instead of latin1 ones.

Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22 13:01:08 +08:00
H.J. Lu
e5a5229868 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>
2024-12-22 12:56:49 +08:00
H.J. Lu
d9d30f6cb5 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>
2024-12-22 12:55:50 +08:00
H.J. Lu
f5fb9fa011 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>
2024-12-22 12:54:44 +08:00
H.J. Lu
9151ecbb5e 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>
2024-12-22 12:51:56 +08:00
H.J. Lu
b2ec6f72b8 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>
2024-12-22 12:50:53 +08:00
H.J. Lu
bdc7f4b4e2 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>
2024-12-22 12:44:42 +08:00
H.J. Lu
6d9d7865d0 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>
2024-12-22 12:43:14 +08:00
H.J. Lu
a0704d9fc6 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>
2024-12-22 12:42:02 +08:00
Adhemerval Zanella
fe925cb045 conform: Use -dD instead of -dN on compiler invocation
clang does not support -dN.
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22 12:41:05 +08:00
H.J. Lu
969d7cf899 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>
2024-12-22 06:07:17 +08:00
H.J. Lu
88499d61bd 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>
2024-12-22 06:07:17 +08:00
H.J. Lu
265e13d33c assert: Sort tests in Makefile
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-22 05:55:39 +08:00
DJ Delorie
e79e5c4899 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>
2024-12-20 22:44:01 -05:00
Adhemerval Zanella
b3a7a15d99 cet: Drop '#pragma GCC target' in tst-cet-legacy-10a[-static].c
After

commit 215447f5cb
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>
2024-12-21 06:16:58 +08:00
Aurelien Jarno
6fd215d6ae 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>
2024-12-20 22:57:06 +01:00
H.J. Lu
034cd67528 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>
2024-12-21 05:24:07 +08:00
H.J. Lu
6025b399c7 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>
2024-12-21 05:14:01 +08:00
H.J. Lu
40bf25b754 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>
2024-12-21 04:36:18 +08:00
Adhemerval Zanella
c3ee510267 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
2024-12-20 15:09:40 -03:00
Florian Weimer
495b96e064 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>
2024-12-20 16:17:10 +01:00
Florian Weimer
c4b160744c elf: Call la_objclose for proxy link maps in _dl_fini (bug 32065)
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2024-12-20 16:17:08 +01:00
Florian Weimer
8f36b14696 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>
2024-12-20 16:16:21 +01:00
Florian Weimer
a20bc2f623 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>
2024-12-20 16:15:53 +01:00
Florian Weimer
4a50fdf8b2 elf: Update DSO list, write audit log to elf/tst-audit23.out
After commit 1d5024f4f0
("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>
2024-12-20 16:15:51 +01:00
Florian Weimer
ef5823d955 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>
2024-12-20 15:52:57 +01:00
Florian Weimer
2b1dba3eb3 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>
2024-12-20 15:52:57 +01:00
Joseph Myers
322e9d4e44 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.
2024-12-20 11:47:33 +00:00
Joseph Myers
37d9618492 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.
2024-12-20 11:47:03 +00:00
Joseph Myers
fbdd8b3fa8 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.
2024-12-20 11:46:06 +00:00
Florian Weimer
9a6533429e 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.
2024-12-20 12:40:17 +01:00