about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* x86: Fix bsearch for compiler that do not define __USE_EXTERN_INLINES azanella/clangAdhemerval Zanella2024-04-181-2/+8
| | | | | | | | | | | | The bsearch is called early during process initialization on Intel platform, before TCB has been set up; and if compiler does not enable __extern_inline it might call the symbol which might use an invalid thread-pointer. Expand the bsearch implementation from stdlib-bsearch.h with a different name. Checked on x86_64-linux-gnu with Intel chip.
* x86_64: update libm test ulpsAdhemerval Zanella2024-04-171-16/+19
| | | | By using clang standard libraries instead of libgcc.
* x86_64: Provide __sfp_handle_exceptions if compiler does notAdhemerval Zanella2024-04-173-1/+70
|
* x86_64: Fix mark-plt configure testAdhemerval Zanella2024-04-172-3/+3
|
* Enable --enable-fortify-source with clangAdhemerval Zanella2024-04-174-6/+26
|
* aarch64: Fix gmon profiling with clangAdhemerval Zanella2024-04-173-12/+23
| | | | | | | | | 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.
* math: Fix potential underflow on ldbl-128 erflAdhemerval Zanella2024-04-171-1/+1
| | | | | | | 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.
* x86_64: update libm test ulpsAdhemerval Zanella2024-04-171-1/+1
| | | | From clang.
* aarch64: update libm test ulpsAdhemerval Zanella2024-04-171-2/+2
| | | | From clang.
* Fix loongarch stpcpy on loaderAdhemerval Zanella2024-04-171-0/+3
|
* x86: Use -mshstk instead of '#pragma GCC target'Adhemerval Zanella2024-04-173-4/+2
|
* i686: Do not build ifunc tests if compiler does not generate supported ↵Adhemerval Zanella2024-04-172-0/+46
| | | | | | | | 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.
* i386: Disable some tests on clangAdhemerval Zanella2024-04-172-0/+9
| | | | | | 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.
* linux: Avoid indirection on operand of type 'void *' for gettimeofdayAdhemerval Zanella2024-04-171-2/+2
| | | | | | | ISO C does not allow and it fixes a clang issue with -Werror,-Wvoid-ptr-dereference. Checked on x86_64-linux-gnu.
* elf: Use volatile to set __rseq_size and __rseq_offsetAdhemerval Zanella2024-04-171-2/+2
| | | | To avoid compiler to optimize them away.
* math: Do not use __builtin_isnan on clangAdhemerval Zanella2024-04-172-1/+5
| | | | It does not handle pseudo normal numbers.
* math: Handle fabsf128 intra PLT for !__USE_EXTERN_INLINESAdhemerval Zanella2024-04-171-0/+3
| | | | | If compiler does not support __USE_EXTERN_INLINES we need to route fabsf128 call to an internal symbol.
* Handle abort call for -fexceptions callAdhemerval Zanella2024-04-172-2/+9
| | | | | | | | 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).
* x86: Use bool for C++ on x86.hAdhemerval Zanella2024-04-172-3/+3
| | | | | Not all compilers might define C99 _Bool type on C++ mode in old standard modes (clang does not define for -std=c++98).
* elf: Do not cast TLS_DTV_UNALLOCATED to voidAdhemerval Zanella2024-04-175-7/+4
| | | | | | | 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).
* x86: Use inhibit_stack_protector on tst-ifunc-isa.hAdhemerval Zanella2024-04-171-2/+3
|
* linux: Adequate tst-clone3 to c11 atomicsAdhemerval Zanella2024-04-172-10/+6
|
* dirent: Remove variable lenght array structure for tst-getdents64.cAdhemerval Zanella2024-04-171-11/+5
| | | | | | | | | | 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]; ^
* math: Fix test-totalorderl-ldbl-96 exponent settingAdhemerval Zanella2024-04-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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); \ ^ ~~~~~
* And defines to __attribute__ (__noclone__) iff compiler supports it.Adhemerval Zanella2024-04-1717-30/+30
|
* x86: Use -mfpmath=387 iff compiler supports itAdhemerval Zanella2024-04-173-1/+38
|
* x86_64: Disable libmvec tests if compiler does not support attribute '__simd__'Adhemerval Zanella2024-04-173-0/+93
| | | | clang ignore the attribute, which is required by libmvec tests.
* x86: Fix test-double-vlen include-nextAdhemerval Zanella2024-04-174-4/+4
| | | | | | | | | | | | 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.
* riscv: Suppress clang confstr -Wignored-attributes feupdateenvAdhemerval Zanella2024-04-171-0/+6
| | | | | | 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.
* riscv: Do not use cfi_label when building with clangAdhemerval Zanella2024-04-174-3/+9
| | | | | | | 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
* arm: Fix clang multi-arch build with ld.bfdAdhemerval Zanella2024-04-175-13/+8
| | | | | | | | | | | | 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.
* arm: Use vmov.i32 instead of vmov on neon memchrAdhemerval Zanella2024-04-171-2/+2
| | | | | | clang fails with: error: invalid instruction
* aarch64: Use 64-bit variable to access the special registersAdhemerval Zanella2024-04-175-15/+29
| | | | | | | | | | | 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.
* i386: sfp-machine.h: Do no use asm input cast for clangAdhemerval Zanella2024-04-171-18/+26
| | | | | | | | | | | | | 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
* i386: Move ___tls_get_addr hidden proto before its first usageAdhemerval Zanella2024-04-171-2/+2
| | | | | clang can not apply asm redirections to functions after these functions are used for the first time.
* i386: Disable math_opt_barrier and math_force_eval for clangAdhemerval Zanella2024-04-171-1/+1
| | | | It triggers an ICE with clang while building round_and_return.
* x86: Add inhibit_stack_protector on ifunc handlersAdhemerval Zanella2024-04-1728-6/+40
|
* x86: math: Avoid the use of __libgcc_cmp_return__ for __gcc_CMPtypeAdhemerval Zanella2024-04-171-2/+11
|
* x86: Define __HAVE_FLOAT128 for Clang and use __builtin_*f128 code pathFangrui Song2024-04-171-7/+14
| | | | | | 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.
* x86: Use -msse2avx iff compiler supports itAdhemerval Zanella2024-04-173-7/+40
|
* posix: Use unsigned to check for _POSIX_VDISABLEAdhemerval Zanella2024-04-172-2/+2
| | | | | | | | | | 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 ~~~~~~~~~~~~~~~ ^ ~~
* string: Use asm alias instead of symbol redirections for stpcpy and mempcpyAdhemerval Zanella2024-04-172-0/+6
| | | | | | | | | | | | | | | | 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.
* math: Use -fexcess-precision=standard iff compiler supports itAdhemerval Zanella2024-04-171-2/+2
|
* math: Suppress clang -Wincompatible-library-redeclaration on s_llroundAdhemerval Zanella2024-04-171-0/+3
| | | | | | | | | | | | 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)'
* math: use fabs on __ieee754_lgamma_rAdhemerval Zanella2024-04-171-1/+1
|
* Suppress -Wmaybe-uninitialized only for gccAdhemerval Zanella2024-04-1720-21/+20
| | | | The warning is not supported by clang.
* powerpc: Fix ld.so address determination for PCREL mode (bug 31640)Florian Weimer2024-04-141-0/+19
| | | | | | | | This seems to have stopped working with some GCC 14 versions, which clobber r2. With other compilers, the kernel-provided r2 value is still available at this point. Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
* Revert "x86_64: Suppress false positive valgrind error"Florian Weimer2024-04-132-24/+0
| | | | | | | | | | | | | | This reverts commit a1735e0aa858f0c8b15e5ee9975bff4279423680. The test failure is a real valgrind bug that needs to be fixed before valgrind is usable with a glibc that has been built with CC="gcc -march=x86-64-v3". The proposed valgrind patch teaches valgrind to replace ld.so strcmp with an unoptimized scalar implementation, thus avoiding any AVX2-related problems. Valgrind bug: <https://bugs.kde.org/show_bug.cgi?id=485487> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* posix: Sync tempname with gnulibAdhemerval Zanella2024-04-101-114/+59
| | | | | | | | | | | | | | | | | | | | | | | | | The gnulib version contains an important change (9ce573cde), which fixes some problems with multithreading, entropy loss, and ASLR leak nfo. It also fixes an issue where getrandom is not being used on some new files generation (only for __GT_NOCREATE on first try). The 044bf893ac removed __path_search, which is now moved to another gnulib shared files (stdio-common/tmpdir.{c,h}). Tthis patch also fixes direxists to use __stat64_time64 instead of __xstat64, and move the include of pathmax.h for !_LIBC (since it is not used by glibc). The license is also changed from GPL 3.0 to 2.1, with permission from the authors (Bruno Haible and Paul Eggert). The sync also removed the clock fallback, since clock_gettime with CLOCK_REALTIME is expected to always succeed. It syncs with gnulib commit 323834962817af7b115187e8c9a833437f8d20ec. Checked on x86_64-linux-gnu. Co-authored-by: Bruno Haible <bruno@clisp.org> Co-authored-by: Paul Eggert <eggert@cs.ucla.edu> Reviewed-by: Bruno Haible <bruno@clisp.org>
* aarch64: Enhanced CPU diagnostics for ld.soFlorian Weimer2024-04-081-0/+84
| | | | | | | This prints some information from struct cpu_features, and the midr_el1 and dczid_el0 system register contents on every CPU. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>