aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
AgeCommit message (Collapse)Author
2024-02-09x86_64: Fix mark-plt configure testazanella/clangAdhemerval Zanella
2024-02-09Enable --enable-fortify-source with clangAdhemerval Zanella
2024-02-09aarch64: Fix gmon profiling with clangAdhemerval Zanella
Different than gcc, clang does not pass the LR value as the first argument. To avoid requiring change clang generated code (since same ABI is used on other OS, like FreeBSD), use a similar strategy as x86_64 to obtain both the frompc and the selfpc from the stack frame. Checked on aarch64-linux-gnu.
2024-02-09math: Fix potential underflow on ldbl-128 erflAdhemerval Zanella
The multiplication is only required if the branch is taken, and the compiler might not optimize it away. Checked on aarch64-linux-gnu with gcc and clang.
2024-02-09x86_64: update libm test ulpsAdhemerval Zanella
From clang.
2024-02-09aarch64: update libm test ulpsAdhemerval Zanella
From clang.
2024-02-09Fix loongarch stpcpy on loaderAdhemerval Zanella
2024-02-09x86: Use -mshstk instead of '#pragma GCC target'Adhemerval Zanella
2024-02-09i686: Do not build ifunc tests if compiler does not generate supported ↵Adhemerval Zanella
relocations clang with --target i668 might not produce supported relocations that ld.bfd can use for -static-pie without -fPIC, which are used on some tests. Disable them for now.
2024-02-09i386: Disable some tests on clangAdhemerval Zanella
clang generated R_I386_PC32 instead of R_386_PLT32 for static ifoo calls, which triggers an ld issues where it can not link non-PIC and PIC objects. This seems to be a clang bug.
2024-02-09linux: Avoid indirection on operand of type 'void *' for gettimeofdayAdhemerval Zanella
ISO C does not allow and it fixes a clang issue with -Werror,-Wvoid-ptr-dereference. Checked on x86_64-linux-gnu.
2024-02-09elf: Use volatile to set __rseq_size and __rseq_offsetAdhemerval Zanella
To avoid compiler to optimize them away.
2024-02-09math: Do not use __builtin_isnan on clangAdhemerval Zanella
It does not handle pseudo normal numbers.
2024-02-09math: Handle fabsf128 intra PLT for !__USE_EXTERN_INLINESAdhemerval Zanella
If compiler does not support __USE_EXTERN_INLINES we need to route fabsf128 call to an internal symbol.
2024-02-09Handle abort call for -fexceptions callAdhemerval Zanella
clang might generate an abort call when cleanup functions (set by __attribute__ ((cleanup)) calls functions not marked as nothrow. We can mitigate by marking some internal functions as __THROW, but it is not possible for functions that issue used-provided callbacks (for instance pthread_once).
2024-02-09x86: Use bool for C++ on x86.hAdhemerval Zanella
Not all compilers might define C99 _Bool type on C++ mode in old standard modes (clang does not define for -std=c++98).
2024-02-09elf: Do not cast TLS_DTV_UNALLOCATED to voidAdhemerval Zanella
The test-as-const-tlsdesc uses _Static_assert to verify the constants generated and clang warns the expression is not an integral constant expression because the cast performs a conversion (and it is no allowed).
2024-02-09x86: Use inhibit_stack_protector on tst-ifunc-isa.hAdhemerval Zanella
2024-02-09linux: Adequate tst-clone3 to c11 atomicsAdhemerval Zanella
2024-02-09dirent: Remove variable lenght array structure for tst-getdents64.cAdhemerval Zanella
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]; ^
2024-02-09math: Fix test-totalorderl-ldbl-96 exponent settingAdhemerval Zanella
Clang issues the following warning: ../sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c:49:2: error: implicit truncation from 'int' to bit-field changes value from 65535 to -1 [-Werror,-Wbitfield-constant-conversion] SET_LDOUBLE_WORDS (ldnx, 0xffff, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../sysdeps/x86_64/fpu/math_ldbl.h:56:28: note: expanded from macro 'SET_LDOUBLE_WORDS' iw_u.parts.sign_exponent = (exp); \ ^ ~~~~~ ../sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c:51:2: error: implicit truncation from 'int' to bit-field changes value from 65535 to -1 [-Werror,-Wbitfield-constant-conversion] SET_LDOUBLE_WORDS (ldny, 0xffff, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../sysdeps/x86_64/fpu/math_ldbl.h:56:28: note: expanded from macro 'SET_LDOUBLE_WORDS' iw_u.parts.sign_exponent = (exp); \ ^ ~~~~~
2024-02-09And defines to __attribute__ (__noclone__) iff compiler supports it.Adhemerval Zanella
2024-02-09x86: Use -mfpmath=387 iff compiler supports itAdhemerval Zanella
2024-02-09x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'Adhemerval Zanella
clang ignore the attribute, which is required by libmvec tests.
2024-02-09x86: Fix test-double-vlen include-nextAdhemerval Zanella
clang issues: ../sysdeps/x86_64/fpu/test-double-vlen4.h:20: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] Instead of suppress the warning, it is simpler to just include the absolute path instead.
2024-02-09riscv: Suppress clang confstr -Wignored-attributes feupdateenvAdhemerval Zanella
clang warns that the alias will be always resolve to __GI___feupdateenv even if weak definition of __GI_feupdateenv is overridden, which is really the intention.
2024-02-09riscv: Do not use cfi_label when building with clangAdhemerval Zanella
The .cfi_label is a gas extension not supported by clang. From a ziglang discussion [1], it seems that it is not really required. [1] https://github.com/ziglang/zig/issues/3340
2024-02-09arm: Fix clang multi-arch build with ld.bfdAdhemerval Zanella
clang binds autogenerated memcpy/memset/memchr calls to the hidden internal symbols, different than gcc that binds without hidden attribute. And this triggers an linker issue with bfd: ld: BFD (GNU Binutils for Ubuntu) 2.38 assertion fail ../../bfd/elf32-arm.c:4286 Similar to other architectures, bind internal memcpy and memcpy symbols to the generic interface instead.
2024-02-09arm: Use vmov.i32 instead of vmov on neon memchrAdhemerval Zanella
clang fails with: error: invalid instruction
2024-02-09aarch64: Use 64-bit variable to access the special registersAdhemerval Zanella
clang issues: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths] while tryng to use 32 bit variables with 'mrs' to get/set the fpsr, dczid_el0, and ctr. Since all of 64 bit register, use the expected variable size.
2024-02-09i386: sfp-machine.h: Do no use asm input cast for clangAdhemerval Zanella
clang by default rejects the input casts with: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions And even with -fheinous-gnu-extensions clang still throws an warning and also states that this option might be removed in the future. For gcc the cast are still useful [1] as type-checking. [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581722.html
2024-02-09i386: Move ___tls_get_addr hidden proto before its first usageAdhemerval Zanella
clang can not apply asm redirections to functions after these functions are used for the first time.
2024-02-09i386: Disable math_opt_barrier and math_force_eval for clangAdhemerval Zanella
It triggers an ICE with clang while building round_and_return.
2024-02-09x86: Add inhibit_stack_protector on ifunc handlersAdhemerval Zanella
2024-02-09x86: math: Avoid the use of __libgcc_cmp_return__ for __gcc_CMPtypeAdhemerval Zanella
2024-02-09x86: Remove __strstr_generic prototypeAdhemerval Zanella
This is not really require and clang throws a attribute declaration must precede definition: ../sysdeps/x86_64/multiarch/strstr.c:37:54: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] extern __typeof (__redirect_strstr) __strstr_generic attribute_hidden; ^ ./../include/libc-symbols.h:423:43: note: expanded from macro 'attribute_hidden' # define attribute_hidden __attribute__ ((visibility ("hidden"))) ^ ../string/strstr.c:76:1: note: previous definition is here STRSTR (const char *haystack, const char *needle) ^ ../sysdeps/x86_64/multiarch/strstr.c:27:16: note: expanded from macro 'STRSTR' #define STRSTR __strstr_generic ^ 1 error generated.
2024-02-09x86: Define __HAVE_FLOAT128 for Clang and use __builtin_*f128 code pathFangrui Song
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.
2024-02-09x86: Use -msse2avx iff compiler supports itAdhemerval Zanella
2024-02-09posix: Use unsigned to check for _POSIX_VDISABLEAdhemerval Zanella
Clang warns: ../sysdeps/posix/fpathconf.c:118:21: error: right side of operator converted from negative value to unsigned: -1 to 18446744073709551615 [-Werror] #if _POSIX_VDISABLE == -1 ~~~~~~~~~~~~~~~ ^ ~~
2024-02-09string: Use asm alias instead of symbol redirections for stpcpy and mempcpyAdhemerval Zanella
Commit 939da411433 added symbols redirections to handle ISO C namespace, however some compiler does not support to redeclare the function prototype. Moving these defintions to exported header it not a good practice (it exposes a internal implementation and it would require to add macros to define it only internally). Instead this patch replaces the symbol redirections by direct asm aliases, as done to handle libcall generation done by compiler on some loop optimizations. The only issue is sparc binutils generates an extra __mempcpy plt not called anywhere in the code, which indicates a binutils issue (this is added in the localplt.data for now). Checked on all affected ABIs.
2024-02-09math: Use -fexcess-precision=standard iff compiler supports itAdhemerval Zanella
2024-02-09configure: Use -Wno-ignored-attributes if compiler warns about multiple aliasesAdhemerval Zanella
clang emits an warning when a double alias redirection is used, to warn the the original symbol will be used even when weak definition is overridden. Howerver, this is a common pattern for weak_alias, where multiple alias are set to same symbol.
2024-02-09math: Suppress clang -Wincompatible-library-redeclaration on s_llroundAdhemerval Zanella
Clang issues: ../sysdeps/ieee754/dbl-64/s_llround.c:83:30: error: incompatible redeclaration of library function 'lround' [-Werror,-Wincompatible-library-redeclaration] libm_alias_double (__lround, lround) ^ ../sysdeps/ieee754/dbl-64/s_llround.c:83:30: note: 'lround' is a builtin with type 'long (double)'
2024-02-09math: use fabs on __ieee754_lgamma_rAdhemerval Zanella
2024-02-09Suppress -Wmaybe-uninitialized only for gccAdhemerval Zanella
The warning is not supported by clang.
2024-02-08Add SOL_VSOCK from Linux 6.7 to bits/socket.hJoseph Myers
Linux 6.7 adds a constant SOL_VSOCK (recall that various constants in include/linux/socket.h are in fact part of the kernel-userspace API despite that not being a uapi header). Add it to glibc's bits/socket.h. Tested for x86_64.
2024-02-08Add new AArch64 HWCAP2 definitions from Linux 6.7 to bits/hwcap.hJoseph Myers
Linux 6.7 adds three new HWCAP2_* values for AArch64; add them to bits/hwcap.h in glibc.
2024-02-05arm: Remove wrong ldr from _dl_start_user (BZ 31339)Adhemerval Zanella
The commit 49d877a80b29d3002887b084eec6676d9f5fec18 (arm: Remove _dl_skip_args usage) removed the _SKIP_ARGS literal, which was previously loader to r4 on loader _start. However, the cleanup did not remove the following 'ldr r4, [sl, r4]' on _dl_start_user, used to check to skip the arguments after ld self-relocations. In my testing, the kernel initially set r4 to 0, which makes the ldr instruction just read the _GLOBAL_OFFSET_TABLE_. However, since r4 is a callee-saved register; a different runtime might not zero initialize it and thus trigger an invalid memory access. Checked on arm-linux-gnu. Reported-by: Adrian Ratiu <adrian.ratiu@collabora.com> Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2024-02-05LoongArch: Use builtins for ffs and ffsllXi Ruoyao
On LoongArch GCC compiles __builtin_ffs{,ll} to basically `(x ? __builtin_ctz (x) : -1) + 1`. Since a hardware ctz instruction is available, this is much better than the table-driven generic implementation. Tested on loongarch64. Signed-off-by: Xi Ruoyao <xry111@xry111.site> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-02-05Remove sysdeps/ia64/math-use-builtins-ffs.hXi Ruoyao
IA64 is gone. Signed-off-by: Xi Ruoyao <xry111@xry111.site>