aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-12-22htl: move pthread_cond_init into libc.gfleury11-15/+13
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241219203727.669825-2-gfleury@disroot.org>
2024-12-22assert/test-assert-2.c: Include <unistd.h>Samuel Thibault1-0/+1
For _exit declaration.
2024-12-23stdio-common: Suppress Clang warnings on scanf13.cH.J. Lu2-0/+11
Suppress Clang warnings on stdio-common/scanf13.c: 1. Before this commit: scanf13.c:43:17: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 43 | "A%mS%10mls%4ml[bcd]%4mCB", &lsp1, &lsp2, &lsp3, &lsp4) != 4) | ~~~~^ scanf13.c:43:22: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 43 | "A%mS%10mls%4ml[bcd]%4mCB", &lsp1, &lsp2, &lsp3, &lsp4) != 4) | ~~~~^ scanf13.c:43:50: error: data argument not used by format string [-Werror,-Wformat-extra-args] 43 | "A%mS%10mls%4ml[bcd]%4mCB", &lsp1, &lsp2, &lsp3, &lsp4) != 4) | ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ scanf13.c:145:27: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 145 | if (sscanf (buf, "%2048mls%mlc", &lsp3, &lsp4) != 2) | ~~~~~~^ scanf13.c:145:31: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 145 | if (sscanf (buf, "%2048mls%mlc", &lsp3, &lsp4) != 2) | ~~~^ scanf13.c:145:43: error: data argument not used by format string [-Werror,-Wformat-extra-args] 145 | if (sscanf (buf, "%2048mls%mlc", &lsp3, &lsp4) != 2) | ~~~~~~~~~~~~~~ ^ scanf13.c:161:31: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 161 | if (sscanf (buf, "%4mC%1500ml[dr/]%548ml[abc/d]%3mlc", | ~~~~~~^ scanf13.c:161:42: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 161 | if (sscanf (buf, "%4mC%1500ml[dr/]%548ml[abc/d]%3mlc", | ~~~~~~~~~~^ scanf13.c:161:53: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 161 | if (sscanf (buf, "%4mC%1500ml[dr/]%548ml[abc/d]%3mlc", | ~~~~~~~~~~^ scanf13.c:162:15: error: data argument not used by format string [-Werror,-Wformat-extra-args] 161 | if (sscanf (buf, "%4mC%1500ml[dr/]%548ml[abc/d]%3mlc", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 162 | &lsp1, &lsp2, &lsp3, &lsp4) != 4) | ^ 10 errors generated. 2. With DIAG_IGNORE_NEEDS_COMMENT_CLANG changes in stdio-common/scanf13.c: scanf13.c:28:40: error: 'sscanf' may overflow; destination buffer in argument 4 has size 8, but the corresponding specifier may require size 11 [-Werror,-Wfortify-source] 28 | "A%ms%10ms%4m[bcd]%4mcB", &sp1, &sp2, &sp3, &sp4) != 4) | ^ scanf13.c:94:34: error: 'sscanf' may overflow; destination buffer in argument 3 has size 8, but the corresponding specifier may require size 2049 [-Werror,-Wfortify-source] 94 | if (sscanf (buf, "%2048ms%mc", &sp3, &sp4) != 2) | ^ scanf13.c:110:61: error: 'sscanf' may overflow; destination buffer in argument 4 has size 8, but the corresponding specifier may require size 1501 [-Werror,-Wfortify-source] 110 | if (sscanf (buf, "%4mc%1500m[dr/]%548m[abc/d]%3mc", &sp1, &sp2, &sp3, &sp4) | ^ scanf13.c:110:67: error: 'sscanf' may overflow; destination buffer in argument 5 has size 8, but the corresponding specifier may require size 549 [-Werror,-Wfortify-source] 110 | if (sscanf (buf, "%4mc%1500m[dr/]%548m[abc/d]%3mc", &sp1, &sp2, &sp3, &sp4) | ^ 4 errors generated. Co-Authored-By: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-23string: Suppress Clang warnings on tester.cH.J. Lu3-2/+49
Add a configure check for -Wno-fortify-source to suppress Clang warnings on string/tester.c, like: tester.c:385:10: error: 'strncat' size argument is too large; destination buffer has size 50, but size argument is 99 [-Werror,-Wfortify-source] 385 | check (strncat (one, "lmn", 99) == one, 1); /* Returned value. */ Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-23Add a reference to Clang /usr/include/tgmath.h dependencyH.J. Lu1-0/+1
The fake Clang /usr/include/tgmath.h dependency bug is: https://github.com/llvm/llvm-project/issues/120891 Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-23Suppress Clang -Wimplicit-fallthrough warningsH.J. Lu2-0/+8
Since Clang doesn't properly handle /* FALLTHROUGH */ in elf/tst-align2.c nor /* fall through */ in misc/tst-tsearch.c tst-align2.c:100:9: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] 100 | case 'A': | ^ tst-align2.c:100:9: note: insert '__attribute__((fallthrough));' to silence this warning 100 | case 'A': | ^ | __attribute__((fallthrough)); tst-align2.c:100:9: note: insert 'break;' to avoid fall-through 100 | case 'A': | ^ | break; suppress them when compiled with Clang. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-23stdio: Suppress -Wformat only for gcc in tst-sprintf-errno.cAdhemerval Zanella1-1/+1
Since Clang doesn't support DIAG_IGNORE_NEEDS_COMMENT (11, "-Wformat="); and for unknown reasons, it doesn't warn the %#m specifier, suppress -Wformat only for gcc in tst-sprintf-errno.c. Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-23include/sys/cdefs.h: Add __attribute_optimization_barrier__Adhemerval Zanella45-101/+112
Add __attribute_optimization_barrier__ to disable inlining and cloning on a function. For Clang, expand it to __attribute__ ((optnone)) Otherwise, expand it to __attribute__ ((noinline, clone)) Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-23assert: Use __writev in assert.c [BZ #32492]DJ Delorie1-1/+1
Replace writev with __writev in assert/assert.c. This fixes [BZ #32492]. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-23Fix build without stack protector [BZ #32494]H.J. Lu3-4/+2
Without stack protector, inhibit_stack_protector is undefined during build: In file included from <command-line>: ./../include/libc-symbols.h:665:3: error: expected ';' before '__typeof' 665 | __typeof (type_name) *name##_ifunc (__VA_ARGS__) \ | ^~~~~~~~ ./../include/libc-symbols.h:676:3: note: in expansion of macro '__ifunc_resolver' 676 | __ifunc_resolver (type_name, name, expr, init, static, __VA_ARGS__) | ^~~~~~~~~~~~~~~~ ./../include/libc-symbols.h:703:3: note: in expansion of macro '__ifunc_args' 703 | __ifunc_args (type_name, name, expr, init, arg) | ^~~~~~~~~~~~ ./../include/libc-symbols.h:790:3: note: in expansion of macro '__ifunc' 790 | __ifunc (redirected_name, name, expr, void, INIT_ARCH) | ^~~~~~~ ../sysdeps/x86_64/multiarch/memchr.c:29:1: note: in expansion of macro 'libc_ifunc_redirected' 29 | libc_ifunc_redirected (__redirect_memchr, memchr, IFUNC_SELECTOR ()); | ^~~~~~~~~~~~~~~~~~~~~ 1. Fix a typo in include/libc-symbols.h to define inhibit_stack_protector for build. 2. Don't include <config.h> in include/libc-symbols.h since it has been included in include/libc-misc.h. 3. Change #include "libc-misc.h" to #include <libc-misc.h> in string/test-string.h. This fixes BZ #32494. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-23Check if TEST_CC supports -Wno-restrict before using itAdhemerval Zanella3-2/+48
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>
2024-12-22hppa: Simplify handling of sanity check errors in clone.S.John David Anglin1-6/+5
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>
2024-12-22hppa: add cacheflush() syscall wrapperJohn David Anglin5-0/+46
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.
2024-12-22hppa: Update libm-test-ulpsJohn David Anglin1-5/+1
Signed-off-by: John David Anglin <dave.anglin@bell.net>
2024-12-22hurd: make mprotect translate KERN_PROTECTION_FAILURE to EACCESSSamuel Thibault1-0/+3
Suggested-by: Sergey Bugaev <bugaevc@gmail.com>
2024-12-22Compile tst-deadline.c with -Wno-ignored-attributes for ClangH.J. Lu2-1/+5
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>
2024-12-22malloc: Only enable -Waggressive-loop-optimizations suppression for gccAdhemerval Zanella1-2/+2
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22Suppress -Wmaybe-uninitialized only for GCCH.J. Lu1-1/+1
Clang doesn't support -Wmaybe-uninitialized. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22Suppress Clang -Wgnu-folding-constant warningsH.J. Lu2-0/+8
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>
2024-12-22stdio: Suppress clang warnings for tst-vprintf-width-i18n.cAdhemerval Zanella1-0/+8
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-22stdio: Fix clang warnings on testsAdhemerval Zanella1-0/+5
clang does not support 'I' specifier and handles it as a 'length modifier'. Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22math: Fix clang warnings for math/test-tgmath-ret.cAdhemerval Zanella1-0/+6
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-22Suppress Clang warning on adding an integer to a stringAdhemerval Zanella4-0/+16
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-22stdio: Suppress %Z format for clangAdhemerval Zanella5-0/+35
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-22stdio: Suppress clang warnings for tst-unlockedio.cAdhemerval Zanella1-0/+7
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-22localedata: Fix clang warnings on testsAdhemerval Zanella1-1/+7
clang does not support 'I' specifier and handles it as a 'length modifier'. Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22elf: Suppress clang warning on tst-unique4Adhemerval Zanella2-1/+7
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-22elf: Enable tst-dlopen-nodelete-reloc if TEST_CXX supports STB_GNU_UNIQUEH.J. Lu3-7/+108
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-22elf: Check PDE load address with non-empty text sectionH.J. Lu2-0/+2
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-22x86: Define __HAVE_FLOAT128 for Clang and use __builtin_*f128 code pathFangrui Song1-8/+16
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-22Add clang specific warning suppression macrosAdhemerval Zanella1-0/+22
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-22x86: Use inhibit_stack_protector on tst-ifunc-isa.hAdhemerval Zanella1-2/+3
Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22elf: Compile test modules with -fsemantic-interpositionH.J. Lu4-0/+67
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-22tst-printf-bz18872.sh: stdio: Use __attribute__ ((optnone)) for ClangAdhemerval Zanella1-0/+4
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-22Handle pragma GCC optimize for clangAdhemerval Zanella2-2/+10
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22dirent: Remove variable length array structure for tst-getdents64.cAdhemerval Zanella1-11/+7
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-22Add include/libc-misc.hH.J. Lu8-67/+203
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-22Add test-config-cflags-float-store for -ffloat-storeH.J. Lu3-2/+46
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-22localedata: Use hexadecimal character escape on testsAdhemerval Zanella11-36/+39
Instead of latin1 ones. Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22tst-atomic.c: Mark as UNSUPPORTED when compiled with ClangH.J. Lu1-0/+10
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-22Enable execstack tests only if compiler supports trampolineH.J. Lu4-2/+80
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-22x86: Include test-flt-eval-method-387 if -mfpmath=387 worksH.J. Lu3-1/+47
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-22x86-64: Disable libmvec ABI test for ClangH.J. Lu1-0/+4
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-22Remove Clang /usr/include/tgmath.h dependencyH.J. Lu1-1/+5
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-22Don't redefine INFINITY nor NANH.J. Lu1-8/+12
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-22Check Clang 12 for __builtin_complexH.J. Lu1-1/+2
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-22Use -finput-charset=ascii only if supportedH.J. Lu6-6/+126
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-22conform: Use -dD instead of -dN on compiler invocationAdhemerval Zanella1-3/+3
clang does not support -dN. Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22math: Exclude tgmath3-macro-tests for ClangH.J. Lu1-0/+5
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-22Check if -mamx-tile works for testingH.J. Lu2-63/+32
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>