Commit Graph

41864 Commits

Author SHA1 Message Date
H.J. Lu
d4ee46b0cd tst-clone3[-internal].c: Add _Atomic to silence Clang
Add _Atomic to futex_wait argument and ctid in tst-clone3[-internal].c to
silence Clang error:

../sysdeps/unix/sysv/linux/tst-clone3-internal.c:93:3: error: address argument to atomic operation must be a pointer to _Atomic type ('pid_t *' (aka 'int *') invalid)
   93 |   wait_tid (&ctid, CTID_INIT_VAL);
      |   ^         ~~~~~
../sysdeps/unix/sysv/linux/tst-clone3-internal.c:51:21: note: expanded from macro 'wait_tid'
   51 |     while ((__tid = atomic_load_explicit (ctid_ptr,                     \
      |                     ^                     ~~~~~~~~
/usr/bin/../lib/clang/19/include/stdatomic.h:145:30: note: expanded from macro 'atomic_load_explicit'
  145 | #define atomic_load_explicit __c11_atomic_load
      |                              ^

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-18 01:54:26 +08:00
H.J. Lu
560cfeb826 tst-atexit-common.c: Mark _exit_with_flush as noreturn
Mark _exit_with_flush as noreturn to silence the Clang error on
tst-atexit-common.c:

In file included from tst-atexit.c:22:
../stdlib/tst-atexit-common.c:113:5: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
  113 |     case 0:  /* Child.  */
      |     ^
../stdlib/tst-atexit-common.c:113:5: note: insert 'break;' to avoid fall-through
  113 |     case 0:  /* Child.  */
      |     ^
      |     break;
1 error generated.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-18 01:54:26 +08:00
Florian Weimer
61c3450db9 x86: Avoid integer truncation with large cache sizes (bug 32470)
Some hypervisors report 1 TiB L3 cache size.  This results
in some variables incorrectly getting zeroed, causing crashes
in memcpy/memmove because invariants are violated.
2024-12-17 18:49:50 +01:00
H.J. Lu
77e921bc61 tst-timespec.c: Explicitly cast TIME_T_MAX to double
Explicitly cast TIME_T_MAX to double in tst-timespec.c to silence Clang
error:

tst-timespec.c:290:19: error: implicit conversion from 'time_t' (aka 'long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-const-int-float-conversion]
  287 |   {.expected = {.tv_sec = 0, .tv_nsec = 1},
      |   ~
  288 |    .observed = {.tv_sec = TIME_T_MAX / TIMESPEC_HZ,
  289 |                 .tv_nsec = TIMESPEC_HZ - 1},
  290 |    .upper_bound = TIME_T_MAX, .lower_bound = 1, .result = 1,
      |                   ^~~~~~~~~~

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-18 01:26:52 +08:00
H.J. Lu
4666f5c3ee tst-resolv-invalid-cname.c: Explicitly cast 192 and 168 to char
Explicitly cast 192 and 168 to char to silence Clang error:

tst-resolv-invalid-cname.c:313:17: error: implicit conversion from 'int' to 'char' changes value from 192 to -64 [-Werror,-Wconstant-conversion]
  313 |       addr[0] = 192;
      |               ~ ^~~
tst-resolv-invalid-cname.c:314:17: error: implicit conversion from 'int' to 'char' changes value from 168 to -88 [-Werror,-Wconstant-conversion]
  314 |       addr[1] = 168;
      |               ~ ^~~

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-18 01:25:55 +08:00
H.J. Lu
0cc88d2327 Silence Clang #include_next error
Use "#include <...>" to silence Clang #include_next error:

In file included from ../sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c:19:
../sysdeps/x86_64/fpu/test-double-vlen4.h:19:2: error: #include_next in file found relative to primary source file or found by absolute path; will search from start of include path [-Werror,-Winclude-next-absolute-path]
   19 | #include_next <test-double-vlen4.h>
      |  ^
1 error generated.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-18 01:22:48 +08:00
H.J. Lu
215447f5cb cet: Pass -mshstk to compiler for tst-cet-legacy-10a[-static].c
Pass -mshstk to compiler to silence Clang:

In file included from ../sysdeps/x86_64/tst-cet-legacy-10a.c:2:
../sysdeps/x86_64/tst-cet-legacy-10.c:29:7: error: always_inline function '_get_ssp' requires target feature 'shstk', but would be inlined into function 'do_test' that is compiled without support for 'shstk'
   29 |   if (_get_ssp () != 0)
      |       ^

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-18 01:20:16 +08:00
Joana Cruz
cff9648d0b AArch64: Improve codegen of AdvSIMD expf family
Load the polynomial evaluation coefficients into 2 vectors and use lanewise MLAs.
Also use intrinsics instead of native operations.
expf: 3% improvement in throughput microbenchmark on Neoverse V1, exp2f: 5%,
exp10f: 13%, coshf: 14%.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2024-12-17 15:28:22 +00:00
Joana Cruz
6914774b9d AArch64: Improve codegen of AdvSIMD atan(2)(f)
Load the polynomial evaluation coefficients into 2 vectors and use lanewise MLAs.
8% improvement in throughput microbenchmark on Neoverse V1.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2024-12-17 15:28:22 +00:00
Joana Cruz
d6e034f5b2 AArch64: Improve codegen of AdvSIMD logf function family
Load the polynomial evaluation coefficients into 2 vectors and use lanewise MLAs.
8% improvement in throughput microbenchmark on Neoverse V1 for log2 and log,
and 2% for log10.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2024-12-17 15:25:58 +00:00
H.J. Lu
f9493a15ea Hide all malloc functions from compiler [BZ #32366]
Since -1 isn't a power of two, compiler may reject it, hide memalign from
Clang 19 which issues an error:

tst-memalign.c:86:31: error: requested alignment is not a power of 2 [-Werror,-Wnon-power-of-two-alignment]
   86 |   p = memalign (-1, pagesize);
      |                 ^~
tst-memalign.c:86:31: error: requested alignment must be 4294967296 bytes or smaller; maximum alignment assumed [-Werror,-Wbuiltin-assume-aligned-alignment]
   86 |   p = memalign (-1, pagesize);
      |                 ^~

Update tst-malloc-aux.h to hide all malloc functions and include it in
all malloc tests to prevent compiler from optimizing out any malloc
functions.

Tested with Clang 19.1.5 and GCC 15 20241206 for BZ #32366.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-17 20:51:08 +08:00
Alejandro Colomar
bd0ea9ff7e libio: Use NULL instead of 0 as a null pointer constant
This was missed in a recent global change.

Fixes: 53fcdf5f74 (2024-11-25, "Silence most -Wzero-as-null-pointer-constant diagnostics")
Reported-by: "Maciej W. Rozycki" <macro@redhat.com>
Cc: Siddhesh Poyarekar <siddhesh@sourceware.org>
Cc: Bruno Haible <bruno@clisp.org>
Cc: Martin Uecker <uecker@tugraz.at>
Cc: Xi Ruoyao <xry111@xry111.site>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Joseph Myers <josmyers@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Maciej W. Rozycki <macro@redhat.com>
2024-12-17 06:37:24 -05:00
DJ Delorie
87cd94bba4 manual: Document more sigaction flags
Adds documentation for three-argument handler

Adds remainder of the SA_* flags

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-12-16 18:23:43 -05:00
H.J. Lu
50c35842df Remove duplicated BUILD_CC in Makeconfig
Remove the second

ifndef BUILD_CC
BUILD_CC = $(CC)
endif

in Makeconfig.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-17 04:56:29 +08:00
Aurelien Jarno
9a4b0eaf72 iconv: do not report error exit with transliteration [BZ #32448]
Commit 6cbf845fcd ("iconv: Preserve iconv -c error exit on invalid
inputs (bug 32046)") changed the error exit code to report an error when
an input character has been transliterated. This looks like a bug as the
moto in the iconv program is to report an error code in the same
condition as the iconv() function.

This happens because the STANDARD_TO_LOOP_ERR_HANDLER macro sets a
default value for result and later updates it if the transliteration
succeed. With the changes, setting the default value also marks the
input as illegal.

Fix that by setting up the default value of result only when the
transliteration is not used. This works because __gconv_transliterate()
calls __gconv_mark_illegal_input() to return an error. At the same time
also fix the typo outself -> ourselves.

Fixes: 6cbf845fcd
Resolves: BZ #32448
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-12-16 21:33:39 +01:00
H.J. Lu
dd413a4d2f Fix sysdeps/x86/fpu/Makefile: Split and sort tests
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-16 05:57:28 +08:00
H.J. Lu
57a44f27c4 sysdeps/x86/fpu/Makefile: Split and sort tests
Split and sort tests in sysdeps/x86/fpu/Makefile.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-16 05:51:02 +08:00
H.J. Lu
07e3eb1774 Use empty initializer to silence GCC 4.9 or older
Use empty initializer to silence GCC 4.9 or older:

getaddrinfo.c: In function ‘gaih_inet’:
getaddrinfo.c:1135:24: error: missing braces around initializer [-Werror=missing-braces]
       / sizeof (struct gaih_typeproto)] = {0};
                        ^

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-16 04:06:30 +08:00
Florian Weimer
b933e5cef6 Linux: Check for 0 return value from vDSO getrandom probe
As of Linux 6.13, there is no code in the vDSO that declines this
initialization request with the special ~0UL state size.  If the vDSO
has the function, the call succeeds and returns 0.  It's expected
that the code would follow the “a negative value indicating an error”
convention, as indicated in the __cvdso_getrandom_data function
comment, so that INTERNAL_SYSCALL_ERROR_P on glibc's side would return
true.  This commit changes the commit to check for zero to indicate
success instead, which covers potential future non-zero success
return values and error returns.

Fixes commit 4f5704ea34 ("powerpc: Use
correct procedure call standard for getrandom vDSO call (bug 32440)").
2024-12-15 17:05:25 +01:00
John David Anglin
6f5e1e4e98 hppa: Update libm-test-ulps
Signed-off-by: John David Anglin <dave.anglin@bell.net>
2024-12-15 09:24:53 -05:00
H.J. Lu
20f8c5df56 Revert "Add braces in initializers for GCC 4.9 or older"
This reverts commit 8aa2a9e033.

as not all targets need braces.
2024-12-15 18:49:52 +08:00
H.J. Lu
d4175a62c2 tst-difftime.c: Use "main (void)"
Use "main (void)" instead of "main (void)" to avoid GCC 4.9 warning:

tst-difftime.c:62:1: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
 main ()
 ^
tst-difftime.c: In function ‘main’:
tst-difftime.c:62:1: error: old-style function definition [-Werror=old-style-definition]
cc1: all warnings being treated as errors

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-15 15:05:27 +08:00
Stafford Horne
afac8b1311 or1k: Update libm-test-ulps
Regen to add new functions acospi, asinpi, atan2pi and atanpi.
2024-12-15 00:42:27 +00:00
gfleury
2716bd6b12 htl: move pthread_sigmask into libc.
Message-ID: <20241212220612.782313-3-gfleury@disroot.org>
2024-12-14 23:13:14 +01:00
gfleury
79cb83c7f9 htl: move __pthread_sigstate into libc.
Message-ID: <20241212220612.782313-2-gfleury@disroot.org>
2024-12-14 23:12:01 +01:00
gfleury
dca0807a4d htl: move __pthread_sigstate_destroy into libc.
Message-ID: <20241212220612.782313-1-gfleury@disroot.org>
2024-12-14 23:11:45 +01:00
H.J. Lu
335ba9b6c1 Return EXIT_UNSUPPORTED if __builtin_add_overflow unavailable
Since GCC 4.9 doesn't have __builtin_add_overflow:

In file included from tst-stringtable.c:180:0:
stringtable.c: In function ‘stringtable_finalize’:
stringtable.c:185:7: error: implicit declaration of function ‘__builtin_add_overflow’ [-Werror=implicit-function-declaration]
       else if (__builtin_add_overflow (previous->offset,
       ^

return EXIT_UNSUPPORTED for GCC 4.9 or older.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-15 05:24:19 +08:00
H.J. Lu
65817569ad ifuncmain9.c: Return EXIT_UNSUPPORTED for GCC 5.4 or older
Since elf/ifuncmain9.c fails at run-time when compiled with GCC 5.4 or
older (PR ipa/81128), return EXIT_UNSUPPORTED for GCC 5.4 or older.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 20:15:52 +08:00
H.J. Lu
ed377c952a include/bits/sigstksz.h: Avoid #elif IS_IN (libsupport)
GCC 4.9 issues an error when generating misc/check-installed-headers-c.out:

In file included from ../signal/signal.h:328:0,
                 from ../include/signal.h:2,
                 from ../misc/sys/param.h:28,
                 from ../include/sys/param.h:1,
                 from /tmp/cih_test_e156ZB.c:10:
../include/bits/sigstksz.h:5:7: error: "IS_IN" is not defined [-Werror=undef]
 #elif IS_IN (libsupport)
       ^

Use "#else" instead.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 19:30:16 +08:00
H.J. Lu
c8c35f8c0f regex.h: Avoid #elif __STDC_VERSION__
GCC 4.9 doesn't define __STDC_VERSION__ and issues an error:

In file included from ../include/regex.h:2:0,
                 from ../posix/re_comp.h:23,
                 from ../include/re_comp.h:1,
                 from /tmp/cih_test_7IKTRI.c:10:
../posix/regex.h:650:19: error: "__STDC_VERSION__" is not defined [-Werror=undef]
 # elif 199901L <= __STDC_VERSION__ || defined restrict
                   ^

Use "#else" instead.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 19:29:12 +08:00
H.J. Lu
5e17b4c983 tst-assert-c++.cc: Return EXIT_UNSUPPORTED for GCC 4.9 or older
Since assert/tst-assert-c++.cc fails to compile with GCC 4.9:

./tst-assert-c++.cc: In function ‘constexpr int check_constexpr()’:
./tst-assert-c++.cc:30:1: error: body of constexpr function ‘constexpr int check_constexpr()’ not a return-statement
 }
 ^

return EXIT_UNSUPPORTED for GCC 4.9 or older.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 19:27:45 +08:00
H.J. Lu
8aa2a9e033 Add braces in initializers for GCC 4.9 or older
Add braces to silence GCC 4.9 or older:

getaddrinfo.c: In function ‘gaih_inet’:
getaddrinfo.c:1135:24: error: missing braces around initializer [-Werror=missing-braces]
       / sizeof (struct gaih_typeproto)] = {0};
                        ^

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 19:26:45 +08:00
H.J. Lu
1d40170dd3 Return EXIT_UNSUPPORTED if __builtin_mul_overflow unavailable
Since GCC 4.9 doesn't support __builtin_mul_overflow:

tst-fd_to_filename.c: In function ‘check_ranges’:
tst-fd_to_filename.c:51:3: error: implicit declaration of function ‘__builtin_mul_overflow’ [-Werror=implicit-function-declaration]
   while (!__builtin_mul_overflow (power, base, &power));
   ^
cc1: all warnings being treated as errors

return EXIT_UNSUPPORTED for GCC 4.9 or older.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 19:26:00 +08:00
H.J. Lu
1a41fc44da tst-minsigstksz-1.c: Return EXIT_UNSUPPORTED for GCC 4.9 or older
Since ATOMIC_INT_LOCK_FREE in GCC 4.9 is defined as

 #define ATOMIC_INT_LOCK_FREE                    \
  __atomic_type_lock_free (atomic_int)

GCC 4.9 fails to compile tst-minsigstksz-1.c:

tst-minsigstksz-1.c:45:6: error: missing binary operator before token "("
 # if ATOMIC_INT_LOCK_FREE != 2
      ^

Change tst-minsigstksz-1.c to define TEST_ATOMIC_OPS to 0 for GCC 4.9 or
older.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 19:25:05 +08:00
H.J. Lu
9856784b6a tester.c: Use -Wmemset-transposed-args for GCC 5 or newer
Since GCC 4.9 issues an error:

In file included from inl-tester.c:6:0:
tester.c:58:1: error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]
 DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Wmemset-transposed-args");
 ^

use it for GCC 5 or newer.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 19:23:58 +08:00
H.J. Lu
a1a414b3ce Makefile.in: Add test to check xcheck rule
Add test to check xcheck rule so that TEST_CC and TEST_CXX are used for
"make test".

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 19:18:38 +08:00
H.J. Lu
ad36038c32 Don't use TEST_CXX as CXX for build
Since the C++ compiler is also used to compile links-dso-program.cc in
libsupport, use TEST_CXX to get C++ headers for testing, but don't use
TEST_CXX as CXX for build.

Tested for m68k-linux-gnu-coldfire build and native build on x86-64.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 19:18:33 +08:00
Wilco Dijkstra
ca7d48a80f AArch64: Update libm-test-ulps
Update ulps for acospi, asinpi, atanpi, atan2pi.
2024-12-13 17:14:58 +00:00
Stefan Liebler
97b74cbbb0 s390: Simplify elf_machine_{load_address, dynamic} [BZ #31799]
If an executable is static PIE and has a non-zero load address
(compare to elf/tst-pie-address-static), it segfaults as
elf_machine_load_address() returns 0x0 and elf_machine_dynamic()
returns the run-time instead of link-time address of _DYNAMIC.

Now rely on __ehdr_start and _DYNAMIC as also done on other
architectures.

Checked back to old arch-levels that this approach works fine:
- 31bit: -march=g5
- 64bit: -march=z900

Note, that there is no static-PIE support on 31bit, but this
approach cleans it also up.

Furthermore this cleanup in glibc does not change anything
regarding the first GOT-element as the s390 ABI
(https://github.com/IBM/s390x-abi) explicitely defines:
The doubleword at _GLOBAL_OFFSET_TABLE_[0] is set by the linkage
editor to hold the address of the dynamic structure, referenced
with the symbol _DYNAMIC. This allows a program, such as the dynamic
linker, to find its own dynamic structure without having yet processed
its relocation entries. This is especially important for the dynamic
linker, because it must initialize itself without relying on other
programs to relocate its memory image.
2024-12-13 09:44:38 +01:00
Stafford Horne
e4e49583d9 or1k: Update libm-test-ulps
Pick up new functions cospi, "Imaginary part of csin", exp10m1, exp2m1,
log10p1, log2p1, sinpi and tanpi.
2024-12-13 07:20:32 +00:00
Michael Jeanson
f2acd75b0e nptl: Add <thread_pointer.h> for or1k
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>
Signed-off-by: Stafford Horne <shorne@gmail.com>
2024-12-13 07:20:32 +00:00
Joseph Myers
3374de9038 Implement C23 atan2pi
C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the atan2pi functions (atan2(y,x)/pi).

Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-12 20:57:44 +00:00
H.J. Lu
3ac826b020 Clear CXX and TEST_CXX if C++ link test fails
Since the C++ compiler is used only for testing, use TEST_CXX as the C++
compiler if available.  If C++ link test fails, clear both CXX and
TEST_CXX so that the C++ compiler isn't used for glibc build nor test.

Tested for m68k-linux-gnu-coldfire build and native build on x86-64.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-12 19:51:24 +08:00
H.J. Lu
6bc301672b math: Remove __XXX math functions from installed math.h [BZ #32418]
Since libm doesn't export __XXX math functions, don't declare them in
the installed math.h by adding <bits/mathcalls-macros.h> to declare
__XXX math functions internally for glibc build.  This fixes BZ #32418.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-12 16:17:54 +08:00
Kuan-Wei Chiu
950891b5e7 Optimize bsearch() implementation for performance
Optimize the bsearch() function to improve binary search performance.
Although the code size grew by 8 bytes, the new implementation achieves
a 15% reduction in execution time on my x86 machine, according to the
bench-bsearch benchmark results.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-11 17:04:42 -05:00
Kuan-Wei Chiu
dce846c789 benchtests: Add benchmark test for bsearch
Introduce a benchmark test for the bsearch function to evaluate its
performance.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
2024-12-11 17:04:42 -05:00
Joseph Myers
ffe79c446c Implement C23 atanpi
C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the atanpi functions (atan(x)/pi).

Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-11 21:51:49 +00:00
Peter Bergner
aec85b2557 powerpc64: Fix dl-trampoline.S big-endian / non-ROP build failure
Fix a big-endian / non-ROP build failure caused by commit 4d9a4c02 when
building dl-trampoline.S.

Reported-by: Joseph Myers <josmyers@redhat.com>
2024-12-11 23:15:13 +03:00
Florian Weimer
4f5704ea34 powerpc: Use correct procedure call standard for getrandom vDSO call (bug 32440)
A plain indirect function call does not work on POWER because
success and failure are signaled through a flag register, and
not via the usual Linux negative return value convention.

This has potential security impact, in two ways: the return value
could be out of bounds (EAGAIN is 11 on powerpc6le), and no
random bytes have been written despite the non-error return value.

Fixes commit 461cab1de7 ("linux: Add
support for getrandom vDSO").

Reported-by: Ján Stanček <jstancek@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-12-11 17:49:04 +01:00
H.J. Lu
b79f257533 Add TEST_CC and TEST_CXX support
Support testing glibc build with a different C compiler or a different
C++ compiler with

$ ../glibc-VERSION/configure TEST_CC="gcc-6.4.1" TEST_CXX="g++-6.4.1"

1. Add LIBC_TRY_CC_AND_TEST_CC_OPTION, LIBC_TRY_CC_AND_TEST_CC_COMMAND
and LIBC_TRY_CC_AND_TEST_LINK to test both CC and TEST_CC.
2. Add check and xcheck targets to Makefile.in and override build compiler
options with ones from TEST_CC and TEST_CXX.

Tested on Fedora 41/x86-64:

1. Building with GCC 14.2.1 and testing with GCC 6.4.1 and GCC 11.2.1.
2. Building with GCC 15 and testing with GCC 6.4.1.

Support for GCC versions older than GCC 6.2 may need to change the test
sources.  Other targets may need to update configure.ac under sysdeps and
modify Makefile.in to override target build compiler options.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-11 18:31:00 +08:00