authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-31 14:30:19+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-31 14:38:21+01:00
log5702d67af60602bdfe955c4ccfa1b13238d36516
treea20349de2cbca64b891cacda84222fd2f83a92e8
parent2ba137b02be42285bdff53d85f19e82cb74802e7
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

glibc: Update source files to 2.41.


187 files changed, 611 insertions(+), 397 deletions(-)

lib/libc/glibc/LICENSES+26-38
...@@ -165,44 +165,8 @@ The file if_ppp.h is under the following CMU license:...@@ -165,44 +165,8 @@ The file if_ppp.h is under the following CMU license:
165 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN165 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
166 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.166 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
167 167
168The following license covers the files from Intel's "Highly Optimized168The files nss/getnameinfo.c and nss/getaddrinfo.c are copyright (C) by
169Mathematical Functions for Itanium" collection:169Craig Metz and are distributed under the following license:
170
171Intel License Agreement
172
173Copyright (c) 2000, Intel Corporation
174
175All rights reserved.
176
177Redistribution and use in source and binary forms, with or without
178modification, are permitted provided that the following conditions are
179met:
180
181* Redistributions of source code must retain the above copyright
182notice, this list of conditions and the following disclaimer.
183
184* Redistributions in binary form must reproduce the above copyright
185notice, this list of conditions and the following disclaimer in the
186documentation and/or other materials provided with the distribution.
187
188* The name of Intel Corporation may not be used to endorse or promote
189products derived from this software without specific prior written
190permission.
191
192THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
193"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
194LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
195A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
196CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
197EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
198PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
199PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
200LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
201NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
202SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
203
204The files inet/getnameinfo.c and sysdeps/posix/getaddrinfo.c are copyright
205(C) by Craig Metz and are distributed under the following license:
206170
207/* The Inner Net License, Version 2.00171/* The Inner Net License, Version 2.00
208172
...@@ -410,3 +374,27 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY...@@ -410,3 +374,27 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
410CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,374CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
411TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE375TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
412SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.376SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
377
378Various files in sysdeps/ieee754/flt-32, taken from the CORE-MATH project
379<https://core-math.gitlabpages.inria.fr/>, are distributed under the
380following license:
381
382Copyright (c) 2022-2024 Alexei Sibidanov. Paul Zimmermann.
383
384Permission is hereby granted, free of charge, to any person obtaining a copy
385of this software and associated documentation files (the "Software"), to deal
386in the Software without restriction, including without limitation the rights
387to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
388copies of the Software, and to permit persons to whom the Software is
389furnished to do so, subject to the following conditions:
390
391The above copyright notice and this permission notice shall be included in all
392copies or substantial portions of the Software.
393
394THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
395IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
396FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
397AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
398LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
399OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
400SOFTWARE.
lib/libc/glibc/bits/byteswap.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Macros and inline functions to swap the order of bytes in integer values.1/* Macros and inline functions to swap the order of bytes in integer values.
2 Copyright (C) 1997-2024 Free Software Foundation, Inc.2 Copyright (C) 1997-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/floatn-common.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Macros to control TS 18661-3 glibc features where the same1/* Macros to control TS 18661-3 glibc features where the same
2 definitions are appropriate for all platforms.2 definitions are appropriate for all platforms.
3 Copyright (C) 2017-2024 Free Software Foundation, Inc.3 Copyright (C) 2017-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/libc-header-start.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Handle feature test macros at the start of a header.1/* Handle feature test macros at the start of a header.
2 Copyright (C) 2016-2024 Free Software Foundation, Inc.2 Copyright (C) 2016-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/long-double.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Properties of long double type.1/* Properties of long double type.
2 Copyright (C) 2016-2024 Free Software Foundation, Inc.2 Copyright (C) 2016-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/select.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1997-2024 Free Software Foundation, Inc.1/* Copyright (C) 1997-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/signum-generic.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Signal number constants. Generic template.1/* Signal number constants. Generic template.
2 Copyright (C) 1991-2024 Free Software Foundation, Inc.2 Copyright (C) 1991-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/stat.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/stdint-intn.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Define intN_t types.1/* Define intN_t types.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.2 Copyright (C) 2017-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/stdlib-bsearch.h+10-12
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Perform binary search - inline version.1/* Perform binary search - inline version.
2 Copyright (C) 1991-2024 Free Software Foundation, Inc.2 Copyright (C) 1991-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -20,22 +20,14 @@ __extern_inline void *...@@ -20,22 +20,14 @@ __extern_inline void *
20bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,20bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
21 __compar_fn_t __compar)21 __compar_fn_t __compar)
22{22{
23 size_t __l, __u, __idx;
24 const void *__p;23 const void *__p;
25 int __comparison;24 int __comparison;
2625
27 __l = 0;26 while (__nmemb)
28 __u = __nmemb;
29 while (__l < __u)
30 {27 {
31 __idx = (__l + __u) / 2;28 __p = (const void *) (((const char *) __base) + ((__nmemb >> 1) * __size));
32 __p = (const void *) (((const char *) __base) + (__idx * __size));
33 __comparison = (*__compar) (__key, __p);29 __comparison = (*__compar) (__key, __p);
34 if (__comparison < 0)30 if (__comparison == 0)
35 __u = __idx;
36 else if (__comparison > 0)
37 __l = __idx + 1;
38 else
39 {31 {
40#if __GNUC_PREREQ(4, 6)32#if __GNUC_PREREQ(4, 6)
41# pragma GCC diagnostic push33# pragma GCC diagnostic push
...@@ -46,6 +38,12 @@ bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,...@@ -46,6 +38,12 @@ bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
46# pragma GCC diagnostic pop38# pragma GCC diagnostic pop
47#endif39#endif
48 }40 }
41 if (__comparison > 0)
42 {
43 __base = ((const char *) __p) + __size;
44 --__nmemb;
45 }
46 __nmemb >>= 1;
49 }47 }
5048
51 return NULL;49 return NULL;
lib/libc/glibc/bits/time64.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* bits/time64.h -- underlying types for __time64_t. Generic version.1/* bits/time64.h -- underlying types for __time64_t. Generic version.
2 Copyright (C) 2018-2024 Free Software Foundation, Inc.2 Copyright (C) 2018-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/timesize.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Bit size of the time_t type at glibc build time, general case.1/* Bit size of the time_t type at glibc build time, general case.
2 Copyright (C) 2018-2024 Free Software Foundation, Inc.2 Copyright (C) 2018-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/types/struct_sched_param.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Sched parameter structure. Generic version.1/* Sched parameter structure. Generic version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.2 Copyright (C) 1996-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/typesizes.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* bits/typesizes.h -- underlying types for *_t. Generic version.1/* bits/typesizes.h -- underlying types for *_t. Generic version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/uintn-identity.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Inline functions to return unsigned integer values unchanged.1/* Inline functions to return unsigned integer values unchanged.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.2 Copyright (C) 2017-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/waitflags.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Definitions of flag bits for `waitpid' et al.1/* Definitions of flag bits for `waitpid' et al.
2 Copyright (C) 1992-2024 Free Software Foundation, Inc.2 Copyright (C) 1992-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/bits/waitstatus.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Definitions of status bits for `wait' et al.1/* Definitions of status bits for `wait' et al.
2 Copyright (C) 1992-2024 Free Software Foundation, Inc.2 Copyright (C) 1992-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/csu/errno.c+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Definition of `errno' variable. Canonical version.1/* Definition of `errno' variable. Canonical version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/csu/init.c+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Special startup support.1/* Special startup support.
2 Copyright (C) 1997-2024 Free Software Foundation, Inc.2 Copyright (C) 1997-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/debug/stack_chk_fail_local.c+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2005-2024 Free Software Foundation, Inc.1/* Copyright (C) 2005-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/elf/elf.h+4-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* This file defines standard ELF types, structures, and macros.1/* This file defines standard ELF types, structures, and macros.
2 Copyright (C) 1995-2024 Free Software Foundation, Inc.2 Copyright (C) 1995-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -797,6 +797,7 @@ typedef struct...@@ -797,6 +797,7 @@ typedef struct
797#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */797#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
798#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */798#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
799#define NT_X86_SHSTK 0x204 /* x86 SHSTK state */799#define NT_X86_SHSTK 0x204 /* x86 SHSTK state */
800#define NT_X86_XSAVE_LAYOUT 0x205 /* XSAVE layout description. */
800#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */801#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
801#define NT_S390_TIMER 0x301 /* s390 timer register */802#define NT_S390_TIMER 0x301 /* s390 timer register */
802#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */803#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
...@@ -835,6 +836,7 @@ typedef struct...@@ -835,6 +836,7 @@ typedef struct
835#define NT_ARM_ZA 0x40c /* ARM SME ZA registers. */836#define NT_ARM_ZA 0x40c /* ARM SME ZA registers. */
836#define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */837#define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */
837#define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */838#define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */
839#define NT_ARM_POE 0x40f /* ARM POE registers. */
838#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */840#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */
839#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */841#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */
840#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */842#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */
...@@ -1389,6 +1391,7 @@ typedef struct...@@ -1389,6 +1391,7 @@ typedef struct
13891391
1390#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0)1392#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0)
1391#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1)1393#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1)
1394#define GNU_PROPERTY_AARCH64_FEATURE_1_GCS (1U << 2)
13921395
1393/* The x86 instruction sets indicated by the corresponding bits are1396/* The x86 instruction sets indicated by the corresponding bits are
1394 used in program. Their support in the hardware is optional. */1397 used in program. Their support in the hardware is optional. */
lib/libc/glibc/include/errno.h+1-1
...@@ -20,7 +20,7 @@...@@ -20,7 +20,7 @@
20# define errno rtld_errno20# define errno rtld_errno
21extern int rtld_errno attribute_hidden;21extern int rtld_errno attribute_hidden;
2222
23# elif IS_IN_LIB && !IS_IN (rtld)23# elif IS_IN_LIB && !IS_IN (rtld) && !defined LIBC_NONSHARED
2424
25# undef errno25# undef errno
26# if IS_IN (libc)26# if IS_IN (libc)
lib/libc/glibc/include/libc-misc.h created+67
...@@ -0,0 +1,67 @@
1/* Miscellaneous definitions for both glibc build and test.
2 Copyright (C) 2024-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _INCLUDE_MISC_H
20#define _INCLUDE_MISC_H
21
22#include <config.h>
23
24/* Add the compiler optimization to inhibit loop transformation to library
25 calls. This is used to avoid recursive calls in memset and memmove
26 default implementations in tests. */
27#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
28# define inhibit_loop_to_libcall \
29 __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
30#else
31# define inhibit_loop_to_libcall
32#endif
33
34#ifdef HAVE_TEST_CC_INHIBIT_LOOP_TO_LIBCALL
35# define test_cc_inhibit_loop_to_libcall \
36 __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
37#else
38# define test_cc_inhibit_loop_to_libcall
39#endif
40
41/* Used to disable stack protection in sensitive places, like ifunc
42 resolvers and early static TLS init. */
43#ifdef __clang__
44# define cc_inhibit_stack_protector \
45 __attribute__((no_stack_protector))
46#else
47# define cc_inhibit_stack_protector \
48 __attribute__ ((__optimize__ ("-fno-stack-protector")))
49#endif
50
51#if IS_IN (testsuite) || IS_IN (testsuite_internal)
52# ifdef HAVE_TEST_CC_NO_STACK_PROTECTOR
53# define test_inhibit_stack_protector cc_inhibit_stack_protector
54# define inhibit_stack_protector cc_inhibit_stack_protector
55# else
56# define test_inhibit_stack_protector
57# define inhibit_stack_protector
58# endif
59#else
60# ifdef HAVE_CC_NO_STACK_PROTECTOR
61# define inhibit_stack_protector cc_inhibit_stack_protector
62# else
63# define inhibit_stack_protector
64# endif
65#endif
66
67#endif
lib/libc/glibc/include/libc-pointer-arith.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Helper macros for pointer arithmetic.1/* Helper macros for pointer arithmetic.
2 Copyright (C) 2012-2024 Free Software Foundation, Inc.2 Copyright (C) 2012-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/include/libc-symbols.h+3-22
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Support macros for making weak and strong aliases for symbols,1/* Support macros for making weak and strong aliases for symbols,
2 and for using symbol sets and linker warnings with GNU ld.2 and for using symbol sets and linker warnings with GNU ld.
3 Copyright (C) 1995-2024 Free Software Foundation, Inc.3 Copyright (C) 1995-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
...@@ -59,6 +59,8 @@...@@ -59,6 +59,8 @@
59# define IN_MODULE (-1)59# define IN_MODULE (-1)
60#endif60#endif
6161
62#include <libc-misc.h>
63
62#ifndef _ISOMAC64#ifndef _ISOMAC
6365
64/* This is defined for the compilation of all C library code. features.h66/* This is defined for the compilation of all C library code. features.h
...@@ -82,8 +84,6 @@...@@ -82,8 +84,6 @@
82# error "glibc must not be compiled with -ffast-math"84# error "glibc must not be compiled with -ffast-math"
83#endif85#endif
8486
85#include <config.h>
86
87/* Obtain the definition of symbol_version_reference. */87/* Obtain the definition of symbol_version_reference. */
88#include <libc-symver.h>88#include <libc-symver.h>
8989
...@@ -374,15 +374,6 @@ for linking")...@@ -374,15 +374,6 @@ for linking")
374#define attribute_relro __attribute__ ((section (".data.rel.ro")))374#define attribute_relro __attribute__ ((section (".data.rel.ro")))
375375
376376
377/* Used to disable stack protection in sensitive places, like ifunc
378 resolvers and early static TLS init. */
379#ifdef HAVE_CC_NO_STACK_PROTECTOR
380# define inhibit_stack_protector \
381 __attribute__ ((__optimize__ ("-fno-stack-protector")))
382#else
383# define inhibit_stack_protector
384#endif
385
386/* The following macros are used for PLT bypassing within libc.so377/* The following macros are used for PLT bypassing within libc.so
387 (and if needed other libraries similarly).378 (and if needed other libraries similarly).
388 First of all, you need to have the function prototyped somewhere,379 First of all, you need to have the function prototyped somewhere,
...@@ -816,16 +807,6 @@ for linking")...@@ -816,16 +807,6 @@ for linking")
816#define libm_ifunc_init()807#define libm_ifunc_init()
817#define libm_ifunc(name, expr) \808#define libm_ifunc(name, expr) \
818 __ifunc (name, name, expr, void, libm_ifunc_init)809 __ifunc (name, name, expr, void, libm_ifunc_init)
819
820/* Add the compiler optimization to inhibit loop transformation to library
821 calls. This is used to avoid recursive calls in memset and memmove
822 default implementations. */
823#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
824# define inhibit_loop_to_libcall \
825 __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
826#else
827# define inhibit_loop_to_libcall
828#endif
829 810
830/* These macros facilitate sharing source files with gnulib.811/* These macros facilitate sharing source files with gnulib.
831812
lib/libc/glibc/include/stap-probe.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Macros for defining Systemtap <sys/sdt.h> static probe points.1/* Macros for defining Systemtap <sys/sdt.h> static probe points.
2 Copyright (C) 2012-2024 Free Software Foundation, Inc.2 Copyright (C) 2012-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/include/stdlib.h+7
...@@ -20,6 +20,7 @@...@@ -20,6 +20,7 @@
20# include <sys/stat.h>20# include <sys/stat.h>
2121
22# include <rtld-malloc.h>22# include <rtld-malloc.h>
23# include <internal-sigset.h>
2324
24extern __typeof (strtol_l) __strtol_l;25extern __typeof (strtol_l) __strtol_l;
25extern __typeof (strtoul_l) __strtoul_l;26extern __typeof (strtoul_l) __strtoul_l;
...@@ -77,6 +78,12 @@ libc_hidden_proto (__isoc23_strtoull_l)...@@ -77,6 +78,12 @@ libc_hidden_proto (__isoc23_strtoull_l)
77# define strtoull_l __isoc23_strtoull_l78# define strtoull_l __isoc23_strtoull_l
78#endif79#endif
7980
81extern void __abort_fork_reset_child (void) attribute_hidden;
82extern void __abort_lock_rdlock (internal_sigset_t *set) attribute_hidden;
83extern void __abort_lock_wrlock (internal_sigset_t *set) attribute_hidden;
84extern void __abort_lock_unlock (const internal_sigset_t *set)
85 attribute_hidden;
86
80libc_hidden_proto (exit)87libc_hidden_proto (exit)
81libc_hidden_proto (abort)88libc_hidden_proto (abort)
82libc_hidden_proto (getenv)89libc_hidden_proto (getenv)
lib/libc/glibc/include/sys/cdefs.h+7
...@@ -56,4 +56,11 @@ rtld_hidden_proto (__chk_fail)...@@ -56,4 +56,11 @@ rtld_hidden_proto (__chk_fail)
5656
57#endif /* !defined _ISOMAC */57#endif /* !defined _ISOMAC */
5858
59/* Prevents a function from being considered for inlining and cloning. */
60#ifdef __clang__
61# define __attribute_optimization_barrier__ __attribute__ ((optnone))
62#else
63# define __attribute_optimization_barrier__ __attribute__ ((noinline, noclone))
64#endif
65
59#endif66#endif
lib/libc/glibc/io/bits/statx.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* statx-related definitions and declarations. Generic version.1/* statx-related definitions and declarations. Generic version.
2 Copyright (C) 2018-2024 Free Software Foundation, Inc.2 Copyright (C) 2018-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/io/fcntl.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/io/mknod.c+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1995-2024 Free Software Foundation, Inc.1/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/io/sys/stat.h+9-9
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
...@@ -26,7 +26,7 @@...@@ -26,7 +26,7 @@
2626
27#include <bits/types.h> /* For __mode_t and __dev_t. */27#include <bits/types.h> /* For __mode_t and __dev_t. */
2828
29#ifdef __USE_XOPEN2K829#if defined(__USE_ATFILE) || defined(__USE_XOPEN2K8)
30# include <bits/types/struct_timespec.h>30# include <bits/types/struct_timespec.h>
31#endif31#endif
3232
...@@ -263,14 +263,14 @@ extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf),...@@ -263,14 +263,14 @@ extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf),
263# ifndef __USE_FILE_OFFSET64263# ifndef __USE_FILE_OFFSET64
264extern int fstatat (int __fd, const char *__restrict __file,264extern int fstatat (int __fd, const char *__restrict __file,
265 struct stat *__restrict __buf, int __flag)265 struct stat *__restrict __buf, int __flag)
266 __THROW __nonnull ((2, 3));266 __THROW __nonnull ((3));
267# else267# else
268# ifdef __USE_TIME64_REDIRECTS268# ifdef __USE_TIME64_REDIRECTS
269# ifdef __REDIRECT_NTH269# ifdef __REDIRECT_NTH
270extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,270extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
271 struct stat *__restrict __buf,271 struct stat *__restrict __buf,
272 int __flag),272 int __flag),
273 __fstatat64_time64) __nonnull ((2, 3));273 __fstatat64_time64) __nonnull ((3));
274# else274# else
275# define fstatat __fstatat64_time64275# define fstatat __fstatat64_time64
276# endif276# endif
...@@ -279,7 +279,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,...@@ -279,7 +279,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
279extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,279extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
280 struct stat *__restrict __buf,280 struct stat *__restrict __buf,
281 int __flag),281 int __flag),
282 fstatat64) __nonnull ((2, 3));282 fstatat64) __nonnull ((3));
283# else283# else
284# define fstatat fstatat64284# define fstatat fstatat64
285# endif285# endif
...@@ -290,7 +290,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,...@@ -290,7 +290,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
290# ifndef __USE_TIME64_REDIRECTS290# ifndef __USE_TIME64_REDIRECTS
291extern int fstatat64 (int __fd, const char *__restrict __file,291extern int fstatat64 (int __fd, const char *__restrict __file,
292 struct stat64 *__restrict __buf, int __flag)292 struct stat64 *__restrict __buf, int __flag)
293 __THROW __nonnull ((2, 3));293 __THROW __nonnull ((3));
294# else294# else
295# ifdef __REDIRECT_NTH295# ifdef __REDIRECT_NTH
296extern int __REDIRECT_NTH (fstatat64, (int __fd,296extern int __REDIRECT_NTH (fstatat64, (int __fd,
...@@ -298,7 +298,7 @@ extern int __REDIRECT_NTH (fstatat64, (int __fd,...@@ -298,7 +298,7 @@ extern int __REDIRECT_NTH (fstatat64, (int __fd,
298 struct stat64 *__restrict __buf,298 struct stat64 *__restrict __buf,
299 int __flag),299 int __flag),
300 __fstatat64_time64)300 __fstatat64_time64)
301 __nonnull ((2, 3));301 __nonnull ((3));
302# else302# else
303# define fstatat64 __fstatat64_time64303# define fstatat64 __fstatat64_time64
304# endif304# endif
...@@ -433,13 +433,13 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)...@@ -433,13 +433,13 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
433extern int utimensat (int __fd, const char *__path,433extern int utimensat (int __fd, const char *__path,
434 const struct timespec __times[2],434 const struct timespec __times[2],
435 int __flags)435 int __flags)
436 __THROW __nonnull ((2));436 __THROW;
437# else437# else
438# ifdef __REDIRECT_NTH438# ifdef __REDIRECT_NTH
439extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path,439extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path,
440 const struct timespec __times[2],440 const struct timespec __times[2],
441 int flags),441 int flags),
442 __utimensat64) __nonnull ((2));442 __utimensat64);
443# else443# else
444# define utimensat __utimensat64444# define utimensat __utimensat64
445# endif445# endif
lib/libc/glibc/locale/bits/types/__locale_t.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Definition of struct __locale_struct and __locale_t.1/* Definition of struct __locale_struct and __locale_t.
2 Copyright (C) 1997-2024 Free Software Foundation, Inc.2 Copyright (C) 1997-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/locale/bits/types/locale_t.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Definition of locale_t.1/* Definition of locale_t.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.2 Copyright (C) 2017-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/misc/sys/cdefs.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 Copyright The GNU Toolchain Authors.2 Copyright The GNU Toolchain Authors.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
lib/libc/glibc/misc/sys/select.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* `fd_set' type and related macros, and `select'/`pselect' declarations.1/* `fd_set' type and related macros, and `select'/`pselect' declarations.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.2 Copyright (C) 1996-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/posix/bits/cpu-set.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Definition of the cpu_set_t structure used by the POSIX 1003.1b-19931/* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993
2 scheduling interface.2 scheduling interface.
3 Copyright (C) 1996-2024 Free Software Foundation, Inc.3 Copyright (C) 1996-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/posix/bits/types.h+2-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* bits/types.h -- definitions of __*_t types underlying *_t types.1/* bits/types.h -- definitions of __*_t types underlying *_t types.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -217,6 +217,7 @@ typedef int __sig_atomic_t;...@@ -217,6 +217,7 @@ typedef int __sig_atomic_t;
217/* Seconds since the Epoch, visible to user code when time_t is too217/* Seconds since the Epoch, visible to user code when time_t is too
218 narrow only for consistency with the old way of widening too-narrow218 narrow only for consistency with the old way of widening too-narrow
219 types. User code should never use __time64_t. */219 types. User code should never use __time64_t. */
220/* Zig patch: Don't check __LIBC here because it breaks fstatat.c on x86. */
220#if __TIMESIZE == 64221#if __TIMESIZE == 64
221# define __time64_t __time_t222# define __time64_t __time_t
222#elif __TIMESIZE != 64223#elif __TIMESIZE != 64
lib/libc/glibc/posix/sys/types.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/signal/signal.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/stdlib/alloca.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/stdlib/bits/stdlib-float.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Floating-point inline functions for stdlib.h.1/* Floating-point inline functions for stdlib.h.
2 Copyright (C) 2012-2024 Free Software Foundation, Inc.2 Copyright (C) 2012-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/stdlib/errno.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/stdlib/exit.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/stdlib/stdlib.h+2-2
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 Copyright The GNU Toolchain Authors.2 Copyright The GNU Toolchain Authors.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
...@@ -727,7 +727,7 @@ extern void *aligned_alloc (size_t __alignment, size_t __size)...@@ -727,7 +727,7 @@ extern void *aligned_alloc (size_t __alignment, size_t __size)
727#endif727#endif
728728
729/* Abort execution and generate a core-dump. */729/* Abort execution and generate a core-dump. */
730extern void abort (void) __THROW __attribute__ ((__noreturn__));730extern void abort (void) __THROW __attribute__ ((__noreturn__)) __COLD;
731731
732732
733/* Register a function to be called when `exit' is called. */733/* Register a function to be called when `exit' is called. */
lib/libc/glibc/string/bits/endian.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Endian macros for string.h functions1/* Endian macros for string.h functions
2 Copyright (C) 1992-2024 Free Software Foundation, Inc.2 Copyright (C) 1992-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/string/endian.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2002-2024 Free Software Foundation, Inc.1/* Copyright (C) 2002-2025 Free Software Foundation, Inc.
22
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
lib/libc/glibc/sysdeps/aarch64/start.S+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1995-2024 Free Software Foundation, Inc.1/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
22
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
lib/libc/glibc/sysdeps/aarch64/sysdep.h+11-3
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1997-2024 Free Software Foundation, Inc.1/* Copyright (C) 1997-2025 Free Software Foundation, Inc.
22
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
...@@ -74,10 +74,18 @@ strip_pac (void *p)...@@ -74,10 +74,18 @@ strip_pac (void *p)
74#define PACIASP hint 2574#define PACIASP hint 25
75#define AUTIASP hint 2975#define AUTIASP hint 29
7676
77/* Guarded Control Stack support. */
78#define CHKFEAT_X16 hint 40
79#define MRS_GCSPR(x) mrs x, s3_3_c2_c5_1
80#define GCSPOPM(x) sysl x, #3, c7, c7, #1
81#define GCSSS1(x) sys #3, c7, c7, #2, x
82#define GCSSS2(x) sysl x, #3, c7, c7, #3
83
77/* GNU_PROPERTY_AARCH64_* macros from elf.h for use in asm code. */84/* GNU_PROPERTY_AARCH64_* macros from elf.h for use in asm code. */
78#define FEATURE_1_AND 0xc000000085#define FEATURE_1_AND 0xc0000000
79#define FEATURE_1_BTI 186#define FEATURE_1_BTI 1
80#define FEATURE_1_PAC 287#define FEATURE_1_PAC 2
88#define FEATURE_1_GCS 4
8189
82/* Add a NT_GNU_PROPERTY_TYPE_0 note. */90/* Add a NT_GNU_PROPERTY_TYPE_0 note. */
83#define GNU_PROPERTY(type, value) \91#define GNU_PROPERTY(type, value) \
...@@ -96,9 +104,9 @@ strip_pac (void *p)...@@ -96,9 +104,9 @@ strip_pac (void *p)
96/* Add GNU property note with the supported features to all asm code104/* Add GNU property note with the supported features to all asm code
97 where sysdep.h is included. */105 where sysdep.h is included. */
98#if HAVE_AARCH64_BTI && HAVE_AARCH64_PAC_RET106#if HAVE_AARCH64_BTI && HAVE_AARCH64_PAC_RET
99GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC)107GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC|FEATURE_1_GCS)
100#elif HAVE_AARCH64_BTI108#elif HAVE_AARCH64_BTI
101GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI)109GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)
102#endif110#endif
103111
104/* Define an entry point visible from C. */112/* Define an entry point visible from C. */
lib/libc/glibc/sysdeps/arc/bits/endianness.h+2-6
...@@ -5,11 +5,7 @@...@@ -5,11 +5,7 @@
5# error "Never use <bits/endian.h> directly; include <endian.h> instead."5# error "Never use <bits/endian.h> directly; include <endian.h> instead."
6#endif6#endif
77
8/* ARC has selectable endianness. */8/* Only little-endian ARC is supported. */
9#ifdef __BIG_ENDIAN__9#define __BYTE_ORDER __LITTLE_ENDIAN
10# define __BYTE_ORDER __BIG_ENDIAN
11#else
12# define __BYTE_ORDER __LITTLE_ENDIAN
13#endif
1410
15#endif /* bits/endianness.h */11#endif /* bits/endianness.h */
lib/libc/glibc/sysdeps/arc/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code for ARC.1/* Startup code for ARC.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/arc/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for ARC.1/* Assembler macros for ARC.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/arm/arm-features.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Macros to test for CPU features on ARM. Generic ARM version.1/* Macros to test for CPU features on ARM. Generic ARM version.
2 Copyright (C) 2012-2024 Free Software Foundation, Inc.2 Copyright (C) 2012-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/arm/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code for ARM & ELF1/* Startup code for ARM & ELF
2 Copyright (C) 1995-2024 Free Software Foundation, Inc.2 Copyright (C) 1995-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/arm/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for ARM.1/* Assembler macros for ARM.
2 Copyright (C) 1997-2024 Free Software Foundation, Inc.2 Copyright (C) 1997-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/csky/abiv2/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code compliant to the ELF C-SKY ABIV2.1/* Startup code compliant to the ELF C-SKY ABIV2.
2 Copyright (C) 2018-2024 Free Software Foundation, Inc.2 Copyright (C) 2018-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/csky/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for C-SKY.1/* Assembler macros for C-SKY.
2 Copyright (C) 2018-2024 Free Software Foundation, Inc.2 Copyright (C) 2018-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/dl-dtprocnum.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Configuration of lookup functions.1/* Configuration of lookup functions.
2 Copyright (C) 2000-2024 Free Software Foundation, Inc.2 Copyright (C) 2000-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/dl-sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* System-specific settings for dynamic linker code. Generic version.1/* System-specific settings for dynamic linker code. Generic version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/dwarf2.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Declarations and definitions of codes relating to the DWARF2 symbolic1/* Declarations and definitions of codes relating to the DWARF2 symbolic
2 debugging information format.2 debugging information format.
3 Copyright (C) 1992-2024 Free Software Foundation, Inc.3 Copyright (C) 1992-2025 Free Software Foundation, Inc.
44
5 This file is part of the GNU C Library.5 This file is part of the GNU C Library.
66
lib/libc/glibc/sysdeps/generic/libc-lock.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* libc-internal interface for mutex locks. Stub version.1/* libc-internal interface for mutex locks. Stub version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.2 Copyright (C) 1996-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/libc-symver.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Symbol version management.1/* Symbol version management.
2 Copyright (C) 1995-2024 Free Software Foundation, Inc.2 Copyright (C) 1995-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/single-thread.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Single thread optimization, generic version.1/* Single thread optimization, generic version.
2 Copyright (C) 2019-2024 Free Software Foundation, Inc.2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Generic asm macros used on many machines.1/* Generic asm macros used on many machines.
2 Copyright (C) 1991-2024 Free Software Foundation, Inc.2 Copyright (C) 1991-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/generic/tls.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Definition for thread-local data handling. Generic version.1/* Definition for thread-local data handling. Generic version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/htl/bits/pthread.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Pthread data structures. Generic version.1/* Pthread data structures. Generic version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/htl/bits/thread-shared-types.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Common threading primitives definitions for both POSIX and C11.1/* Common threading primitives definitions for both POSIX and C11.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.2 Copyright (C) 2017-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/htl/libc-lockP.h+4-7
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Private libc-internal interface for mutex locks.1/* Private libc-internal interface for mutex locks.
2 Copyright (C) 2015-2024 Free Software Foundation, Inc.2 Copyright (C) 2015-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 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,...@@ -77,6 +77,7 @@ extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
77 const pthread_mutexattr_t *__mutex_attr);77 const pthread_mutexattr_t *__mutex_attr);
7878
79extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);79extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
80libc_hidden_proto (__pthread_mutex_destroy)
8081
81extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex);82extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex);
8283
...@@ -85,8 +86,10 @@ extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);...@@ -85,8 +86,10 @@ extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
85extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);86extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
8687
87extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr);88extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr);
89libc_hidden_proto (__pthread_mutexattr_init)
8890
89extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr);91extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr);
92libc_hidden_proto (__pthread_mutexattr_destroy)
9093
91extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr,94extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr,
92 int __kind);95 int __kind);
...@@ -113,8 +116,6 @@ extern int __pthread_atfork (void (*__prepare) (void),...@@ -113,8 +116,6 @@ extern int __pthread_atfork (void (*__prepare) (void),
113 void (*__parent) (void),116 void (*__parent) (void),
114 void (*__child) (void));117 void (*__child) (void));
115118
116
117
118/* Make the pthread functions weak so that we can elide them from119/* Make the pthread functions weak so that we can elide them from
119 single-threaded processes. */120 single-threaded processes. */
120#if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread)121#if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread)
...@@ -124,8 +125,6 @@ weak_extern (__pthread_mutex_destroy)...@@ -124,8 +125,6 @@ weak_extern (__pthread_mutex_destroy)
124weak_extern (__pthread_mutex_lock)125weak_extern (__pthread_mutex_lock)
125weak_extern (__pthread_mutex_trylock)126weak_extern (__pthread_mutex_trylock)
126weak_extern (__pthread_mutex_unlock)127weak_extern (__pthread_mutex_unlock)
127weak_extern (__pthread_mutexattr_init)
128weak_extern (__pthread_mutexattr_destroy)
129weak_extern (__pthread_mutexattr_settype)128weak_extern (__pthread_mutexattr_settype)
130weak_extern (__pthread_rwlock_init)129weak_extern (__pthread_rwlock_init)
131weak_extern (__pthread_rwlock_destroy)130weak_extern (__pthread_rwlock_destroy)
...@@ -147,8 +146,6 @@ weak_extern (__pthread_setcancelstate)...@@ -147,8 +146,6 @@ weak_extern (__pthread_setcancelstate)
147# pragma weak __pthread_mutex_lock146# pragma weak __pthread_mutex_lock
148# pragma weak __pthread_mutex_trylock147# pragma weak __pthread_mutex_trylock
149# pragma weak __pthread_mutex_unlock148# pragma weak __pthread_mutex_unlock
150# pragma weak __pthread_mutexattr_init
151# pragma weak __pthread_mutexattr_destroy
152# pragma weak __pthread_mutexattr_settype149# pragma weak __pthread_mutexattr_settype
153# pragma weak __pthread_rwlock_destroy150# pragma weak __pthread_rwlock_destroy
154# pragma weak __pthread_rwlock_rdlock151# pragma weak __pthread_rwlock_rdlock
lib/libc/glibc/sysdeps/htl/pthread.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Posix threads. Hurd version.1/* Posix threads. Hurd version.
2 Copyright (C) 2000-2024 Free Software Foundation, Inc.2 Copyright (C) 2000-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/i386/htl/bits/pthreadtypes-arch.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Machine-specific pthread type layouts. Hurd i386 version.1/* Machine-specific pthread type layouts. Hurd i386 version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/i386/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code compliant to the ELF i386 ABI.1/* Startup code compliant to the ELF i386 ABI.
2 Copyright (C) 1995-2024 Free Software Foundation, Inc.2 Copyright (C) 1995-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/i386/symbol-hacks.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Hacks needed for symbol manipulation. i386 version.1/* Hacks needed for symbol manipulation. i386 version.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.2 Copyright (C) 2017-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/i386/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for i386.1/* Assembler macros for i386.
2 Copyright (C) 1991-2024 Free Software Foundation, Inc.2 Copyright (C) 1991-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/loongarch/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code compliant to the ELF LoongArch ABI.1/* Startup code compliant to the ELF LoongArch ABI.
2 Copyright (C) 2022-2024 Free Software Foundation, Inc.2 Copyright (C) 2022-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/loongarch/sys/regdef.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Register Macro definitions1/* Register Macro definitions
2 Copyright (C) 2022-2024 Free Software Foundation, Inc.2 Copyright (C) 2022-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
55
lib/libc/glibc/sysdeps/m68k/coldfire/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for Coldfire.1/* Assembler macros for Coldfire.
2 Copyright (C) 1998-2024 Free Software Foundation, Inc.2 Copyright (C) 1998-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/m680x0/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for m680x0.1/* Assembler macros for m680x0.
2 Copyright (C) 2010-2024 Free Software Foundation, Inc.2 Copyright (C) 2010-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/nptl/bits/pthreadtypes-arch.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2010-2024 Free Software Foundation, Inc.1/* Copyright (C) 2010-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code compliant to the ELF m68k ABI.1/* Startup code compliant to the ELF m68k ABI.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.2 Copyright (C) 1996-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/symbol-hacks.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Hacks needed for symbol manipulation. m68k version.1/* Hacks needed for symbol manipulation. m68k version.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.2 Copyright (C) 2017-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/m68k/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for m68k.1/* Assembler macros for m68k.
2 Copyright (C) 1998-2024 Free Software Foundation, Inc.2 Copyright (C) 1998-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mach/libc-lock.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* libc-internal interface for mutex locks. Mach cthreads version.1/* libc-internal interface for mutex locks. Mach cthreads version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.2 Copyright (C) 1996-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mach/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1994-2024 Free Software Foundation, Inc.1/* Copyright (C) 1994-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/dl-dtprocnum.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Configuration of lookup functions. MIPS version.1/* Configuration of lookup functions. MIPS version.
2 Copyright (C) 2000-2024 Free Software Foundation, Inc.2 Copyright (C) 2000-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/nptl/bits/pthreadtypes-arch.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Machine-specific pthread type layouts. MIPS version.1/* Machine-specific pthread type layouts. MIPS version.
2 Copyright (C) 2005-2024 Free Software Foundation, Inc.2 Copyright (C) 2005-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/mips/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code compliant to the ELF Mips ABI.1/* Startup code compliant to the ELF Mips ABI.
2 Copyright (C) 1995-2024 Free Software Foundation, Inc.2 Copyright (C) 1995-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/nptl/bits/pthreadtypes.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Declaration of common pthread types for all architectures.1/* Declaration of common pthread types for all architectures.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.2 Copyright (C) 2017-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/nptl/bits/thread-shared-types.h+2-3
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Common threading primitives definitions for both POSIX and C11.1/* Common threading primitives definitions for both POSIX and C11.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.2 Copyright (C) 2017-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -95,8 +95,7 @@ struct __pthread_cond_s...@@ -95,8 +95,7 @@ struct __pthread_cond_s
95{95{
96 __atomic_wide_counter __wseq;96 __atomic_wide_counter __wseq;
97 __atomic_wide_counter __g1_start;97 __atomic_wide_counter __g1_start;
98 unsigned int __g_refs[2] __LOCK_ALIGNMENT;98 unsigned int __g_size[2] __LOCK_ALIGNMENT;
99 unsigned int __g_size[2];
100 unsigned int __g1_orig_size;99 unsigned int __g1_orig_size;
101 unsigned int __wrefs;100 unsigned int __wrefs;
102 unsigned int __g_signals[2];101 unsigned int __g_signals[2];
lib/libc/glibc/sysdeps/nptl/libc-lock.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* libc-internal interface for mutex locks. NPTL version.1/* libc-internal interface for mutex locks. NPTL version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.2 Copyright (C) 1996-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/nptl/libc-lockP.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Private libc-internal interface for mutex locks. NPTL version.1/* Private libc-internal interface for mutex locks. NPTL version.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.2 Copyright (C) 1996-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/nptl/pthread.h+2-2
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2002-2024 Free Software Foundation, Inc.1/* Copyright (C) 2002-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
...@@ -152,7 +152,7 @@ enum...@@ -152,7 +152,7 @@ enum
152152
153153
154/* Conditional variable handling. */154/* Conditional variable handling. */
155#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, {0, 0}, 0, 0, {0, 0} } }155#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0} } }
156156
157157
158/* Cleanup buffers */158/* Cleanup buffers */
lib/libc/glibc/sysdeps/powerpc/powerpc32/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code for programs linked with GNU libc.1/* Startup code for programs linked with GNU libc.
2 Copyright (C) 1998-2024 Free Software Foundation, Inc.2 Copyright (C) 1998-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc32/symbol-hacks.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Hacks needed for symbol manipulation. powerpc version.1/* Hacks needed for symbol manipulation. powerpc version.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.2 Copyright (C) 2017-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc32/sysdep.h+4-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembly macros for 32-bit PowerPC.1/* Assembly macros for 32-bit PowerPC.
2 Copyright (C) 1999-2024 Free Software Foundation, Inc.2 Copyright (C) 1999-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -104,6 +104,9 @@ GOT_LABEL: ; \...@@ -104,6 +104,9 @@ GOT_LABEL: ; \
104# define JUMPTARGET(name) name104# define JUMPTARGET(name) name
105#endif105#endif
106106
107#define TAIL_CALL_NO_RETURN(__func) \
108 b __func@local
109
107#if defined SHARED && defined PIC && !defined NO_HIDDEN110#if defined SHARED && defined PIC && !defined NO_HIDDEN
108# undef HIDDEN_JUMPTARGET111# undef HIDDEN_JUMPTARGET
109# define HIDDEN_JUMPTARGET(name) __GI_##name##@local112# define HIDDEN_JUMPTARGET(name) __GI_##name##@local
lib/libc/glibc/sysdeps/powerpc/powerpc64/dl-dtprocnum.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Configuration of lookup functions. PowerPC64 version.1/* Configuration of lookup functions. PowerPC64 version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc64/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code for programs linked with GNU libc. PowerPC64 version.1/* Startup code for programs linked with GNU libc. PowerPC64 version.
2 Copyright (C) 1998-2024 Free Software Foundation, Inc.2 Copyright (C) 1998-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/powerpc/powerpc64/sysdep.h+23-3
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembly macros for 64-bit PowerPC.1/* Assembly macros for 64-bit PowerPC.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -31,8 +31,9 @@...@@ -31,8 +31,9 @@
31#define FRAME_TOC_SAVE 4031#define FRAME_TOC_SAVE 40
32#define FRAME_PARM_SAVE 4832#define FRAME_PARM_SAVE 48
33#else33#else
34#define FRAME_MIN_SIZE 3234#define FRAME_ROP_SAVE -8
35#define FRAME_MIN_SIZE_PARM 9635#define FRAME_MIN_SIZE 48 /* Includes space for the ROP save slot */
36#define FRAME_MIN_SIZE_PARM 112 /* Includes space for the ROP save slot */
36#define FRAME_TOC_SAVE 2437#define FRAME_TOC_SAVE 24
37#define FRAME_PARM_SAVE 3238#define FRAME_PARM_SAVE 32
38#endif39#endif
...@@ -352,6 +353,25 @@ LT_LABELSUFFIX(name,_name_end): ; \...@@ -352,6 +353,25 @@ LT_LABELSUFFIX(name,_name_end): ; \
352 ENTRY (name); \353 ENTRY (name); \
353 DO_CALL (SYS_ify (syscall_name))354 DO_CALL (SYS_ify (syscall_name))
354355
356#ifdef SHARED
357# define TAIL_CALL_NO_RETURN(__func) \
358 b JUMPTARGET (NOTOC (__func))
359#else
360# define TAIL_CALL_NO_RETURN(__func) \
361 .ifdef .Local ## __func; \
362 b .Local ## __func; \
363 .else; \
364.Local ## __func: \
365 mflr 0; \
366 std 0,FRAME_LR_SAVE(1); \
367 stdu 1,-FRAME_MIN_SIZE(1); \
368 cfi_adjust_cfa_offset(FRAME_MIN_SIZE); \
369 cfi_offset(lr,FRAME_LR_SAVE); \
370 bl JUMPTARGET(__func); \
371 nop; \
372 .endif
373#endif
374
355#ifdef SHARED375#ifdef SHARED
356#define TAIL_CALL_SYSCALL_ERROR \376#define TAIL_CALL_SYSCALL_ERROR \
357 b JUMPTARGET (NOTOC (__syscall_error))377 b JUMPTARGET (NOTOC (__syscall_error))
lib/libc/glibc/sysdeps/powerpc/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1999-2024 Free Software Foundation, Inc.1/* Copyright (C) 1999-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/riscv/nptl/bits/pthreadtypes-arch.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Machine-specific pthread type layouts. RISC-V version.1/* Machine-specific pthread type layouts. RISC-V version.
2 Copyright (C) 2011-2024 Free Software Foundation, Inc.2 Copyright (C) 2011-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/riscv/start.S+2-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code compliant to the ELF RISC-V ABI.1/* Startup code compliant to the ELF RISC-V ABI.
2 Copyright (C) 1995-2024 Free Software Foundation, Inc.2 Copyright (C) 1995-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -87,6 +87,7 @@ load_gp:...@@ -87,6 +87,7 @@ load_gp:
87 ret87 ret
8888
89 .section .preinit_array,"aw"89 .section .preinit_array,"aw"
90 .align PTRLOG
90 .dc.a load_gp91 .dc.a load_gp
9192
92/* Define a symbol for the first piece of initialized data. */93/* Define a symbol for the first piece of initialized data. */
lib/libc/glibc/sysdeps/s390/s390-64/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code compliant to the 64 bit S/390 ELF ABI.1/* Startup code compliant to the 64 bit S/390 ELF ABI.
2 Copyright (C) 2001-2024 Free Software Foundation, Inc.2 Copyright (C) 2001-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for 64 bit S/390.1/* Assembler macros for 64 bit S/390.
2 Copyright (C) 2001-2024 Free Software Foundation, Inc.2 Copyright (C) 2001-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sparc/dl-dtprocnum.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Configuration of lookup functions. SPARC version.1/* Configuration of lookup functions. SPARC version.
2 Copyright (C) 2000-2024 Free Software Foundation, Inc.2 Copyright (C) 2000-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sparc/sparc32/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code for elf32-sparc1/* Startup code for elf32-sparc
2 Copyright (C) 1997-2024 Free Software Foundation, Inc.2 Copyright (C) 1997-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sparc/sparc64/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code for elf64-sparc1/* Startup code for elf64-sparc
2 Copyright (C) 1997-2024 Free Software Foundation, Inc.2 Copyright (C) 1997-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/sparc/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2011-2024 Free Software Foundation, Inc.1/* Copyright (C) 2011-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/arm/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1997-2024 Free Software Foundation, Inc.1/* Copyright (C) 1997-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/i386/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/mips/mips32/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/mips/mips64/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/mips/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/powerpc/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sh/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1999-2024 Free Software Foundation, Inc.1/* Copyright (C) 1999-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysdep.h+142-33
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
...@@ -24,6 +24,9 @@...@@ -24,6 +24,9 @@
24#define SYSCALL__(name, args) PSEUDO (__##name, name, args)24#define SYSCALL__(name, args) PSEUDO (__##name, name, args)
25#define SYSCALL(name, args) PSEUDO (name, name, args)25#define SYSCALL(name, args) PSEUDO (name, name, args)
2626
27#ifndef __ASSEMBLER__
28# include <errno.h>
29
27#define __SYSCALL_CONCAT_X(a,b) a##b30#define __SYSCALL_CONCAT_X(a,b) a##b
28#define __SYSCALL_CONCAT(a,b) __SYSCALL_CONCAT_X (a, b)31#define __SYSCALL_CONCAT(a,b) __SYSCALL_CONCAT_X (a, b)
2932
...@@ -108,42 +111,148 @@...@@ -108,42 +111,148 @@
108#define INLINE_SYSCALL_CALL(...) \111#define INLINE_SYSCALL_CALL(...) \
109 __INLINE_SYSCALL_DISP (__INLINE_SYSCALL, __VA_ARGS__)112 __INLINE_SYSCALL_DISP (__INLINE_SYSCALL, __VA_ARGS__)
110113
111#if IS_IN (rtld)114#define __INTERNAL_SYSCALL_NCS0(name) \
112/* All cancellation points are compiled out in the dynamic loader. */115 INTERNAL_SYSCALL_NCS (name, 0)
113# define NO_SYSCALL_CANCEL_CHECKING 1116#define __INTERNAL_SYSCALL_NCS1(name, a1) \
117 INTERNAL_SYSCALL_NCS (name, 1, a1)
118#define __INTERNAL_SYSCALL_NCS2(name, a1, a2) \
119 INTERNAL_SYSCALL_NCS (name, 2, a1, a2)
120#define __INTERNAL_SYSCALL_NCS3(name, a1, a2, a3) \
121 INTERNAL_SYSCALL_NCS (name, 3, a1, a2, a3)
122#define __INTERNAL_SYSCALL_NCS4(name, a1, a2, a3, a4) \
123 INTERNAL_SYSCALL_NCS (name, 4, a1, a2, a3, a4)
124#define __INTERNAL_SYSCALL_NCS5(name, a1, a2, a3, a4, a5) \
125 INTERNAL_SYSCALL_NCS (name, 5, a1, a2, a3, a4, a5)
126#define __INTERNAL_SYSCALL_NCS6(name, a1, a2, a3, a4, a5, a6) \
127 INTERNAL_SYSCALL_NCS (name, 6, a1, a2, a3, a4, a5, a6)
128#define __INTERNAL_SYSCALL_NCS7(name, a1, a2, a3, a4, a5, a6, a7) \
129 INTERNAL_SYSCALL_NCS (name, 7, a1, a2, a3, a4, a5, a6, a7)
130
131/* Issue a syscall defined by syscall number plus any other argument required.
132 It is similar to INTERNAL_SYSCALL_NCS macro, but without the need to pass
133 the expected argument number as third parameter. */
134#define INTERNAL_SYSCALL_NCS_CALL(...) \
135 __INTERNAL_SYSCALL_DISP (__INTERNAL_SYSCALL_NCS, __VA_ARGS__)
136
137/* Cancellation macros. */
138#include <syscall_types.h>
139
140/* Adjust both the __syscall_cancel and the SYSCALL_CANCEL macro to support
141 7 arguments instead of default 6 (curently only mip32). It avoid add
142 the requirement to each architecture to support 7 argument macros
143 {INTERNAL,INLINE}_SYSCALL. */
144#ifdef HAVE_CANCELABLE_SYSCALL_WITH_7_ARGS
145# define __SYSCALL_CANCEL7_ARG_DEF __syscall_arg_t a7,
146# define __SYSCALL_CANCEL7_ARCH_ARG_DEF ,__syscall_arg_t a7
147# define __SYSCALL_CANCEL7_ARG 0,
148# define __SYSCALL_CANCEL7_ARG7 a7,
149# define __SYSCALL_CANCEL7_ARCH_ARG7 , a7
114#else150#else
115# define NO_SYSCALL_CANCEL_CHECKING SINGLE_THREAD_P151# define __SYSCALL_CANCEL7_ARG_DEF
152# define __SYSCALL_CANCEL7_ARCH_ARG_DEF
153# define __SYSCALL_CANCEL7_ARG
154# define __SYSCALL_CANCEL7_ARG7
155# define __SYSCALL_CANCEL7_ARCH_ARG7
116#endif156#endif
157long int __internal_syscall_cancel (__syscall_arg_t a1, __syscall_arg_t a2,
158 __syscall_arg_t a3, __syscall_arg_t a4,
159 __syscall_arg_t a5, __syscall_arg_t a6,
160 __SYSCALL_CANCEL7_ARG_DEF
161 __syscall_arg_t nr) attribute_hidden;
117162
118#define SYSCALL_CANCEL(...) \163long int __syscall_cancel (__syscall_arg_t arg1, __syscall_arg_t arg2,
119 ({ \164 __syscall_arg_t arg3, __syscall_arg_t arg4,
120 long int sc_ret; \165 __syscall_arg_t arg5, __syscall_arg_t arg6,
121 if (NO_SYSCALL_CANCEL_CHECKING) \166 __SYSCALL_CANCEL7_ARG_DEF
122 sc_ret = INLINE_SYSCALL_CALL (__VA_ARGS__); \167 __syscall_arg_t nr) attribute_hidden;
123 else \
124 { \
125 int sc_cancel_oldtype = LIBC_CANCEL_ASYNC (); \
126 sc_ret = INLINE_SYSCALL_CALL (__VA_ARGS__); \
127 LIBC_CANCEL_RESET (sc_cancel_oldtype); \
128 } \
129 sc_ret; \
130 })
131168
132/* Issue a syscall defined by syscall number plus any other argument169#define __SYSCALL_CANCEL0(name) \
133 required. Any error will be returned unmodified (including errno). */170 __syscall_cancel (0, 0, 0, 0, 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name)
134#define INTERNAL_SYSCALL_CANCEL(...) \171#define __SYSCALL_CANCEL1(name, a1) \
135 ({ \172 __syscall_cancel (__SSC (a1), 0, 0, 0, 0, 0, \
136 long int sc_ret; \173 __SYSCALL_CANCEL7_ARG __NR_##name)
137 if (NO_SYSCALL_CANCEL_CHECKING) \174#define __SYSCALL_CANCEL2(name, a1, a2) \
138 sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); \175 __syscall_cancel (__SSC (a1), __SSC (a2), 0, 0, 0, 0, \
139 else \176 __SYSCALL_CANCEL7_ARG __NR_##name)
140 { \177#define __SYSCALL_CANCEL3(name, a1, a2, a3) \
141 int sc_cancel_oldtype = LIBC_CANCEL_ASYNC (); \178 __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), 0, 0, 0, \
142 sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); \179 __SYSCALL_CANCEL7_ARG __NR_##name)
143 LIBC_CANCEL_RESET (sc_cancel_oldtype); \180#define __SYSCALL_CANCEL4(name, a1, a2, a3, a4) \
144 } \181 __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
145 sc_ret; \182 __SSC(a4), 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name)
146 })183#define __SYSCALL_CANCEL5(name, a1, a2, a3, a4, a5) \
184 __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC(a4), \
185 __SSC (a5), 0, __SYSCALL_CANCEL7_ARG __NR_##name)
186#define __SYSCALL_CANCEL6(name, a1, a2, a3, a4, a5, a6) \
187 __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC (a4), \
188 __SSC (a5), __SSC (a6), __SYSCALL_CANCEL7_ARG \
189 __NR_##name)
190#define __SYSCALL_CANCEL7(name, a1, a2, a3, a4, a5, a6, a7) \
191 __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC (a4), \
192 __SSC (a5), __SSC (a6), __SSC (a7), __NR_##name)
193
194#define __SYSCALL_CANCEL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n
195#define __SYSCALL_CANCEL_NARGS(...) \
196 __SYSCALL_CANCEL_NARGS_X (__VA_ARGS__,7,6,5,4,3,2,1,0,)
197#define __SYSCALL_CANCEL_CONCAT_X(a,b) a##b
198#define __SYSCALL_CANCEL_CONCAT(a,b) __SYSCALL_CANCEL_CONCAT_X (a, b)
199#define __SYSCALL_CANCEL_DISP(b,...) \
200 __SYSCALL_CANCEL_CONCAT (b,__SYSCALL_CANCEL_NARGS(__VA_ARGS__))(__VA_ARGS__)
201
202/* Issue a cancellable syscall defined first argument plus any other argument
203 required. If and error occurs its value, the macro returns -1 and sets
204 errno accordingly. */
205#define __SYSCALL_CANCEL_CALL(...) \
206 __SYSCALL_CANCEL_DISP (__SYSCALL_CANCEL, __VA_ARGS__)
207
208#define __INTERNAL_SYSCALL_CANCEL0(name) \
209 __internal_syscall_cancel (0, 0, 0, 0, 0, 0, __SYSCALL_CANCEL7_ARG \
210 __NR_##name)
211#define __INTERNAL_SYSCALL_CANCEL1(name, a1) \
212 __internal_syscall_cancel (__SSC (a1), 0, 0, 0, 0, 0, \
213 __SYSCALL_CANCEL7_ARG __NR_##name)
214#define __INTERNAL_SYSCALL_CANCEL2(name, a1, a2) \
215 __internal_syscall_cancel (__SSC (a1), __SSC (a2), 0, 0, 0, 0, \
216 __SYSCALL_CANCEL7_ARG __NR_##name)
217#define __INTERNAL_SYSCALL_CANCEL3(name, a1, a2, a3) \
218 __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), 0, \
219 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name)
220#define __INTERNAL_SYSCALL_CANCEL4(name, a1, a2, a3, a4) \
221 __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
222 __SSC(a4), 0, 0, \
223 __SYSCALL_CANCEL7_ARG __NR_##name)
224#define __INTERNAL_SYSCALL_CANCEL5(name, a1, a2, a3, a4, a5) \
225 __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
226 __SSC(a4), __SSC (a5), 0, \
227 __SYSCALL_CANCEL7_ARG __NR_##name)
228#define __INTERNAL_SYSCALL_CANCEL6(name, a1, a2, a3, a4, a5, a6) \
229 __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
230 __SSC (a4), __SSC (a5), __SSC (a6), \
231 __SYSCALL_CANCEL7_ARG __NR_##name)
232#define __INTERNAL_SYSCALL_CANCEL7(name, a1, a2, a3, a4, a5, a6, a7) \
233 __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
234 __SSC (a4), __SSC (a5), __SSC (a6), \
235 __SSC (a7), __NR_##name)
236
237/* Issue a cancellable syscall defined by syscall number NAME plus any other
238 argument required. If an error occurs its value is returned as an negative
239 number unmodified and errno is not set. */
240#define __INTERNAL_SYSCALL_CANCEL_CALL(...) \
241 __SYSCALL_CANCEL_DISP (__INTERNAL_SYSCALL_CANCEL, __VA_ARGS__)
242
243#if IS_IN (rtld)
244/* The loader does not need to handle thread cancellation, use direct
245 syscall instead. */
246# define INTERNAL_SYSCALL_CANCEL(...) INTERNAL_SYSCALL_CALL(__VA_ARGS__)
247# define SYSCALL_CANCEL(...) INLINE_SYSCALL_CALL (__VA_ARGS__)
248#else
249# define INTERNAL_SYSCALL_CANCEL(...) \
250 __INTERNAL_SYSCALL_CANCEL_CALL (__VA_ARGS__)
251# define SYSCALL_CANCEL(...) \
252 __SYSCALL_CANCEL_CALL (__VA_ARGS__)
253#endif
254
255#endif /* __ASSEMBLER__ */
147256
148/* Machine-dependent sysdep.h files are expected to define the macro257/* Machine-dependent sysdep.h files are expected to define the macro
149 PSEUDO (function_name, syscall_name) to emit assembly code to define the258 PSEUDO (function_name, syscall_name) to emit assembly code to define the
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number. AArch64 version.2 kernel version number. AArch64 version.
3 Copyright (C) 2018-2024 Free Software Foundation, Inc.3 Copyright (C) 2018-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sys/elf.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1996-2024 Free Software Foundation, Inc.1/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
22
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h+2-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2005-2024 Free Software Foundation, Inc.1/* Copyright (C) 2005-2025 Free Software Foundation, Inc.
22
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
...@@ -164,6 +164,7 @@...@@ -164,6 +164,7 @@
164# define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"164# define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"
165# define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"165# define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"
166# define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"166# define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"
167# define HAVE_GETRANDOM_VSYSCALL "__kernel_getrandom"
167168
168# define HAVE_CLONE3_WRAPPER 1169# define HAVE_CLONE3_WRAPPER 1
169170
lib/libc/glibc/sysdeps/unix/sysv/linux/arc/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for ARC.1/* Assembler macros for ARC.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number.2 kernel version number.
3 Copyright (C) 2006-2024 Free Software Foundation, Inc.3 Copyright (C) 2006-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sys/elf.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1996-2024 Free Software Foundation, Inc.1/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/bits/stat.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/bits/timex.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1995-2024 Free Software Foundation, Inc.1/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/csky/kernel_stat.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Internal definitions for stat functions. Linux/csky.1/* Internal definitions for stat functions. Linux/csky.
2 Copyright (C) 2011-2024 Free Software Foundation, Inc.2 Copyright (C) 2011-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/csky/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembly macros for C-SKY.1/* Assembly macros for C-SKY.
2 Copyright (C) 2018-2024 Free Software Foundation, Inc.2 Copyright (C) 2018-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/dl-sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* System-specific settings for dynamic linker code. Linux version.1/* System-specific settings for dynamic linker code. Linux version.
2 Copyright (C) 2005-2024 Free Software Foundation, Inc.2 Copyright (C) 2005-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/fstat.c+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Get file status. Linux version.1/* Get file status. Linux version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c+3-3
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Get file status. Linux version.1/* Get file status. Linux version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 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)...@@ -30,7 +30,7 @@ __fstat64_time64 (int fd, struct __stat64_t64 *buf)
30{30{
31#if !FSTATAT_USE_STATX31#if !FSTATAT_USE_STATX
32# if XSTAT_IS_XSTAT6432# if XSTAT_IS_XSTAT64
33 /* The __NR_stat macro is defined for all ABIs that also define 33 /* The __NR_stat macro is defined for all ABIs that also define
34 XSTAT_IS_STAT64, so to correctly identify alpha and sparc check34 XSTAT_IS_STAT64, so to correctly identify alpha and sparc check
35 __NR_newfstatat (similar to what fstatat64 does). */35 __NR_newfstatat (similar to what fstatat64 does). */
36# ifdef __NR_newfstatat36# ifdef __NR_newfstatat
...@@ -60,7 +60,7 @@ __fstat64_time64 (int fd, struct __stat64_t64 *buf)...@@ -60,7 +60,7 @@ __fstat64_time64 (int fd, struct __stat64_t64 *buf)
60# endif60# endif
61#else /* !FSTATAT_USE_STATX */61#else /* !FSTATAT_USE_STATX */
62 /* All kABIs with non-LFS support and with old 32-bit time_t support62 /* All kABIs with non-LFS support and with old 32-bit time_t support
63 e.g. arm, csky, i386, hppa, m68k, microblaze, nios2, sh, powerpc32,63 e.g. arm, csky, i386, hppa, m68k, microblaze, sh, powerpc32,
64 and sparc32. */64 and sparc32. */
65 if (fd < 0)65 if (fd < 0)
66 {66 {
lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c+3-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Get file status. Linux version.1/* Get file status. Linux version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -16,6 +16,8 @@...@@ -16,6 +16,8 @@
16 License along with the GNU C Library; if not, see16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */17 <https://www.gnu.org/licenses/>. */
1818
19/* zig patch: fixes to make this file compile */
20
19#include <inttypes.h>21#include <inttypes.h>
20#include <sys/stat.h>22#include <sys/stat.h>
21#include <kernel_stat.h>23#include <kernel_stat.h>
lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c+4-2
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Get file status. Linux version.1/* Get file status. Linux version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -16,6 +16,8 @@...@@ -16,6 +16,8 @@
16 License along with the GNU C Library; if not, see16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */17 <https://www.gnu.org/licenses/>. */
1818
19/* zig patch: fixes to make this file compile */
20
19#define __fstatat __redirect___fstatat21#define __fstatat __redirect___fstatat
20#define fstatat __redirect_fstatat22#define fstatat __redirect_fstatat
21#include <inttypes.h>23#include <inttypes.h>
...@@ -104,7 +106,7 @@ fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf,...@@ -104,7 +106,7 @@ fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf,
104#else106#else
105# ifdef __NR_fstatat64107# ifdef __NR_fstatat64
106 /* All kABIs with non-LFS support and with old 32-bit time_t support108 /* All kABIs with non-LFS support and with old 32-bit time_t support
107 e.g. arm, csky, i386, hppa, m68k, microblaze, nios2, sh, powerpc32,109 e.g. arm, csky, i386, hppa, m68k, microblaze, sh, powerpc32,
108 and sparc32. */110 and sparc32. */
109 struct stat64 st64;111 struct stat64 st64;
110 r = INTERNAL_SYSCALL_CALL (fstatat64, fd, file, &st64, flag);112 r = INTERNAL_SYSCALL_CALL (fstatat64, fd, file, &st64, flag);
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/dl-sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* System-specific settings for dynamic linker code. i386 version.1/* System-specific settings for dynamic linker code. i386 version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number. i386 version.2 kernel version number. i386 version.
3 Copyright (C) 1999-2024 Free Software Foundation, Inc.3 Copyright (C) 1999-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/include/sys/timex.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Internal declarations for sys/timex.h.1/* Internal declarations for sys/timex.h.
2 Copyright (C) 2014-2024 Free Software Foundation, Inc.2 Copyright (C) 2014-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number.2 kernel version number.
3 Copyright (C) 1999-2024 Free Software Foundation, Inc.3 Copyright (C) 1999-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel_stat.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Internal definitions for stat functions.1/* Internal definitions for stat functions.
2 Copyright (C) 2021-2024 Free Software Foundation, Inc.2 Copyright (C) 2021-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/loongarch/sysdep.h+2-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembly macros for LoongArch.1/* Assembly macros for LoongArch.
2 Copyright (C) 2022-2024 Free Software Foundation, Inc.2 Copyright (C) 2022-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -119,6 +119,7 @@...@@ -119,6 +119,7 @@
119#define HAVE_CLOCK_GETTIME64_VSYSCALL "__vdso_clock_gettime"119#define HAVE_CLOCK_GETTIME64_VSYSCALL "__vdso_clock_gettime"
120#define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday"120#define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday"
121#define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"121#define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"
122#define HAVE_GETRANDOM_VSYSCALL "__vdso_getrandom"
122123
123#define HAVE_CLONE3_WRAPPER 1124#define HAVE_CLONE3_WRAPPER 1
124125
lib/libc/glibc/sysdeps/unix/sysv/linux/lstat.c+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Get file status. Linux version.1/* Get file status. Linux version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Get file status.1/* Get file status.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.2 Copyright (C) 1996-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2010-2024 Free Software Foundation, Inc.1/* Copyright (C) 2010-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number.2 kernel version number.
3 Copyright (C) 2008-2024 Free Software Foundation, Inc.3 Copyright (C) 2008-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/m680x0/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2010-2024 Free Software Foundation, Inc.1/* Copyright (C) 2010-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/m68k/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1996-2024 Free Software Foundation, Inc.1/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number.2 kernel version number.
3 Copyright (C) 1999-2024 Free Software Foundation, Inc.3 Copyright (C) 1999-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h+5-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2000-2024 Free Software Foundation, Inc.1/* Copyright (C) 2000-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
...@@ -18,6 +18,10 @@...@@ -18,6 +18,10 @@
18#ifndef _LINUX_MIPS_MIPS32_SYSDEP_H18#ifndef _LINUX_MIPS_MIPS32_SYSDEP_H
19#define _LINUX_MIPS_MIPS32_SYSDEP_H 119#define _LINUX_MIPS_MIPS32_SYSDEP_H 1
2020
21/* mips32 have cancelable syscalls with 7 arguments (currently only
22 sync_file_range). */
23#define HAVE_CANCELABLE_SYSCALL_WITH_7_ARGS 1
24
21/* There is some commonality. */25/* There is some commonality. */
22#include <sysdeps/unix/sysv/linux/mips/sysdep.h>26#include <sysdeps/unix/sysv/linux/mips/sysdep.h>
23#include <sysdeps/unix/sysv/linux/sysdep.h>27#include <sysdeps/unix/sysv/linux/sysdep.h>
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Struct stat/stat64 to stat/stat64 conversion for Linux.1/* Struct stat/stat64 to stat/stat64 conversion for Linux.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h+23-31
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2000-2024 Free Software Foundation, Inc.1/* Copyright (C) 2000-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
...@@ -44,15 +44,7 @@...@@ -44,15 +44,7 @@
44#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL44#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
45#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 145#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
4646
47#if _MIPS_SIM == _ABIN3247#include <syscall_types.h>
48/* Convert X to a long long, without losing any bits if it is one
49 already or warning if it is a 32-bit pointer. */
50# define ARGIFY(X) ((long long int) (__typeof__ ((X) - (X))) (X))
51typedef long long int __syscall_arg_t;
52#else
53# define ARGIFY(X) ((long int) (X))
54typedef long int __syscall_arg_t;
55#endif
5648
57/* Note that the original Linux syscall restart convention required the49/* Note that the original Linux syscall restart convention required the
58 instruction immediately preceding SYSCALL to initialize $v0 with the50 instruction immediately preceding SYSCALL to initialize $v0 with the
...@@ -120,7 +112,7 @@ typedef long int __syscall_arg_t;...@@ -120,7 +112,7 @@ typedef long int __syscall_arg_t;
120 long int _sys_result; \112 long int _sys_result; \
121 \113 \
122 { \114 { \
123 __syscall_arg_t _arg1 = ARGIFY (arg1); \115 __syscall_arg_t _arg1 = __SSC (arg1); \
124 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\116 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\
125 = (number); \117 = (number); \
126 register __syscall_arg_t __v0 asm ("$2"); \118 register __syscall_arg_t __v0 asm ("$2"); \
...@@ -144,8 +136,8 @@ typedef long int __syscall_arg_t;...@@ -144,8 +136,8 @@ typedef long int __syscall_arg_t;
144 long int _sys_result; \136 long int _sys_result; \
145 \137 \
146 { \138 { \
147 __syscall_arg_t _arg1 = ARGIFY (arg1); \139 __syscall_arg_t _arg1 = __SSC (arg1); \
148 __syscall_arg_t _arg2 = ARGIFY (arg2); \140 __syscall_arg_t _arg2 = __SSC (arg2); \
149 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\141 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\
150 = (number); \142 = (number); \
151 register __syscall_arg_t __v0 asm ("$2"); \143 register __syscall_arg_t __v0 asm ("$2"); \
...@@ -170,9 +162,9 @@ typedef long int __syscall_arg_t;...@@ -170,9 +162,9 @@ typedef long int __syscall_arg_t;
170 long int _sys_result; \162 long int _sys_result; \
171 \163 \
172 { \164 { \
173 __syscall_arg_t _arg1 = ARGIFY (arg1); \165 __syscall_arg_t _arg1 = __SSC (arg1); \
174 __syscall_arg_t _arg2 = ARGIFY (arg2); \166 __syscall_arg_t _arg2 = __SSC (arg2); \
175 __syscall_arg_t _arg3 = ARGIFY (arg3); \167 __syscall_arg_t _arg3 = __SSC (arg3); \
176 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\168 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\
177 = (number); \169 = (number); \
178 register __syscall_arg_t __v0 asm ("$2"); \170 register __syscall_arg_t __v0 asm ("$2"); \
...@@ -199,10 +191,10 @@ typedef long int __syscall_arg_t;...@@ -199,10 +191,10 @@ typedef long int __syscall_arg_t;
199 long int _sys_result; \191 long int _sys_result; \
200 \192 \
201 { \193 { \
202 __syscall_arg_t _arg1 = ARGIFY (arg1); \194 __syscall_arg_t _arg1 = __SSC (arg1); \
203 __syscall_arg_t _arg2 = ARGIFY (arg2); \195 __syscall_arg_t _arg2 = __SSC (arg2); \
204 __syscall_arg_t _arg3 = ARGIFY (arg3); \196 __syscall_arg_t _arg3 = __SSC (arg3); \
205 __syscall_arg_t _arg4 = ARGIFY (arg4); \197 __syscall_arg_t _arg4 = __SSC (arg4); \
206 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\198 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\
207 = (number); \199 = (number); \
208 register __syscall_arg_t __v0 asm ("$2"); \200 register __syscall_arg_t __v0 asm ("$2"); \
...@@ -229,11 +221,11 @@ typedef long int __syscall_arg_t;...@@ -229,11 +221,11 @@ typedef long int __syscall_arg_t;
229 long int _sys_result; \221 long int _sys_result; \
230 \222 \
231 { \223 { \
232 __syscall_arg_t _arg1 = ARGIFY (arg1); \224 __syscall_arg_t _arg1 = __SSC (arg1); \
233 __syscall_arg_t _arg2 = ARGIFY (arg2); \225 __syscall_arg_t _arg2 = __SSC (arg2); \
234 __syscall_arg_t _arg3 = ARGIFY (arg3); \226 __syscall_arg_t _arg3 = __SSC (arg3); \
235 __syscall_arg_t _arg4 = ARGIFY (arg4); \227 __syscall_arg_t _arg4 = __SSC (arg4); \
236 __syscall_arg_t _arg5 = ARGIFY (arg5); \228 __syscall_arg_t _arg5 = __SSC (arg5); \
237 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\229 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\
238 = (number); \230 = (number); \
239 register __syscall_arg_t __v0 asm ("$2"); \231 register __syscall_arg_t __v0 asm ("$2"); \
...@@ -261,12 +253,12 @@ typedef long int __syscall_arg_t;...@@ -261,12 +253,12 @@ typedef long int __syscall_arg_t;
261 long int _sys_result; \253 long int _sys_result; \
262 \254 \
263 { \255 { \
264 __syscall_arg_t _arg1 = ARGIFY (arg1); \256 __syscall_arg_t _arg1 = __SSC (arg1); \
265 __syscall_arg_t _arg2 = ARGIFY (arg2); \257 __syscall_arg_t _arg2 = __SSC (arg2); \
266 __syscall_arg_t _arg3 = ARGIFY (arg3); \258 __syscall_arg_t _arg3 = __SSC (arg3); \
267 __syscall_arg_t _arg4 = ARGIFY (arg4); \259 __syscall_arg_t _arg4 = __SSC (arg4); \
268 __syscall_arg_t _arg5 = ARGIFY (arg5); \260 __syscall_arg_t _arg5 = __SSC (arg5); \
269 __syscall_arg_t _arg6 = ARGIFY (arg6); \261 __syscall_arg_t _arg6 = __SSC (arg6); \
270 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\262 register __syscall_arg_t __s0 asm ("$16") __attribute__ ((unused))\
271 = (number); \263 = (number); \
272 register __syscall_arg_t __v0 asm ("$2"); \264 register __syscall_arg_t __v0 asm ("$2"); \
lib/libc/glibc/sysdeps/unix/sysv/linux/mips/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Syscall definitions, Linux MIPS generic version.1/* Syscall definitions, Linux MIPS generic version.
2 Copyright (C) 2019-2024 Free Software Foundation, Inc.2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c+3-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Create a special or ordinary file. Linux version.1/* Create a special or ordinary file. Linux version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -16,6 +16,8 @@...@@ -16,6 +16,8 @@
16 License along with the GNU C Library; if not, see16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */17 <https://www.gnu.org/licenses/>. */
1818
19/* zig patch: fixes to make this file compile */
20
19#include <inttypes.h>21#include <inttypes.h>
20#include <sys/types.h>22#include <sys/types.h>
21#include <sys/stat.h>23#include <sys/stat.h>
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number. PowerPC version.2 kernel version number. PowerPC version.
3 Copyright (C) 1999-2024 Free Software Foundation, Inc.3 Copyright (C) 1999-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Definition of `struct stat' used in the kernel.1/* Definition of `struct stat' used in the kernel.
2 Copyright (C) 1997-2024 Free Software Foundation, Inc.2 Copyright (C) 1997-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1992-2024 Free Software Foundation, Inc.1/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/powerpc/sysdep.h+24-21
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Syscall definitions, Linux PowerPC generic version.1/* Syscall definitions, Linux PowerPC generic version.
2 Copyright (C) 2019-2024 Free Software Foundation, Inc.2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -32,6 +32,18 @@...@@ -32,6 +32,18 @@
32#undef SYS_ify32#undef SYS_ify
33#define SYS_ify(syscall_name) __NR_##syscall_name33#define SYS_ify(syscall_name) __NR_##syscall_name
3434
35#define tostring(s) #s
36#define stringify(s) tostring(s)
37
38#ifdef _ARCH_PWR4
39/* Power4 and later cpus introduced a faster instruction to copy one
40 CR field, rather than the slower microcoded mfcr which copies all
41 CR fields. */
42# define MFCR0(REG) "mfocrf " stringify(REG) ",0x80"
43#else
44# define MFCR0(REG) "mfcr " stringify(REG)
45#endif
46
35/* Define a macro which expands inline into the wrapper code for a system47/* Define a macro which expands inline into the wrapper code for a system
36 call. This use is for internal calls that do not need to handle errors48 call. This use is for internal calls that do not need to handle errors
37 normally. It will never touch errno. This returns just what the kernel49 normally. It will never touch errno. This returns just what the kernel
...@@ -52,7 +64,7 @@...@@ -52,7 +64,7 @@
52 __asm__ __volatile__ \64 __asm__ __volatile__ \
53 ("mtctr %0\n\t" \65 ("mtctr %0\n\t" \
54 "bctrl\n\t" \66 "bctrl\n\t" \
55 "mfcr %0\n\t" \67 MFCR0(%0) "\n\t" \
56 "0:" \68 "0:" \
57 : "+r" (r0), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), \69 : "+r" (r0), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), \
58 "+r" (r7), "+r" (r8) \70 "+r" (r7), "+r" (r8) \
...@@ -83,11 +95,10 @@...@@ -83,11 +95,10 @@
83 "scv 0\n\t" \95 "scv 0\n\t" \
84 ".machine \"pop\"\n\t" \96 ".machine \"pop\"\n\t" \
85 "0:" \97 "0:" \
86 : "=&r" (r0), \98 : "+r" (r0), \
87 "=&r" (r3), "=&r" (r4), "=&r" (r5), \99 "+r" (r3), "+r" (r4), "+r" (r5), \
88 "=&r" (r6), "=&r" (r7), "=&r" (r8) \100 "+r" (r6), "+r" (r7), "+r" (r8) \
89 : ASM_INPUT_##nr \101 : : "r9", "r10", "r11", "r12", \
90 : "r9", "r10", "r11", "r12", \
91 "cr0", "cr1", "cr5", "cr6", "cr7", \102 "cr0", "cr1", "cr5", "cr6", "cr7", \
92 "xer", "lr", "ctr", "memory"); \103 "xer", "lr", "ctr", "memory"); \
93 r3; \104 r3; \
...@@ -97,13 +108,12 @@...@@ -97,13 +108,12 @@
97 ({ \108 ({ \
98 __asm__ __volatile__ \109 __asm__ __volatile__ \
99 ("sc\n\t" \110 ("sc\n\t" \
100 "mfcr %0\n\t" \111 MFCR0(%0) "\n\t" \
101 "0:" \112 "0:" \
102 : "=&r" (r0), \113 : "+r" (r0), \
103 "=&r" (r3), "=&r" (r4), "=&r" (r5), \114 "+r" (r3), "+r" (r4), "+r" (r5), \
104 "=&r" (r6), "=&r" (r7), "=&r" (r8) \115 "+r" (r6), "+r" (r7), "+r" (r8) \
105 : ASM_INPUT_##nr \116 : : "r9", "r10", "r11", "r12", \
106 : "r9", "r10", "r11", "r12", \
107 "xer", "cr0", "ctr", "memory"); \117 "xer", "cr0", "ctr", "memory"); \
108 r0 & (1 << 28) ? -r3 : r3; \118 r0 & (1 << 28) ? -r3 : r3; \
109 })119 })
...@@ -199,14 +209,6 @@...@@ -199,14 +209,6 @@
199 __illegally_sized_syscall_arg6 (); \209 __illegally_sized_syscall_arg6 (); \
200 r8 = _arg6210 r8 = _arg6
201211
202#define ASM_INPUT_0 "0" (r0)
203#define ASM_INPUT_1 ASM_INPUT_0, "1" (r3)
204#define ASM_INPUT_2 ASM_INPUT_1, "2" (r4)
205#define ASM_INPUT_3 ASM_INPUT_2, "3" (r5)
206#define ASM_INPUT_4 ASM_INPUT_3, "4" (r6)
207#define ASM_INPUT_5 ASM_INPUT_4, "5" (r7)
208#define ASM_INPUT_6 ASM_INPUT_5, "6" (r8)
209
210/* List of system calls which are supported as vsyscalls. */212/* List of system calls which are supported as vsyscalls. */
211#define VDSO_NAME "LINUX_2.6.15"213#define VDSO_NAME "LINUX_2.6.15"
212#define VDSO_HASH 123718565214#define VDSO_HASH 123718565
...@@ -223,5 +225,6 @@...@@ -223,5 +225,6 @@
223#define HAVE_TIME_VSYSCALL "__kernel_time"225#define HAVE_TIME_VSYSCALL "__kernel_time"
224#define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"226#define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"
225#define HAVE_GET_TBFREQ "__kernel_get_tbfreq"227#define HAVE_GET_TBFREQ "__kernel_get_tbfreq"
228#define HAVE_GETRANDOM_VSYSCALL "__kernel_getrandom"
226229
227#endif /* _LINUX_POWERPC_SYSDEP_H */230#endif /* _LINUX_POWERPC_SYSDEP_H */
lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number. RISC-V version.2 kernel version number. RISC-V version.
3 Copyright (C) 2018-2024 Free Software Foundation, Inc.3 Copyright (C) 2018-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* bits/typesizes.h -- underlying types for *_t. Linux/s390 version.1/* bits/typesizes.h -- underlying types for *_t. Linux/s390 version.
2 Copyright (C) 2003-2024 Free Software Foundation, Inc.2 Copyright (C) 2003-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number. S/390 version.2 kernel version number. S/390 version.
3 Copyright (C) 1999-2024 Free Software Foundation, Inc.3 Copyright (C) 1999-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for 64 bit S/390.1/* Assembler macros for 64 bit S/390.
2 Copyright (C) 2001-2024 Free Software Foundation, Inc.2 Copyright (C) 2001-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sys/elf.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2000-2024 Free Software Foundation, Inc.1/* Copyright (C) 2000-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h+2-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Syscall definitions, Linux s390 version.1/* Syscall definitions, Linux s390 version.
2 Copyright (C) 2019-2024 Free Software Foundation, Inc.2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -72,6 +72,7 @@...@@ -72,6 +72,7 @@
72#ifdef __s390x__72#ifdef __s390x__
73#define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"73#define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"
74#define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"74#define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"
75#define HAVE_GETRANDOM_VSYSCALL "__kernel_getrandom"
75#else76#else
76#define HAVE_CLOCK_GETRES_VSYSCALL "__kernel_clock_getres"77#define HAVE_CLOCK_GETRES_VSYSCALL "__kernel_clock_getres"
77#define HAVE_CLOCK_GETTIME_VSYSCALL "__kernel_clock_gettime"78#define HAVE_CLOCK_GETTIME_VSYSCALL "__kernel_clock_gettime"
lib/libc/glibc/sysdeps/unix/sysv/linux/single-thread.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Single thread optimization, Linux version.1/* Single thread optimization, Linux version.
2 Copyright (C) 2019-2024 Free Software Foundation, Inc.2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version.1/* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number. SPARC version.2 kernel version number. SPARC version.
3 Copyright (C) 1999-2024 Free Software Foundation, Inc.3 Copyright (C) 1999-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h+3-2
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1997-2024 Free Software Foundation, Inc.1/* Copyright (C) 1997-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
...@@ -107,6 +107,7 @@ ENTRY(name); \...@@ -107,6 +107,7 @@ ENTRY(name); \
107#else /* __ASSEMBLER__ */107#else /* __ASSEMBLER__ */
108108
109#define __SYSCALL_STRING \109#define __SYSCALL_STRING \
110 "mov %[scn], %%g1;" \
110 "ta 0x10;" \111 "ta 0x10;" \
111 "bcc 1f;" \112 "bcc 1f;" \
112 " nop;" \113 " nop;" \
...@@ -114,7 +115,7 @@ ENTRY(name); \...@@ -114,7 +115,7 @@ ENTRY(name); \
114 "1:"115 "1:"
115116
116#define __SYSCALL_CLOBBERS \117#define __SYSCALL_CLOBBERS \
117 "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \118 "g1", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
118 "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \119 "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
119 "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \120 "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
120 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \121 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Struct kernel_stat64 to stat64. Linux/SPARC version.1/* Struct kernel_stat64 to stat64. Linux/SPARC version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h+3-2
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1997-2024 Free Software Foundation, Inc.1/* Copyright (C) 1997-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
...@@ -106,6 +106,7 @@ ENTRY(name); \...@@ -106,6 +106,7 @@ ENTRY(name); \
106#else /* __ASSEMBLER__ */106#else /* __ASSEMBLER__ */
107107
108#define __SYSCALL_STRING \108#define __SYSCALL_STRING \
109 "mov %[scn], %%g1;" \
109 "ta 0x6d;" \110 "ta 0x6d;" \
110 "bcc,pt %%xcc, 1f;" \111 "bcc,pt %%xcc, 1f;" \
111 " nop;" \112 " nop;" \
...@@ -113,7 +114,7 @@ ENTRY(name); \...@@ -113,7 +114,7 @@ ENTRY(name); \
113 "1:"114 "1:"
114115
115#define __SYSCALL_CLOBBERS \116#define __SYSCALL_CLOBBERS \
116 "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \117 "g1", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
117 "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \118 "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
118 "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \119 "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
119 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \120 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
lib/libc/glibc/sysdeps/unix/sysv/linux/sparc/sysdep.h+45-31
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2000-2024 Free Software Foundation, Inc.1/* Copyright (C) 2000-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
...@@ -50,97 +50,109 @@...@@ -50,97 +50,109 @@
5050
51#undef INTERNAL_SYSCALL_NCS51#undef INTERNAL_SYSCALL_NCS
52#define INTERNAL_SYSCALL_NCS(name, nr, args...) \52#define INTERNAL_SYSCALL_NCS(name, nr, args...) \
53 internal_syscall##nr(__SYSCALL_STRING, name, args)53 _internal_syscall##nr(__SYSCALL_STRING, "p", name, args)
5454
55#define internal_syscall0(string,name,dummy...) \55#define _internal_syscall0(string,nc,name,dummy...) \
56({ \56({ \
57 register long int __g1 __asm__ ("g1") = (name); \
58 register long __o0 __asm__ ("o0"); \57 register long __o0 __asm__ ("o0"); \
58 long int _name = (long int) (name); \
59 __asm __volatile (string : "=r" (__o0) : \59 __asm __volatile (string : "=r" (__o0) : \
60 "r" (__g1) : \60 [scn] nc (_name) : \
61 __SYSCALL_CLOBBERS); \61 __SYSCALL_CLOBBERS); \
62 __o0; \62 __o0; \
63})63})
64#define internal_syscall0(string,name,args...) \
65 _internal_syscall0(string, "i", name, args)
6466
65#define internal_syscall1(string,name,arg1) \67#define _internal_syscall1(string,nc,name,arg1) \
66({ \68({ \
67 long int _arg1 = (long int) (arg1); \69 long int _arg1 = (long int) (arg1); \
68 register long int __g1 __asm__("g1") = (name); \70 long int _name = (long int) (name); \
69 register long int __o0 __asm__ ("o0") = _arg1; \71 register long int __o0 __asm__ ("o0") = _arg1; \
70 __asm __volatile (string : "=r" (__o0) : \72 __asm __volatile (string : "+r" (__o0) : \
71 "r" (__g1), "0" (__o0) : \73 [scn] nc (_name) : \
72 __SYSCALL_CLOBBERS); \74 __SYSCALL_CLOBBERS); \
73 __o0; \75 __o0; \
74})76})
77#define internal_syscall1(string,name,args...) \
78 _internal_syscall1(string, "i", name, args)
7579
76#define internal_syscall2(string,name,arg1,arg2) \80#define _internal_syscall2(string,nc,name,arg1,arg2) \
77({ \81({ \
78 long int _arg1 = (long int) (arg1); \82 long int _arg1 = (long int) (arg1); \
79 long int _arg2 = (long int) (arg2); \83 long int _arg2 = (long int) (arg2); \
80 register long int __g1 __asm__("g1") = (name); \84 long int _name = (long int) (name); \
81 register long int __o0 __asm__ ("o0") = _arg1; \85 register long int __o0 __asm__ ("o0") = _arg1; \
82 register long int __o1 __asm__ ("o1") = _arg2; \86 register long int __o1 __asm__ ("o1") = _arg2; \
83 __asm __volatile (string : "=r" (__o0) : \87 __asm __volatile (string : "+r" (__o0) : \
84 "r" (__g1), "0" (__o0), "r" (__o1) : \88 [scn] nc (_name), "r" (__o1) : \
85 __SYSCALL_CLOBBERS); \89 __SYSCALL_CLOBBERS); \
86 __o0; \90 __o0; \
87})91})
92#define internal_syscall2(string,name,args...) \
93 _internal_syscall2(string, "i", name, args)
8894
89#define internal_syscall3(string,name,arg1,arg2,arg3) \95#define _internal_syscall3(string,nc,name,arg1,arg2,arg3) \
90({ \96({ \
91 long int _arg1 = (long int) (arg1); \97 long int _arg1 = (long int) (arg1); \
92 long int _arg2 = (long int) (arg2); \98 long int _arg2 = (long int) (arg2); \
93 long int _arg3 = (long int) (arg3); \99 long int _arg3 = (long int) (arg3); \
94 register long int __g1 __asm__("g1") = (name); \100 long int _name = (long int) (name); \
95 register long int __o0 __asm__ ("o0") = _arg1; \101 register long int __o0 __asm__ ("o0") = _arg1; \
96 register long int __o1 __asm__ ("o1") = _arg2; \102 register long int __o1 __asm__ ("o1") = _arg2; \
97 register long int __o2 __asm__ ("o2") = _arg3; \103 register long int __o2 __asm__ ("o2") = _arg3; \
98 __asm __volatile (string : "=r" (__o0) : \104 __asm __volatile (string : "+r" (__o0) : \
99 "r" (__g1), "0" (__o0), "r" (__o1), \105 [scn] nc (_name), "r" (__o1), \
100 "r" (__o2) : \106 "r" (__o2) : \
101 __SYSCALL_CLOBBERS); \107 __SYSCALL_CLOBBERS); \
102 __o0; \108 __o0; \
103})109})
110#define internal_syscall3(string,name,args...) \
111 _internal_syscall3(string, "i", name, args)
104112
105#define internal_syscall4(string,name,arg1,arg2,arg3,arg4) \113#define _internal_syscall4(string,nc,name,arg1,arg2,arg3,arg4) \
106({ \114({ \
107 long int _arg1 = (long int) (arg1); \115 long int _arg1 = (long int) (arg1); \
108 long int _arg2 = (long int) (arg2); \116 long int _arg2 = (long int) (arg2); \
109 long int _arg3 = (long int) (arg3); \117 long int _arg3 = (long int) (arg3); \
110 long int _arg4 = (long int) (arg4); \118 long int _arg4 = (long int) (arg4); \
111 register long int __g1 __asm__("g1") = (name); \119 long int _name = (long int) (name); \
112 register long int __o0 __asm__ ("o0") = _arg1; \120 register long int __o0 __asm__ ("o0") = _arg1; \
113 register long int __o1 __asm__ ("o1") = _arg2; \121 register long int __o1 __asm__ ("o1") = _arg2; \
114 register long int __o2 __asm__ ("o2") = _arg3; \122 register long int __o2 __asm__ ("o2") = _arg3; \
115 register long int __o3 __asm__ ("o3") = _arg4; \123 register long int __o3 __asm__ ("o3") = _arg4; \
116 __asm __volatile (string : "=r" (__o0) : \124 __asm __volatile (string : "+r" (__o0) : \
117 "r" (__g1), "0" (__o0), "r" (__o1), \125 [scn] nc (_name), "r" (__o1), \
118 "r" (__o2), "r" (__o3) : \126 "r" (__o2), "r" (__o3) : \
119 __SYSCALL_CLOBBERS); \127 __SYSCALL_CLOBBERS); \
120 __o0; \128 __o0; \
121})129})
130#define internal_syscall4(string,name,args...) \
131 _internal_syscall4(string, "i", name, args)
122132
123#define internal_syscall5(string,name,arg1,arg2,arg3,arg4,arg5) \133#define _internal_syscall5(string,nc,name,arg1,arg2,arg3,arg4,arg5) \
124({ \134({ \
125 long int _arg1 = (long int) (arg1); \135 long int _arg1 = (long int) (arg1); \
126 long int _arg2 = (long int) (arg2); \136 long int _arg2 = (long int) (arg2); \
127 long int _arg3 = (long int) (arg3); \137 long int _arg3 = (long int) (arg3); \
128 long int _arg4 = (long int) (arg4); \138 long int _arg4 = (long int) (arg4); \
129 long int _arg5 = (long int) (arg5); \139 long int _arg5 = (long int) (arg5); \
130 register long int __g1 __asm__("g1") = (name); \140 long int _name = (long int) (name); \
131 register long int __o0 __asm__ ("o0") = _arg1; \141 register long int __o0 __asm__ ("o0") = _arg1; \
132 register long int __o1 __asm__ ("o1") = _arg2; \142 register long int __o1 __asm__ ("o1") = _arg2; \
133 register long int __o2 __asm__ ("o2") = _arg3; \143 register long int __o2 __asm__ ("o2") = _arg3; \
134 register long int __o3 __asm__ ("o3") = _arg4; \144 register long int __o3 __asm__ ("o3") = _arg4; \
135 register long int __o4 __asm__ ("o4") = _arg5; \145 register long int __o4 __asm__ ("o4") = _arg5; \
136 __asm __volatile (string : "=r" (__o0) : \146 __asm __volatile (string : "+r" (__o0) : \
137 "r" (__g1), "0" (__o0), "r" (__o1), \147 [scn] nc (_name), "r" (__o1), \
138 "r" (__o2), "r" (__o3), "r" (__o4) : \148 "r" (__o2), "r" (__o3), "r" (__o4) : \
139 __SYSCALL_CLOBBERS); \149 __SYSCALL_CLOBBERS); \
140 __o0; \150 __o0; \
141})151})
152#define internal_syscall5(string,name,args...) \
153 _internal_syscall5(string, "i", name, args)
142154
143#define internal_syscall6(string,name,arg1,arg2,arg3,arg4,arg5,arg6) \155#define _internal_syscall6(string,nc,name,arg1,arg2,arg3,arg4,arg5,arg6)\
144({ \156({ \
145 long int _arg1 = (long int) (arg1); \157 long int _arg1 = (long int) (arg1); \
146 long int _arg2 = (long int) (arg2); \158 long int _arg2 = (long int) (arg2); \
...@@ -148,20 +160,22 @@...@@ -148,20 +160,22 @@
148 long int _arg4 = (long int) (arg4); \160 long int _arg4 = (long int) (arg4); \
149 long int _arg5 = (long int) (arg5); \161 long int _arg5 = (long int) (arg5); \
150 long int _arg6 = (long int) (arg6); \162 long int _arg6 = (long int) (arg6); \
151 register long int __g1 __asm__("g1") = (name); \163 long int _name = (long int) (name); \
152 register long int __o0 __asm__ ("o0") = _arg1; \164 register long int __o0 __asm__ ("o0") = _arg1; \
153 register long int __o1 __asm__ ("o1") = _arg2; \165 register long int __o1 __asm__ ("o1") = _arg2; \
154 register long int __o2 __asm__ ("o2") = _arg3; \166 register long int __o2 __asm__ ("o2") = _arg3; \
155 register long int __o3 __asm__ ("o3") = _arg4; \167 register long int __o3 __asm__ ("o3") = _arg4; \
156 register long int __o4 __asm__ ("o4") = _arg5; \168 register long int __o4 __asm__ ("o4") = _arg5; \
157 register long int __o5 __asm__ ("o5") = _arg6; \169 register long int __o5 __asm__ ("o5") = _arg6; \
158 __asm __volatile (string : "=r" (__o0) : \170 __asm __volatile (string : "+r" (__o0) : \
159 "r" (__g1), "0" (__o0), "r" (__o1), \171 [scn] nc (_name), "r" (__o1), \
160 "r" (__o2), "r" (__o3), "r" (__o4), \172 "r" (__o2), "r" (__o3), "r" (__o4), \
161 "r" (__o5) : \173 "r" (__o5) : \
162 __SYSCALL_CLOBBERS); \174 __SYSCALL_CLOBBERS); \
163 __o0; \175 __o0; \
164})176})
177#define internal_syscall6(string,name,args...) \
178 _internal_syscall6(string, "i", name, args)
165179
166#define INLINE_CLONE_SYSCALL(arg1,arg2,arg3,arg4,arg5) \180#define INLINE_CLONE_SYSCALL(arg1,arg2,arg3,arg4,arg5) \
167({ \181({ \
...@@ -170,15 +184,15 @@...@@ -170,15 +184,15 @@
170 long int _arg3 = (long int) (arg3); \184 long int _arg3 = (long int) (arg3); \
171 long int _arg4 = (long int) (arg4); \185 long int _arg4 = (long int) (arg4); \
172 long int _arg5 = (long int) (arg5); \186 long int _arg5 = (long int) (arg5); \
187 long int _name = __NR_clone; \
173 register long int __o0 __asm__ ("o0") = _arg1; \188 register long int __o0 __asm__ ("o0") = _arg1; \
174 register long int __o1 __asm__ ("o1") = _arg2; \189 register long int __o1 __asm__ ("o1") = _arg2; \
175 register long int __o2 __asm__ ("o2") = _arg3; \190 register long int __o2 __asm__ ("o2") = _arg3; \
176 register long int __o3 __asm__ ("o3") = _arg4; \191 register long int __o3 __asm__ ("o3") = _arg4; \
177 register long int __o4 __asm__ ("o4") = _arg5; \192 register long int __o4 __asm__ ("o4") = _arg5; \
178 register long int __g1 __asm__ ("g1") = __NR_clone; \
179 __asm __volatile (__SYSCALL_STRING : \193 __asm __volatile (__SYSCALL_STRING : \
180 "=r" (__o0), "=r" (__o1) : \194 "=r" (__o0), "=r" (__o1) : \
181 "r" (__g1), "0" (__o0), "1" (__o1), \195 [scn] "i" (_name), "0" (__o0), "1" (__o1), \
182 "r" (__o2), "r" (__o3), "r" (__o4) : \196 "r" (__o2), "r" (__o3), "r" (__o4) : \
183 __SYSCALL_CLOBBERS); \197 __SYSCALL_CLOBBERS); \
184 if (__glibc_unlikely ((unsigned long int) (__o0) > -4096UL)) \198 if (__glibc_unlikely ((unsigned long int) (__o0) > -4096UL)) \
lib/libc/glibc/sysdeps/unix/sysv/linux/stat.c+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Get file status. Linux version.1/* Get file status. Linux version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/stat64.c+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Get file status. Linux version.1/* Get file status. Linux version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Struct stat/stat64 to stat/stat64 conversion for Linux.1/* Struct stat/stat64 to stat/stat64 conversion for Linux.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Copy to/from struct stat with and without 64-bit time_t support.1/* Copy to/from struct stat with and without 64-bit time_t support.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/struct_stat_time64.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Struct stat with 64-bit time support.1/* Struct stat with 64-bit time support.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sys/syscall.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1995-2024 Free Software Foundation, Inc.1/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sys/timex.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1995-2024 Free Software Foundation, Inc.1/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2015-2024 Free Software Foundation, Inc.1/* Copyright (C) 2015-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/x86/bits/typesizes.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version.1/* bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version.
2 Copyright (C) 2012-2024 Free Software Foundation, Inc.2 Copyright (C) 2012-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/x86/sys/elf.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1998-2024 Free Software Foundation, Inc.1/* Copyright (C) 1998-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/kernel-features.h+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* Set flags signalling availability of kernel features based on given1/* Set flags signalling availability of kernel features based on given
2 kernel version number. x86-64 version.2 kernel version number. x86-64 version.
3 Copyright (C) 1999-2024 Free Software Foundation, Inc.3 Copyright (C) 1999-2025 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.4 This file is part of the GNU C Library.
55
6 The GNU C Library is free software; you can redistribute it and/or6 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/sysdep.h+2-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2001-2024 Free Software Foundation, Inc.1/* Copyright (C) 2001-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
...@@ -376,6 +376,7 @@...@@ -376,6 +376,7 @@
376# define HAVE_TIME_VSYSCALL "__vdso_time"376# define HAVE_TIME_VSYSCALL "__vdso_time"
377# define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"377# define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"
378# define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres"378# define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres"
379# define HAVE_GETRANDOM_VSYSCALL "__vdso_getrandom"
379380
380# define HAVE_CLONE3_WRAPPER 1381# define HAVE_CLONE3_WRAPPER 1
381382
lib/libc/glibc/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2012-2024 Free Software Foundation, Inc.1/* Copyright (C) 2012-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/unix/x86_64/sysdep.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 1991-2024 Free Software Foundation, Inc.1/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/wordsize-32/divdi3-symbol-hacks.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Hacks needed for divdi3 symbol manipulation.1/* Hacks needed for divdi3 symbol manipulation.
2 Copyright (C) 2004-2024 Free Software Foundation, Inc.2 Copyright (C) 2004-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/x86/nptl/bits/pthreadtypes-arch.h+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Copyright (C) 2002-2024 Free Software Foundation, Inc.1/* Copyright (C) 2002-2025 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.2 This file is part of the GNU C Library.
33
4 The GNU C Library is free software; you can redistribute it and/or4 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/x86/sysdep.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for x86.1/* Assembler macros for x86.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.2 Copyright (C) 2017-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/x86_64/start.S+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Startup code compliant to the ELF x86-64 ABI.1/* Startup code compliant to the ELF x86-64 ABI.
2 Copyright (C) 2001-2024 Free Software Foundation, Inc.2 Copyright (C) 2001-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
lib/libc/glibc/sysdeps/x86_64/sysdep.h+3-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for x86-64.1/* Assembler macros for x86-64.
2 Copyright (C) 2001-2024 Free Software Foundation, Inc.2 Copyright (C) 2001-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -19,6 +19,8 @@...@@ -19,6 +19,8 @@
19#ifndef _X86_64_SYSDEP_H19#ifndef _X86_64_SYSDEP_H
20#define _X86_64_SYSDEP_H 120#define _X86_64_SYSDEP_H 1
2121
22/* zig patch: inline x86-lp_size.h */
23
22#include <sysdeps/x86/sysdep.h>24#include <sysdeps/x86/sysdep.h>
23#ifdef __ASSEMBLER__25#ifdef __ASSEMBLER__
24# define LP_SIZE 826# define LP_SIZE 8
lib/libc/glibc/sysdeps/x86_64/x32/sysdep.h+3-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Assembler macros for x32.1/* Assembler macros for x32.
2 Copyright (C) 2012-2024 Free Software Foundation, Inc.2 Copyright (C) 2012-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
5 The GNU C Library is free software; you can redistribute it and/or5 The GNU C Library is free software; you can redistribute it and/or
...@@ -16,6 +16,8 @@...@@ -16,6 +16,8 @@
16 License along with the GNU C Library; if not, see16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */17 <https://www.gnu.org/licenses/>. */
1818
19/* zig patch: inline x86-lp_size.h */
20
19#include <sysdeps/x86_64/sysdep.h>21#include <sysdeps/x86_64/sysdep.h>
20#undef LP_SIZE22#undef LP_SIZE
21#ifdef __ASSEMBLER__23#ifdef __ASSEMBLER__