about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* [hurd] Add MTU_DISCOVER valuesSamuel Thibault2023-02-151-0/+20
|
* hurd: Fix unwinding over INTR_MSG_TRAP in shared tooSamuel Thibault2023-02-141-0/+1
| | | | | This follows 63550530d98d ("hurd: Fix unwinding over INTR_MSG_TRAP"), for the shared library case.
* mach: undef ENTRY2Sergey Bugaev2023-02-141-0/+1
| | | | | | | | This macro from Mach headers conflicts with how sysdeps/x86_64/multiarch/strcmp-sse2.S expects it to be defined. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230214173722.428140-3-bugaevc@gmail.com>
* hurd: i386 TLS tweaksSergey Bugaev2023-02-141-13/+35
| | | | | | | | | | | | | | * Micro-optimize TLS access using GCC's native support for gs-based addressing when available; * Just use THREAD_GETMEM and THREAD_SETMEM instead of more inline assembly; * Sync tcbhead_t layout with NPTL, in particular update/fix __private_ss offset; * Statically assert that the two offsets that are a part of ABI are what we expect them to be. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230214173722.428140-2-bugaevc@gmail.com>
* stdio: Do not ignore posix_spawn error on popen (BZ #29016)Adhemerval Zanella2023-02-143-16/+63
| | | | | | To correctly return error in case of default shell is not present. Checked on x86_64-linux-gnu.
* update auto-libm-test-out-hypotPaul Zimmermann2023-02-141-0/+25
| | | | | This change was forgotten in commit cf7ffdd. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* added pair of inputs for hypotf in binary32Paul Zimmermann2023-02-141-0/+2
| | | | | | | | | | | | | | This pair yields an error of 1 ulp in binary32, whereas the current maximal known error for hypotf on x86_64 is zero: Checking hypot with glibc-2.37 hypot 0 -1 -0x1.003222p-20,-0x1.6a2d58p-32 [0.501] 0.500001 0.500000001392678 libm gives 0x1.003224p-20 mpfr gives 0x1.003222p-20 See https://sourceware.org/pipermail/libc-alpha/2023-February/145432.html and https://sourceware.org/pipermail/libc-alpha/2023-February/145442.html Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Naming the parameter of dummy_sa_handlerMahesh Bodapati2023-02-131-1/+1
| | | | | | | | ISO C does not support omitting parameter names in function definitions before C2X,the compiler is giving an error with older versions of gcc and this commit will resolve the test failure "error: parameter name omitted" Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* hurd: Fix tcflag_t and speed_t types on 64-bitSergey Bugaev2023-02-121-2/+2
| | | | | | | | These are supposed to stay 32-bit even on 64-bit systems. This matches BSD and Linux, as well as how these types are already defined in tioctl.defs Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
* htl: Remove ./sysdeps/htl/bits/types/struct___pthread_mutex.hSamuel Thibault2023-02-121-61/+0
| | | | This follows a99155555c21 ("htl: Remove unused files")
* hurd, htl: Add some x86_64-specific codeSergey Bugaev2023-02-123-0/+78
| | | | | Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-12-bugaevc@gmail.com>
* Fix typos in commentsSamuel Thibault2023-02-122-2/+2
|
* htl: Generalize i386 pt-machdep.h to x86Samuel Thibault2023-02-123-1/+3
|
* hurd: Set up the basic tree for x86_64-gnuSergey Bugaev2023-02-126-2/+10
| | | | | | | And move pt-setup.c to the generic x86 tree. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-11-bugaevc@gmail.com>
* mach: Look for mach_i386.defs on x86_64 tooSergey Bugaev2023-02-122-6/+6
| | | | | Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-10-bugaevc@gmail.com>
* htl: Fix semaphore referenceSergey Bugaev2023-02-121-5/+5
| | | | | | | 'sem' is the opaque 'sem_t', 'isem' is the actual 'struct new_sem'. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-6-bugaevc@gmail.com>
* hurd: Fix xattr error valueSergey Bugaev2023-02-121-1/+1
| | | | | | | This does not seem like it is supposed to return negative error codes. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-5-bugaevc@gmail.com>
* mach, hurd: Cast through uintptr_tSergey Bugaev2023-02-126-15/+25
| | | | | | | | | | | | | | | | When casting between a pointer and an integer of a different size, GCC emits a warning (which is escalated to a build failure by -Werror). Indeed, if what you start with is a pointer, which you then cast to a shorter integer and then back again, you're going to cut off some bits of the pointer. But if you start with an integer (such as mach_port_t), then cast it to a longer pointer (void *), and then back to a shorter integer, you are fine. To keep GCC happy, cast through an intermediary uintptr_t, which is always the same size as a pointer. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-4-bugaevc@gmail.com>
* hurd: Use mach_msg_type_number_t where appropriateSergey Bugaev2023-02-127-9/+11
| | | | | | | | | | It has been decided that on x86_64, mach_msg_type_number_t stays 32-bit. Therefore, it's not possible to use mach_msg_type_number_t interchangeably with size_t, in particular this breaks when a pointer to a variable is passed to a MIG routine. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-3-bugaevc@gmail.com>
* hurd: Refactor readlinkat()Sergey Bugaev2023-02-121-23/+32
| | | | | | | | | Make the code flow more linear using early returns where possible. This makes it so much easier to reason about what runs on error / successful code paths. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-2-bugaevc@gmail.com>
* Use __builtin_FILE instead of __FILE__ in assert in C++.Paul Pluzhnikov2023-02-101-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Likewise use __builtin_LINE instead of __LINE__. When building C++, inline functions are required to have the exact same sequence of tokens in every translation unit. But __FILE__ token, when used in a header file, does not necessarily expand to the exact same string literal, and that may cause compilation failure when C++ modules are being used. (It would also cause unpredictable output on assertion failure at runtime, but this rarely matters in practice.) For example, given the following sources: // a.h #include <assert.h> inline void fn () { assert (0); } // a.cc #include "a.h" // b.cc #include "foo/../a.h" preprocessing a.cc will yield a call to __assert_fail("0", "a.h", ...) but b.cc will yield __assert_fail("0", "foo/../a.h", ...)
* hurd: Fix unwinding over INTR_MSG_TRAPSamuel Thibault2023-02-092-13/+3
| | | | | | | | | | We used to use .cfi_adjust_cfa_offset around %esp manipulation asm instructions to fix unwinding, but when building glibc with -fno-omit-frame-pointer this is bogus since in that case %ebp is the CFA and does not move. Instead, let's force -fno-omit-frame-pointer when building intr-msg.c so that %ebp can always be used and no .cfi_adjust_cfa_offset is needed.
* powerpc64: Add the clone3 wrapperAdhemerval Zanella Netto2023-02-092-0/+158
| | | | | | | | | | | | | | | | It follows the internal signature: extern int clone3 (struct clone_args *__cl_args, size_t __size, int (*__func) (void *__arg), void *__arg); The powerpc64 ABI requires an initial stackframe so the child can store/restore the TOC. It is create prior calling clone3 by adjusting the stack size (since kernel will compute the stack as stack plus size). Checked on powerpc64-linux-gnu (power8, kernel 6.0) and powerpc64le-linux-gnu (power9, kernel 4.18). Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com>
* string: Disable stack protector in early static initializationAdhemerval Zanella2023-02-081-0/+2
| | | | | | | For powerpc, strncmp is used on _dl_string_platform issued by __tcb_parse_hwcap_and_convert_at_platform. Reviewed-by: Carlos Eduardo Seo <carlos.seo@linaro.org>
* string: Add libc_hidden_proto for memrchrAdhemerval Zanella2023-02-0815-18/+45
| | | | | | | Although static linker can optimize it to local call, it follows the internal scheme to provide hidden proto and definitions. Reviewed-by: Carlos Eduardo Seo <carlos.seo@linaro.org>
* string: Add libc_hidden_proto for strchrnulAdhemerval Zanella2023-02-0812-12/+35
| | | | | | | Although static linker can optimize it to local call, it follows the internal scheme to provide hidden proto and definitions. Reviewed-by: Carlos Eduardo Seo <carlos.seo@linaro.org>
* elf: Smoke-test ldconfig -p against system /etc/ld.so.cacheFlorian Weimer2023-02-082-0/+83
| | | | | | | | The test is sufficient to detect the ldconfig bug fixed in commit 9fe6f6363886aae6b2b210cae3ed1f5921299083 ("elf: Fix 64 time_t support for installed statically binaries"). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* NEWS: Document CVE-2023-25139.Carlos O'Donell2023-02-071-1/+6
| | | | Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Use 64-bit time_t interfaces in strftime and strptime (bug 30053)Andreas Schwab2023-02-075-2/+62
| | | | Both functions use time_t only internally, so the ABI is not affected.
* C-SKY: Strip hard float abi from hard float feature.quxm2023-02-074-43/+68
| | | | | | | | | | | | | | | | | | | The hard float abi and hard float are different, Hard float abi: Use float register to pass float type arguments. Hard float: Enable the hard float ISA feature. So the with_fp_cond cannot represent these two features. When -mfloat-abi=softfp, the float abi is soft and hard float is enabled. So add 'with_hard_float_abi' in preconfigure and define 'CSKY_HARD_FLOAT_ABI' if float abi is hard, and use 'CSKY_HARD_FLOAT_ABI' to determine dynamic linker because it is what determines compatibility. And with_fp_cond is still needed to tell glibc whether to enable hard floating feature. In addition, use AC_TRY_COMMAND to test gcc to ensure compatibility between different versions of gcc. The original way has a problem that __CSKY_HARD_FLOAT_FPU_SF__ means the target only has single hard float-points ISA, so it's not defined in CPUs like ck810f. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* S390: Influence hwcaps/stfle via GLIBC_TUNABLES.Stefan Liebler2023-02-0712-64/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables the option to influence hwcaps and stfle bits used by the s390 specific ifunc-resolvers. The currently x86-specific tunable glibc.cpu.hwcaps is also used on s390x to achieve the task. In addition the user can also set a CPU arch-level like z13 instead of single HWCAP and STFLE features. Note that the tunable only handles the features which are really used in the IFUNC-resolvers. All others are ignored as the values are only used inside glibc. Thus we can influence: - HWCAP_S390_VXRS (z13) - HWCAP_S390_VXRS_EXT (z14) - HWCAP_S390_VXRS_EXT2 (z15) - STFLE_MIE3 (z15) The influenced hwcap/stfle-bits are stored in the s390-specific cpu_features struct which also contains reserved fields for future usage. The ifunc-resolvers and users of stfle bits are adjusted to use the information from cpu_features struct. On 31bit, the ELF_MACHINE_IRELATIVE macro is now also defined. Otherwise the new ifunc-resolvers segfaults as they depend on the not yet processed_rtld_global_ro@GLIBC_PRIVATE relocation.
* string: Hook up the default implementation on test-strrchrAdhemerval Zanella2023-02-061-14/+24
| | | | | | And remove SIMPLE_STRRCHR, which is not used anywhere. Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* string: Hook up the default implementation on test-memrchrAdhemerval Zanella2023-02-061-0/+7
| | | | Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* string: Hook up the default implementation on test-memchrAdhemerval Zanella2023-02-061-11/+20
| | | | | | And remove SIMPLE_MEMCHR, which is not used anywhere. Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* string: Hook up the default implementation on test-strcpyAdhemerval Zanella2023-02-061-10/+24
| | | | Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* string: Hook up the default implementation on test-stpcpyAdhemerval Zanella2023-02-061-11/+21
| | | | Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* string: Hook up the default implementation on test-strncmpAdhemerval Zanella2023-02-061-0/+16
| | | | Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* string: Hook up the default implementation on test-strcmpAdhemerval Zanella2023-02-061-0/+22
| | | | Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* string: Hook up the default implementation on test-strchrAdhemerval Zanella2023-02-061-15/+38
| | | | | | Also remove the simple_STRCHR, which can be easily replaced. Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* string: Hook up the default implementation on test-strnlenAdhemerval Zanella2023-02-061-11/+24
| | | | | | Also remove the SIMPLE_STRNLEN, which is not used anywhere. Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* string: Hook up the default implementation on test-strlenAdhemerval Zanella2023-02-061-17/+14
| | | | | | | Also remove the simple_STRLEN and builtin_strlen, which are not used anywhere. Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* riscv: Add string-fza.h and string-fzi.hAdhemerval Zanella2023-02-062-0/+146
| | | | | | | | | | It uses the bitmanip extension to optimize index_fist and index_last with clz/ctz (using generic implementation that routes to compiler builtin) and orc.b to check null bytes. Checked the string test on riscv64 user mode. Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* sh: Add string-fzb.hAdhemerval Zanella2023-02-061-0/+55
| | | | | | Use the SH cmp/str on has_{zero,eq,zero_eq}. Checked on sh4-linux-gnu.
* powerpc: Add string-fza.hRichard Henderson2023-02-061-0/+71
| | | | | | | | | | | While ppc has the more important string functions in assembly, there are still a few generic routines used. Use the Power 6 CMPB insn for testing of zeros. Checked on powerpc64le-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* arm: Add string-fza.hRichard Henderson2023-02-061-0/+67
| | | | | | | | | | | While arm has the more important string functions in assembly, there are still a few generic routines used. Use the UQSUB8 insn for testing of zeros. Checked on armv7-linux-gnueabihf Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* alpha: Add string-fza, string-fzb.h, string-fzi.h, and string-shift.hRichard Henderson2023-02-064-0/+218
| | | | | | | | | | | | | While alpha has the more important string functions in assembly, there are still a few for find the generic routines are used. Use the CMPBGE insn, via the builtin, for testing of zeros. Use a simplified expansion of __builtin_ctz when the insn isn't available. Checked on alpha-linux-gnu. Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* hppa: Add string-fza.h, string-fzc.h, and string-fzi.hRichard Henderson2023-02-063-0/+250
| | | | | | | | | | | | | Use UXOR,SBZ to test for a zero byte within a word. While we can get semi-decent code out of asm-goto, we would do slightly better with a compiler builtin. For index_zero et al, sequential testing of bytes is less expensive than any tricks that involve a count-leading-zeros insn that we don't have. Checked on hppa-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* hppa: Add memcopy.hRichard Henderson2023-02-061-0/+42
| | | | | | | | | | | | | | | GCC's combine pass cannot merge (x >> c | y << (32 - c)) into a double-word shift unless (1) the subtract is in the same basic block and (2) the result of the subtract is used exactly once. Neither condition is true for any use of MERGE. By forcing the use of a double-word shift, we not only reduce contention on SAR, but also allow the setting of SAR to be hoisted outside of a loop. Checked on hppa-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* string: Improve generic strrchr with memrchr and strlenAdhemerval Zanella2023-02-061-17/+1
| | | | | | | | | | | Now that both strlen and memrchr have word vectorized implementation, it should be faster to implement strrchr based on memrchr over the string length instead of calling strchr on a loop. Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc-linux-gnu, and powerpc64-linux-gnu by removing the arch-specific assembly implementation and disabling multi-arch (it covers both LE and BE for 64 and 32 bits).
* string: Improve generic memrchrAdhemerval Zanella2023-02-061-157/+39
| | | | | | | | | | | | | | New algorithm read the lastaligned address and mask off the unwanted bytes. The loop now read word-aligned address and check using the has_eq macro. Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc-linux-gnu, and powerpc64-linux-gnu by removing the arch-specific assembly implementation and disabling multi-arch (it covers both LE and BE for 64 and 32 bits). Co-authored-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>