From 5702d67af60602bdfe955c4ccfa1b13238d36516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 31 Jan 2025 14:30:19 +0100 Subject: [PATCH] glibc: Update source files to 2.41. --- lib/libc/glibc/LICENSES | 64 +++---- lib/libc/glibc/bits/byteswap.h | 2 +- lib/libc/glibc/bits/floatn-common.h | 2 +- lib/libc/glibc/bits/libc-header-start.h | 2 +- lib/libc/glibc/bits/long-double.h | 2 +- lib/libc/glibc/bits/select.h | 2 +- lib/libc/glibc/bits/signum-generic.h | 2 +- lib/libc/glibc/bits/stat.h | 2 +- lib/libc/glibc/bits/stdint-intn.h | 2 +- lib/libc/glibc/bits/stdlib-bsearch.h | 22 +-- lib/libc/glibc/bits/time64.h | 2 +- lib/libc/glibc/bits/timesize.h | 2 +- .../glibc/bits/types/struct_sched_param.h | 2 +- lib/libc/glibc/bits/typesizes.h | 2 +- lib/libc/glibc/bits/uintn-identity.h | 2 +- lib/libc/glibc/bits/waitflags.h | 2 +- lib/libc/glibc/bits/waitstatus.h | 2 +- lib/libc/glibc/csu/errno.c | 2 +- lib/libc/glibc/csu/init.c | 2 +- lib/libc/glibc/debug/stack_chk_fail_local.c | 2 +- lib/libc/glibc/elf/elf.h | 5 +- lib/libc/glibc/include/errno.h | 2 +- lib/libc/glibc/include/libc-misc.h | 67 +++++++ lib/libc/glibc/include/libc-pointer-arith.h | 2 +- lib/libc/glibc/include/libc-symbols.h | 25 +-- lib/libc/glibc/include/stap-probe.h | 2 +- lib/libc/glibc/include/stdlib.h | 7 + lib/libc/glibc/include/sys/cdefs.h | 7 + lib/libc/glibc/io/bits/statx.h | 2 +- lib/libc/glibc/io/fcntl.h | 2 +- lib/libc/glibc/io/mknod.c | 2 +- lib/libc/glibc/io/sys/stat.h | 18 +- lib/libc/glibc/locale/bits/types/__locale_t.h | 2 +- lib/libc/glibc/locale/bits/types/locale_t.h | 2 +- lib/libc/glibc/misc/sys/cdefs.h | 2 +- lib/libc/glibc/misc/sys/select.h | 2 +- lib/libc/glibc/posix/bits/cpu-set.h | 2 +- lib/libc/glibc/posix/bits/types.h | 3 +- lib/libc/glibc/posix/sys/types.h | 2 +- lib/libc/glibc/signal/signal.h | 2 +- lib/libc/glibc/stdlib/alloca.h | 2 +- lib/libc/glibc/stdlib/bits/stdlib-float.h | 2 +- lib/libc/glibc/stdlib/errno.h | 2 +- lib/libc/glibc/stdlib/exit.h | 2 +- lib/libc/glibc/stdlib/stdlib.h | 4 +- lib/libc/glibc/string/bits/endian.h | 2 +- lib/libc/glibc/string/endian.h | 2 +- .../aarch64/nptl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/aarch64/start.S | 2 +- lib/libc/glibc/sysdeps/aarch64/sysdep.h | 14 +- lib/libc/glibc/sysdeps/arc/bits/endianness.h | 8 +- lib/libc/glibc/sysdeps/arc/start.S | 2 +- lib/libc/glibc/sysdeps/arc/sysdep.h | 2 +- lib/libc/glibc/sysdeps/arm/arm-features.h | 2 +- lib/libc/glibc/sysdeps/arm/start.S | 2 +- lib/libc/glibc/sysdeps/arm/sysdep.h | 2 +- lib/libc/glibc/sysdeps/csky/abiv2/start.S | 2 +- lib/libc/glibc/sysdeps/csky/sysdep.h | 2 +- lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h | 2 +- lib/libc/glibc/sysdeps/generic/dl-sysdep.h | 2 +- lib/libc/glibc/sysdeps/generic/dwarf2.h | 2 +- lib/libc/glibc/sysdeps/generic/libc-lock.h | 2 +- lib/libc/glibc/sysdeps/generic/libc-symver.h | 2 +- .../glibc/sysdeps/generic/single-thread.h | 2 +- lib/libc/glibc/sysdeps/generic/sysdep.h | 2 +- lib/libc/glibc/sysdeps/generic/tls.h | 2 +- lib/libc/glibc/sysdeps/htl/bits/pthread.h | 2 +- .../sysdeps/htl/bits/thread-shared-types.h | 2 +- lib/libc/glibc/sysdeps/htl/libc-lockP.h | 11 +- lib/libc/glibc/sysdeps/htl/pthread.h | 2 +- .../sysdeps/i386/htl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/i386/start.S | 2 +- lib/libc/glibc/sysdeps/i386/symbol-hacks.h | 2 +- lib/libc/glibc/sysdeps/i386/sysdep.h | 2 +- lib/libc/glibc/sysdeps/loongarch/start.S | 2 +- lib/libc/glibc/sysdeps/loongarch/sys/regdef.h | 2 +- lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h | 2 +- lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h | 2 +- .../m68k/nptl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/m68k/start.S | 2 +- lib/libc/glibc/sysdeps/m68k/symbol-hacks.h | 2 +- lib/libc/glibc/sysdeps/m68k/sysdep.h | 2 +- lib/libc/glibc/sysdeps/mach/libc-lock.h | 2 +- lib/libc/glibc/sysdeps/mach/sysdep.h | 2 +- lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h | 2 +- .../mips/nptl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/mips/start.S | 2 +- .../glibc/sysdeps/nptl/bits/pthreadtypes.h | 2 +- .../sysdeps/nptl/bits/thread-shared-types.h | 5 +- lib/libc/glibc/sysdeps/nptl/libc-lock.h | 2 +- lib/libc/glibc/sysdeps/nptl/libc-lockP.h | 2 +- lib/libc/glibc/sysdeps/nptl/pthread.h | 4 +- .../glibc/sysdeps/powerpc/powerpc32/start.S | 2 +- .../sysdeps/powerpc/powerpc32/symbol-hacks.h | 2 +- .../glibc/sysdeps/powerpc/powerpc32/sysdep.h | 5 +- .../sysdeps/powerpc/powerpc64/dl-dtprocnum.h | 2 +- .../glibc/sysdeps/powerpc/powerpc64/start.S | 2 +- .../glibc/sysdeps/powerpc/powerpc64/sysdep.h | 26 ++- lib/libc/glibc/sysdeps/powerpc/sysdep.h | 2 +- .../riscv/nptl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/riscv/start.S | 3 +- lib/libc/glibc/sysdeps/s390/s390-64/start.S | 2 +- lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h | 2 +- lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h | 2 +- lib/libc/glibc/sysdeps/sparc/sparc32/start.S | 2 +- lib/libc/glibc/sysdeps/sparc/sparc64/start.S | 2 +- lib/libc/glibc/sysdeps/sparc/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/arm/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/i386/sysdep.h | 2 +- .../glibc/sysdeps/unix/mips/mips32/sysdep.h | 2 +- .../glibc/sysdeps/unix/mips/mips64/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/mips/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/sh/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/sysdep.h | 177 ++++++++++++++---- .../unix/sysv/linux/aarch64/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/aarch64/sys/elf.h | 2 +- .../sysdeps/unix/sysv/linux/aarch64/sysdep.h | 3 +- .../sysdeps/unix/sysv/linux/arc/sysdep.h | 2 +- .../unix/sysv/linux/arm/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/arm/sys/elf.h | 2 +- .../sysdeps/unix/sysv/linux/arm/sysdep.h | 2 +- .../glibc/sysdeps/unix/sysv/linux/bits/stat.h | 2 +- .../sysdeps/unix/sysv/linux/bits/timex.h | 2 +- .../unix/sysv/linux/csky/kernel_stat.h | 2 +- .../sysdeps/unix/sysv/linux/csky/sysdep.h | 2 +- .../glibc/sysdeps/unix/sysv/linux/dl-sysdep.h | 2 +- .../glibc/sysdeps/unix/sysv/linux/fstat.c | 2 +- .../glibc/sysdeps/unix/sysv/linux/fstat64.c | 6 +- .../glibc/sysdeps/unix/sysv/linux/fstatat.c | 4 +- .../glibc/sysdeps/unix/sysv/linux/fstatat64.c | 6 +- .../sysdeps/unix/sysv/linux/i386/dl-sysdep.h | 2 +- .../unix/sysv/linux/i386/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/i386/sysdep.h | 2 +- .../unix/sysv/linux/include/sys/timex.h | 2 +- .../sysdeps/unix/sysv/linux/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/kernel_stat.h | 2 +- .../unix/sysv/linux/loongarch/sysdep.h | 3 +- .../glibc/sysdeps/unix/sysv/linux/lstat.c | 2 +- .../glibc/sysdeps/unix/sysv/linux/lstat64.c | 2 +- .../unix/sysv/linux/m68k/coldfire/sysdep.h | 2 +- .../unix/sysv/linux/m68k/kernel-features.h | 2 +- .../unix/sysv/linux/m68k/m680x0/sysdep.h | 2 +- .../sysdeps/unix/sysv/linux/m68k/sysdep.h | 2 +- .../unix/sysv/linux/mips/kernel-features.h | 2 +- .../unix/sysv/linux/mips/mips32/sysdep.h | 6 +- .../unix/sysv/linux/mips/mips64/kstat_cp.h | 2 +- .../unix/sysv/linux/mips/mips64/sysdep.h | 54 +++--- .../sysdeps/unix/sysv/linux/mips/sysdep.h | 2 +- .../glibc/sysdeps/unix/sysv/linux/mknodat.c | 4 +- .../unix/sysv/linux/powerpc/kernel-features.h | 2 +- .../linux/powerpc/powerpc32/kernel_stat.h | 2 +- .../sysv/linux/powerpc/powerpc64/sysdep.h | 2 +- .../sysdeps/unix/sysv/linux/powerpc/sysdep.h | 45 ++--- .../unix/sysv/linux/riscv/kernel-features.h | 2 +- .../unix/sysv/linux/s390/bits/typesizes.h | 2 +- .../unix/sysv/linux/s390/kernel-features.h | 2 +- .../unix/sysv/linux/s390/s390-64/sysdep.h | 2 +- .../sysdeps/unix/sysv/linux/s390/sys/elf.h | 2 +- .../sysdeps/unix/sysv/linux/s390/sysdep.h | 3 +- .../sysdeps/unix/sysv/linux/single-thread.h | 2 +- .../unix/sysv/linux/sparc/bits/typesizes.h | 2 +- .../unix/sysv/linux/sparc/kernel-features.h | 2 +- .../unix/sysv/linux/sparc/sparc32/sysdep.h | 5 +- .../unix/sysv/linux/sparc/sparc64/kstat_cp.h | 2 +- .../unix/sysv/linux/sparc/sparc64/sysdep.h | 5 +- .../sysdeps/unix/sysv/linux/sparc/sysdep.h | 76 +++++--- lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c | 2 +- .../glibc/sysdeps/unix/sysv/linux/stat64.c | 2 +- .../sysdeps/unix/sysv/linux/stat_t64_cp.c | 2 +- .../sysdeps/unix/sysv/linux/stat_t64_cp.h | 2 +- .../unix/sysv/linux/struct_stat_time64.h | 2 +- .../sysdeps/unix/sysv/linux/sys/syscall.h | 2 +- .../glibc/sysdeps/unix/sysv/linux/sys/timex.h | 2 +- .../glibc/sysdeps/unix/sysv/linux/sysdep.h | 2 +- .../unix/sysv/linux/x86/bits/typesizes.h | 2 +- .../sysdeps/unix/sysv/linux/x86/sys/elf.h | 2 +- .../unix/sysv/linux/x86_64/kernel-features.h | 2 +- .../sysdeps/unix/sysv/linux/x86_64/sysdep.h | 3 +- .../unix/sysv/linux/x86_64/x32/sysdep.h | 2 +- lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h | 2 +- .../sysdeps/wordsize-32/divdi3-symbol-hacks.h | 2 +- .../sysdeps/x86/nptl/bits/pthreadtypes-arch.h | 2 +- lib/libc/glibc/sysdeps/x86/sysdep.h | 2 +- lib/libc/glibc/sysdeps/x86_64/start.S | 2 +- lib/libc/glibc/sysdeps/x86_64/sysdep.h | 4 +- lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h | 4 +- 187 files changed, 612 insertions(+), 398 deletions(-) create mode 100644 lib/libc/glibc/include/libc-misc.h diff --git a/lib/libc/glibc/LICENSES b/lib/libc/glibc/LICENSES index f4b24c1a41..56d857f027 100644 --- a/lib/libc/glibc/LICENSES +++ b/lib/libc/glibc/LICENSES @@ -165,44 +165,8 @@ The file if_ppp.h is under the following CMU license: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -The following license covers the files from Intel's "Highly Optimized -Mathematical Functions for Itanium" collection: - -Intel License Agreement - -Copyright (c) 2000, Intel Corporation - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -* The name of Intel Corporation may not be used to endorse or promote -products derived from this software without specific prior written -permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The files inet/getnameinfo.c and sysdeps/posix/getaddrinfo.c are copyright -(C) by Craig Metz and are distributed under the following license: +The files nss/getnameinfo.c and nss/getaddrinfo.c are copyright (C) by +Craig Metz and are distributed under the following license: /* The Inner Net License, Version 2.00 @@ -410,3 +374,27 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Various files in sysdeps/ieee754/flt-32, taken from the CORE-MATH project +, are distributed under the +following license: + +Copyright (c) 2022-2024 Alexei Sibidanov. Paul Zimmermann. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/libc/glibc/bits/byteswap.h b/lib/libc/glibc/bits/byteswap.h index d15c940db2..c0841a3574 100644 --- a/lib/libc/glibc/bits/byteswap.h +++ b/lib/libc/glibc/bits/byteswap.h @@ -1,5 +1,5 @@ /* Macros and inline functions to swap the order of bytes in integer values. - Copyright (C) 1997-2024 Free Software Foundation, Inc. + Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/floatn-common.h b/lib/libc/glibc/bits/floatn-common.h index c800cdb1b1..01a579687e 100644 --- a/lib/libc/glibc/bits/floatn-common.h +++ b/lib/libc/glibc/bits/floatn-common.h @@ -1,6 +1,6 @@ /* Macros to control TS 18661-3 glibc features where the same definitions are appropriate for all platforms. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/libc-header-start.h b/lib/libc/glibc/bits/libc-header-start.h index 4ab1304b0d..e8477f972a 100644 --- a/lib/libc/glibc/bits/libc-header-start.h +++ b/lib/libc/glibc/bits/libc-header-start.h @@ -1,5 +1,5 @@ /* Handle feature test macros at the start of a header. - Copyright (C) 2016-2024 Free Software Foundation, Inc. + Copyright (C) 2016-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/long-double.h b/lib/libc/glibc/bits/long-double.h index 6c9f32bc91..77421347b5 100644 --- a/lib/libc/glibc/bits/long-double.h +++ b/lib/libc/glibc/bits/long-double.h @@ -1,5 +1,5 @@ /* Properties of long double type. - Copyright (C) 2016-2024 Free Software Foundation, Inc. + Copyright (C) 2016-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/select.h b/lib/libc/glibc/bits/select.h index 2b642fea21..065e1d1dde 100644 --- a/lib/libc/glibc/bits/select.h +++ b/lib/libc/glibc/bits/select.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2024 Free Software Foundation, Inc. +/* Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/signum-generic.h b/lib/libc/glibc/bits/signum-generic.h index 0978101900..31dc2cd395 100644 --- a/lib/libc/glibc/bits/signum-generic.h +++ b/lib/libc/glibc/bits/signum-generic.h @@ -1,5 +1,5 @@ /* Signal number constants. Generic template. - Copyright (C) 1991-2024 Free Software Foundation, Inc. + Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/stat.h b/lib/libc/glibc/bits/stat.h index d71603db46..9dae670f67 100644 --- a/lib/libc/glibc/bits/stat.h +++ b/lib/libc/glibc/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/stdint-intn.h b/lib/libc/glibc/bits/stdint-intn.h index 5bcfa6b031..a7fde320e1 100644 --- a/lib/libc/glibc/bits/stdint-intn.h +++ b/lib/libc/glibc/bits/stdint-intn.h @@ -1,5 +1,5 @@ /* Define intN_t types. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/stdlib-bsearch.h b/lib/libc/glibc/bits/stdlib-bsearch.h index 540d718952..5ca67857e5 100644 --- a/lib/libc/glibc/bits/stdlib-bsearch.h +++ b/lib/libc/glibc/bits/stdlib-bsearch.h @@ -1,5 +1,5 @@ /* Perform binary search - inline version. - Copyright (C) 1991-2024 Free Software Foundation, Inc. + Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,22 +20,14 @@ __extern_inline void * bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) { - size_t __l, __u, __idx; const void *__p; int __comparison; - __l = 0; - __u = __nmemb; - while (__l < __u) + while (__nmemb) { - __idx = (__l + __u) / 2; - __p = (const void *) (((const char *) __base) + (__idx * __size)); + __p = (const void *) (((const char *) __base) + ((__nmemb >> 1) * __size)); __comparison = (*__compar) (__key, __p); - if (__comparison < 0) - __u = __idx; - else if (__comparison > 0) - __l = __idx + 1; - else + if (__comparison == 0) { #if __GNUC_PREREQ(4, 6) # pragma GCC diagnostic push @@ -46,6 +38,12 @@ bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, # pragma GCC diagnostic pop #endif } + if (__comparison > 0) + { + __base = ((const char *) __p) + __size; + --__nmemb; + } + __nmemb >>= 1; } return NULL; diff --git a/lib/libc/glibc/bits/time64.h b/lib/libc/glibc/bits/time64.h index 6f43066ec2..e858cefdff 100644 --- a/lib/libc/glibc/bits/time64.h +++ b/lib/libc/glibc/bits/time64.h @@ -1,5 +1,5 @@ /* bits/time64.h -- underlying types for __time64_t. Generic version. - Copyright (C) 2018-2024 Free Software Foundation, Inc. + Copyright (C) 2018-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/timesize.h b/lib/libc/glibc/bits/timesize.h index 0cd6130179..9accad9658 100644 --- a/lib/libc/glibc/bits/timesize.h +++ b/lib/libc/glibc/bits/timesize.h @@ -1,5 +1,5 @@ /* Bit size of the time_t type at glibc build time, general case. - Copyright (C) 2018-2024 Free Software Foundation, Inc. + Copyright (C) 2018-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/types/struct_sched_param.h b/lib/libc/glibc/bits/types/struct_sched_param.h index e11d0c5991..7a2e06b834 100644 --- a/lib/libc/glibc/bits/types/struct_sched_param.h +++ b/lib/libc/glibc/bits/types/struct_sched_param.h @@ -1,5 +1,5 @@ /* Sched parameter structure. Generic version. - Copyright (C) 1996-2024 Free Software Foundation, Inc. + Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/typesizes.h b/lib/libc/glibc/bits/typesizes.h index 0146b3cc97..b6db5c3637 100644 --- a/lib/libc/glibc/bits/typesizes.h +++ b/lib/libc/glibc/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Generic version. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/uintn-identity.h b/lib/libc/glibc/bits/uintn-identity.h index 8104070583..96c58abe65 100644 --- a/lib/libc/glibc/bits/uintn-identity.h +++ b/lib/libc/glibc/bits/uintn-identity.h @@ -1,5 +1,5 @@ /* Inline functions to return unsigned integer values unchanged. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/waitflags.h b/lib/libc/glibc/bits/waitflags.h index fc58b3d92d..5e7c0f506d 100644 --- a/lib/libc/glibc/bits/waitflags.h +++ b/lib/libc/glibc/bits/waitflags.h @@ -1,5 +1,5 @@ /* Definitions of flag bits for `waitpid' et al. - Copyright (C) 1992-2024 Free Software Foundation, Inc. + Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/bits/waitstatus.h b/lib/libc/glibc/bits/waitstatus.h index e62a882cf4..ccc2239473 100644 --- a/lib/libc/glibc/bits/waitstatus.h +++ b/lib/libc/glibc/bits/waitstatus.h @@ -1,5 +1,5 @@ /* Definitions of status bits for `wait' et al. - Copyright (C) 1992-2024 Free Software Foundation, Inc. + Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/csu/errno.c b/lib/libc/glibc/csu/errno.c index 3bd6414b74..558315365f 100644 --- a/lib/libc/glibc/csu/errno.c +++ b/lib/libc/glibc/csu/errno.c @@ -1,5 +1,5 @@ /* Definition of `errno' variable. Canonical version. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/csu/init.c b/lib/libc/glibc/csu/init.c index 3ee6148898..92a22de162 100644 --- a/lib/libc/glibc/csu/init.c +++ b/lib/libc/glibc/csu/init.c @@ -1,5 +1,5 @@ /* Special startup support. - Copyright (C) 1997-2024 Free Software Foundation, Inc. + Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/debug/stack_chk_fail_local.c b/lib/libc/glibc/debug/stack_chk_fail_local.c index 24151e9244..4ba407637f 100644 --- a/lib/libc/glibc/debug/stack_chk_fail_local.c +++ b/lib/libc/glibc/debug/stack_chk_fail_local.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2024 Free Software Foundation, Inc. +/* Copyright (C) 2005-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/elf/elf.h b/lib/libc/glibc/elf/elf.h index 33aea7f743..96df2eec01 100644 --- a/lib/libc/glibc/elf/elf.h +++ b/lib/libc/glibc/elf/elf.h @@ -1,5 +1,5 @@ /* This file defines standard ELF types, structures, and macros. - Copyright (C) 1995-2024 Free Software Foundation, Inc. + Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -797,6 +797,7 @@ typedef struct #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ #define NT_X86_SHSTK 0x204 /* x86 SHSTK state */ +#define NT_X86_XSAVE_LAYOUT 0x205 /* XSAVE layout description. */ #define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ #define NT_S390_TIMER 0x301 /* s390 timer register */ #define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */ @@ -835,6 +836,7 @@ typedef struct #define NT_ARM_ZA 0x40c /* ARM SME ZA registers. */ #define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */ #define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */ +#define NT_ARM_POE 0x40f /* ARM POE registers. */ #define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */ #define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */ #define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */ @@ -1389,6 +1391,7 @@ typedef struct #define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0) #define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1) +#define GNU_PROPERTY_AARCH64_FEATURE_1_GCS (1U << 2) /* The x86 instruction sets indicated by the corresponding bits are used in program. Their support in the hardware is optional. */ diff --git a/lib/libc/glibc/include/errno.h b/lib/libc/glibc/include/errno.h index c361a785c2..f0ccaa74dd 100644 --- a/lib/libc/glibc/include/errno.h +++ b/lib/libc/glibc/include/errno.h @@ -20,7 +20,7 @@ # define errno rtld_errno extern int rtld_errno attribute_hidden; -# elif IS_IN_LIB && !IS_IN (rtld) +# elif IS_IN_LIB && !IS_IN (rtld) && !defined LIBC_NONSHARED # undef errno # if IS_IN (libc) diff --git a/lib/libc/glibc/include/libc-misc.h b/lib/libc/glibc/include/libc-misc.h new file mode 100644 index 0000000000..e76a8097d8 --- /dev/null +++ b/lib/libc/glibc/include/libc-misc.h @@ -0,0 +1,67 @@ +/* Miscellaneous definitions for both glibc build and test. + Copyright (C) 2024-2025 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _INCLUDE_MISC_H +#define _INCLUDE_MISC_H + +#include + +/* Add the compiler optimization to inhibit loop transformation to library + calls. This is used to avoid recursive calls in memset and memmove + default implementations in tests. */ +#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL +# define inhibit_loop_to_libcall \ + __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns"))) +#else +# define inhibit_loop_to_libcall +#endif + +#ifdef HAVE_TEST_CC_INHIBIT_LOOP_TO_LIBCALL +# define test_cc_inhibit_loop_to_libcall \ + __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns"))) +#else +# define test_cc_inhibit_loop_to_libcall +#endif + +/* Used to disable stack protection in sensitive places, like ifunc + resolvers and early static TLS init. */ +#ifdef __clang__ +# define cc_inhibit_stack_protector \ + __attribute__((no_stack_protector)) +#else +# define cc_inhibit_stack_protector \ + __attribute__ ((__optimize__ ("-fno-stack-protector"))) +#endif + +#if IS_IN (testsuite) || IS_IN (testsuite_internal) +# ifdef HAVE_TEST_CC_NO_STACK_PROTECTOR +# define test_inhibit_stack_protector cc_inhibit_stack_protector +# define inhibit_stack_protector cc_inhibit_stack_protector +# else +# define test_inhibit_stack_protector +# define inhibit_stack_protector +# endif +#else +# ifdef HAVE_CC_NO_STACK_PROTECTOR +# define inhibit_stack_protector cc_inhibit_stack_protector +# else +# define inhibit_stack_protector +# endif +#endif + +#endif diff --git a/lib/libc/glibc/include/libc-pointer-arith.h b/lib/libc/glibc/include/libc-pointer-arith.h index 2456644dd2..815ba65ec9 100644 --- a/lib/libc/glibc/include/libc-pointer-arith.h +++ b/lib/libc/glibc/include/libc-pointer-arith.h @@ -1,5 +1,5 @@ /* Helper macros for pointer arithmetic. - Copyright (C) 2012-2024 Free Software Foundation, Inc. + Copyright (C) 2012-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/include/libc-symbols.h b/lib/libc/glibc/include/libc-symbols.h index 21f7bfac1a..b11460131d 100644 --- a/lib/libc/glibc/include/libc-symbols.h +++ b/lib/libc/glibc/include/libc-symbols.h @@ -1,6 +1,6 @@ /* Support macros for making weak and strong aliases for symbols, and for using symbol sets and linker warnings with GNU ld. - Copyright (C) 1995-2024 Free Software Foundation, Inc. + Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -59,6 +59,8 @@ # define IN_MODULE (-1) #endif +#include + #ifndef _ISOMAC /* This is defined for the compilation of all C library code. features.h @@ -82,8 +84,6 @@ # error "glibc must not be compiled with -ffast-math" #endif -#include - /* Obtain the definition of symbol_version_reference. */ #include @@ -374,15 +374,6 @@ for linking") #define attribute_relro __attribute__ ((section (".data.rel.ro"))) -/* Used to disable stack protection in sensitive places, like ifunc - resolvers and early static TLS init. */ -#ifdef HAVE_CC_NO_STACK_PROTECTOR -# define inhibit_stack_protector \ - __attribute__ ((__optimize__ ("-fno-stack-protector"))) -#else -# define inhibit_stack_protector -#endif - /* The following macros are used for PLT bypassing within libc.so (and if needed other libraries similarly). First of all, you need to have the function prototyped somewhere, @@ -816,16 +807,6 @@ for linking") #define libm_ifunc_init() #define libm_ifunc(name, expr) \ __ifunc (name, name, expr, void, libm_ifunc_init) - -/* Add the compiler optimization to inhibit loop transformation to library - calls. This is used to avoid recursive calls in memset and memmove - default implementations. */ -#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL -# define inhibit_loop_to_libcall \ - __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns"))) -#else -# define inhibit_loop_to_libcall -#endif /* These macros facilitate sharing source files with gnulib. diff --git a/lib/libc/glibc/include/stap-probe.h b/lib/libc/glibc/include/stap-probe.h index 552d532d5e..9ff4ca83e5 100644 --- a/lib/libc/glibc/include/stap-probe.h +++ b/lib/libc/glibc/include/stap-probe.h @@ -1,5 +1,5 @@ /* Macros for defining Systemtap static probe points. - Copyright (C) 2012-2024 Free Software Foundation, Inc. + Copyright (C) 2012-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/include/stdlib.h b/lib/libc/glibc/include/stdlib.h index 0cab3f5b56..57f4ab8545 100644 --- a/lib/libc/glibc/include/stdlib.h +++ b/lib/libc/glibc/include/stdlib.h @@ -20,6 +20,7 @@ # include # include +# include extern __typeof (strtol_l) __strtol_l; extern __typeof (strtoul_l) __strtoul_l; @@ -77,6 +78,12 @@ libc_hidden_proto (__isoc23_strtoull_l) # define strtoull_l __isoc23_strtoull_l #endif +extern void __abort_fork_reset_child (void) attribute_hidden; +extern void __abort_lock_rdlock (internal_sigset_t *set) attribute_hidden; +extern void __abort_lock_wrlock (internal_sigset_t *set) attribute_hidden; +extern void __abort_lock_unlock (const internal_sigset_t *set) + attribute_hidden; + libc_hidden_proto (exit) libc_hidden_proto (abort) libc_hidden_proto (getenv) diff --git a/lib/libc/glibc/include/sys/cdefs.h b/lib/libc/glibc/include/sys/cdefs.h index b84ad34a70..a676f75f62 100644 --- a/lib/libc/glibc/include/sys/cdefs.h +++ b/lib/libc/glibc/include/sys/cdefs.h @@ -56,4 +56,11 @@ rtld_hidden_proto (__chk_fail) #endif /* !defined _ISOMAC */ +/* Prevents a function from being considered for inlining and cloning. */ +#ifdef __clang__ +# define __attribute_optimization_barrier__ __attribute__ ((optnone)) +#else +# define __attribute_optimization_barrier__ __attribute__ ((noinline, noclone)) +#endif + #endif diff --git a/lib/libc/glibc/io/bits/statx.h b/lib/libc/glibc/io/bits/statx.h index 89d8dab6ee..5c1228c3bf 100644 --- a/lib/libc/glibc/io/bits/statx.h +++ b/lib/libc/glibc/io/bits/statx.h @@ -1,5 +1,5 @@ /* statx-related definitions and declarations. Generic version. - Copyright (C) 2018-2024 Free Software Foundation, Inc. + Copyright (C) 2018-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/io/fcntl.h b/lib/libc/glibc/io/fcntl.h index e712aeeff7..2e07f8fc4b 100644 --- a/lib/libc/glibc/io/fcntl.h +++ b/lib/libc/glibc/io/fcntl.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/io/mknod.c b/lib/libc/glibc/io/mknod.c index 8bfbba50f6..66020d58ca 100644 --- a/lib/libc/glibc/io/mknod.c +++ b/lib/libc/glibc/io/mknod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2024 Free Software Foundation, Inc. +/* Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/io/sys/stat.h b/lib/libc/glibc/io/sys/stat.h index 3b4ba80132..4bea9e9a77 100644 --- a/lib/libc/glibc/io/sys/stat.h +++ b/lib/libc/glibc/io/sys/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,7 +26,7 @@ #include /* For __mode_t and __dev_t. */ -#ifdef __USE_XOPEN2K8 +#if defined(__USE_ATFILE) || defined(__USE_XOPEN2K8) # include #endif @@ -263,14 +263,14 @@ extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf), # ifndef __USE_FILE_OFFSET64 extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) - __THROW __nonnull ((2, 3)); + __THROW __nonnull ((3)); # else # ifdef __USE_TIME64_REDIRECTS # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag), - __fstatat64_time64) __nonnull ((2, 3)); + __fstatat64_time64) __nonnull ((3)); # else # define fstatat __fstatat64_time64 # endif @@ -279,7 +279,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag), - fstatat64) __nonnull ((2, 3)); + fstatat64) __nonnull ((3)); # else # define fstatat fstatat64 # endif @@ -290,7 +290,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, # ifndef __USE_TIME64_REDIRECTS extern int fstatat64 (int __fd, const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) - __THROW __nonnull ((2, 3)); + __THROW __nonnull ((3)); # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (fstatat64, (int __fd, @@ -298,7 +298,7 @@ extern int __REDIRECT_NTH (fstatat64, (int __fd, struct stat64 *__restrict __buf, int __flag), __fstatat64_time64) - __nonnull ((2, 3)); + __nonnull ((3)); # else # define fstatat64 __fstatat64_time64 # endif @@ -433,13 +433,13 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode) extern int utimensat (int __fd, const char *__path, const struct timespec __times[2], int __flags) - __THROW __nonnull ((2)); + __THROW; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path, const struct timespec __times[2], int flags), - __utimensat64) __nonnull ((2)); + __utimensat64); # else # define utimensat __utimensat64 # endif diff --git a/lib/libc/glibc/locale/bits/types/__locale_t.h b/lib/libc/glibc/locale/bits/types/__locale_t.h index 52be00104d..746b1209f1 100644 --- a/lib/libc/glibc/locale/bits/types/__locale_t.h +++ b/lib/libc/glibc/locale/bits/types/__locale_t.h @@ -1,5 +1,5 @@ /* Definition of struct __locale_struct and __locale_t. - Copyright (C) 1997-2024 Free Software Foundation, Inc. + Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/locale/bits/types/locale_t.h b/lib/libc/glibc/locale/bits/types/locale_t.h index bc20639a4c..fe8864ca6b 100644 --- a/lib/libc/glibc/locale/bits/types/locale_t.h +++ b/lib/libc/glibc/locale/bits/types/locale_t.h @@ -1,5 +1,5 @@ /* Definition of locale_t. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/misc/sys/cdefs.h b/lib/libc/glibc/misc/sys/cdefs.h index ab9620bd0d..215ff937ee 100644 --- a/lib/libc/glibc/misc/sys/cdefs.h +++ b/lib/libc/glibc/misc/sys/cdefs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. Copyright The GNU Toolchain Authors. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/misc/sys/select.h b/lib/libc/glibc/misc/sys/select.h index 2e45e94bc1..d2cdc0f1cd 100644 --- a/lib/libc/glibc/misc/sys/select.h +++ b/lib/libc/glibc/misc/sys/select.h @@ -1,5 +1,5 @@ /* `fd_set' type and related macros, and `select'/`pselect' declarations. - Copyright (C) 1996-2024 Free Software Foundation, Inc. + Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/posix/bits/cpu-set.h b/lib/libc/glibc/posix/bits/cpu-set.h index dbcdc7800d..9dc2d31fa7 100644 --- a/lib/libc/glibc/posix/bits/cpu-set.h +++ b/lib/libc/glibc/posix/bits/cpu-set.h @@ -1,6 +1,6 @@ /* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993 scheduling interface. - Copyright (C) 1996-2024 Free Software Foundation, Inc. + Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/posix/bits/types.h b/lib/libc/glibc/posix/bits/types.h index 905a7e6b22..97d2b1be35 100644 --- a/lib/libc/glibc/posix/bits/types.h +++ b/lib/libc/glibc/posix/bits/types.h @@ -1,5 +1,5 @@ /* bits/types.h -- definitions of __*_t types underlying *_t types. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -217,6 +217,7 @@ typedef int __sig_atomic_t; /* Seconds since the Epoch, visible to user code when time_t is too narrow only for consistency with the old way of widening too-narrow types. User code should never use __time64_t. */ +/* Zig patch: Don't check __LIBC here because it breaks fstatat.c on x86. */ #if __TIMESIZE == 64 # define __time64_t __time_t #elif __TIMESIZE != 64 diff --git a/lib/libc/glibc/posix/sys/types.h b/lib/libc/glibc/posix/sys/types.h index 0f1ce36d5e..ab3037a9da 100644 --- a/lib/libc/glibc/posix/sys/types.h +++ b/lib/libc/glibc/posix/sys/types.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/signal/signal.h b/lib/libc/glibc/signal/signal.h index 8e07b041b1..413b4fd23f 100644 --- a/lib/libc/glibc/signal/signal.h +++ b/lib/libc/glibc/signal/signal.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/stdlib/alloca.h b/lib/libc/glibc/stdlib/alloca.h index bead95399a..ec36f825ad 100644 --- a/lib/libc/glibc/stdlib/alloca.h +++ b/lib/libc/glibc/stdlib/alloca.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/stdlib/bits/stdlib-float.h b/lib/libc/glibc/stdlib/bits/stdlib-float.h index ee97232716..5f2902949e 100644 --- a/lib/libc/glibc/stdlib/bits/stdlib-float.h +++ b/lib/libc/glibc/stdlib/bits/stdlib-float.h @@ -1,5 +1,5 @@ /* Floating-point inline functions for stdlib.h. - Copyright (C) 2012-2024 Free Software Foundation, Inc. + Copyright (C) 2012-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/stdlib/errno.h b/lib/libc/glibc/stdlib/errno.h index e50380f057..64517aa2fb 100644 --- a/lib/libc/glibc/stdlib/errno.h +++ b/lib/libc/glibc/stdlib/errno.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/stdlib/exit.h b/lib/libc/glibc/stdlib/exit.h index 3dc9f4c6ba..bbe80292e4 100644 --- a/lib/libc/glibc/stdlib/exit.h +++ b/lib/libc/glibc/stdlib/exit.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/stdlib/stdlib.h b/lib/libc/glibc/stdlib/stdlib.h index 901926e893..975f5aeb0b 100644 --- a/lib/libc/glibc/stdlib/stdlib.h +++ b/lib/libc/glibc/stdlib/stdlib.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. Copyright The GNU Toolchain Authors. This file is part of the GNU C Library. @@ -727,7 +727,7 @@ extern void *aligned_alloc (size_t __alignment, size_t __size) #endif /* Abort execution and generate a core-dump. */ -extern void abort (void) __THROW __attribute__ ((__noreturn__)); +extern void abort (void) __THROW __attribute__ ((__noreturn__)) __COLD; /* Register a function to be called when `exit' is called. */ diff --git a/lib/libc/glibc/string/bits/endian.h b/lib/libc/glibc/string/bits/endian.h index 08ca11efe9..e267b2b513 100644 --- a/lib/libc/glibc/string/bits/endian.h +++ b/lib/libc/glibc/string/bits/endian.h @@ -1,5 +1,5 @@ /* Endian macros for string.h functions - Copyright (C) 1992-2024 Free Software Foundation, Inc. + Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/string/endian.h b/lib/libc/glibc/string/endian.h index fd20a2b198..6b5d65f967 100644 --- a/lib/libc/glibc/string/endian.h +++ b/lib/libc/glibc/string/endian.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h index 5fe9577f80..7f11e82ff5 100644 --- a/lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2024 Free Software Foundation, Inc. +/* Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/aarch64/start.S b/lib/libc/glibc/sysdeps/aarch64/start.S index 5d187f3068..ef6b5ad686 100644 --- a/lib/libc/glibc/sysdeps/aarch64/start.S +++ b/lib/libc/glibc/sysdeps/aarch64/start.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2024 Free Software Foundation, Inc. +/* Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/aarch64/sysdep.h b/lib/libc/glibc/sysdeps/aarch64/sysdep.h index 464674e89c..036eb12527 100644 --- a/lib/libc/glibc/sysdeps/aarch64/sysdep.h +++ b/lib/libc/glibc/sysdeps/aarch64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2024 Free Software Foundation, Inc. +/* Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -74,10 +74,18 @@ strip_pac (void *p) #define PACIASP hint 25 #define AUTIASP hint 29 +/* Guarded Control Stack support. */ +#define CHKFEAT_X16 hint 40 +#define MRS_GCSPR(x) mrs x, s3_3_c2_c5_1 +#define GCSPOPM(x) sysl x, #3, c7, c7, #1 +#define GCSSS1(x) sys #3, c7, c7, #2, x +#define GCSSS2(x) sysl x, #3, c7, c7, #3 + /* GNU_PROPERTY_AARCH64_* macros from elf.h for use in asm code. */ #define FEATURE_1_AND 0xc0000000 #define FEATURE_1_BTI 1 #define FEATURE_1_PAC 2 +#define FEATURE_1_GCS 4 /* Add a NT_GNU_PROPERTY_TYPE_0 note. */ #define GNU_PROPERTY(type, value) \ @@ -96,9 +104,9 @@ strip_pac (void *p) /* Add GNU property note with the supported features to all asm code where sysdep.h is included. */ #if HAVE_AARCH64_BTI && HAVE_AARCH64_PAC_RET -GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC) +GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC|FEATURE_1_GCS) #elif HAVE_AARCH64_BTI -GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI) +GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS) #endif /* Define an entry point visible from C. */ diff --git a/lib/libc/glibc/sysdeps/arc/bits/endianness.h b/lib/libc/glibc/sysdeps/arc/bits/endianness.h index 8f17ca84b4..4a6e7d4c15 100644 --- a/lib/libc/glibc/sysdeps/arc/bits/endianness.h +++ b/lib/libc/glibc/sysdeps/arc/bits/endianness.h @@ -5,11 +5,7 @@ # error "Never use directly; include instead." #endif -/* ARC has selectable endianness. */ -#ifdef __BIG_ENDIAN__ -# define __BYTE_ORDER __BIG_ENDIAN -#else -# define __BYTE_ORDER __LITTLE_ENDIAN -#endif +/* Only little-endian ARC is supported. */ +#define __BYTE_ORDER __LITTLE_ENDIAN #endif /* bits/endianness.h */ diff --git a/lib/libc/glibc/sysdeps/arc/start.S b/lib/libc/glibc/sysdeps/arc/start.S index 03ee8a0f2e..372dd3e299 100644 --- a/lib/libc/glibc/sysdeps/arc/start.S +++ b/lib/libc/glibc/sysdeps/arc/start.S @@ -1,5 +1,5 @@ /* Startup code for ARC. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/arc/sysdep.h b/lib/libc/glibc/sysdeps/arc/sysdep.h index 234ef39ddf..b831b5f79b 100644 --- a/lib/libc/glibc/sysdeps/arc/sysdep.h +++ b/lib/libc/glibc/sysdeps/arc/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for ARC. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/arm/arm-features.h b/lib/libc/glibc/sysdeps/arm/arm-features.h index 69e7e36b29..04adcc90a8 100644 --- a/lib/libc/glibc/sysdeps/arm/arm-features.h +++ b/lib/libc/glibc/sysdeps/arm/arm-features.h @@ -1,5 +1,5 @@ /* Macros to test for CPU features on ARM. Generic ARM version. - Copyright (C) 2012-2024 Free Software Foundation, Inc. + Copyright (C) 2012-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/arm/start.S b/lib/libc/glibc/sysdeps/arm/start.S index 20a6dbb9cd..64eead31d5 100644 --- a/lib/libc/glibc/sysdeps/arm/start.S +++ b/lib/libc/glibc/sysdeps/arm/start.S @@ -1,5 +1,5 @@ /* Startup code for ARM & ELF - Copyright (C) 1995-2024 Free Software Foundation, Inc. + Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/arm/sysdep.h b/lib/libc/glibc/sysdeps/arm/sysdep.h index 8b7fee7f3b..8e66fa5666 100644 --- a/lib/libc/glibc/sysdeps/arm/sysdep.h +++ b/lib/libc/glibc/sysdeps/arm/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for ARM. - Copyright (C) 1997-2024 Free Software Foundation, Inc. + Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/csky/abiv2/start.S b/lib/libc/glibc/sysdeps/csky/abiv2/start.S index 4c03a55335..ce1d7d56f6 100644 --- a/lib/libc/glibc/sysdeps/csky/abiv2/start.S +++ b/lib/libc/glibc/sysdeps/csky/abiv2/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF C-SKY ABIV2. - Copyright (C) 2018-2024 Free Software Foundation, Inc. + Copyright (C) 2018-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/csky/sysdep.h b/lib/libc/glibc/sysdeps/csky/sysdep.h index aa8c2ad17a..8ca062b06d 100644 --- a/lib/libc/glibc/sysdeps/csky/sysdep.h +++ b/lib/libc/glibc/sysdeps/csky/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for C-SKY. - Copyright (C) 2018-2024 Free Software Foundation, Inc. + Copyright (C) 2018-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h b/lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h index 7b4b51006e..8cf83a3725 100644 --- a/lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h +++ b/lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h @@ -1,5 +1,5 @@ /* Configuration of lookup functions. - Copyright (C) 2000-2024 Free Software Foundation, Inc. + Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/generic/dl-sysdep.h b/lib/libc/glibc/sysdeps/generic/dl-sysdep.h index 30a696a5f0..d7a90f23d5 100644 --- a/lib/libc/glibc/sysdeps/generic/dl-sysdep.h +++ b/lib/libc/glibc/sysdeps/generic/dl-sysdep.h @@ -1,5 +1,5 @@ /* System-specific settings for dynamic linker code. Generic version. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/generic/dwarf2.h b/lib/libc/glibc/sysdeps/generic/dwarf2.h index 880fab545a..cdd0f96102 100644 --- a/lib/libc/glibc/sysdeps/generic/dwarf2.h +++ b/lib/libc/glibc/sysdeps/generic/dwarf2.h @@ -1,6 +1,6 @@ /* Declarations and definitions of codes relating to the DWARF2 symbolic debugging information format. - Copyright (C) 1992-2024 Free Software Foundation, Inc. + Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/generic/libc-lock.h b/lib/libc/glibc/sysdeps/generic/libc-lock.h index ea62912910..fafaf8c932 100644 --- a/lib/libc/glibc/sysdeps/generic/libc-lock.h +++ b/lib/libc/glibc/sysdeps/generic/libc-lock.h @@ -1,5 +1,5 @@ /* libc-internal interface for mutex locks. Stub version. - Copyright (C) 1996-2024 Free Software Foundation, Inc. + Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/generic/libc-symver.h b/lib/libc/glibc/sysdeps/generic/libc-symver.h index 7dd4762a70..0725e0c8e3 100644 --- a/lib/libc/glibc/sysdeps/generic/libc-symver.h +++ b/lib/libc/glibc/sysdeps/generic/libc-symver.h @@ -1,5 +1,5 @@ /* Symbol version management. - Copyright (C) 1995-2024 Free Software Foundation, Inc. + Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/generic/single-thread.h b/lib/libc/glibc/sysdeps/generic/single-thread.h index a76ff7ac19..6a37563e5f 100644 --- a/lib/libc/glibc/sysdeps/generic/single-thread.h +++ b/lib/libc/glibc/sysdeps/generic/single-thread.h @@ -1,5 +1,5 @@ /* Single thread optimization, generic version. - Copyright (C) 2019-2024 Free Software Foundation, Inc. + Copyright (C) 2019-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/generic/sysdep.h b/lib/libc/glibc/sysdeps/generic/sysdep.h index c47e53d3d8..4c0dda4d23 100644 --- a/lib/libc/glibc/sysdeps/generic/sysdep.h +++ b/lib/libc/glibc/sysdeps/generic/sysdep.h @@ -1,5 +1,5 @@ /* Generic asm macros used on many machines. - Copyright (C) 1991-2024 Free Software Foundation, Inc. + Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/generic/tls.h b/lib/libc/glibc/sysdeps/generic/tls.h index bb363c1ec3..f6155b5ba6 100644 --- a/lib/libc/glibc/sysdeps/generic/tls.h +++ b/lib/libc/glibc/sysdeps/generic/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. Generic version. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/htl/bits/pthread.h b/lib/libc/glibc/sysdeps/htl/bits/pthread.h index 9ff0fc4b67..c0ec3932ae 100644 --- a/lib/libc/glibc/sysdeps/htl/bits/pthread.h +++ b/lib/libc/glibc/sysdeps/htl/bits/pthread.h @@ -1,5 +1,5 @@ /* Pthread data structures. Generic version. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h b/lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h index 251e254374..32a545014c 100644 --- a/lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h +++ b/lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h @@ -1,5 +1,5 @@ /* Common threading primitives definitions for both POSIX and C11. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/htl/libc-lockP.h b/lib/libc/glibc/sysdeps/htl/libc-lockP.h index fbb3e14f39..a3a53e8833 100644 --- a/lib/libc/glibc/sysdeps/htl/libc-lockP.h +++ b/lib/libc/glibc/sysdeps/htl/libc-lockP.h @@ -1,5 +1,5 @@ /* Private libc-internal interface for mutex locks. - Copyright (C) 2015-2024 Free Software Foundation, Inc. + Copyright (C) 2015-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -77,6 +77,7 @@ extern int __pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutex_attr); extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex); +libc_hidden_proto (__pthread_mutex_destroy) extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex); @@ -85,8 +86,10 @@ extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr); +libc_hidden_proto (__pthread_mutexattr_init) extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr); +libc_hidden_proto (__pthread_mutexattr_destroy) extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind); @@ -113,8 +116,6 @@ extern int __pthread_atfork (void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)); - - /* Make the pthread functions weak so that we can elide them from single-threaded processes. */ #if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread) @@ -124,8 +125,6 @@ weak_extern (__pthread_mutex_destroy) weak_extern (__pthread_mutex_lock) weak_extern (__pthread_mutex_trylock) weak_extern (__pthread_mutex_unlock) -weak_extern (__pthread_mutexattr_init) -weak_extern (__pthread_mutexattr_destroy) weak_extern (__pthread_mutexattr_settype) weak_extern (__pthread_rwlock_init) weak_extern (__pthread_rwlock_destroy) @@ -147,8 +146,6 @@ weak_extern (__pthread_setcancelstate) # pragma weak __pthread_mutex_lock # pragma weak __pthread_mutex_trylock # pragma weak __pthread_mutex_unlock -# pragma weak __pthread_mutexattr_init -# pragma weak __pthread_mutexattr_destroy # pragma weak __pthread_mutexattr_settype # pragma weak __pthread_rwlock_destroy # pragma weak __pthread_rwlock_rdlock diff --git a/lib/libc/glibc/sysdeps/htl/pthread.h b/lib/libc/glibc/sysdeps/htl/pthread.h index 65837d10cf..a299fec278 100644 --- a/lib/libc/glibc/sysdeps/htl/pthread.h +++ b/lib/libc/glibc/sysdeps/htl/pthread.h @@ -1,5 +1,5 @@ /* Posix threads. Hurd version. - Copyright (C) 2000-2024 Free Software Foundation, Inc. + Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h index 163b3dfd0d..4aed38fc63 100644 --- a/lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h @@ -1,5 +1,5 @@ /* Machine-specific pthread type layouts. Hurd i386 version. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/i386/start.S b/lib/libc/glibc/sysdeps/i386/start.S index 30577176f8..01f8098b58 100644 --- a/lib/libc/glibc/sysdeps/i386/start.S +++ b/lib/libc/glibc/sysdeps/i386/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF i386 ABI. - Copyright (C) 1995-2024 Free Software Foundation, Inc. + Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/i386/symbol-hacks.h b/lib/libc/glibc/sysdeps/i386/symbol-hacks.h index f62465a836..f263d736a6 100644 --- a/lib/libc/glibc/sysdeps/i386/symbol-hacks.h +++ b/lib/libc/glibc/sysdeps/i386/symbol-hacks.h @@ -1,5 +1,5 @@ /* Hacks needed for symbol manipulation. i386 version. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/i386/sysdep.h b/lib/libc/glibc/sysdeps/i386/sysdep.h index 86b5fdd6ae..3aefe7af1e 100644 --- a/lib/libc/glibc/sysdeps/i386/sysdep.h +++ b/lib/libc/glibc/sysdeps/i386/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for i386. - Copyright (C) 1991-2024 Free Software Foundation, Inc. + Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/loongarch/start.S b/lib/libc/glibc/sysdeps/loongarch/start.S index de7f9645cf..754c08dc1f 100644 --- a/lib/libc/glibc/sysdeps/loongarch/start.S +++ b/lib/libc/glibc/sysdeps/loongarch/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF LoongArch ABI. - Copyright (C) 2022-2024 Free Software Foundation, Inc. + Copyright (C) 2022-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/loongarch/sys/regdef.h b/lib/libc/glibc/sysdeps/loongarch/sys/regdef.h index 80ce3e9c00..c65a2c4662 100644 --- a/lib/libc/glibc/sysdeps/loongarch/sys/regdef.h +++ b/lib/libc/glibc/sysdeps/loongarch/sys/regdef.h @@ -1,5 +1,5 @@ /* Register Macro definitions - Copyright (C) 2022-2024 Free Software Foundation, Inc. + Copyright (C) 2022-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h b/lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h index 0d7b21e397..563a67266e 100644 --- a/lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h +++ b/lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for Coldfire. - Copyright (C) 1998-2024 Free Software Foundation, Inc. + Copyright (C) 1998-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h b/lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h index 3c521ae7f4..7faceb35dc 100644 --- a/lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h +++ b/lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for m680x0. - Copyright (C) 2010-2024 Free Software Foundation, Inc. + Copyright (C) 2010-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h index f286b76164..56beb0ed19 100644 --- a/lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2024 Free Software Foundation, Inc. +/* Copyright (C) 2010-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/m68k/start.S b/lib/libc/glibc/sysdeps/m68k/start.S index d1af04a045..9b2ea124ba 100644 --- a/lib/libc/glibc/sysdeps/m68k/start.S +++ b/lib/libc/glibc/sysdeps/m68k/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF m68k ABI. - Copyright (C) 1996-2024 Free Software Foundation, Inc. + Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/m68k/symbol-hacks.h b/lib/libc/glibc/sysdeps/m68k/symbol-hacks.h index e8a2cc6e49..d9c1f96c2e 100644 --- a/lib/libc/glibc/sysdeps/m68k/symbol-hacks.h +++ b/lib/libc/glibc/sysdeps/m68k/symbol-hacks.h @@ -1,5 +1,5 @@ /* Hacks needed for symbol manipulation. m68k version. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/m68k/sysdep.h b/lib/libc/glibc/sysdeps/m68k/sysdep.h index f0ecc8f202..26448d26c5 100644 --- a/lib/libc/glibc/sysdeps/m68k/sysdep.h +++ b/lib/libc/glibc/sysdeps/m68k/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for m68k. - Copyright (C) 1998-2024 Free Software Foundation, Inc. + Copyright (C) 1998-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/mach/libc-lock.h b/lib/libc/glibc/sysdeps/mach/libc-lock.h index 63427f7767..41fd1c6b85 100644 --- a/lib/libc/glibc/sysdeps/mach/libc-lock.h +++ b/lib/libc/glibc/sysdeps/mach/libc-lock.h @@ -1,5 +1,5 @@ /* libc-internal interface for mutex locks. Mach cthreads version. - Copyright (C) 1996-2024 Free Software Foundation, Inc. + Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/mach/sysdep.h b/lib/libc/glibc/sysdeps/mach/sysdep.h index 3e0553d80f..8293c66eb8 100644 --- a/lib/libc/glibc/sysdeps/mach/sysdep.h +++ b/lib/libc/glibc/sysdeps/mach/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1994-2024 Free Software Foundation, Inc. +/* Copyright (C) 1994-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h b/lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h index c166e8a25c..801f8b71f1 100644 --- a/lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h +++ b/lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h @@ -1,5 +1,5 @@ /* Configuration of lookup functions. MIPS version. - Copyright (C) 2000-2024 Free Software Foundation, Inc. + Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h index 5ea0c7955e..ab3cdfb794 100644 --- a/lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h @@ -1,5 +1,5 @@ /* Machine-specific pthread type layouts. MIPS version. - Copyright (C) 2005-2024 Free Software Foundation, Inc. + Copyright (C) 2005-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/mips/start.S b/lib/libc/glibc/sysdeps/mips/start.S index 0b10d0e7ce..c58915c134 100644 --- a/lib/libc/glibc/sysdeps/mips/start.S +++ b/lib/libc/glibc/sysdeps/mips/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF Mips ABI. - Copyright (C) 1995-2024 Free Software Foundation, Inc. + Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h b/lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h index bace817f0b..1afb017bec 100644 --- a/lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h +++ b/lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h @@ -1,5 +1,5 @@ /* Declaration of common pthread types for all architectures. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h b/lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h index df54eef6f7..7c24c0a6be 100644 --- a/lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h +++ b/lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h @@ -1,5 +1,5 @@ /* Common threading primitives definitions for both POSIX and C11. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -95,8 +95,7 @@ struct __pthread_cond_s { __atomic_wide_counter __wseq; __atomic_wide_counter __g1_start; - unsigned int __g_refs[2] __LOCK_ALIGNMENT; - unsigned int __g_size[2]; + unsigned int __g_size[2] __LOCK_ALIGNMENT; unsigned int __g1_orig_size; unsigned int __wrefs; unsigned int __g_signals[2]; diff --git a/lib/libc/glibc/sysdeps/nptl/libc-lock.h b/lib/libc/glibc/sysdeps/nptl/libc-lock.h index 84aa961549..3775547994 100644 --- a/lib/libc/glibc/sysdeps/nptl/libc-lock.h +++ b/lib/libc/glibc/sysdeps/nptl/libc-lock.h @@ -1,5 +1,5 @@ /* libc-internal interface for mutex locks. NPTL version. - Copyright (C) 1996-2024 Free Software Foundation, Inc. + Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/nptl/libc-lockP.h b/lib/libc/glibc/sysdeps/nptl/libc-lockP.h index 348999ca23..1be3dd1ec1 100644 --- a/lib/libc/glibc/sysdeps/nptl/libc-lockP.h +++ b/lib/libc/glibc/sysdeps/nptl/libc-lockP.h @@ -1,5 +1,5 @@ /* Private libc-internal interface for mutex locks. NPTL version. - Copyright (C) 1996-2024 Free Software Foundation, Inc. + Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/nptl/pthread.h b/lib/libc/glibc/sysdeps/nptl/pthread.h index 3d4f4a756c..050b4ab8d1 100644 --- a/lib/libc/glibc/sysdeps/nptl/pthread.h +++ b/lib/libc/glibc/sysdeps/nptl/pthread.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2024 Free Software Foundation, Inc. +/* Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -152,7 +152,7 @@ enum /* Conditional variable handling. */ -#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, {0, 0}, 0, 0, {0, 0} } } +#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0} } } /* Cleanup buffers */ diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S b/lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S index 9f7ee4bcfa..d1a7c54859 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S @@ -1,5 +1,5 @@ /* Startup code for programs linked with GNU libc. - Copyright (C) 1998-2024 Free Software Foundation, Inc. + Copyright (C) 1998-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h b/lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h index b554c859b0..898495ac00 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h @@ -1,5 +1,5 @@ /* Hacks needed for symbol manipulation. powerpc version. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h b/lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h index 62de4ca2e5..863b011764 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h @@ -1,5 +1,5 @@ /* Assembly macros for 32-bit PowerPC. - Copyright (C) 1999-2024 Free Software Foundation, Inc. + Copyright (C) 1999-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -104,6 +104,9 @@ GOT_LABEL: ; \ # define JUMPTARGET(name) name #endif +#define TAIL_CALL_NO_RETURN(__func) \ + b __func@local + #if defined SHARED && defined PIC && !defined NO_HIDDEN # undef HIDDEN_JUMPTARGET # define HIDDEN_JUMPTARGET(name) __GI_##name##@local diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h b/lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h index 1bca0f7197..452e3b82b5 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h @@ -1,5 +1,5 @@ /* Configuration of lookup functions. PowerPC64 version. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S b/lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S index 564374bc5a..b9a5205edb 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S @@ -1,5 +1,5 @@ /* Startup code for programs linked with GNU libc. PowerPC64 version. - Copyright (C) 1998-2024 Free Software Foundation, Inc. + Copyright (C) 1998-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h b/lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h index c363939e1a..f05dae71f6 100644 --- a/lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h +++ b/lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h @@ -1,5 +1,5 @@ /* Assembly macros for 64-bit PowerPC. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -31,8 +31,9 @@ #define FRAME_TOC_SAVE 40 #define FRAME_PARM_SAVE 48 #else -#define FRAME_MIN_SIZE 32 -#define FRAME_MIN_SIZE_PARM 96 +#define FRAME_ROP_SAVE -8 +#define FRAME_MIN_SIZE 48 /* Includes space for the ROP save slot */ +#define FRAME_MIN_SIZE_PARM 112 /* Includes space for the ROP save slot */ #define FRAME_TOC_SAVE 24 #define FRAME_PARM_SAVE 32 #endif @@ -352,6 +353,25 @@ LT_LABELSUFFIX(name,_name_end): ; \ ENTRY (name); \ DO_CALL (SYS_ify (syscall_name)) +#ifdef SHARED +# define TAIL_CALL_NO_RETURN(__func) \ + b JUMPTARGET (NOTOC (__func)) +#else +# define TAIL_CALL_NO_RETURN(__func) \ + .ifdef .Local ## __func; \ + b .Local ## __func; \ + .else; \ +.Local ## __func: \ + mflr 0; \ + std 0,FRAME_LR_SAVE(1); \ + stdu 1,-FRAME_MIN_SIZE(1); \ + cfi_adjust_cfa_offset(FRAME_MIN_SIZE); \ + cfi_offset(lr,FRAME_LR_SAVE); \ + bl JUMPTARGET(__func); \ + nop; \ + .endif +#endif + #ifdef SHARED #define TAIL_CALL_SYSCALL_ERROR \ b JUMPTARGET (NOTOC (__syscall_error)) diff --git a/lib/libc/glibc/sysdeps/powerpc/sysdep.h b/lib/libc/glibc/sysdeps/powerpc/sysdep.h index 1e48657b7a..8ce71565b1 100644 --- a/lib/libc/glibc/sysdeps/powerpc/sysdep.h +++ b/lib/libc/glibc/sysdeps/powerpc/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999-2024 Free Software Foundation, Inc. +/* Copyright (C) 1999-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h index d8fea559f6..ec246b4f3f 100644 --- a/lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h @@ -1,5 +1,5 @@ /* Machine-specific pthread type layouts. RISC-V version. - Copyright (C) 2011-2024 Free Software Foundation, Inc. + Copyright (C) 2011-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/riscv/start.S b/lib/libc/glibc/sysdeps/riscv/start.S index ede186ef23..2db79c0ae6 100644 --- a/lib/libc/glibc/sysdeps/riscv/start.S +++ b/lib/libc/glibc/sysdeps/riscv/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF RISC-V ABI. - Copyright (C) 1995-2024 Free Software Foundation, Inc. + Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -87,6 +87,7 @@ load_gp: ret .section .preinit_array,"aw" + .align PTRLOG .dc.a load_gp /* Define a symbol for the first piece of initialized data. */ diff --git a/lib/libc/glibc/sysdeps/s390/s390-64/start.S b/lib/libc/glibc/sysdeps/s390/s390-64/start.S index 6e9d66be79..959d761164 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-64/start.S +++ b/lib/libc/glibc/sysdeps/s390/s390-64/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the 64 bit S/390 ELF ABI. - Copyright (C) 2001-2024 Free Software Foundation, Inc. + Copyright (C) 2001-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h b/lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h index f8abd2f3e3..cb5e432fc5 100644 --- a/lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h +++ b/lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for 64 bit S/390. - Copyright (C) 2001-2024 Free Software Foundation, Inc. + Copyright (C) 2001-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h b/lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h index c09a9e37b0..fca73324af 100644 --- a/lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h +++ b/lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h @@ -1,5 +1,5 @@ /* Configuration of lookup functions. SPARC version. - Copyright (C) 2000-2024 Free Software Foundation, Inc. + Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/sparc/sparc32/start.S b/lib/libc/glibc/sysdeps/sparc/sparc32/start.S index e919df8042..694b020ce0 100644 --- a/lib/libc/glibc/sysdeps/sparc/sparc32/start.S +++ b/lib/libc/glibc/sysdeps/sparc/sparc32/start.S @@ -1,5 +1,5 @@ /* Startup code for elf32-sparc - Copyright (C) 1997-2024 Free Software Foundation, Inc. + Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/sparc/sparc64/start.S b/lib/libc/glibc/sysdeps/sparc/sparc64/start.S index a1527d2318..c9c25c2e47 100644 --- a/lib/libc/glibc/sysdeps/sparc/sparc64/start.S +++ b/lib/libc/glibc/sysdeps/sparc/sparc64/start.S @@ -1,5 +1,5 @@ /* Startup code for elf64-sparc - Copyright (C) 1997-2024 Free Software Foundation, Inc. + Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/sparc/sysdep.h b/lib/libc/glibc/sysdeps/sparc/sysdep.h index 44a6952bff..8381b0570d 100644 --- a/lib/libc/glibc/sysdeps/sparc/sysdep.h +++ b/lib/libc/glibc/sysdeps/sparc/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2024 Free Software Foundation, Inc. +/* Copyright (C) 2011-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/arm/sysdep.h b/lib/libc/glibc/sysdeps/unix/arm/sysdep.h index c0ab28a91b..814d16fbad 100644 --- a/lib/libc/glibc/sysdeps/unix/arm/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/arm/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2024 Free Software Foundation, Inc. +/* Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/i386/sysdep.h b/lib/libc/glibc/sysdeps/unix/i386/sysdep.h index fde1e5cfb2..e58f841f8b 100644 --- a/lib/libc/glibc/sysdeps/unix/i386/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/i386/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h b/lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h index c515b94540..e09e4be5b0 100644 --- a/lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h b/lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h index 6565b84e3a..206569357a 100644 --- a/lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/mips/sysdep.h b/lib/libc/glibc/sysdeps/unix/mips/sysdep.h index 54e92b26d0..bb2794bd71 100644 --- a/lib/libc/glibc/sysdeps/unix/mips/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/mips/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h b/lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h index 947efd8f89..a580834872 100644 --- a/lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sh/sysdep.h b/lib/libc/glibc/sysdeps/unix/sh/sysdep.h index 83f641d1d6..28cb75ba1a 100644 --- a/lib/libc/glibc/sysdeps/unix/sh/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sh/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999-2024 Free Software Foundation, Inc. +/* Copyright (C) 1999-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysdep.h index a19e84165b..2cc98725c3 100644 --- a/lib/libc/glibc/sysdeps/unix/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,6 +24,9 @@ #define SYSCALL__(name, args) PSEUDO (__##name, name, args) #define SYSCALL(name, args) PSEUDO (name, name, args) +#ifndef __ASSEMBLER__ +# include + #define __SYSCALL_CONCAT_X(a,b) a##b #define __SYSCALL_CONCAT(a,b) __SYSCALL_CONCAT_X (a, b) @@ -108,42 +111,148 @@ #define INLINE_SYSCALL_CALL(...) \ __INLINE_SYSCALL_DISP (__INLINE_SYSCALL, __VA_ARGS__) -#if IS_IN (rtld) -/* All cancellation points are compiled out in the dynamic loader. */ -# define NO_SYSCALL_CANCEL_CHECKING 1 +#define __INTERNAL_SYSCALL_NCS0(name) \ + INTERNAL_SYSCALL_NCS (name, 0) +#define __INTERNAL_SYSCALL_NCS1(name, a1) \ + INTERNAL_SYSCALL_NCS (name, 1, a1) +#define __INTERNAL_SYSCALL_NCS2(name, a1, a2) \ + INTERNAL_SYSCALL_NCS (name, 2, a1, a2) +#define __INTERNAL_SYSCALL_NCS3(name, a1, a2, a3) \ + INTERNAL_SYSCALL_NCS (name, 3, a1, a2, a3) +#define __INTERNAL_SYSCALL_NCS4(name, a1, a2, a3, a4) \ + INTERNAL_SYSCALL_NCS (name, 4, a1, a2, a3, a4) +#define __INTERNAL_SYSCALL_NCS5(name, a1, a2, a3, a4, a5) \ + INTERNAL_SYSCALL_NCS (name, 5, a1, a2, a3, a4, a5) +#define __INTERNAL_SYSCALL_NCS6(name, a1, a2, a3, a4, a5, a6) \ + INTERNAL_SYSCALL_NCS (name, 6, a1, a2, a3, a4, a5, a6) +#define __INTERNAL_SYSCALL_NCS7(name, a1, a2, a3, a4, a5, a6, a7) \ + INTERNAL_SYSCALL_NCS (name, 7, a1, a2, a3, a4, a5, a6, a7) + +/* Issue a syscall defined by syscall number plus any other argument required. + It is similar to INTERNAL_SYSCALL_NCS macro, but without the need to pass + the expected argument number as third parameter. */ +#define INTERNAL_SYSCALL_NCS_CALL(...) \ + __INTERNAL_SYSCALL_DISP (__INTERNAL_SYSCALL_NCS, __VA_ARGS__) + +/* Cancellation macros. */ +#include + +/* Adjust both the __syscall_cancel and the SYSCALL_CANCEL macro to support + 7 arguments instead of default 6 (curently only mip32). It avoid add + the requirement to each architecture to support 7 argument macros + {INTERNAL,INLINE}_SYSCALL. */ +#ifdef HAVE_CANCELABLE_SYSCALL_WITH_7_ARGS +# define __SYSCALL_CANCEL7_ARG_DEF __syscall_arg_t a7, +# define __SYSCALL_CANCEL7_ARCH_ARG_DEF ,__syscall_arg_t a7 +# define __SYSCALL_CANCEL7_ARG 0, +# define __SYSCALL_CANCEL7_ARG7 a7, +# define __SYSCALL_CANCEL7_ARCH_ARG7 , a7 #else -# define NO_SYSCALL_CANCEL_CHECKING SINGLE_THREAD_P +# define __SYSCALL_CANCEL7_ARG_DEF +# define __SYSCALL_CANCEL7_ARCH_ARG_DEF +# define __SYSCALL_CANCEL7_ARG +# define __SYSCALL_CANCEL7_ARG7 +# define __SYSCALL_CANCEL7_ARCH_ARG7 +#endif +long int __internal_syscall_cancel (__syscall_arg_t a1, __syscall_arg_t a2, + __syscall_arg_t a3, __syscall_arg_t a4, + __syscall_arg_t a5, __syscall_arg_t a6, + __SYSCALL_CANCEL7_ARG_DEF + __syscall_arg_t nr) attribute_hidden; + +long int __syscall_cancel (__syscall_arg_t arg1, __syscall_arg_t arg2, + __syscall_arg_t arg3, __syscall_arg_t arg4, + __syscall_arg_t arg5, __syscall_arg_t arg6, + __SYSCALL_CANCEL7_ARG_DEF + __syscall_arg_t nr) attribute_hidden; + +#define __SYSCALL_CANCEL0(name) \ + __syscall_cancel (0, 0, 0, 0, 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name) +#define __SYSCALL_CANCEL1(name, a1) \ + __syscall_cancel (__SSC (a1), 0, 0, 0, 0, 0, \ + __SYSCALL_CANCEL7_ARG __NR_##name) +#define __SYSCALL_CANCEL2(name, a1, a2) \ + __syscall_cancel (__SSC (a1), __SSC (a2), 0, 0, 0, 0, \ + __SYSCALL_CANCEL7_ARG __NR_##name) +#define __SYSCALL_CANCEL3(name, a1, a2, a3) \ + __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), 0, 0, 0, \ + __SYSCALL_CANCEL7_ARG __NR_##name) +#define __SYSCALL_CANCEL4(name, a1, a2, a3, a4) \ + __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \ + __SSC(a4), 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name) +#define __SYSCALL_CANCEL5(name, a1, a2, a3, a4, a5) \ + __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC(a4), \ + __SSC (a5), 0, __SYSCALL_CANCEL7_ARG __NR_##name) +#define __SYSCALL_CANCEL6(name, a1, a2, a3, a4, a5, a6) \ + __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC (a4), \ + __SSC (a5), __SSC (a6), __SYSCALL_CANCEL7_ARG \ + __NR_##name) +#define __SYSCALL_CANCEL7(name, a1, a2, a3, a4, a5, a6, a7) \ + __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC (a4), \ + __SSC (a5), __SSC (a6), __SSC (a7), __NR_##name) + +#define __SYSCALL_CANCEL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n +#define __SYSCALL_CANCEL_NARGS(...) \ + __SYSCALL_CANCEL_NARGS_X (__VA_ARGS__,7,6,5,4,3,2,1,0,) +#define __SYSCALL_CANCEL_CONCAT_X(a,b) a##b +#define __SYSCALL_CANCEL_CONCAT(a,b) __SYSCALL_CANCEL_CONCAT_X (a, b) +#define __SYSCALL_CANCEL_DISP(b,...) \ + __SYSCALL_CANCEL_CONCAT (b,__SYSCALL_CANCEL_NARGS(__VA_ARGS__))(__VA_ARGS__) + +/* Issue a cancellable syscall defined first argument plus any other argument + required. If and error occurs its value, the macro returns -1 and sets + errno accordingly. */ +#define __SYSCALL_CANCEL_CALL(...) \ + __SYSCALL_CANCEL_DISP (__SYSCALL_CANCEL, __VA_ARGS__) + +#define __INTERNAL_SYSCALL_CANCEL0(name) \ + __internal_syscall_cancel (0, 0, 0, 0, 0, 0, __SYSCALL_CANCEL7_ARG \ + __NR_##name) +#define __INTERNAL_SYSCALL_CANCEL1(name, a1) \ + __internal_syscall_cancel (__SSC (a1), 0, 0, 0, 0, 0, \ + __SYSCALL_CANCEL7_ARG __NR_##name) +#define __INTERNAL_SYSCALL_CANCEL2(name, a1, a2) \ + __internal_syscall_cancel (__SSC (a1), __SSC (a2), 0, 0, 0, 0, \ + __SYSCALL_CANCEL7_ARG __NR_##name) +#define __INTERNAL_SYSCALL_CANCEL3(name, a1, a2, a3) \ + __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), 0, \ + 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name) +#define __INTERNAL_SYSCALL_CANCEL4(name, a1, a2, a3, a4) \ + __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \ + __SSC(a4), 0, 0, \ + __SYSCALL_CANCEL7_ARG __NR_##name) +#define __INTERNAL_SYSCALL_CANCEL5(name, a1, a2, a3, a4, a5) \ + __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \ + __SSC(a4), __SSC (a5), 0, \ + __SYSCALL_CANCEL7_ARG __NR_##name) +#define __INTERNAL_SYSCALL_CANCEL6(name, a1, a2, a3, a4, a5, a6) \ + __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \ + __SSC (a4), __SSC (a5), __SSC (a6), \ + __SYSCALL_CANCEL7_ARG __NR_##name) +#define __INTERNAL_SYSCALL_CANCEL7(name, a1, a2, a3, a4, a5, a6, a7) \ + __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \ + __SSC (a4), __SSC (a5), __SSC (a6), \ + __SSC (a7), __NR_##name) + +/* Issue a cancellable syscall defined by syscall number NAME plus any other + argument required. If an error occurs its value is returned as an negative + number unmodified and errno is not set. */ +#define __INTERNAL_SYSCALL_CANCEL_CALL(...) \ + __SYSCALL_CANCEL_DISP (__INTERNAL_SYSCALL_CANCEL, __VA_ARGS__) + +#if IS_IN (rtld) +/* The loader does not need to handle thread cancellation, use direct + syscall instead. */ +# define INTERNAL_SYSCALL_CANCEL(...) INTERNAL_SYSCALL_CALL(__VA_ARGS__) +# define SYSCALL_CANCEL(...) INLINE_SYSCALL_CALL (__VA_ARGS__) +#else +# define INTERNAL_SYSCALL_CANCEL(...) \ + __INTERNAL_SYSCALL_CANCEL_CALL (__VA_ARGS__) +# define SYSCALL_CANCEL(...) \ + __SYSCALL_CANCEL_CALL (__VA_ARGS__) #endif -#define SYSCALL_CANCEL(...) \ - ({ \ - long int sc_ret; \ - if (NO_SYSCALL_CANCEL_CHECKING) \ - sc_ret = INLINE_SYSCALL_CALL (__VA_ARGS__); \ - else \ - { \ - int sc_cancel_oldtype = LIBC_CANCEL_ASYNC (); \ - sc_ret = INLINE_SYSCALL_CALL (__VA_ARGS__); \ - LIBC_CANCEL_RESET (sc_cancel_oldtype); \ - } \ - sc_ret; \ - }) - -/* Issue a syscall defined by syscall number plus any other argument - required. Any error will be returned unmodified (including errno). */ -#define INTERNAL_SYSCALL_CANCEL(...) \ - ({ \ - long int sc_ret; \ - if (NO_SYSCALL_CANCEL_CHECKING) \ - sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); \ - else \ - { \ - int sc_cancel_oldtype = LIBC_CANCEL_ASYNC (); \ - sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); \ - LIBC_CANCEL_RESET (sc_cancel_oldtype); \ - } \ - sc_ret; \ - }) +#endif /* __ASSEMBLER__ */ /* Machine-dependent sysdep.h files are expected to define the macro PSEUDO (function_name, syscall_name) to emit assembly code to define the diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h index d99056df4c..8cdd6ed112 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. AArch64 version. - Copyright (C) 2018-2024 Free Software Foundation, Inc. + Copyright (C) 2018-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h index c2a961833d..7ccf9a2588 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2024 Free Software Foundation, Inc. +/* Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h index bbbe35723c..b813805931 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2024 Free Software Foundation, Inc. +/* Copyright (C) 2005-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -164,6 +164,7 @@ # define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres" # define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime" # define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday" +# define HAVE_GETRANDOM_VSYSCALL "__kernel_getrandom" # define HAVE_CLONE3_WRAPPER 1 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h index 60d5ef8629..06e31404ec 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for ARC. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h index f17c2f9e68..10caae8b91 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 2006-2024 Free Software Foundation, Inc. + Copyright (C) 2006-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h index 82ec0fec50..9acb39e5ea 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2024 Free Software Foundation, Inc. +/* Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h index 7110e12ec5..6a477068ba 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h index fad5f43590..e42a305829 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h index 03ccde6d0a..56ba6c25bf 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2024 Free Software Foundation, Inc. +/* Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h index d987a25c0c..f39c7c1dec 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h @@ -1,5 +1,5 @@ /* Internal definitions for stat functions. Linux/csky. - Copyright (C) 2011-2024 Free Software Foundation, Inc. + Copyright (C) 2011-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h index e632f3e0ca..6ef105d330 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h @@ -1,5 +1,5 @@ /* Assembly macros for C-SKY. - Copyright (C) 2018-2024 Free Software Foundation, Inc. + Copyright (C) 2018-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h index 36c09bb537..6381243a48 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h @@ -1,5 +1,5 @@ /* System-specific settings for dynamic linker code. Linux version. - Copyright (C) 2005-2024 Free Software Foundation, Inc. + Copyright (C) 2005-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c index fab87e7690..0df9da3222 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c index cc9f695df9..8da9be35e4 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -30,7 +30,7 @@ __fstat64_time64 (int fd, struct __stat64_t64 *buf) { #if !FSTATAT_USE_STATX # if XSTAT_IS_XSTAT64 - /* The __NR_stat macro is defined for all ABIs that also define + /* The __NR_stat macro is defined for all ABIs that also define XSTAT_IS_STAT64, so to correctly identify alpha and sparc check __NR_newfstatat (similar to what fstatat64 does). */ # ifdef __NR_newfstatat @@ -60,7 +60,7 @@ __fstat64_time64 (int fd, struct __stat64_t64 *buf) # endif #else /* !FSTATAT_USE_STATX */ /* All kABIs with non-LFS support and with old 32-bit time_t support - e.g. arm, csky, i386, hppa, m68k, microblaze, nios2, sh, powerpc32, + e.g. arm, csky, i386, hppa, m68k, microblaze, sh, powerpc32, and sparc32. */ if (fd < 0) { diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c index de6aa91d26..f7c13dba0c 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +/* zig patch: fixes to make this file compile */ + #include #include #include diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c index f6f7f4bbfc..0c27744b79 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +/* zig patch: fixes to make this file compile */ + #define __fstatat __redirect___fstatat #define fstatat __redirect_fstatat #include @@ -104,7 +106,7 @@ fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf, #else # ifdef __NR_fstatat64 /* All kABIs with non-LFS support and with old 32-bit time_t support - e.g. arm, csky, i386, hppa, m68k, microblaze, nios2, sh, powerpc32, + e.g. arm, csky, i386, hppa, m68k, microblaze, sh, powerpc32, and sparc32. */ struct stat64 st64; r = INTERNAL_SYSCALL_CALL (fstatat64, fd, file, &st64, flag); diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h index 7c33130ac9..60f6d4dc39 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h @@ -1,5 +1,5 @@ /* System-specific settings for dynamic linker code. i386 version. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h index 446acfce00..d21e3bae46 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. i386 version. - Copyright (C) 1999-2024 Free Software Foundation, Inc. + Copyright (C) 1999-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h index 25852f894e..87806a7a97 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h index c4a0af486b..8af305d410 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h @@ -1,5 +1,5 @@ /* Internal declarations for sys/timex.h. - Copyright (C) 2014-2024 Free Software Foundation, Inc. + Copyright (C) 2014-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h index a25cf07e9f..86b2d3ce51 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 1999-2024 Free Software Foundation, Inc. + Copyright (C) 1999-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h index b6cfc4a805..a861c94a80 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h @@ -1,5 +1,5 @@ /* Internal definitions for stat functions. - Copyright (C) 2021-2024 Free Software Foundation, Inc. + Copyright (C) 2021-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/loongarch/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/loongarch/sysdep.h index eb0ba790da..b9835d8391 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/loongarch/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/loongarch/sysdep.h @@ -1,5 +1,5 @@ /* Assembly macros for LoongArch. - Copyright (C) 2022-2024 Free Software Foundation, Inc. + Copyright (C) 2022-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -119,6 +119,7 @@ #define HAVE_CLOCK_GETTIME64_VSYSCALL "__vdso_clock_gettime" #define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday" #define HAVE_GETCPU_VSYSCALL "__vdso_getcpu" +#define HAVE_GETRANDOM_VSYSCALL "__vdso_getrandom" #define HAVE_CLONE3_WRAPPER 1 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c index 7d87fcf65d..5b441718a4 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c index cd09493c3a..3d70ef8c00 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c @@ -1,5 +1,5 @@ /* Get file status. - Copyright (C) 1996-2024 Free Software Foundation, Inc. + Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h index 4f39f252d9..30b182fe1c 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2024 Free Software Foundation, Inc. +/* Copyright (C) 2010-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h index 82a34a85b2..3515b20433 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 2008-2024 Free Software Foundation, Inc. + Copyright (C) 2008-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h index 2560e915d7..02bde90490 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2024 Free Software Foundation, Inc. +/* Copyright (C) 2010-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h index 0e43b4ae51..6f6b46e026 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2024 Free Software Foundation, Inc. +/* Copyright (C) 1996-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h index 59771775f9..d86ac92352 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 1999-2024 Free Software Foundation, Inc. + Copyright (C) 1999-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h index 1827caf595..83ccfb08af 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,6 +18,10 @@ #ifndef _LINUX_MIPS_MIPS32_SYSDEP_H #define _LINUX_MIPS_MIPS32_SYSDEP_H 1 +/* mips32 have cancelable syscalls with 7 arguments (currently only + sync_file_range). */ +#define HAVE_CANCELABLE_SYSCALL_WITH_7_ARGS 1 + /* There is some commonality. */ #include #include diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h index fac8c0c9f2..6e8375d54b 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h @@ -1,5 +1,5 @@ /* Struct stat/stat64 to stat/stat64 conversion for Linux. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h index 0a1711dad2..78044d669d 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -44,15 +44,7 @@ #undef HAVE_INTERNAL_BRK_ADDR_SYMBOL #define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 -#if _MIPS_SIM == _ABIN32 -/* Convert X to a long long, without losing any bits if it is one - already or warning if it is a 32-bit pointer. */ -# define ARGIFY(X) ((long long int) (__typeof__ ((X) - (X))) (X)) -typedef long long int __syscall_arg_t; -#else -# define ARGIFY(X) ((long int) (X)) -typedef long int __syscall_arg_t; -#endif +#include /* Note that the original Linux syscall restart convention required the instruction immediately preceding SYSCALL to initialize $v0 with the @@ -120,7 +112,7 @@ typedef long int __syscall_arg_t; long int _sys_result; \ \ { \ - __syscall_arg_t _arg1 = ARGIFY (arg1); \ + __syscall_arg_t _arg1 = __SSC (arg1); \ register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ = (number); \ register __syscall_arg_t __v0 asm ("$2"); \ @@ -144,8 +136,8 @@ typedef long int __syscall_arg_t; long int _sys_result; \ \ { \ - __syscall_arg_t _arg1 = ARGIFY (arg1); \ - __syscall_arg_t _arg2 = ARGIFY (arg2); \ + __syscall_arg_t _arg1 = __SSC (arg1); \ + __syscall_arg_t _arg2 = __SSC (arg2); \ register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ = (number); \ register __syscall_arg_t __v0 asm ("$2"); \ @@ -170,9 +162,9 @@ typedef long int __syscall_arg_t; long int _sys_result; \ \ { \ - __syscall_arg_t _arg1 = ARGIFY (arg1); \ - __syscall_arg_t _arg2 = ARGIFY (arg2); \ - __syscall_arg_t _arg3 = ARGIFY (arg3); \ + __syscall_arg_t _arg1 = __SSC (arg1); \ + __syscall_arg_t _arg2 = __SSC (arg2); \ + __syscall_arg_t _arg3 = __SSC (arg3); \ register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ = (number); \ register __syscall_arg_t __v0 asm ("$2"); \ @@ -199,10 +191,10 @@ typedef long int __syscall_arg_t; long int _sys_result; \ \ { \ - __syscall_arg_t _arg1 = ARGIFY (arg1); \ - __syscall_arg_t _arg2 = ARGIFY (arg2); \ - __syscall_arg_t _arg3 = ARGIFY (arg3); \ - __syscall_arg_t _arg4 = ARGIFY (arg4); \ + __syscall_arg_t _arg1 = __SSC (arg1); \ + __syscall_arg_t _arg2 = __SSC (arg2); \ + __syscall_arg_t _arg3 = __SSC (arg3); \ + __syscall_arg_t _arg4 = __SSC (arg4); \ register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ = (number); \ register __syscall_arg_t __v0 asm ("$2"); \ @@ -229,11 +221,11 @@ typedef long int __syscall_arg_t; long int _sys_result; \ \ { \ - __syscall_arg_t _arg1 = ARGIFY (arg1); \ - __syscall_arg_t _arg2 = ARGIFY (arg2); \ - __syscall_arg_t _arg3 = ARGIFY (arg3); \ - __syscall_arg_t _arg4 = ARGIFY (arg4); \ - __syscall_arg_t _arg5 = ARGIFY (arg5); \ + __syscall_arg_t _arg1 = __SSC (arg1); \ + __syscall_arg_t _arg2 = __SSC (arg2); \ + __syscall_arg_t _arg3 = __SSC (arg3); \ + __syscall_arg_t _arg4 = __SSC (arg4); \ + __syscall_arg_t _arg5 = __SSC (arg5); \ register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ = (number); \ register __syscall_arg_t __v0 asm ("$2"); \ @@ -261,12 +253,12 @@ typedef long int __syscall_arg_t; long int _sys_result; \ \ { \ - __syscall_arg_t _arg1 = ARGIFY (arg1); \ - __syscall_arg_t _arg2 = ARGIFY (arg2); \ - __syscall_arg_t _arg3 = ARGIFY (arg3); \ - __syscall_arg_t _arg4 = ARGIFY (arg4); \ - __syscall_arg_t _arg5 = ARGIFY (arg5); \ - __syscall_arg_t _arg6 = ARGIFY (arg6); \ + __syscall_arg_t _arg1 = __SSC (arg1); \ + __syscall_arg_t _arg2 = __SSC (arg2); \ + __syscall_arg_t _arg3 = __SSC (arg3); \ + __syscall_arg_t _arg4 = __SSC (arg4); \ + __syscall_arg_t _arg5 = __SSC (arg5); \ + __syscall_arg_t _arg6 = __SSC (arg6); \ register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\ = (number); \ register __syscall_arg_t __v0 asm ("$2"); \ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h index 74ca3d67f7..76e121a11f 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h @@ -1,5 +1,5 @@ /* Syscall definitions, Linux MIPS generic version. - Copyright (C) 2019-2024 Free Software Foundation, Inc. + Copyright (C) 2019-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c index 74dad63fd9..291b5bc658 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c @@ -1,5 +1,5 @@ /* Create a special or ordinary file. Linux version. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +/* zig patch: fixes to make this file compile */ + #include #include #include diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 9ddfe82105..6e5adb97b3 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. PowerPC version. - Copyright (C) 1999-2024 Free Software Foundation, Inc. + Copyright (C) 1999-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h index 6e2a5c2c6a..40b5163ae9 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h @@ -1,5 +1,5 @@ /* Definition of `struct stat' used in the kernel. - Copyright (C) 1997-2024 Free Software Foundation, Inc. + Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h index 41c4e0aca6..4018c3079e 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2024 Free Software Foundation, Inc. +/* Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h index a69b7db338..929784df55 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h @@ -1,5 +1,5 @@ /* Syscall definitions, Linux PowerPC generic version. - Copyright (C) 2019-2024 Free Software Foundation, Inc. + Copyright (C) 2019-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,6 +32,18 @@ #undef SYS_ify #define SYS_ify(syscall_name) __NR_##syscall_name +#define tostring(s) #s +#define stringify(s) tostring(s) + +#ifdef _ARCH_PWR4 +/* Power4 and later cpus introduced a faster instruction to copy one + CR field, rather than the slower microcoded mfcr which copies all + CR fields. */ +# define MFCR0(REG) "mfocrf " stringify(REG) ",0x80" +#else +# define MFCR0(REG) "mfcr " stringify(REG) +#endif + /* Define a macro which expands inline into the wrapper code for a system call. This use is for internal calls that do not need to handle errors normally. It will never touch errno. This returns just what the kernel @@ -52,7 +64,7 @@ __asm__ __volatile__ \ ("mtctr %0\n\t" \ "bctrl\n\t" \ - "mfcr %0\n\t" \ + MFCR0(%0) "\n\t" \ "0:" \ : "+r" (r0), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), \ "+r" (r7), "+r" (r8) \ @@ -83,11 +95,10 @@ "scv 0\n\t" \ ".machine \"pop\"\n\t" \ "0:" \ - : "=&r" (r0), \ - "=&r" (r3), "=&r" (r4), "=&r" (r5), \ - "=&r" (r6), "=&r" (r7), "=&r" (r8) \ - : ASM_INPUT_##nr \ - : "r9", "r10", "r11", "r12", \ + : "+r" (r0), \ + "+r" (r3), "+r" (r4), "+r" (r5), \ + "+r" (r6), "+r" (r7), "+r" (r8) \ + : : "r9", "r10", "r11", "r12", \ "cr0", "cr1", "cr5", "cr6", "cr7", \ "xer", "lr", "ctr", "memory"); \ r3; \ @@ -97,13 +108,12 @@ ({ \ __asm__ __volatile__ \ ("sc\n\t" \ - "mfcr %0\n\t" \ + MFCR0(%0) "\n\t" \ "0:" \ - : "=&r" (r0), \ - "=&r" (r3), "=&r" (r4), "=&r" (r5), \ - "=&r" (r6), "=&r" (r7), "=&r" (r8) \ - : ASM_INPUT_##nr \ - : "r9", "r10", "r11", "r12", \ + : "+r" (r0), \ + "+r" (r3), "+r" (r4), "+r" (r5), \ + "+r" (r6), "+r" (r7), "+r" (r8) \ + : : "r9", "r10", "r11", "r12", \ "xer", "cr0", "ctr", "memory"); \ r0 & (1 << 28) ? -r3 : r3; \ }) @@ -199,14 +209,6 @@ __illegally_sized_syscall_arg6 (); \ r8 = _arg6 -#define ASM_INPUT_0 "0" (r0) -#define ASM_INPUT_1 ASM_INPUT_0, "1" (r3) -#define ASM_INPUT_2 ASM_INPUT_1, "2" (r4) -#define ASM_INPUT_3 ASM_INPUT_2, "3" (r5) -#define ASM_INPUT_4 ASM_INPUT_3, "4" (r6) -#define ASM_INPUT_5 ASM_INPUT_4, "5" (r7) -#define ASM_INPUT_6 ASM_INPUT_5, "6" (r8) - /* List of system calls which are supported as vsyscalls. */ #define VDSO_NAME "LINUX_2.6.15" #define VDSO_HASH 123718565 @@ -223,5 +225,6 @@ #define HAVE_TIME_VSYSCALL "__kernel_time" #define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday" #define HAVE_GET_TBFREQ "__kernel_get_tbfreq" +#define HAVE_GETRANDOM_VSYSCALL "__kernel_getrandom" #endif /* _LINUX_POWERPC_SYSDEP_H */ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h index 022be5195a..dce50835d1 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. RISC-V version. - Copyright (C) 2018-2024 Free Software Foundation, Inc. + Copyright (C) 2018-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h index 7451fa6357..2bbf72f71d 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Linux/s390 version. - Copyright (C) 2003-2024 Free Software Foundation, Inc. + Copyright (C) 2003-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h index 79363f9f5f..4d9f2232e0 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. S/390 version. - Copyright (C) 1999-2024 Free Software Foundation, Inc. + Copyright (C) 1999-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h index 885ab81a4f..a282e1222e 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for 64 bit S/390. - Copyright (C) 2001-2024 Free Software Foundation, Inc. + Copyright (C) 2001-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h index f49abfafea..1e3581b65f 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h index 9b3000ca62..c802980013 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h @@ -1,5 +1,5 @@ /* Syscall definitions, Linux s390 version. - Copyright (C) 2019-2024 Free Software Foundation, Inc. + Copyright (C) 2019-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -72,6 +72,7 @@ #ifdef __s390x__ #define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres" #define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime" +#define HAVE_GETRANDOM_VSYSCALL "__kernel_getrandom" #else #define HAVE_CLOCK_GETRES_VSYSCALL "__kernel_clock_getres" #define HAVE_CLOCK_GETTIME_VSYSCALL "__kernel_clock_gettime" diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h index b651860fa5..eecaa2dc66 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h @@ -1,5 +1,5 @@ /* Single thread optimization, Linux version. - Copyright (C) 2019-2024 Free Software Foundation, Inc. + Copyright (C) 2019-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h index 9f3842a2f4..97e9641ab7 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h index f7efbaece5..24423db127 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. SPARC version. - Copyright (C) 1999-2024 Free Software Foundation, Inc. + Copyright (C) 1999-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h index d2d68f5312..9ad5192dec 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2024 Free Software Foundation, Inc. +/* Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -107,6 +107,7 @@ ENTRY(name); \ #else /* __ASSEMBLER__ */ #define __SYSCALL_STRING \ + "mov %[scn], %%g1;" \ "ta 0x10;" \ "bcc 1f;" \ " nop;" \ @@ -114,7 +115,7 @@ ENTRY(name); \ "1:" #define __SYSCALL_CLOBBERS \ - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + "g1", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h index 2aff560d64..8f4f9f85a7 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h @@ -1,5 +1,5 @@ /* Struct kernel_stat64 to stat64. Linux/SPARC version. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h index 96047424e9..1781dec0d3 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2024 Free Software Foundation, Inc. +/* Copyright (C) 1997-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -106,6 +106,7 @@ ENTRY(name); \ #else /* __ASSEMBLER__ */ #define __SYSCALL_STRING \ + "mov %[scn], %%g1;" \ "ta 0x6d;" \ "bcc,pt %%xcc, 1f;" \ " nop;" \ @@ -113,7 +114,7 @@ ENTRY(name); \ "1:" #define __SYSCALL_CLOBBERS \ - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + "g1", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h index dcabb57fe2..0051f8b4ca 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -50,97 +50,109 @@ #undef INTERNAL_SYSCALL_NCS #define INTERNAL_SYSCALL_NCS(name, nr, args...) \ - internal_syscall##nr(__SYSCALL_STRING, name, args) + _internal_syscall##nr(__SYSCALL_STRING, "p", name, args) -#define internal_syscall0(string,name,dummy...) \ +#define _internal_syscall0(string,nc,name,dummy...) \ ({ \ - register long int __g1 __asm__ ("g1") = (name); \ register long __o0 __asm__ ("o0"); \ + long int _name = (long int) (name); \ __asm __volatile (string : "=r" (__o0) : \ - "r" (__g1) : \ + [scn] nc (_name) : \ __SYSCALL_CLOBBERS); \ __o0; \ }) +#define internal_syscall0(string,name,args...) \ + _internal_syscall0(string, "i", name, args) -#define internal_syscall1(string,name,arg1) \ +#define _internal_syscall1(string,nc,name,arg1) \ ({ \ long int _arg1 = (long int) (arg1); \ - register long int __g1 __asm__("g1") = (name); \ + long int _name = (long int) (name); \ register long int __o0 __asm__ ("o0") = _arg1; \ - __asm __volatile (string : "=r" (__o0) : \ - "r" (__g1), "0" (__o0) : \ + __asm __volatile (string : "+r" (__o0) : \ + [scn] nc (_name) : \ __SYSCALL_CLOBBERS); \ __o0; \ }) +#define internal_syscall1(string,name,args...) \ + _internal_syscall1(string, "i", name, args) -#define internal_syscall2(string,name,arg1,arg2) \ +#define _internal_syscall2(string,nc,name,arg1,arg2) \ ({ \ long int _arg1 = (long int) (arg1); \ long int _arg2 = (long int) (arg2); \ - register long int __g1 __asm__("g1") = (name); \ + long int _name = (long int) (name); \ register long int __o0 __asm__ ("o0") = _arg1; \ register long int __o1 __asm__ ("o1") = _arg2; \ - __asm __volatile (string : "=r" (__o0) : \ - "r" (__g1), "0" (__o0), "r" (__o1) : \ + __asm __volatile (string : "+r" (__o0) : \ + [scn] nc (_name), "r" (__o1) : \ __SYSCALL_CLOBBERS); \ __o0; \ }) +#define internal_syscall2(string,name,args...) \ + _internal_syscall2(string, "i", name, args) -#define internal_syscall3(string,name,arg1,arg2,arg3) \ +#define _internal_syscall3(string,nc,name,arg1,arg2,arg3) \ ({ \ long int _arg1 = (long int) (arg1); \ long int _arg2 = (long int) (arg2); \ long int _arg3 = (long int) (arg3); \ - register long int __g1 __asm__("g1") = (name); \ + long int _name = (long int) (name); \ register long int __o0 __asm__ ("o0") = _arg1; \ register long int __o1 __asm__ ("o1") = _arg2; \ register long int __o2 __asm__ ("o2") = _arg3; \ - __asm __volatile (string : "=r" (__o0) : \ - "r" (__g1), "0" (__o0), "r" (__o1), \ + __asm __volatile (string : "+r" (__o0) : \ + [scn] nc (_name), "r" (__o1), \ "r" (__o2) : \ __SYSCALL_CLOBBERS); \ __o0; \ }) +#define internal_syscall3(string,name,args...) \ + _internal_syscall3(string, "i", name, args) -#define internal_syscall4(string,name,arg1,arg2,arg3,arg4) \ +#define _internal_syscall4(string,nc,name,arg1,arg2,arg3,arg4) \ ({ \ long int _arg1 = (long int) (arg1); \ long int _arg2 = (long int) (arg2); \ long int _arg3 = (long int) (arg3); \ long int _arg4 = (long int) (arg4); \ - register long int __g1 __asm__("g1") = (name); \ + long int _name = (long int) (name); \ register long int __o0 __asm__ ("o0") = _arg1; \ register long int __o1 __asm__ ("o1") = _arg2; \ register long int __o2 __asm__ ("o2") = _arg3; \ register long int __o3 __asm__ ("o3") = _arg4; \ - __asm __volatile (string : "=r" (__o0) : \ - "r" (__g1), "0" (__o0), "r" (__o1), \ + __asm __volatile (string : "+r" (__o0) : \ + [scn] nc (_name), "r" (__o1), \ "r" (__o2), "r" (__o3) : \ __SYSCALL_CLOBBERS); \ __o0; \ }) +#define internal_syscall4(string,name,args...) \ + _internal_syscall4(string, "i", name, args) -#define internal_syscall5(string,name,arg1,arg2,arg3,arg4,arg5) \ +#define _internal_syscall5(string,nc,name,arg1,arg2,arg3,arg4,arg5) \ ({ \ long int _arg1 = (long int) (arg1); \ long int _arg2 = (long int) (arg2); \ long int _arg3 = (long int) (arg3); \ long int _arg4 = (long int) (arg4); \ long int _arg5 = (long int) (arg5); \ - register long int __g1 __asm__("g1") = (name); \ + long int _name = (long int) (name); \ register long int __o0 __asm__ ("o0") = _arg1; \ register long int __o1 __asm__ ("o1") = _arg2; \ register long int __o2 __asm__ ("o2") = _arg3; \ register long int __o3 __asm__ ("o3") = _arg4; \ register long int __o4 __asm__ ("o4") = _arg5; \ - __asm __volatile (string : "=r" (__o0) : \ - "r" (__g1), "0" (__o0), "r" (__o1), \ + __asm __volatile (string : "+r" (__o0) : \ + [scn] nc (_name), "r" (__o1), \ "r" (__o2), "r" (__o3), "r" (__o4) : \ __SYSCALL_CLOBBERS); \ __o0; \ }) +#define internal_syscall5(string,name,args...) \ + _internal_syscall5(string, "i", name, args) -#define internal_syscall6(string,name,arg1,arg2,arg3,arg4,arg5,arg6) \ +#define _internal_syscall6(string,nc,name,arg1,arg2,arg3,arg4,arg5,arg6)\ ({ \ long int _arg1 = (long int) (arg1); \ long int _arg2 = (long int) (arg2); \ @@ -148,20 +160,22 @@ long int _arg4 = (long int) (arg4); \ long int _arg5 = (long int) (arg5); \ long int _arg6 = (long int) (arg6); \ - register long int __g1 __asm__("g1") = (name); \ + long int _name = (long int) (name); \ register long int __o0 __asm__ ("o0") = _arg1; \ register long int __o1 __asm__ ("o1") = _arg2; \ register long int __o2 __asm__ ("o2") = _arg3; \ register long int __o3 __asm__ ("o3") = _arg4; \ register long int __o4 __asm__ ("o4") = _arg5; \ register long int __o5 __asm__ ("o5") = _arg6; \ - __asm __volatile (string : "=r" (__o0) : \ - "r" (__g1), "0" (__o0), "r" (__o1), \ + __asm __volatile (string : "+r" (__o0) : \ + [scn] nc (_name), "r" (__o1), \ "r" (__o2), "r" (__o3), "r" (__o4), \ "r" (__o5) : \ __SYSCALL_CLOBBERS); \ __o0; \ }) +#define internal_syscall6(string,name,args...) \ + _internal_syscall6(string, "i", name, args) #define INLINE_CLONE_SYSCALL(arg1,arg2,arg3,arg4,arg5) \ ({ \ @@ -170,15 +184,15 @@ long int _arg3 = (long int) (arg3); \ long int _arg4 = (long int) (arg4); \ long int _arg5 = (long int) (arg5); \ + long int _name = __NR_clone; \ register long int __o0 __asm__ ("o0") = _arg1; \ register long int __o1 __asm__ ("o1") = _arg2; \ register long int __o2 __asm__ ("o2") = _arg3; \ register long int __o3 __asm__ ("o3") = _arg4; \ register long int __o4 __asm__ ("o4") = _arg5; \ - register long int __g1 __asm__ ("g1") = __NR_clone; \ __asm __volatile (__SYSCALL_STRING : \ "=r" (__o0), "=r" (__o1) : \ - "r" (__g1), "0" (__o0), "1" (__o1), \ + [scn] "i" (_name), "0" (__o0), "1" (__o1), \ "r" (__o2), "r" (__o3), "r" (__o4) : \ __SYSCALL_CLOBBERS); \ if (__glibc_unlikely ((unsigned long int) (__o0) > -4096UL)) \ diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c index 21364f6e39..ce5175b34c 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c index 4c8e175b7a..61b6f5e669 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c @@ -1,5 +1,5 @@ /* Get file status. Linux version. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c index 3a07b78dc7..a409f9580c 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c @@ -1,5 +1,5 @@ /* Struct stat/stat64 to stat/stat64 conversion for Linux. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h index 176b99558f..7f34f783e2 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h @@ -1,5 +1,5 @@ /* Copy to/from struct stat with and without 64-bit time_t support. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h index 52797dedaf..c2efdff3ac 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h @@ -1,5 +1,5 @@ /* Struct stat with 64-bit time support. - Copyright (C) 2020-2024 Free Software Foundation, Inc. + Copyright (C) 2020-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h index 259d7a77cd..781f1780d0 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2024 Free Software Foundation, Inc. +/* Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h index 568748d767..db67ca26a3 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2024 Free Software Foundation, Inc. +/* Copyright (C) 1995-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h index bf260a704e..1385082f7b 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015-2024 Free Software Foundation, Inc. +/* Copyright (C) 2015-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h index f4e2ec29f0..8ba6e7fa95 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version. - Copyright (C) 2012-2024 Free Software Foundation, Inc. + Copyright (C) 2012-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h index b38d423945..e8108efe2c 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2024 Free Software Foundation, Inc. +/* Copyright (C) 1998-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h index 2681e73b8b..7778171875 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. x86-64 version. - Copyright (C) 1999-2024 Free Software Foundation, Inc. + Copyright (C) 1999-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h index a2b021bd86..1d175dfb13 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2024 Free Software Foundation, Inc. +/* Copyright (C) 2001-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -376,6 +376,7 @@ # define HAVE_TIME_VSYSCALL "__vdso_time" # define HAVE_GETCPU_VSYSCALL "__vdso_getcpu" # define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres" +# define HAVE_GETRANDOM_VSYSCALL "__vdso_getrandom" # define HAVE_CLONE3_WRAPPER 1 diff --git a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h index f3f9c527c7..707261ade3 100644 --- a/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2024 Free Software Foundation, Inc. +/* Copyright (C) 2012-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h b/lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h index 6cbb4d867b..ac789a9d45 100644 --- a/lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h +++ b/lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2024 Free Software Foundation, Inc. +/* Copyright (C) 1991-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h b/lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h index a876464a58..e51d84780a 100644 --- a/lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h +++ b/lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h @@ -1,5 +1,5 @@ /* Hacks needed for divdi3 symbol manipulation. - Copyright (C) 2004-2024 Free Software Foundation, Inc. + Copyright (C) 2004-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h b/lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h index b23ff3b028..bcdd76a2ab 100644 --- a/lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h +++ b/lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2024 Free Software Foundation, Inc. +/* Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/x86/sysdep.h b/lib/libc/glibc/sysdeps/x86/sysdep.h index 7359149e17..541393f1dc 100644 --- a/lib/libc/glibc/sysdeps/x86/sysdep.h +++ b/lib/libc/glibc/sysdeps/x86/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for x86. - Copyright (C) 2017-2024 Free Software Foundation, Inc. + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/x86_64/start.S b/lib/libc/glibc/sysdeps/x86_64/start.S index d30307f705..6cb661bf04 100644 --- a/lib/libc/glibc/sysdeps/x86_64/start.S +++ b/lib/libc/glibc/sysdeps/x86_64/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF x86-64 ABI. - Copyright (C) 2001-2024 Free Software Foundation, Inc. + Copyright (C) 2001-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/glibc/sysdeps/x86_64/sysdep.h b/lib/libc/glibc/sysdeps/x86_64/sysdep.h index ad90e8c8cc..0356f09379 100644 --- a/lib/libc/glibc/sysdeps/x86_64/sysdep.h +++ b/lib/libc/glibc/sysdeps/x86_64/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for x86-64. - Copyright (C) 2001-2024 Free Software Foundation, Inc. + Copyright (C) 2001-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,6 +19,8 @@ #ifndef _X86_64_SYSDEP_H #define _X86_64_SYSDEP_H 1 +/* zig patch: inline x86-lp_size.h */ + #include #ifdef __ASSEMBLER__ # define LP_SIZE 8 diff --git a/lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h b/lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h index 39cb08b3cf..91beeabf05 100644 --- a/lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h +++ b/lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for x32. - Copyright (C) 2012-2024 Free Software Foundation, Inc. + Copyright (C) 2012-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +/* zig patch: inline x86-lp_size.h */ + #include #undef LP_SIZE #ifdef __ASSEMBLER__