authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-07-31 23:06:50+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-07-31 23:06:50+02:00
logf6c5f8b79908d6c1550fe535ceb26d1d8944c197
treeff1cdc8acf95337acf4fcf7ea57d584abfcd2ea4
parent8a4b5424d61a4ac8947cff1b9a8481578573db67
parentb665f716f3d35b4ae1505fa4b95bea42da031785
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

Merge branch 'glibc-2.44'


133 files changed, 2208 insertions(+), 2671 deletions(-)

lib/libc/glibc/abilists
Binary files a/lib/libc/glibc/abilists and b/lib/libc/glibc/abilists differ
lib/libc/glibc/elf/elf.h+6-2
...@@ -798,7 +798,8 @@ typedef struct...@@ -798,7 +798,8 @@ typedef struct
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_X86_XSAVE_LAYOUT 0x205 /* XSAVE layout description. */
801#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */801#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves. This was
802 used in now removed s390-32 arch. */
802#define NT_S390_TIMER 0x301 /* s390 timer register */803#define NT_S390_TIMER 0x301 /* s390 timer register */
803#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */804#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
804#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */805#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
...@@ -846,6 +847,7 @@ typedef struct...@@ -846,6 +847,7 @@ typedef struct
846#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */847#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */
847#define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged848#define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged
848 address control */849 address control */
850#define NT_RISCV_USER_CFI 0x903 /* RISC-V shadow stack state */
849#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */851#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */
850#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and852#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and
851 status registers. */853 status registers. */
...@@ -3470,7 +3472,9 @@ enum...@@ -3470,7 +3472,9 @@ enum
34703472
3471/* Valid values for the e_flags field. */3473/* Valid values for the e_flags field. */
34723474
3473#define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed. */3475#define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed.
3476 This was used in now removed s390-32
3477 arch. */
34743478
3475/* Additional s390 relocs */3479/* Additional s390 relocs */
34763480
lib/libc/glibc/include/libc-symbols.h+2-1
...@@ -113,6 +113,7 @@...@@ -113,6 +113,7 @@
113#define HAVE_LIBINTL_H 1113#define HAVE_LIBINTL_H 1
114#define HAVE_WCTYPE_H 1114#define HAVE_WCTYPE_H 1
115#define HAVE_ISWCTYPE 1115#define HAVE_ISWCTYPE 1
116#define HAVE_MEMPCPY 1
116#define ENABLE_NLS 1117#define ENABLE_NLS 1
117118
118/* The symbols in all the user (non-_) macros are C symbols. */119/* The symbols in all the user (non-_) macros are C symbols. */
...@@ -682,7 +683,7 @@ for linking")...@@ -682,7 +683,7 @@ for linking")
682683
683/* Helper / base macros for indirect function symbols. */684/* Helper / base macros for indirect function symbols. */
684#define __ifunc_resolver(type_name, name, expr, init, classifier, ...) \685#define __ifunc_resolver(type_name, name, expr, init, classifier, ...) \
685 classifier inhibit_stack_protector \686 classifier \
686 __typeof (type_name) *name##_ifunc (__VA_ARGS__) \687 __typeof (type_name) *name##_ifunc (__VA_ARGS__) \
687 { \688 { \
688 init (); \689 init (); \
lib/libc/glibc/sysdeps/aarch64/sysdep.h+28-4
...@@ -43,7 +43,6 @@...@@ -43,7 +43,6 @@
43#define FEATURE_1_PAC 243#define FEATURE_1_PAC 2
44#define FEATURE_1_GCS 444#define FEATURE_1_GCS 4
4545
46/* Add a NT_GNU_PROPERTY_TYPE_0 note. */
47#define GNU_PROPERTY(type, value) \46#define GNU_PROPERTY(type, value) \
48 .section .note.gnu.property, "a"; \47 .section .note.gnu.property, "a"; \
49 .p2align 3; \48 .p2align 3; \
...@@ -57,9 +56,34 @@...@@ -57,9 +56,34 @@
57 .word 0; \56 .word 0; \
58 .text57 .text
5958
60/* Add GNU property note with the supported features to all asm code59#ifdef __ARM_BUILDATTR64_FV
61 where sysdep.h is included. */60/* Add AArch64 feature bits build attributes. */
62GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC|FEATURE_1_GCS)61# define FEATURE_1_AND_MARK(value) \
62 .aeabi_subsection aeabi_feature_and_bits, optional, ULEB128; \
63 .if ((value) & FEATURE_1_BTI); \
64 .aeabi_attribute Tag_Feature_BTI, 1; \
65 .else; \
66 .aeabi_attribute Tag_Feature_BTI, 0; \
67 .endif; \
68 .if ((value) & FEATURE_1_GCS); \
69 .aeabi_attribute Tag_Feature_GCS, 1; \
70 .else; \
71 .aeabi_attribute Tag_Feature_GCS, 0; \
72 .endif; \
73 .if ((value) & FEATURE_1_PAC); \
74 .aeabi_attribute Tag_Feature_PAC, 1; \
75 .else; \
76 .aeabi_attribute Tag_Feature_PAC, 0; \
77 .endif; \
78 .text
79#else
80/* Add a NT_GNU_PROPERTY_TYPE_0 note. */
81# define FEATURE_1_AND_MARK(value) GNU_PROPERTY (FEATURE_1_AND, value)
82#endif /* __ARM_BUILDATTR64_FV */
83
84/* Add marking with the supported features to all asm code where sysdep.h
85 is included. */
86FEATURE_1_AND_MARK (FEATURE_1_BTI | FEATURE_1_PAC | FEATURE_1_GCS)
6387
64/* Define an entry point visible from C. */88/* Define an entry point visible from C. */
65#define ENTRY(name) \89#define ENTRY(name) \
lib/libc/glibc/sysdeps/arm/start.S+27
...@@ -90,6 +90,7 @@ _start:...@@ -90,6 +90,7 @@ _start:
90 push { a1 }90 push { a1 }
9191
92#ifdef PIC92#ifdef PIC
93# ifdef SHARED
93 ldr sl, .L_GOT94 ldr sl, .L_GOT
94 adr a4, .L_GOT95 adr a4, .L_GOT
95 add sl, sl, a496 add sl, sl, a4
...@@ -103,6 +104,16 @@ _start:...@@ -103,6 +104,16 @@ _start:
103 /* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */104 /* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
104 /* Let the libc call main and exit with its return code. */105 /* Let the libc call main and exit with its return code. */
105 bl __libc_start_main(PLT)106 bl __libc_start_main(PLT)
107# else
108 ldr a1, .L_main_rel /* Load the relative offset of __wrap_main. */
109 adr a4, .L_main_rel /* Load the actual runtime address of the label. */
110 add a1, a4, a1 /* Add them together to get the absolute address. */
111
112 mov a4, #0 /* Used to be init. */
113 push { a4 } /* Used to be fini. */
114
115 bl __libc_start_main
116# endif /* ifdef SHARED */
106#else117#else
107118
108 mov a4, #0 /* Used to init. */119 mov a4, #0 /* Used to init. */
...@@ -119,14 +130,30 @@ _start:...@@ -119,14 +130,30 @@ _start:
119130
120#ifdef PIC131#ifdef PIC
121 .align 2132 .align 2
133# ifdef SHARED
122.L_GOT:134.L_GOT:
123 .word _GLOBAL_OFFSET_TABLE_ - .L_GOT135 .word _GLOBAL_OFFSET_TABLE_ - .L_GOT
124 .word main(GOT)136 .word main(GOT)
137# else
138.L_main_rel:
139 .word __wrap_main - .L_main_rel
140# endif
125#endif141#endif
126142
127 .cantunwind143 .cantunwind
128 .fnend144 .fnend
129145
146#if defined PIC && !defined SHARED
147/* When main is not defined in the executable but in a shared library then
148 a wrapper is needed, because crt1.o and rcrt1.o share this code and the
149 latter (static PIE) must avoid GOT relocations before __libc_start_main
150 is called. The branch to main is turned into a PLT entry by every linker,
151 unlike a REL32 data relocation against main. */
152 .type __wrap_main, %function
153__wrap_main:
154 b main
155#endif
156
130/* Define a symbol for the first piece of initialized data. */157/* Define a symbol for the first piece of initialized data. */
131 .data158 .data
132 .globl __data_start159 .globl __data_start
lib/libc/glibc/sysdeps/htl/libc-lockP.h+14
...@@ -21,6 +21,20 @@...@@ -21,6 +21,20 @@
2121
22#include <pthread.h>22#include <pthread.h>
2323
24typedef pthread_rwlock_t __libc_rwlock_t;
25
26#define __libc_rwlock_define(CLASS,NAME) \
27 CLASS __libc_rwlock_t NAME;
28#define __libc_rwlock_define_initialized(CLASS,NAME) \
29 CLASS __libc_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;
30#define __libc_rwlock_init(NAME) __pthread_rwlock_init (&(NAME), NULL)
31#define __libc_rwlock_fini(NAME) ((void) 0)
32#define __libc_rwlock_rdlock(NAME) __pthread_rwlock_rdlock (&(NAME))
33#define __libc_rwlock_wrlock(NAME) __pthread_rwlock_wrlock (&(NAME))
34#define __libc_rwlock_tryrdlock(NAME) __pthread_rwlock_tryrdlock (&(NAME))
35#define __libc_rwlock_trywrlock(NAME) __pthread_rwlock_trywrlock (&(NAME))
36#define __libc_rwlock_unlock(NAME) __pthread_rwlock_unlock (&(NAME))
37
24/* If we check for a weakly referenced symbol and then perform a38/* If we check for a weakly referenced symbol and then perform a
25 normal jump to it te code generated for some platforms in case of39 normal jump to it te code generated for some platforms in case of
26 PIC is unnecessarily slow. What would happen is that the function40 PIC is unnecessarily slow. What would happen is that the function
lib/libc/glibc/sysdeps/loongarch/start.S+18-8
...@@ -36,6 +36,7 @@...@@ -36,6 +36,7 @@
36#define __ASSEMBLY__ 136#define __ASSEMBLY__ 1
37#include <entry.h>37#include <entry.h>
38#include <sys/asm.h>38#include <sys/asm.h>
39#include <sysdep.h>
3940
40/* The entry point's job is to call __libc_start_main. Per the ABI,41/* The entry point's job is to call __libc_start_main. Per the ABI,
41 a0 contains the address of a function to be passed to atexit.42 a0 contains the address of a function to be passed to atexit.
...@@ -57,23 +58,32 @@ ENTRY (ENTRY_POINT)...@@ -57,23 +58,32 @@ ENTRY (ENTRY_POINT)
57/* Terminate call stack by noting ra is undefined. Use a dummy58/* Terminate call stack by noting ra is undefined. Use a dummy
58 .cfi_label to force starting the FDE. */59 .cfi_label to force starting the FDE. */
59 .cfi_label .Ldummy60 .cfi_label .Ldummy
60 cfi_undefined (1)61 cfi_undefined (1)
61 or a5, a0, zero /* rtld_fini */62 or a5, a0, zero /* rtld_fini */
6263
63 la.pcrel a0, t0, main64#if defined PIC && !defined SHARED
65 /* Avoid relocation in static PIE since _start is called before it
66 is relocated. */
67 la.pcrel a0, __wrap_main
68#else
69 LA_GOT (a0, main)
70#endif
71
64 REG_L a1, sp, 072 REG_L a1, sp, 0
65 ADDI a2, sp, SZREG73 ADDI a2, sp, SZREG
6674
67 /* Adjust $sp for 16-aligned */75 /* Adjust $sp for 16-bytes aligned */
68 BSTRINS sp, zero, 3, 076 REG_ALIGN_ASM (sp, 4)
6977
70 move a3, zero /* used to be init */78 move a3, zero /* used to be init */
71 move a4, zero /* used to be fini */79 move a4, zero /* used to be fini */
72 or a6, sp, zero /* stack_end */80 or a6, sp, zero /* stack_end */
7381
74 la.pcrel ra, t0, __libc_start_main82 CALL (__libc_start_main)
75 jirl ra, ra, 083 CALL (abort)
7684
77 la.pcrel ra, t0, abort85#if defined PIC && !defined SHARED
78 jirl ra, ra, 086__wrap_main:
87 TAIL (main)
88#endif
79END (ENTRY_POINT)89END (ENTRY_POINT)
lib/libc/glibc/sysdeps/loongarch/sys/asm.h created+104
...@@ -0,0 +1,104 @@
1/* Miscellaneous macros.
2 Copyright (C) 2022-2026 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 _SYS_ASM_H
20#define _SYS_ASM_H
21
22#include <sys/regdef.h>
23#include <sysdeps/generic/sysdep.h>
24
25/* Macros to handle different pointer/register sizes for 32/64-bit code. */
26#if __loongarch_grlen == 64
27#define SZREG 8
28#define REG_L ld.d
29#define REG_S st.d
30#define SRLI srli.d
31#define SLLI slli.d
32#define ADDI addi.d
33#define ADD add.d
34#define SUB sub.d
35#define LI li.d
36#define BSTRINS bstrins.d
37
38#elif __loongarch_grlen == 32
39
40#define SZREG 4
41#define REG_L ld.w
42#define REG_S st.w
43#define SRLI srli.w
44#define SLLI slli.w
45#define ADDI addi.w
46#define ADD add.w
47#define SUB sub.w
48#define LI li.w
49#define BSTRINS bstrins.w
50
51#else
52#error __loongarch_grlen must equal 32 or 64
53#endif
54
55#if __loongarch_frlen == 64
56 #define SZFREG 8
57 #define FREG_L fld.d
58 #define FREG_S fst.d
59#elif __loongarch_frlen == 32
60 #define SZFREG 4
61 #define FREG_L fld.s
62 #define FREG_S fst.s
63#endif
64
65#define SZVREG 16
66#define SZXREG 32
67
68/* Declare leaf routine.
69 The usage of macro LEAF/ENTRY is as follows:
70 1. LEAF(fcn) -- the align value of fcn is .align 3 (default value)
71 2. LEAF(fcn, 6) -- the align value of fcn is .align 6
72*/
73#define LEAF_IMPL(symbol, aln, ...) \
74 .text; \
75 .globl symbol; \
76 .align aln; \
77 .type symbol, @function; \
78symbol: \
79 cfi_startproc;
80
81
82#define LEAF(...) LEAF_IMPL(__VA_ARGS__, 3)
83#define ENTRY(...) LEAF(__VA_ARGS__)
84
85#define LEAF_NO_ALIGN(symbol) \
86 .text; \
87 .globl symbol; \
88 .type symbol, @function; \
89symbol: \
90 cfi_startproc;
91
92#define ENTRY_NO_ALIGN(symbol) LEAF_NO_ALIGN(symbol)
93
94
95/* Mark end of function. */
96#undef END
97#define END(function) \
98 cfi_endproc; \
99 .size function, .- function;
100
101/* Stack alignment. */
102#define ALMASK ~15
103
104#endif /* sys/asm.h */
lib/libc/glibc/sysdeps/loongarch/sysdep.h created+94
...@@ -0,0 +1,94 @@
1/* Macros for LoongArch.
2 Copyright (C) 2026 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 _LOONGARCH_SYSDEP_H
20#define _LOONGARCH_SYSDEP_H
21
22#if __loongarch_grlen == 64
23
24#define PTRLOG 3
25/* Align reg to 2^n. Used in C. */
26#define REG_ALIGN_C(reg, n) \
27 "bstrins.d\t" __STRING(reg) ", $zero, (" __STRING(n) "-1), 0"
28
29#elif __loongarch_grlen == 32
30
31#define PTRLOG 2
32#define REG_ALIGN_C(reg, n) \
33 "srli.w\t" __STRING(reg)", " __STRING(reg)", " __STRING(n) "\n\t" \
34 "slli.w\t" __STRING(reg)", " __STRING(reg)", " __STRING(n)
35
36#else
37#error __loongarch_grlen must equal 32 or 64
38#endif
39
40#ifdef __ASSEMBLER__
41
42/* Stack alignment bytes. */
43#define STACK_ALIGN 16
44
45/* Macros to handle different pointer/register sizes for 32/64-bit code. */
46#if __loongarch_grlen == 64
47#define SRAI srai.d
48
49/* Align reg to 2^n. Used in assembly. */
50#define REG_ALIGN_ASM(reg, n) bstrins.d reg, zero, (n-1), 0
51
52#define LOAD_LOCAL(reg, sym) \
53 pcalau12i reg, %pc_hi20(sym); \
54 ld.d reg, reg, %pc_lo12(sym);
55
56#define LOAD_GLOBAL(reg, sym) \
57 la.got reg, sym; \
58 ld.d reg, reg, 0;
59
60#define LA_GOT(reg, sym) la.got reg, t0, sym
61
62#define CALL(sym) call36 sym
63#define TAIL(sym) tail36 t0, sym
64
65#elif __loongarch_grlen == 32 /* __loongarch_grlen == 64 */
66
67#define SRAI srai.w
68
69/* LA32R not have bstrins.w, use srli.w and slli.w on both LA32S and LA32R. */
70#define REG_ALIGN_ASM(reg, n) \
71 srli.w reg, reg, n; \
72 slli.w reg, reg, n;
73
74#define LOAD_LOCAL(reg, sym) \
75 1: pcaddu12i reg, %pcadd_hi20(sym); \
76 ld.w reg, reg, %pcadd_lo12(1b);
77
78#define LOAD_GLOBAL(reg, sym) \
79 1: pcaddu12i reg, %got_pcadd_hi20(sym); \
80 ld.w reg, reg, %pcadd_lo12(1b); \
81 ld.w reg, reg, 0;
82
83#define LA_GOT(reg, sym) la.got reg, sym
84
85#define CALL(sym) call30 sym
86#define TAIL(sym) tail30 t0, sym
87
88#else /* __loongarch_grlen == 64 */
89#error __loongarch_grlen must equal 32 or 64
90#endif /* __loongarch_grlen == 64 */
91
92#endif /* __ASSEMBLER__ */
93
94#endif /* _LOONGARCH_SYSDEP_H */
lib/libc/glibc/sysdeps/mach/libc-lock.h+10-10
...@@ -145,16 +145,16 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;...@@ -145,16 +145,16 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
145#define __rtld_lock_unlock_recursive(NAME) \145#define __rtld_lock_unlock_recursive(NAME) \
146 __libc_lock_unlock_recursive (NAME)146 __libc_lock_unlock_recursive (NAME)
147147
148/* XXX for now */148/* XXX for now, waiting for a futex-based pthread_rwlock implementation */
149#define __libc_rwlock_define __libc_lock_define149#define __mach_rwlock_define __libc_lock_define
150#define __libc_rwlock_define_initialized __libc_lock_define_initialized150#define __mach_rwlock_define_initialized __libc_lock_define_initialized
151#define __libc_rwlock_init __libc_lock_init151#define __mach_rwlock_init __libc_lock_init
152#define __libc_rwlock_fini __libc_lock_fini152#define __mach_rwlock_fini __libc_lock_fini
153#define __libc_rwlock_rdlock __libc_lock_lock153#define __mach_rwlock_rdlock __libc_lock_lock
154#define __libc_rwlock_wrlock __libc_lock_lock154#define __mach_rwlock_wrlock __libc_lock_lock
155#define __libc_rwlock_tryrdlock __libc_lock_trylock155#define __mach_rwlock_tryrdlock __libc_lock_trylock
156#define __libc_rwlock_trywrlock __libc_lock_trylock156#define __mach_rwlock_trywrlock __libc_lock_trylock
157#define __libc_rwlock_unlock __libc_lock_unlock157#define __mach_rwlock_unlock __libc_lock_unlock
158158
159struct __libc_cleanup_frame159struct __libc_cleanup_frame
160{160{
lib/libc/glibc/sysdeps/s390/s390-64/start-2.33.S deleted-107
...@@ -1,107 +0,0 @@
1/* Startup code compliant to the 64 bit S/390 ELF ABI.
2 Copyright (C) 2001-2020 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
4 This file is part of the GNU C Library.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 In addition to the permissions in the GNU Lesser General Public
12 License, the Free Software Foundation gives you unlimited
13 permission to link the compiled version of this file with other
14 programs, and to distribute those programs without any restriction
15 coming from the use of this file. (The GNU Lesser General Public
16 License restrictions do apply in other respects; for example, they
17 cover modification of the file, and distribution when not linked
18 into another program.)
19
20 Note that people who make modified versions of this file are not
21 obligated to grant this special exception for their modified
22 versions; it is their choice whether to do so. The GNU Lesser
23 General Public License gives permission to release a modified
24 version without this exception; this exception also makes it
25 possible to release a modified version which carries forward this
26 exception.
27
28 The GNU C Library is distributed in the hope that it will be useful,
29 but WITHOUT ANY WARRANTY; without even the implied warranty of
30 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31 Lesser General Public License for more details.
32
33 You should have received a copy of the GNU Lesser General Public
34 License along with the GNU C Library; if not, see
35 <https://www.gnu.org/licenses/>. */
36
37#include <sysdep.h>
38
39/*
40 This is the canonical entry point, usually the first thing in the text
41 segment. Most registers' values are unspecified, except for:
42
43 %r14 Contains a function pointer to be registered with `atexit'.
44 This is how the dynamic linker arranges to have DT_FINI
45 functions called for shared libraries that have been loaded
46 before this code runs.
47
48 %r15 The stack contains the arguments and environment:
49 0(%r15) argc
50 8(%r15) argv[0]
51 ...
52 (8*argc)(%r15) NULL
53 (8*(argc+1))(%r15) envp[0]
54 ...
55 NULL
56*/
57
58 .text
59 .globl _start
60 .type _start,@function
61_start:
62 cfi_startproc
63 /* Mark r14 as undefined in order to stop unwinding here! */
64 cfi_undefined (r14)
65 /* Load argc and argv from stack. */
66 la %r4,8(%r15) # get argv
67 lg %r3,0(%r15) # get argc
68
69 /* Align the stack to a double word boundary. */
70 lghi %r0,-16
71 ngr %r15,%r0
72
73 /* Setup a stack frame and a parameter area. */
74 aghi %r15,-176 # make room on stack
75 xc 0(8,%r15),0(%r15) # clear back-chain
76
77 /* Set up arguments for __libc_start_main:
78 main, argc, argv, envp, _init, _fini, rtld_fini, stack_end
79 Note that envp will be determined later in __libc_start_main.
80 */
81 stmg %r14,%r15,160(%r15) # store rtld_fini/stack_end to parameter area
82 la %r7,160(%r15)
83 larl %r6,__libc_csu_fini # load pointer to __libc_csu_fini
84 larl %r5,__libc_csu_init # load pointer to __libc_csu_init
85
86 /* Ok, now branch to the libc main routine. */
87#ifdef PIC
88 larl %r2,main@GOTENT # load pointer to main
89 lg %r2,0(%r2)
90 brasl %r14,__libc_start_main@plt
91#else
92 larl %r2,main # load pointer to main
93 brasl %r14,__libc_start_main
94#endif
95
96 /* Crash if __libc_start_main returns. */
97 .word 0
98
99 cfi_endproc
100
101 /* Define a symbol for the first piece of initialized data. */
102 .data
103 .globl __data_start
104__data_start:
105 .long 0
106 .weak data_start
107 data_start = __data_start
lib/libc/glibc/sysdeps/s390/s390-64/start.S deleted-134
...@@ -1,134 +0,0 @@
1/* Startup code compliant to the 64 bit S/390 ELF ABI.
2 Copyright (C) 2001-2026 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 In addition to the permissions in the GNU Lesser General Public
11 License, the Free Software Foundation gives you unlimited
12 permission to link the compiled version of this file with other
13 programs, and to distribute those programs without any restriction
14 coming from the use of this file. (The GNU Lesser General Public
15 License restrictions do apply in other respects; for example, they
16 cover modification of the file, and distribution when not linked
17 into another program.)
18
19 Note that people who make modified versions of this file are not
20 obligated to grant this special exception for their modified
21 versions; it is their choice whether to do so. The GNU Lesser
22 General Public License gives permission to release a modified
23 version without this exception; this exception also makes it
24 possible to release a modified version which carries forward this
25 exception.
26
27 The GNU C Library is distributed in the hope that it will be useful,
28 but WITHOUT ANY WARRANTY; without even the implied warranty of
29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30 Lesser General Public License for more details.
31
32 You should have received a copy of the GNU Lesser General Public
33 License along with the GNU C Library; if not, see
34 <https://www.gnu.org/licenses/>. */
35
36#include <sysdep.h>
37
38/*
39 This is the canonical entry point, usually the first thing in the text
40 segment. Most registers' values are unspecified, except for:
41
42 %r14 Contains a function pointer to be registered with `atexit'.
43 This is how the dynamic linker arranges to have DT_FINI
44 functions called for shared libraries that have been loaded
45 before this code runs.
46
47 %r15 The stack contains the arguments and environment:
48 0(%r15) argc
49 8(%r15) argv[0]
50 ...
51 (8*argc)(%r15) NULL
52 (8*(argc+1))(%r15) envp[0]
53 ...
54 NULL
55*/
56
57 .text
58 .globl _start
59 .type _start,@function
60_start:
61 cfi_startproc
62 /* Mark r14 as undefined in order to stop unwinding here! */
63 cfi_undefined (r14)
64 /* Load argc and argv from stack. */
65 la %r4,8(%r15) # get argv
66 lg %r3,0(%r15) # get argc
67
68 /* Align the stack to a double word boundary. */
69 lghi %r0,-16
70 ngr %r15,%r0
71
72 /* Setup a stack frame and a parameter area. */
73 aghi %r15,-176 # make room on stack
74 xc 0(8,%r15),0(%r15) # clear back-chain
75
76 /* Set up arguments for __libc_start_main:
77 main, argc, argv, envp, _init, _fini, rtld_fini, stack_end
78 Note that envp will be determined later in __libc_start_main.
79 */
80 stmg %r14,%r15,160(%r15) # store rtld_fini/stack_end to parameter area
81 la %r7,160(%r15)
82 lghi %r6,0 # Used to be fini.
83 lghi %r5,0 # Used to be init.
84
85 /* Ok, now branch to the libc main routine. */
86#ifdef PIC
87# ifdef SHARED
88 /* Used for dynamic linked position independent executable.
89 => Scrt1.o */
90 larl %r2,main@GOTENT # load pointer to main
91 lg %r2,0(%r2)
92# else
93 /* Used for dynamic linked position dependent executable.
94 => crt1.o (glibc configured without --disable-default-pie:
95 PIC is defined)
96 Or for static linked position independent executable.
97 => rcrt1.o (only available if glibc configured without
98 --disable-default-pie: PIC is defined) */
99 larl %r2,__wrap_main
100# endif
101 brasl %r14,__libc_start_main@plt
102#else
103 /* Used for dynamic/static linked position dependent executable.
104 => crt1.o (glibc configured with --disable-default-pie:
105 PIC and SHARED are not defined) */
106 larl %r2,main # load pointer to main
107 brasl %r14,__libc_start_main
108#endif
109
110 /* Crash if __libc_start_main returns. */
111 .word 0
112
113 cfi_endproc
114
115#if defined PIC && !defined SHARED
116 /* When main is not defined in the executable but in a shared library
117 then a wrapper is needed in crt1.o of the static-pie enabled libc,
118 because crt1.o and rcrt1.o share code and the later must avoid the
119 use of GOT relocations before __libc_start_main is called. */
120__wrap_main:
121 cfi_startproc
122 larl %r1,main@GOTENT # load pointer to main
123 lg %r1,0(%r1)
124 br %r1
125 cfi_endproc
126#endif
127
128 /* Define a symbol for the first piece of initialized data. */
129 .data
130 .globl __data_start
131__data_start:
132 .long 0
133 .weak data_start
134 data_start = __data_start
lib/libc/glibc/sysdeps/s390/s390-64/sysdep.h deleted-93
...@@ -1,93 +0,0 @@
1/* Assembler macros for 64 bit S/390.
2 Copyright (C) 2001-2026 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#include <sysdeps/generic/sysdep.h>
20
21#ifdef __ASSEMBLER__
22
23/* Syntactic details of assembler. */
24
25/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */
26#define ALIGNARG(log2) 1<<log2
27#define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
28
29
30/* Define an entry point visible from C. */
31#define ENTRY(name) \
32 .globl C_SYMBOL_NAME(name); \
33 .type C_SYMBOL_NAME(name),@function; \
34 .align ALIGNARG(4); \
35 C_LABEL(name) \
36 cfi_startproc; \
37 CALL_MCOUNT
38
39#undef END
40#define END(name) \
41 cfi_endproc; \
42 ASM_SIZE_DIRECTIVE(name) \
43
44/* If compiled for profiling, call `mcount' at the start of each function. */
45#ifdef PROF
46#ifdef PIC
47#define CALL_MCOUNT \
48 lgr 0,14 ; larl 1,0f ; brasl 14,_mcount@PLT ; lgr 14,0 ; \
49 .data ; .align 4 ; 0: .long 0 ; .text ;
50#else
51#define CALL_MCOUNT \
52 lgr 0,14 ; larl 1,0f ; brasl 14,_mcount ; lgr 14,0 ; \
53 .data ; .align 4 ; 0: .long 0 ; .text ;
54#endif
55#else
56#define CALL_MCOUNT /* Do nothing. */
57#endif
58
59/* Since C identifiers are not normally prefixed with an underscore
60 on this system, the asm identifier `syscall_error' intrudes on the
61 C name space. Make sure we use an innocuous name. */
62#define syscall_error __syscall_error
63#define mcount _mcount
64
65#undef PSEUDO
66#define PSEUDO(name, syscall_name, args) \
67lose: SYSCALL_PIC_SETUP \
68 jg JUMPTARGET(syscall_error); \
69 .globl syscall_error; \
70 ENTRY (name) \
71 DO_CALL (syscall_name, args); \
72 jm lose
73
74#undef PSEUDO_END
75#define PSEUDO_END(name) \
76 END (name)
77
78#undef JUMPTARGET
79#ifdef SHARED
80#define JUMPTARGET(name) name##@PLT
81#define SYSCALL_PIC_SETUP \
82 larl %r12,_GLOBAL_OFFSET_TABLE_
83#else
84#define JUMPTARGET(name) name
85#define SYSCALL_PIC_SETUP /* Nothing. */
86#endif
87
88/* Local label name for asm code. */
89#ifndef L
90#define L(name) .L##name
91#endif
92
93#endif /* __ASSEMBLER__ */
lib/libc/glibc/sysdeps/s390/start-2.33.S created+107
...@@ -0,0 +1,107 @@
1/* Startup code compliant to the 64 bit S/390 ELF ABI.
2 Copyright (C) 2001-2020 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
4 This file is part of the GNU C Library.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 In addition to the permissions in the GNU Lesser General Public
12 License, the Free Software Foundation gives you unlimited
13 permission to link the compiled version of this file with other
14 programs, and to distribute those programs without any restriction
15 coming from the use of this file. (The GNU Lesser General Public
16 License restrictions do apply in other respects; for example, they
17 cover modification of the file, and distribution when not linked
18 into another program.)
19
20 Note that people who make modified versions of this file are not
21 obligated to grant this special exception for their modified
22 versions; it is their choice whether to do so. The GNU Lesser
23 General Public License gives permission to release a modified
24 version without this exception; this exception also makes it
25 possible to release a modified version which carries forward this
26 exception.
27
28 The GNU C Library is distributed in the hope that it will be useful,
29 but WITHOUT ANY WARRANTY; without even the implied warranty of
30 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31 Lesser General Public License for more details.
32
33 You should have received a copy of the GNU Lesser General Public
34 License along with the GNU C Library; if not, see
35 <https://www.gnu.org/licenses/>. */
36
37#include <sysdep.h>
38
39/*
40 This is the canonical entry point, usually the first thing in the text
41 segment. Most registers' values are unspecified, except for:
42
43 %r14 Contains a function pointer to be registered with `atexit'.
44 This is how the dynamic linker arranges to have DT_FINI
45 functions called for shared libraries that have been loaded
46 before this code runs.
47
48 %r15 The stack contains the arguments and environment:
49 0(%r15) argc
50 8(%r15) argv[0]
51 ...
52 (8*argc)(%r15) NULL
53 (8*(argc+1))(%r15) envp[0]
54 ...
55 NULL
56*/
57
58 .text
59 .globl _start
60 .type _start,@function
61_start:
62 cfi_startproc
63 /* Mark r14 as undefined in order to stop unwinding here! */
64 cfi_undefined (r14)
65 /* Load argc and argv from stack. */
66 la %r4,8(%r15) # get argv
67 lg %r3,0(%r15) # get argc
68
69 /* Align the stack to a double word boundary. */
70 lghi %r0,-16
71 ngr %r15,%r0
72
73 /* Setup a stack frame and a parameter area. */
74 aghi %r15,-176 # make room on stack
75 xc 0(8,%r15),0(%r15) # clear back-chain
76
77 /* Set up arguments for __libc_start_main:
78 main, argc, argv, envp, _init, _fini, rtld_fini, stack_end
79 Note that envp will be determined later in __libc_start_main.
80 */
81 stmg %r14,%r15,160(%r15) # store rtld_fini/stack_end to parameter area
82 la %r7,160(%r15)
83 larl %r6,__libc_csu_fini # load pointer to __libc_csu_fini
84 larl %r5,__libc_csu_init # load pointer to __libc_csu_init
85
86 /* Ok, now branch to the libc main routine. */
87#ifdef PIC
88 larl %r2,main@GOTENT # load pointer to main
89 lg %r2,0(%r2)
90 brasl %r14,__libc_start_main@plt
91#else
92 larl %r2,main # load pointer to main
93 brasl %r14,__libc_start_main
94#endif
95
96 /* Crash if __libc_start_main returns. */
97 .word 0
98
99 cfi_endproc
100
101 /* Define a symbol for the first piece of initialized data. */
102 .data
103 .globl __data_start
104__data_start:
105 .long 0
106 .weak data_start
107 data_start = __data_start
lib/libc/glibc/sysdeps/s390/start.S created+134
...@@ -0,0 +1,134 @@
1/* Startup code compliant to the 64 bit S/390 ELF ABI.
2 Copyright (C) 2001-2026 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 In addition to the permissions in the GNU Lesser General Public
11 License, the Free Software Foundation gives you unlimited
12 permission to link the compiled version of this file with other
13 programs, and to distribute those programs without any restriction
14 coming from the use of this file. (The GNU Lesser General Public
15 License restrictions do apply in other respects; for example, they
16 cover modification of the file, and distribution when not linked
17 into another program.)
18
19 Note that people who make modified versions of this file are not
20 obligated to grant this special exception for their modified
21 versions; it is their choice whether to do so. The GNU Lesser
22 General Public License gives permission to release a modified
23 version without this exception; this exception also makes it
24 possible to release a modified version which carries forward this
25 exception.
26
27 The GNU C Library is distributed in the hope that it will be useful,
28 but WITHOUT ANY WARRANTY; without even the implied warranty of
29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30 Lesser General Public License for more details.
31
32 You should have received a copy of the GNU Lesser General Public
33 License along with the GNU C Library; if not, see
34 <https://www.gnu.org/licenses/>. */
35
36#include <sysdep.h>
37
38/*
39 This is the canonical entry point, usually the first thing in the text
40 segment. Most registers' values are unspecified, except for:
41
42 %r14 Contains a function pointer to be registered with `atexit'.
43 This is how the dynamic linker arranges to have DT_FINI
44 functions called for shared libraries that have been loaded
45 before this code runs.
46
47 %r15 The stack contains the arguments and environment:
48 0(%r15) argc
49 8(%r15) argv[0]
50 ...
51 (8*argc)(%r15) NULL
52 (8*(argc+1))(%r15) envp[0]
53 ...
54 NULL
55*/
56
57 .text
58 .globl _start
59 .type _start,@function
60_start:
61 cfi_startproc
62 /* Mark r14 as undefined in order to stop unwinding here! */
63 cfi_undefined (r14)
64 /* Load argc and argv from stack. */
65 la %r4,8(%r15) # get argv
66 lg %r3,0(%r15) # get argc
67
68 /* Align the stack to a double word boundary. */
69 lghi %r0,-16
70 ngr %r15,%r0
71
72 /* Setup a stack frame and a parameter area. */
73 aghi %r15,-176 # make room on stack
74 xc 0(8,%r15),0(%r15) # clear back-chain
75
76 /* Set up arguments for __libc_start_main:
77 main, argc, argv, envp, _init, _fini, rtld_fini, stack_end
78 Note that envp will be determined later in __libc_start_main.
79 */
80 stmg %r14,%r15,160(%r15) # store rtld_fini/stack_end to parameter area
81 la %r7,160(%r15)
82 lghi %r6,0 # Used to be fini.
83 lghi %r5,0 # Used to be init.
84
85 /* Ok, now branch to the libc main routine. */
86#ifdef PIC
87# ifdef SHARED
88 /* Used for dynamic linked position independent executable.
89 => Scrt1.o */
90 larl %r2,main@GOTENT # load pointer to main
91 lg %r2,0(%r2)
92# else
93 /* Used for dynamic linked position dependent executable.
94 => crt1.o (glibc configured without --disable-default-pie:
95 PIC is defined)
96 Or for static linked position independent executable.
97 => rcrt1.o (only available if glibc configured without
98 --disable-default-pie: PIC is defined) */
99 larl %r2,__wrap_main
100# endif
101 brasl %r14,__libc_start_main@plt
102#else
103 /* Used for dynamic/static linked position dependent executable.
104 => crt1.o (glibc configured with --disable-default-pie:
105 PIC and SHARED are not defined) */
106 larl %r2,main # load pointer to main
107 brasl %r14,__libc_start_main
108#endif
109
110 /* Crash if __libc_start_main returns. */
111 .word 0
112
113 cfi_endproc
114
115#if defined PIC && !defined SHARED
116 /* When main is not defined in the executable but in a shared library
117 then a wrapper is needed in crt1.o of the static-pie enabled libc,
118 because crt1.o and rcrt1.o share code and the later must avoid the
119 use of GOT relocations before __libc_start_main is called. */
120__wrap_main:
121 cfi_startproc
122 larl %r1,main@GOTENT # load pointer to main
123 lg %r1,0(%r1)
124 br %r1
125 cfi_endproc
126#endif
127
128 /* Define a symbol for the first piece of initialized data. */
129 .data
130 .globl __data_start
131__data_start:
132 .long 0
133 .weak data_start
134 data_start = __data_start
lib/libc/glibc/sysdeps/s390/sysdep.h created+93
...@@ -0,0 +1,93 @@
1/* Assembler macros for 64 bit S/390.
2 Copyright (C) 2001-2026 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#include <sysdeps/generic/sysdep.h>
20
21#ifdef __ASSEMBLER__
22
23/* Syntactic details of assembler. */
24
25/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */
26#define ALIGNARG(log2) 1<<log2
27#define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
28
29
30/* Define an entry point visible from C. */
31#define ENTRY(name) \
32 .globl C_SYMBOL_NAME(name); \
33 .type C_SYMBOL_NAME(name),@function; \
34 .align ALIGNARG(4); \
35 C_LABEL(name) \
36 cfi_startproc; \
37 CALL_MCOUNT
38
39#undef END
40#define END(name) \
41 cfi_endproc; \
42 ASM_SIZE_DIRECTIVE(name) \
43
44/* If compiled for profiling, call `mcount' at the start of each function. */
45#ifdef PROF
46#ifdef PIC
47#define CALL_MCOUNT \
48 lgr 0,14 ; larl 1,0f ; brasl 14,_mcount@PLT ; lgr 14,0 ; \
49 .data ; .align 4 ; 0: .long 0 ; .text ;
50#else
51#define CALL_MCOUNT \
52 lgr 0,14 ; larl 1,0f ; brasl 14,_mcount ; lgr 14,0 ; \
53 .data ; .align 4 ; 0: .long 0 ; .text ;
54#endif
55#else
56#define CALL_MCOUNT /* Do nothing. */
57#endif
58
59/* Since C identifiers are not normally prefixed with an underscore
60 on this system, the asm identifier `syscall_error' intrudes on the
61 C name space. Make sure we use an innocuous name. */
62#define syscall_error __syscall_error
63#define mcount _mcount
64
65#undef PSEUDO
66#define PSEUDO(name, syscall_name, args) \
67lose: SYSCALL_PIC_SETUP \
68 jg JUMPTARGET(syscall_error); \
69 .globl syscall_error; \
70 ENTRY (name) \
71 DO_CALL (syscall_name, args); \
72 jm lose
73
74#undef PSEUDO_END
75#define PSEUDO_END(name) \
76 END (name)
77
78#undef JUMPTARGET
79#ifdef SHARED
80#define JUMPTARGET(name) name##@PLT
81#define SYSCALL_PIC_SETUP \
82 larl %r12,_GLOBAL_OFFSET_TABLE_
83#else
84#define JUMPTARGET(name) name
85#define SYSCALL_PIC_SETUP /* Nothing. */
86#endif
87
88/* Local label name for asm code. */
89#ifndef L
90#define L(name) .L##name
91#endif
92
93#endif /* __ASSEMBLER__ */
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h+6-1
...@@ -155,7 +155,7 @@...@@ -155,7 +155,7 @@
155 similar to kernel:155 similar to kernel:
156156
157 - __ASSUME_CLONE_BACKWARDS: for variant 1.157 - __ASSUME_CLONE_BACKWARDS: for variant 1.
158 - __ASSUME_CLONE_BACKWARDS2: for variant 2 (s390).158 - __ASSUME_CLONE_BACKWARDS2: for variant 2 (s390x).
159 - __ASSUME_CLONE_BACKWARDS3: for variant 3 (microblaze).159 - __ASSUME_CLONE_BACKWARDS3: for variant 3 (microblaze).
160 - __ASSUME_CLONE_DEFAULT: for variant 4.160 - __ASSUME_CLONE_DEFAULT: for variant 4.
161 */161 */
...@@ -266,4 +266,9 @@...@@ -266,4 +266,9 @@
266/* zig patch: don't assume kernel version */266/* zig patch: don't assume kernel version */
267#define __ASSUME_MSEAL 0267#define __ASSUME_MSEAL 0
268268
269/* The PIDFD_GET_INFO ioctl was introduced across all architectures in Linux
270 6.13. */
271/* zig patch: don't assume kernel version */
272#define __ASSUME_PIDFD_GET_INFO 0
273
269#endif /* kernel-features.h */274#endif /* kernel-features.h */
lib/libc/glibc/sysdeps/unix/sysv/linux/loongarch/sysdep.h+25-6
...@@ -19,6 +19,7 @@...@@ -19,6 +19,7 @@
19#ifndef _LINUX_LOONGARCH_SYSDEP_H19#ifndef _LINUX_LOONGARCH_SYSDEP_H
20#define _LINUX_LOONGARCH_SYSDEP_H 120#define _LINUX_LOONGARCH_SYSDEP_H 1
2121
22#include <sysdeps/loongarch/sysdep.h>
22#include <sysdeps/unix/sysv/linux/sysdep.h>23#include <sysdeps/unix/sysv/linux/sysdep.h>
23#include <sysdeps/unix/sysdep.h>24#include <sysdeps/unix/sysdep.h>
24#include <tls.h>25#include <tls.h>
...@@ -34,9 +35,9 @@...@@ -34,9 +35,9 @@
34#undef PSEUDO35#undef PSEUDO
35#define PSEUDO(name, syscall_name, args) \36#define PSEUDO(name, syscall_name, args) \
36 ENTRY (name); \37 ENTRY (name); \
37 li.d a7, SYS_ify (syscall_name); \38 LI a7, SYS_ify (syscall_name); \
38 syscall 0; \39 syscall 0; \
39 li.d a7, -4096; \40 LI a7, -4096; \
40 bltu a7, a0, .Lsyscall_error##name;41 bltu a7, a0, .Lsyscall_error##name;
4142
42#undef PSEUDO_END43#undef PSEUDO_END
...@@ -52,16 +53,16 @@...@@ -52,16 +53,16 @@
52 .Lsyscall_error##name : la t0, rtld_errno; \53 .Lsyscall_error##name : la t0, rtld_errno; \
53 sub.w a0, zero, a0; \54 sub.w a0, zero, a0; \
54 st.w a0, t0, 0; \55 st.w a0, t0, 0; \
55 li.d a0, -1;56 LI a0, -1;
5657
57#else58#else
5859
59#define SYSCALL_ERROR_HANDLER(name) \60#define SYSCALL_ERROR_HANDLER(name) \
60 .Lsyscall_error##name : la.tls.ie t0, errno; \61 .Lsyscall_error##name : la.tls.ie t0, errno; \
61 add.d t0, tp, t0; \62 ADD t0, tp, t0; \
62 sub.w a0, zero, a0; \63 sub.w a0, zero, a0; \
63 st.w a0, t0, 0; \64 st.w a0, t0, 0; \
64 li.d a0, -1;65 LI a0, -1;
6566
66#endif67#endif
67#else68#else
...@@ -74,7 +75,7 @@...@@ -74,7 +75,7 @@
74#undef PSEUDO_NEORRNO75#undef PSEUDO_NEORRNO
75#define PSEUDO_NOERRNO(name, syscall_name, args) \76#define PSEUDO_NOERRNO(name, syscall_name, args) \
76 ENTRY (name); \77 ENTRY (name); \
77 li.d a7, SYS_ify (syscall_name); \78 LI a7, SYS_ify (syscall_name); \
78 syscall 0;79 syscall 0;
7980
80#undef PSEUDO_END_NOERRNO81#undef PSEUDO_END_NOERRNO
...@@ -85,11 +86,17 @@...@@ -85,11 +86,17 @@
8586
86/* Performs a system call, returning the error code. */87/* Performs a system call, returning the error code. */
87#undef PSEUDO_ERRVAL88#undef PSEUDO_ERRVAL
89#if __loongarch_grlen == 64
88#define PSEUDO_ERRVAL(name, syscall_name, args) \90#define PSEUDO_ERRVAL(name, syscall_name, args) \
89 PSEUDO_NOERRNO (name, syscall_name, args); \91 PSEUDO_NOERRNO (name, syscall_name, args); \
90 slli.d a0, a0, 32; \92 slli.d a0, a0, 32; \
91 srai.d a0, a0, 32; /* sign_ext */ \93 srai.d a0, a0, 32; /* sign_ext */ \
92 sub.d a0, zero, a0;94 sub.d a0, zero, a0;
95#else
96#define PSEUDO_ERRVAL(name, syscall_name, args) \
97 PSEUDO_NOERRNO (name, syscall_name, args); \
98 sub.w a0, zero, a0;
99#endif
93100
94#undef PSEUDO_END_ERRVAL101#undef PSEUDO_END_ERRVAL
95#define PSEUDO_END_ERRVAL(name) END (name);102#define PSEUDO_END_ERRVAL(name) END (name);
...@@ -109,6 +116,18 @@...@@ -109,6 +116,18 @@
109#undef SYS_ify116#undef SYS_ify
110#define SYS_ify(syscall_name) __NR_##syscall_name117#define SYS_ify(syscall_name) __NR_##syscall_name
111118
119#if __WORDSIZE == 32
120/* Workarounds for generic code needing to handle 64-bit time_t. */
121#define __NR_clock_getres __NR_clock_getres_time64
122#define __NR_futex __NR_futex_time64
123#define __NR_ppoll __NR_ppoll_time64
124#define __NR_pselect6 __NR_pselect6_time64
125#define __NR_recvmmsg __NR_recvmmsg_time64
126#define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64
127#define __NR_semtimedop __NR_semtimedop_time64
128#define __NR_utimensat __NR_utimensat_time64
129#endif /* __WORDSIZE == 32 */
130
112#ifndef __ASSEMBLER__131#ifndef __ASSEMBLER__
113132
114#define VDSO_NAME "LINUX_5.10"133#define VDSO_NAME "LINUX_5.10"
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/bits/typesizes.h+14-22
...@@ -57,42 +57,34 @@...@@ -57,42 +57,34 @@
57#define __TIMER_T_TYPE void *57#define __TIMER_T_TYPE void *
58#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE58#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
59#define __FSID_T_TYPE struct { int __val[2]; }59#define __FSID_T_TYPE struct { int __val[2]; }
60#if defined __GNUC__ && __GNUC__ <= 260
61/* Compatibility with g++ 2.95.x. */61/* With s390-32, __SSIZE_T_TYPE was __SWORD_TYPE for compatibility with
62#define __SSIZE_T_TYPE __SWORD_TYPE62 g++ 2.95.x. Afterwards __SLONGWORD_TYPE was needed as size_t was
63#else63 unsigned long int on s390-32.
64/* size_t is unsigned long int on s390 -m31. */64 Now as only s390-64 exists, __SWORD_TYPE can be used as also used in the
65#define __SSIZE_T_TYPE __SLONGWORD_TYPE65 generic version as both types result in long int. */
66#endif66#define __SSIZE_T_TYPE __SWORD_TYPE
67
67#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE68#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
68#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE69#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
69#define __CPU_MASK_TYPE __ULONGWORD_TYPE70#define __CPU_MASK_TYPE __ULONGWORD_TYPE
7071
71#ifdef __s390x__
72/* Tell the libc code that off_t and off64_t are actually the same type72/* Tell the libc code that off_t and off64_t are actually the same type
73 for all ABI purposes, even if possibly expressed as different base types73 for all ABI purposes, even if possibly expressed as different base types
74 for C type-checking purposes. */74 for C type-checking purposes. */
75# define __OFF_T_MATCHES_OFF64_T 175#define __OFF_T_MATCHES_OFF64_T 1
7676
77/* Same for ino_t and ino64_t. */77/* Same for ino_t and ino64_t. */
78# define __INO_T_MATCHES_INO64_T 178#define __INO_T_MATCHES_INO64_T 1
7979
80/* And for __rlim_t and __rlim64_t. */80/* And for __rlim_t and __rlim64_t. */
81# define __RLIM_T_MATCHES_RLIM64_T 181#define __RLIM_T_MATCHES_RLIM64_T 1
8282
83/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */83/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
84# define __STATFS_MATCHES_STATFS64 184#define __STATFS_MATCHES_STATFS64 1
8585
86/* And for getitimer, setitimer and rusage */86/* And for getitimer, setitimer and rusage */
87# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 187#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
88#else
89# define __RLIM_T_MATCHES_RLIM64_T 0
90
91# define __STATFS_MATCHES_STATFS64 0
92
93/* And for getitimer, setitimer and rusage */
94# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
95#endif
9688
97/* Number of descriptors that can fit in an `fd_set'. */89/* Number of descriptors that can fit in an `fd_set'. */
98#define __FD_SETSIZE 102490#define __FD_SETSIZE 1024
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/kernel-features.h-3
...@@ -47,9 +47,6 @@...@@ -47,9 +47,6 @@
47# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS47# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
48# undef __ASSUME_SYSVIPC_DEFAULT_IPC_6448# undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
49#endif49#endif
50#ifndef __s390x__
51# define __ASSUME_SYSVIPC_BROKEN_MODE_T
52#endif
5350
54#undef __ASSUME_CLONE_DEFAULT51#undef __ASSUME_CLONE_DEFAULT
55#define __ASSUME_CLONE_BACKWARDS252#define __ASSUME_CLONE_BACKWARDS2
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h deleted-178
...@@ -1,178 +0,0 @@
1/* Assembler macros for 64 bit S/390.
2 Copyright (C) 2001-2026 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 _LINUX_S390_SYSDEP_H
20#define _LINUX_S390_SYSDEP_H
21
22#include <sysdeps/s390/s390-64/sysdep.h>
23#include <sysdeps/unix/sysdep.h>
24#include <sysdeps/unix/sysv/linux/s390/sysdep.h>
25#include <sysdeps/unix/sysv/linux/sysdep.h>
26#include <dl-sysdep.h> /* For RTLD_PRIVATE_ERRNO. */
27#include <tls.h>
28
29/* For Linux we can use the system call table in the header file
30 /usr/include/asm/unistd.h
31 of the kernel. But these symbols do not follow the SYS_* syntax
32 so we have to redefine the `SYS_ify' macro here. */
33/* In newer 2.1 kernels __NR_syscall is missing so we define it here. */
34#define __NR_syscall 0
35
36#undef SYS_ify
37#define SYS_ify(syscall_name) __NR_##syscall_name
38
39#ifdef __ASSEMBLER__
40
41/* Linux uses a negative return value to indicate syscall errors, unlike
42 most Unices, which use the condition codes' carry flag.
43
44 Since version 2.1 the return value of a system call might be negative
45 even if the call succeeded. E.g., the `lseek' system call might return
46 a large offset. Therefore we must not anymore test for < 0, but test
47 for a real error by making sure the value in gpr2 is a real error
48 number. Linus said he will make sure that no syscall returns a value
49 in -1 .. -4095 as a valid result so we can safely test with -4095. */
50
51#undef PSEUDO
52#define PSEUDO(name, syscall_name, args) \
53 .text; \
54 ENTRY (name) \
55 DO_CALL (syscall_name, args); \
56 lghi %r4,-4095 ; \
57 clgr %r2,%r4 ; \
58 jgnl SYSCALL_ERROR_LABEL
59
60#undef PSEUDO_END
61#define PSEUDO_END(name) \
62 SYSCALL_ERROR_HANDLER; \
63 END (name)
64
65#undef PSEUDO_NOERRNO
66#define PSEUDO_NOERRNO(name, syscall_name, args) \
67 .text; \
68 ENTRY (name) \
69 DO_CALL (syscall_name, args)
70
71#undef PSEUDO_END_NOERRNO
72#define PSEUDO_END_NOERRNO(name) \
73 SYSCALL_ERROR_HANDLER; \
74 END (name)
75
76#undef PSEUDO_ERRVAL
77#define PSEUDO_ERRVAL(name, syscall_name, args) \
78 .text; \
79 ENTRY (name) \
80 DO_CALL (syscall_name, args); \
81 lcgr %r2,%r2
82
83#undef PSEUDO_END_ERRVAL
84#define PSEUDO_END_ERRVAL(name) \
85 SYSCALL_ERROR_HANDLER; \
86 END (name)
87
88#undef SYSCALL_ERROR_LABEL
89#ifndef PIC
90# undef SYSCALL_ERROR_LABEL
91# define SYSCALL_ERROR_LABEL syscall_error
92# define SYSCALL_ERROR_HANDLER
93#else
94# if RTLD_PRIVATE_ERRNO
95# undef SYSCALL_ERROR_LABEL
96# define SYSCALL_ERROR_LABEL 0f
97# define SYSCALL_ERROR_HANDLER \
980: larl %r1,rtld_errno; \
99 lcr %r2,%r2; \
100 st %r2,0(%r1); \
101 lghi %r2,-1; \
102 br %r14
103# elif defined _LIBC_REENTRANT
104# if IS_IN (libc)
105# define SYSCALL_ERROR_ERRNO __libc_errno
106# else
107# define SYSCALL_ERROR_ERRNO errno
108# endif
109# undef SYSCALL_ERROR_LABEL
110# define SYSCALL_ERROR_LABEL 0f
111# define SYSCALL_ERROR_HANDLER \
1120: lcr %r0,%r2; \
113 larl %r1,SYSCALL_ERROR_ERRNO@indntpoff; \
114 lg %r1,0(%r1); \
115 ear %r2,%a0; \
116 sllg %r2,%r2,32; \
117 ear %r2,%a1; \
118 st %r0,0(%r1,%r2); \
119 lghi %r2,-1; \
120 br %r14
121# else
122# undef SYSCALL_ERROR_LABEL
123# define SYSCALL_ERROR_LABEL 0f
124# define SYSCALL_ERROR_HANDLER \
1250: larl %r1,_GLOBAL_OFFSET_TABLE_; \
126 lg %r1,errno@GOT(%r1); \
127 lcr %r2,%r2; \
128 st %r2,0(%r1); \
129 lghi %r2,-1; \
130 br %r14
131# endif /* _LIBC_REENTRANT */
132#endif /* PIC */
133
134/* Linux takes system call arguments in registers:
135
136 syscall number 1 call-clobbered
137 arg 1 2 call-clobbered
138 arg 2 3 call-clobbered
139 arg 3 4 call-clobbered
140 arg 4 5 call-clobbered
141 arg 5 6 call-saved
142 arg 6 7 call-saved
143
144 (Of course a function with say 3 arguments does not have entries for
145 arguments 4 and 5.)
146 For system calls with 6 parameters a stack operation is required
147 to load the 6th parameter to register 7. Call saved register 7 is
148 moved to register 0 and back to avoid an additional stack frame.
149 */
150
151#define DO_CALL(syscall, args) \
152 .if args > 5; \
153 lgr %r0,%r7; \
154 lg %r7,160(%r15); \
155 .endif; \
156 lghi %r1,SYS_ify (syscall); \
157 svc 0; \
158 .if args > 5; \
159 lgr %r7,%r0; \
160 .endif
161
162#define ret \
163 br 14
164
165#define ret_NOERRNO \
166 br 14
167
168#define ret_ERRVAL \
169 br 14
170
171#else
172
173# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
174# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
175
176#endif /* __ASSEMBLER__ */
177
178#endif /* _LINUX_S390_SYSDEP_H */
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/sysdep.h+186-37
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Syscall definitions, Linux s390 version.1/* Assembler macros for 64 bit S/390.
2 Copyright (C) 2019-2026 Free Software Foundation, Inc.2 Copyright (C) 2001-2026 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
...@@ -14,15 +14,163 @@...@@ -14,15 +14,163 @@
1414
15 You should have received a copy of the GNU Lesser General Public15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */17 <https://www.gnu.org/licenses/>. */
1818
19#ifndef __ASSEMBLY__19#ifndef _LINUX_S390_SYSDEP_H
20#define _LINUX_S390_SYSDEP_H
21
22#include <sysdeps/s390/sysdep.h>
23#include <sysdeps/unix/sysdep.h>
24#include <sysdeps/unix/sysv/linux/sysdep.h>
25#include <dl-sysdep.h> /* For RTLD_PRIVATE_ERRNO. */
26#include <tls.h>
27
28/* For Linux we can use the system call table in the header file
29 /usr/include/asm/unistd.h
30 of the kernel. But these symbols do not follow the SYS_* syntax
31 so we have to redefine the `SYS_ify' macro here. */
32/* In newer 2.1 kernels __NR_syscall is missing so we define it here. */
33#define __NR_syscall 0
2034
21#undef SYS_ify35#undef SYS_ify
22#define SYS_ify(syscall_name) __NR_##syscall_name36#define SYS_ify(syscall_name) __NR_##syscall_name
2337
24#undef INTERNAL_SYSCALL_NCS38#ifdef __ASSEMBLER__
25#define INTERNAL_SYSCALL_NCS(no, nr, args...) \39
40/* Linux uses a negative return value to indicate syscall errors, unlike
41 most Unices, which use the condition codes' carry flag.
42
43 Since version 2.1 the return value of a system call might be negative
44 even if the call succeeded. E.g., the `lseek' system call might return
45 a large offset. Therefore we must not anymore test for < 0, but test
46 for a real error by making sure the value in gpr2 is a real error
47 number. Linus said he will make sure that no syscall returns a value
48 in -1 .. -4095 as a valid result so we can safely test with -4095. */
49
50# undef PSEUDO
51# define PSEUDO(name, syscall_name, args) \
52 .text; \
53 ENTRY (name) \
54 DO_CALL (syscall_name, args); \
55 lghi %r4,-4095 ; \
56 clgr %r2,%r4 ; \
57 jgnl SYSCALL_ERROR_LABEL
58
59# undef PSEUDO_END
60# define PSEUDO_END(name) \
61 SYSCALL_ERROR_HANDLER; \
62 END (name)
63
64# undef PSEUDO_NOERRNO
65# define PSEUDO_NOERRNO(name, syscall_name, args) \
66 .text; \
67 ENTRY (name) \
68 DO_CALL (syscall_name, args)
69
70# undef PSEUDO_END_NOERRNO
71# define PSEUDO_END_NOERRNO(name) \
72 SYSCALL_ERROR_HANDLER; \
73 END (name)
74
75# undef PSEUDO_ERRVAL
76# define PSEUDO_ERRVAL(name, syscall_name, args) \
77 .text; \
78 ENTRY (name) \
79 DO_CALL (syscall_name, args); \
80 lcgr %r2,%r2
81
82# undef PSEUDO_END_ERRVAL
83# define PSEUDO_END_ERRVAL(name) \
84 SYSCALL_ERROR_HANDLER; \
85 END (name)
86
87# undef SYSCALL_ERROR_LABEL
88# ifndef PIC
89# undef SYSCALL_ERROR_LABEL
90# define SYSCALL_ERROR_LABEL syscall_error
91# define SYSCALL_ERROR_HANDLER
92# else
93# if RTLD_PRIVATE_ERRNO
94# undef SYSCALL_ERROR_LABEL
95# define SYSCALL_ERROR_LABEL 0f
96# define SYSCALL_ERROR_HANDLER \
970: larl %r1,rtld_errno; \
98 lcr %r2,%r2; \
99 st %r2,0(%r1); \
100 lghi %r2,-1; \
101 br %r14
102# elif defined _LIBC_REENTRANT
103# if IS_IN (libc)
104# define SYSCALL_ERROR_ERRNO __libc_errno
105# else
106# define SYSCALL_ERROR_ERRNO errno
107# endif
108# undef SYSCALL_ERROR_LABEL
109# define SYSCALL_ERROR_LABEL 0f
110# define SYSCALL_ERROR_HANDLER \
1110: lcr %r0,%r2; \
112 larl %r1,SYSCALL_ERROR_ERRNO@indntpoff; \
113 lg %r1,0(%r1); \
114 ear %r2,%a0; \
115 sllg %r2,%r2,32; \
116 ear %r2,%a1; \
117 st %r0,0(%r1,%r2); \
118 lghi %r2,-1; \
119 br %r14
120# else
121# undef SYSCALL_ERROR_LABEL
122# define SYSCALL_ERROR_LABEL 0f
123# define SYSCALL_ERROR_HANDLER \
1240: larl %r1,_GLOBAL_OFFSET_TABLE_; \
125 lg %r1,errno@GOT(%r1); \
126 lcr %r2,%r2; \
127 st %r2,0(%r1); \
128 lghi %r2,-1; \
129 br %r14
130# endif /* _LIBC_REENTRANT */
131# endif /* PIC */
132
133/* Linux takes system call arguments in registers:
134
135 syscall number 1 call-clobbered
136 arg 1 2 call-clobbered
137 arg 2 3 call-clobbered
138 arg 3 4 call-clobbered
139 arg 4 5 call-clobbered
140 arg 5 6 call-saved
141 arg 6 7 call-saved
142
143 (Of course a function with say 3 arguments does not have entries for
144 arguments 4 and 5.)
145 For system calls with 6 parameters a stack operation is required
146 to load the 6th parameter to register 7. Call saved register 7 is
147 moved to register 0 and back to avoid an additional stack frame.
148 */
149
150# define DO_CALL(syscall, args) \
151 .if args > 5; \
152 lgr %r0,%r7; \
153 lg %r7,160(%r15); \
154 .endif; \
155 lghi %r1,SYS_ify (syscall); \
156 svc 0; \
157 .if args > 5; \
158 lgr %r7,%r0; \
159 .endif
160
161# define ret \
162 br 14
163
164# define ret_NOERRNO \
165 br 14
166
167# define ret_ERRVAL \
168 br 14
169
170#else /* not __ASSEMBLER__ */
171
172# undef INTERNAL_SYSCALL_NCS
173# define INTERNAL_SYSCALL_NCS(no, nr, args...) \
26 ({ \174 ({ \
27 DECLARGS_##nr(args) \175 DECLARGS_##nr(args) \
28 register unsigned long int _nr __asm__("1") = (unsigned long int)(no); \176 register unsigned long int _nr __asm__("1") = (unsigned long int)(no); \
...@@ -34,51 +182,52 @@...@@ -34,51 +182,52 @@
34 : "memory" ); \182 : "memory" ); \
35 _ret; })183 _ret; })
36184
37#undef INTERNAL_SYSCALL185# undef INTERNAL_SYSCALL
38#define INTERNAL_SYSCALL(name, nr, args...) \186# define INTERNAL_SYSCALL(name, nr, args...) \
39 INTERNAL_SYSCALL_NCS(__NR_##name, nr, args)187 INTERNAL_SYSCALL_NCS(__NR_##name, nr, args)
40188
41#define DECLARGS_0()189# define DECLARGS_0()
42#define DECLARGS_1(arg1) \190# define DECLARGS_1(arg1) \
43 register unsigned long int gpr2 __asm__ ("2") = (unsigned long int)(arg1);191 register unsigned long int gpr2 __asm__ ("2") = (unsigned long int)(arg1);
44#define DECLARGS_2(arg1, arg2) \192# define DECLARGS_2(arg1, arg2) \
45 DECLARGS_1(arg1) \193 DECLARGS_1(arg1) \
46 register unsigned long int gpr3 __asm__ ("3") = (unsigned long int)(arg2);194 register unsigned long int gpr3 __asm__ ("3") = (unsigned long int)(arg2);
47#define DECLARGS_3(arg1, arg2, arg3) \195# define DECLARGS_3(arg1, arg2, arg3) \
48 DECLARGS_2(arg1, arg2) \196 DECLARGS_2(arg1, arg2) \
49 register unsigned long int gpr4 __asm__ ("4") = (unsigned long int)(arg3);197 register unsigned long int gpr4 __asm__ ("4") = (unsigned long int)(arg3);
50#define DECLARGS_4(arg1, arg2, arg3, arg4) \198# define DECLARGS_4(arg1, arg2, arg3, arg4) \
51 DECLARGS_3(arg1, arg2, arg3) \199 DECLARGS_3(arg1, arg2, arg3) \
52 register unsigned long int gpr5 __asm__ ("5") = (unsigned long int)(arg4);200 register unsigned long int gpr5 __asm__ ("5") = (unsigned long int)(arg4);
53#define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \201# define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
54 DECLARGS_4(arg1, arg2, arg3, arg4) \202 DECLARGS_4(arg1, arg2, arg3, arg4) \
55 register unsigned long int gpr6 __asm__ ("6") = (unsigned long int)(arg5);203 register unsigned long int gpr6 __asm__ ("6") = (unsigned long int)(arg5);
56#define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \204# define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
57 DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \205 DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
58 register unsigned long int gpr7 __asm__ ("7") = (unsigned long int)(arg6);206 register unsigned long int gpr7 __asm__ ("7") = (unsigned long int)(arg6);
59207
60#define ASMFMT_0208# define ASMFMT_0
61#define ASMFMT_1 , "0" (gpr2)209# define ASMFMT_1 , "0" (gpr2)
62#define ASMFMT_2 , "0" (gpr2), "d" (gpr3)210# define ASMFMT_2 , "0" (gpr2), "d" (gpr3)
63#define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4)211# define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4)
64#define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5)212# define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5)
65#define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)213# define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
66#define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)214# define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)
67215
68#define VDSO_NAME "LINUX_2.6.29"216# define VDSO_NAME "LINUX_2.6.29"
69#define VDSO_HASH 123718585217# define VDSO_HASH 123718585
70218
71/* List of system calls which are supported as vsyscalls. */219/* List of system calls which are supported as vsyscalls. */
72#ifdef __s390x__220# define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"
73#define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"221# define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"
74#define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"222# define HAVE_GETRANDOM_VSYSCALL "__kernel_getrandom"
75#define HAVE_GETRANDOM_VSYSCALL "__kernel_getrandom"223# define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"
76#else224# define HAVE_GETCPU_VSYSCALL "__kernel_getcpu"
77#define HAVE_CLOCK_GETRES_VSYSCALL "__kernel_clock_getres"225
78#define HAVE_CLOCK_GETTIME_VSYSCALL "__kernel_clock_gettime"226# define HAVE_CLONE3_WRAPPER 1
79#endif227
80#define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"228# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
81#define HAVE_GETCPU_VSYSCALL "__kernel_getcpu"229# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
82230
83#define HAVE_CLONE3_WRAPPER 1231#endif /* __ASSEMBLER__ */
84#endif232
233#endif /* _LINUX_S390_SYSDEP_H */
lib/libc/glibc/sysdeps/unix/sysv/linux/s390/xstatver.h+6-15
...@@ -1,19 +1,10 @@...@@ -1,19 +1,10 @@
1/* Versions of the 'struct stat' data structure used in compatibility xstat1/* Versions of the 'struct stat' data structure used in compatibility xstat
2 functions. */2 functions. */
33#define _STAT_VER_KERNEL 0
4#include <bits/wordsize.h>4#define _STAT_VER_LINUX 1
5
6#if __WORDSIZE == 64
7# define _STAT_VER_KERNEL 0
8# define _STAT_VER_LINUX 1
9# define _MKNOD_VER_LINUX 0
10#else
11# define _STAT_VER_LINUX_OLD 1
12# define _STAT_VER_KERNEL 1
13# define _STAT_VER_SVR4 2
14# define _STAT_VER_LINUX 3
15# define _MKNOD_VER_LINUX 1
16# define _MKNOD_VER_SVR4 2
17#endif
18#define _STAT_VER _STAT_VER_LINUX5#define _STAT_VER _STAT_VER_LINUX
6
7/* Versions of the 'xmknod' interface used in compatibility xmknod
8 functions. */
9#define _MKNOD_VER_LINUX 0
19#define _MKNOD_VER _MKNOD_VER_LINUX10#define _MKNOD_VER _MKNOD_VER_LINUX
lib/libc/include/aarch64-linux-gnu/bits/hwcap.h+18-1
...@@ -55,6 +55,21 @@...@@ -55,6 +55,21 @@
55#define HWCAP_PACA (1 << 30)55#define HWCAP_PACA (1 << 30)
56#define HWCAP_PACG (1UL << 31)56#define HWCAP_PACG (1UL << 31)
57#define HWCAP_GCS (1UL << 32)57#define HWCAP_GCS (1UL << 32)
58#define HWCAP_CMPBR (1UL << 33)
59#define HWCAP_FPRCVT (1UL << 34)
60#define HWCAP_F8MM8 (1UL << 35)
61#define HWCAP_F8MM4 (1UL << 36)
62#define HWCAP_SVE_F16MM (1UL << 37)
63#define HWCAP_SVE_ELTPERM (1UL << 38)
64#define HWCAP_SVE_AES2 (1UL << 39)
65#define HWCAP_SVE_BFSCALE (1UL << 40)
66#define HWCAP_SVE2P2 (1UL << 41)
67#define HWCAP_SME2P2 (1UL << 42)
68#define HWCAP_SME_SBITPERM (1UL << 43)
69#define HWCAP_SME_AES (1UL << 44)
70#define HWCAP_SME_SFEXPA (1UL << 45)
71#define HWCAP_SME_STMOP (1UL << 46)
72#define HWCAP_SME_SMOP4 (1UL << 47)
5873
59#define HWCAP2_DCPODP (1 << 0)74#define HWCAP2_DCPODP (1 << 0)
60#define HWCAP2_SVE2 (1 << 1)75#define HWCAP2_SVE2 (1 << 1)
...@@ -122,4 +137,6 @@...@@ -122,4 +137,6 @@
122#define HWCAP2_POE (1UL << 63)137#define HWCAP2_POE (1UL << 63)
123138
124#define HWCAP3_MTE_FAR (1UL << 0)139#define HWCAP3_MTE_FAR (1UL << 0)
125#define HWCAP3_MTE_STORE_ONLY (1UL << 1)
\ No newline at end of file
140#define HWCAP3_MTE_STORE_ONLY (1UL << 1)
141#define HWCAP3_LSFE (1UL << 2)
142#define HWCAP3_LS64 (1UL << 3)
\ No newline at end of file
lib/libc/include/aarch64-linux-gnu/bits/long-double.h deleted-21
...@@ -1,21 +0,0 @@
1/* Properties of long double type. ldbl-128 version.
2 Copyright (C) 2016-2026 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 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/* long double is distinct from double, so there is nothing to
20 define here. */
21#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0
\ No newline at end of file
lib/libc/include/aarch64-linux-gnu/bits/math-vector.h+8
...@@ -157,6 +157,10 @@...@@ -157,6 +157,10 @@
157# define __DECL_SIMD_pow __DECL_SIMD_aarch64157# define __DECL_SIMD_pow __DECL_SIMD_aarch64
158# undef __DECL_SIMD_powf158# undef __DECL_SIMD_powf
159# define __DECL_SIMD_powf __DECL_SIMD_aarch64159# define __DECL_SIMD_powf __DECL_SIMD_aarch64
160# undef __DECL_SIMD_powr
161# define __DECL_SIMD_powr __DECL_SIMD_aarch64
162# undef __DECL_SIMD_powrf
163# define __DECL_SIMD_powrf __DECL_SIMD_aarch64
160# undef __DECL_SIMD_rsqrt164# undef __DECL_SIMD_rsqrt
161# define __DECL_SIMD_rsqrt __DECL_SIMD_aarch64165# define __DECL_SIMD_rsqrt __DECL_SIMD_aarch64
162# undef __DECL_SIMD_rsqrtf166# undef __DECL_SIMD_rsqrtf
...@@ -243,6 +247,7 @@ __vpcs __f32x4_t _ZGVnN4v_log2f (__f32x4_t);...@@ -243,6 +247,7 @@ __vpcs __f32x4_t _ZGVnN4v_log2f (__f32x4_t);
243__vpcs __f32x4_t _ZGVnN4v_log2p1f (__f32x4_t);247__vpcs __f32x4_t _ZGVnN4v_log2p1f (__f32x4_t);
244__vpcs __f32x4_t _ZGVnN4v_logp1f (__f32x4_t);248__vpcs __f32x4_t _ZGVnN4v_logp1f (__f32x4_t);
245__vpcs __f32x4_t _ZGVnN4vv_powf (__f32x4_t, __f32x4_t);249__vpcs __f32x4_t _ZGVnN4vv_powf (__f32x4_t, __f32x4_t);
250__vpcs __f32x4_t _ZGVnN4vv_powrf (__f32x4_t, __f32x4_t);
246__vpcs __f32x4_t _ZGVnN4v_rsqrtf (__f32x4_t);251__vpcs __f32x4_t _ZGVnN4v_rsqrtf (__f32x4_t);
247__vpcs __f32x4_t _ZGVnN4v_sinf (__f32x4_t);252__vpcs __f32x4_t _ZGVnN4v_sinf (__f32x4_t);
248__vpcs __f32x4_t _ZGVnN4v_sinhf (__f32x4_t);253__vpcs __f32x4_t _ZGVnN4v_sinhf (__f32x4_t);
...@@ -283,6 +288,7 @@ __vpcs __f64x2_t _ZGVnN2v_log2 (__f64x2_t);...@@ -283,6 +288,7 @@ __vpcs __f64x2_t _ZGVnN2v_log2 (__f64x2_t);
283__vpcs __f64x2_t _ZGVnN2v_log2p1 (__f64x2_t);288__vpcs __f64x2_t _ZGVnN2v_log2p1 (__f64x2_t);
284__vpcs __f64x2_t _ZGVnN2v_logp1 (__f64x2_t);289__vpcs __f64x2_t _ZGVnN2v_logp1 (__f64x2_t);
285__vpcs __f64x2_t _ZGVnN2vv_pow (__f64x2_t, __f64x2_t);290__vpcs __f64x2_t _ZGVnN2vv_pow (__f64x2_t, __f64x2_t);
291__vpcs __f64x2_t _ZGVnN2vv_powr (__f64x2_t, __f64x2_t);
286__vpcs __f64x2_t _ZGVnN2v_rsqrt (__f64x2_t);292__vpcs __f64x2_t _ZGVnN2v_rsqrt (__f64x2_t);
287__vpcs __f64x2_t _ZGVnN2v_sin (__f64x2_t);293__vpcs __f64x2_t _ZGVnN2v_sin (__f64x2_t);
288__vpcs __f64x2_t _ZGVnN2v_sinh (__f64x2_t);294__vpcs __f64x2_t _ZGVnN2v_sinh (__f64x2_t);
...@@ -328,6 +334,7 @@ __sv_f32_t _ZGVsMxv_log2f (__sv_f32_t, __sv_bool_t);...@@ -328,6 +334,7 @@ __sv_f32_t _ZGVsMxv_log2f (__sv_f32_t, __sv_bool_t);
328__sv_f32_t _ZGVsMxv_log2p1f (__sv_f32_t, __sv_bool_t);334__sv_f32_t _ZGVsMxv_log2p1f (__sv_f32_t, __sv_bool_t);
329__sv_f32_t _ZGVsMxv_logp1f (__sv_f32_t, __sv_bool_t);335__sv_f32_t _ZGVsMxv_logp1f (__sv_f32_t, __sv_bool_t);
330__sv_f32_t _ZGVsMxvv_powf (__sv_f32_t, __sv_f32_t, __sv_bool_t);336__sv_f32_t _ZGVsMxvv_powf (__sv_f32_t, __sv_f32_t, __sv_bool_t);
337__sv_f32_t _ZGVsMxvv_powrf (__sv_f32_t, __sv_f32_t, __sv_bool_t);
331__sv_f32_t _ZGVsMxv_rsqrtf (__sv_f32_t, __sv_bool_t);338__sv_f32_t _ZGVsMxv_rsqrtf (__sv_f32_t, __sv_bool_t);
332__sv_f32_t _ZGVsMxv_sinf (__sv_f32_t, __sv_bool_t);339__sv_f32_t _ZGVsMxv_sinf (__sv_f32_t, __sv_bool_t);
333__sv_f32_t _ZGVsMxv_sinhf (__sv_f32_t, __sv_bool_t);340__sv_f32_t _ZGVsMxv_sinhf (__sv_f32_t, __sv_bool_t);
...@@ -368,6 +375,7 @@ __sv_f64_t _ZGVsMxv_log2 (__sv_f64_t, __sv_bool_t);...@@ -368,6 +375,7 @@ __sv_f64_t _ZGVsMxv_log2 (__sv_f64_t, __sv_bool_t);
368__sv_f64_t _ZGVsMxv_log2p1 (__sv_f64_t, __sv_bool_t);375__sv_f64_t _ZGVsMxv_log2p1 (__sv_f64_t, __sv_bool_t);
369__sv_f64_t _ZGVsMxv_logp1 (__sv_f64_t, __sv_bool_t);376__sv_f64_t _ZGVsMxv_logp1 (__sv_f64_t, __sv_bool_t);
370__sv_f64_t _ZGVsMxvv_pow (__sv_f64_t, __sv_f64_t, __sv_bool_t);377__sv_f64_t _ZGVsMxvv_pow (__sv_f64_t, __sv_f64_t, __sv_bool_t);
378__sv_f64_t _ZGVsMxvv_powr (__sv_f64_t, __sv_f64_t, __sv_bool_t);
371__sv_f64_t _ZGVsMxv_rsqrt (__sv_f64_t, __sv_bool_t);379__sv_f64_t _ZGVsMxv_rsqrt (__sv_f64_t, __sv_bool_t);
372__sv_f64_t _ZGVsMxv_sin (__sv_f64_t, __sv_bool_t);380__sv_f64_t _ZGVsMxv_sin (__sv_f64_t, __sv_bool_t);
373__sv_f64_t _ZGVsMxv_sinh (__sv_f64_t, __sv_bool_t);381__sv_f64_t _ZGVsMxv_sinh (__sv_f64_t, __sv_bool_t);
lib/libc/include/aarch64-linux-gnu/bits/struct_stat.h deleted-127
...@@ -1,127 +0,0 @@
1/* Definition for struct stat.
2 Copyright (C) 2020-2026 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#if !defined _SYS_STAT_H && !defined _FCNTL_H
20# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
21#endif
22
23#ifndef _BITS_STRUCT_STAT_H
24#define _BITS_STRUCT_STAT_H 1
25
26#include <bits/endian.h>
27#include <bits/wordsize.h>
28
29#if defined __USE_FILE_OFFSET64
30# define __field64(type, type64, name) type64 name
31#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
32# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
33# error "ino_t and off_t must both be the same type"
34# endif
35# define __field64(type, type64, name) type name
36#elif __BYTE_ORDER == __LITTLE_ENDIAN
37# define __field64(type, type64, name) \
38 type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
39#else
40# define __field64(type, type64, name) \
41 int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
42#endif
43
44struct stat
45 {
46 __dev_t st_dev; /* Device. */
47 __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */
48 __mode_t st_mode; /* File mode. */
49 __nlink_t st_nlink; /* Link count. */
50 __uid_t st_uid; /* User ID of the file's owner. */
51 __gid_t st_gid; /* Group ID of the file's group.*/
52 __dev_t st_rdev; /* Device number, if device. */
53 __dev_t __pad1;
54 __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */
55 __blksize_t st_blksize; /* Optimal block size for I/O. */
56 int __pad2;
57 __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */
58#ifdef __USE_XOPEN2K8
59 /* Nanosecond resolution timestamps are stored in a format
60 equivalent to 'struct timespec'. This is the type used
61 whenever possible but the Unix namespace rules do not allow the
62 identifier 'timespec' to appear in the <sys/stat.h> header.
63 Therefore we have to handle the use of this header in strictly
64 standard-compliant sources special. */
65 struct timespec st_atim; /* Time of last access. */
66 struct timespec st_mtim; /* Time of last modification. */
67 struct timespec st_ctim; /* Time of last status change. */
68# define st_atime st_atim.tv_sec /* Backward compatibility. */
69# define st_mtime st_mtim.tv_sec
70# define st_ctime st_ctim.tv_sec
71#else
72 __time_t st_atime; /* Time of last access. */
73 unsigned long int st_atimensec; /* Nscecs of last access. */
74 __time_t st_mtime; /* Time of last modification. */
75 unsigned long int st_mtimensec; /* Nsecs of last modification. */
76 __time_t st_ctime; /* Time of last status change. */
77 unsigned long int st_ctimensec; /* Nsecs of last status change. */
78#endif
79 int __glibc_reserved[2];
80 };
81
82#undef __field64
83
84#ifdef __USE_LARGEFILE64
85struct stat64
86 {
87 __dev_t st_dev; /* Device. */
88 __ino64_t st_ino; /* File serial number. */
89 __mode_t st_mode; /* File mode. */
90 __nlink_t st_nlink; /* Link count. */
91 __uid_t st_uid; /* User ID of the file's owner. */
92 __gid_t st_gid; /* Group ID of the file's group.*/
93 __dev_t st_rdev; /* Device number, if device. */
94 __dev_t __pad1;
95 __off64_t st_size; /* Size of file, in bytes. */
96 __blksize_t st_blksize; /* Optimal block size for I/O. */
97 int __pad2;
98 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
99#ifdef __USE_XOPEN2K8
100 /* Nanosecond resolution timestamps are stored in a format
101 equivalent to 'struct timespec'. This is the type used
102 whenever possible but the Unix namespace rules do not allow the
103 identifier 'timespec' to appear in the <sys/stat.h> header.
104 Therefore we have to handle the use of this header in strictly
105 standard-compliant sources special. */
106 struct timespec st_atim; /* Time of last access. */
107 struct timespec st_mtim; /* Time of last modification. */
108 struct timespec st_ctim; /* Time of last status change. */
109#else
110 __time_t st_atime; /* Time of last access. */
111 unsigned long int st_atimensec; /* Nscecs of last access. */
112 __time_t st_mtime; /* Time of last modification. */
113 unsigned long int st_mtimensec; /* Nsecs of last modification. */
114 __time_t st_ctime; /* Time of last status change. */
115 unsigned long int st_ctimensec; /* Nsecs of last status change. */
116#endif
117 int __glibc_reserved[2];
118 };
119#endif
120
121/* Tell code we have these members. */
122#define _STATBUF_ST_BLKSIZE
123#define _STATBUF_ST_RDEV
124/* Nanosecond resolution time values are supported. */
125#define _STATBUF_ST_NSEC
126
127#endif /* _BITS_STRUCT_STAT_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-gnu/bits/timesize.h deleted-20
...@@ -1,20 +0,0 @@
1/* Bit size of the time_t type at glibc build time, general case.
2 Copyright (C) 2018-2026 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/* Size in bits of the 'time_t' type of the default ABI. */
20#define __TIMESIZE 64
\ No newline at end of file
lib/libc/include/aarch64-linux-gnu/finclude/math-vector-fortran.h+80-78
...@@ -16,81 +16,83 @@...@@ -16,81 +16,83 @@
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!GCC$ builtin (acos) attributes simd (notinbranch)
20!GCC$ builtin (acosf) attributes simd (notinbranch)
21!GCC$ builtin (acosh) attributes simd (notinbranch)
22!GCC$ builtin (acoshf) attributes simd (notinbranch)
23!GCC$ builtin (acospi) attributes simd (notinbranch)
24!GCC$ builtin (acospif) attributes simd (notinbranch)
25!GCC$ builtin (asin) attributes simd (notinbranch)
26!GCC$ builtin (asinf) attributes simd (notinbranch)
27!GCC$ builtin (asinh) attributes simd (notinbranch)
28!GCC$ builtin (asinhf) attributes simd (notinbranch)
29!GCC$ builtin (asinpi) attributes simd (notinbranch)
30!GCC$ builtin (asinpif) attributes simd (notinbranch)
31!GCC$ builtin (atan) attributes simd (notinbranch)
32!GCC$ builtin (atan2) attributes simd (notinbranch)
33!GCC$ builtin (atan2f) attributes simd (notinbranch)
34!GCC$ builtin (atan2pi) attributes simd (notinbranch)
35!GCC$ builtin (atan2pif) attributes simd (notinbranch)
36!GCC$ builtin (atanf) attributes simd (notinbranch)
37!GCC$ builtin (atanh) attributes simd (notinbranch)
38!GCC$ builtin (atanhf) attributes simd (notinbranch)
39!GCC$ builtin (atanpi) attributes simd (notinbranch)
40!GCC$ builtin (atanpif) attributes simd (notinbranch)
41!GCC$ builtin (cbrt) attributes simd (notinbranch)
42!GCC$ builtin (cbrtf) attributes simd (notinbranch)
43!GCC$ builtin (cos) attributes simd (notinbranch)
44!GCC$ builtin (cosf) attributes simd (notinbranch)
45!GCC$ builtin (cosh) attributes simd (notinbranch)
46!GCC$ builtin (coshf) attributes simd (notinbranch)
47!GCC$ builtin (cospi) attributes simd (notinbranch)
48!GCC$ builtin (cospif) attributes simd (notinbranch)
49!GCC$ builtin (erf) attributes simd (notinbranch)
50!GCC$ builtin (erfc) attributes simd (notinbranch)
51!GCC$ builtin (erfcf) attributes simd (notinbranch)
52!GCC$ builtin (erff) attributes simd (notinbranch)
53!GCC$ builtin (exp) attributes simd (notinbranch)
54!GCC$ builtin (exp10) attributes simd (notinbranch)
55!GCC$ builtin (exp10f) attributes simd (notinbranch)
56!GCC$ builtin (exp10m1) attributes simd (notinbranch)
57!GCC$ builtin (exp10m1f) attributes simd (notinbranch)
58!GCC$ builtin (exp2) attributes simd (notinbranch)
59!GCC$ builtin (exp2f) attributes simd (notinbranch)
60!GCC$ builtin (exp2m1) attributes simd (notinbranch)
61!GCC$ builtin (exp2m1f) attributes simd (notinbranch)
62!GCC$ builtin (expf) attributes simd (notinbranch)
63!GCC$ builtin (expm1) attributes simd (notinbranch)
64!GCC$ builtin (expm1f) attributes simd (notinbranch)
65!GCC$ builtin (hypot) attributes simd (notinbranch)
66!GCC$ builtin (hypotf) attributes simd (notinbranch)
67!GCC$ builtin (log) attributes simd (notinbranch)
68!GCC$ builtin (log10) attributes simd (notinbranch)
69!GCC$ builtin (log10f) attributes simd (notinbranch)
70!GCC$ builtin (log10p1) attributes simd (notinbranch)
71!GCC$ builtin (log10p1f) attributes simd (notinbranch)
72!GCC$ builtin (log1p) attributes simd (notinbranch)
73!GCC$ builtin (log1pf) attributes simd (notinbranch)
74!GCC$ builtin (log2) attributes simd (notinbranch)
75!GCC$ builtin (log2f) attributes simd (notinbranch)
76!GCC$ builtin (log2p1) attributes simd (notinbranch)
77!GCC$ builtin (log2p1f) attributes simd (notinbranch)
78!GCC$ builtin (logf) attributes simd (notinbranch)
79!GCC$ builtin (logp1) attributes simd (notinbranch)
80!GCC$ builtin (logp1f) attributes simd (notinbranch)
81!GCC$ builtin (pow) attributes simd (notinbranch)
82!GCC$ builtin (powf) attributes simd (notinbranch)
83!GCC$ builtin (rsqrt) attributes simd (notinbranch)
84!GCC$ builtin (rsqrtf) attributes simd (notinbranch)
85!GCC$ builtin (sin) attributes simd (notinbranch)
86!GCC$ builtin (sinf) attributes simd (notinbranch)
87!GCC$ builtin (sinh) attributes simd (notinbranch)
88!GCC$ builtin (sinhf) attributes simd (notinbranch)
89!GCC$ builtin (sinpi) attributes simd (notinbranch)
90!GCC$ builtin (sinpif) attributes simd (notinbranch)
91!GCC$ builtin (tan) attributes simd (notinbranch)
92!GCC$ builtin (tanf) attributes simd (notinbranch)
93!GCC$ builtin (tanh) attributes simd (notinbranch)
94!GCC$ builtin (tanhf) attributes simd (notinbranch)
95!GCC$ builtin (tanpi) attributes simd (notinbranch)
96!GCC$ builtin (tanpif) attributes simd (notinbranch)
\ No newline at end of file
19!GCC$ builtin (acos) attributes simd (notinbranch) if('fastmath')
20!GCC$ builtin (acosf) attributes simd (notinbranch) if('fastmath')
21!GCC$ builtin (acosh) attributes simd (notinbranch) if('fastmath')
22!GCC$ builtin (acoshf) attributes simd (notinbranch) if('fastmath')
23!GCC$ builtin (acospi) attributes simd (notinbranch) if('fastmath')
24!GCC$ builtin (acospif) attributes simd (notinbranch) if('fastmath')
25!GCC$ builtin (asin) attributes simd (notinbranch) if('fastmath')
26!GCC$ builtin (asinf) attributes simd (notinbranch) if('fastmath')
27!GCC$ builtin (asinh) attributes simd (notinbranch) if('fastmath')
28!GCC$ builtin (asinhf) attributes simd (notinbranch) if('fastmath')
29!GCC$ builtin (asinpi) attributes simd (notinbranch) if('fastmath')
30!GCC$ builtin (asinpif) attributes simd (notinbranch) if('fastmath')
31!GCC$ builtin (atan) attributes simd (notinbranch) if('fastmath')
32!GCC$ builtin (atan2) attributes simd (notinbranch) if('fastmath')
33!GCC$ builtin (atan2f) attributes simd (notinbranch) if('fastmath')
34!GCC$ builtin (atan2pi) attributes simd (notinbranch) if('fastmath')
35!GCC$ builtin (atan2pif) attributes simd (notinbranch) if('fastmath')
36!GCC$ builtin (atanf) attributes simd (notinbranch) if('fastmath')
37!GCC$ builtin (atanh) attributes simd (notinbranch) if('fastmath')
38!GCC$ builtin (atanhf) attributes simd (notinbranch) if('fastmath')
39!GCC$ builtin (atanpi) attributes simd (notinbranch) if('fastmath')
40!GCC$ builtin (atanpif) attributes simd (notinbranch) if('fastmath')
41!GCC$ builtin (cbrt) attributes simd (notinbranch) if('fastmath')
42!GCC$ builtin (cbrtf) attributes simd (notinbranch) if('fastmath')
43!GCC$ builtin (cos) attributes simd (notinbranch) if('fastmath')
44!GCC$ builtin (cosf) attributes simd (notinbranch) if('fastmath')
45!GCC$ builtin (cosh) attributes simd (notinbranch) if('fastmath')
46!GCC$ builtin (coshf) attributes simd (notinbranch) if('fastmath')
47!GCC$ builtin (cospi) attributes simd (notinbranch) if('fastmath')
48!GCC$ builtin (cospif) attributes simd (notinbranch) if('fastmath')
49!GCC$ builtin (erf) attributes simd (notinbranch) if('fastmath')
50!GCC$ builtin (erfc) attributes simd (notinbranch) if('fastmath')
51!GCC$ builtin (erfcf) attributes simd (notinbranch) if('fastmath')
52!GCC$ builtin (erff) attributes simd (notinbranch) if('fastmath')
53!GCC$ builtin (exp) attributes simd (notinbranch) if('fastmath')
54!GCC$ builtin (exp10) attributes simd (notinbranch) if('fastmath')
55!GCC$ builtin (exp10f) attributes simd (notinbranch) if('fastmath')
56!GCC$ builtin (exp10m1) attributes simd (notinbranch) if('fastmath')
57!GCC$ builtin (exp10m1f) attributes simd (notinbranch) if('fastmath')
58!GCC$ builtin (exp2) attributes simd (notinbranch) if('fastmath')
59!GCC$ builtin (exp2f) attributes simd (notinbranch) if('fastmath')
60!GCC$ builtin (exp2m1) attributes simd (notinbranch) if('fastmath')
61!GCC$ builtin (exp2m1f) attributes simd (notinbranch) if('fastmath')
62!GCC$ builtin (expf) attributes simd (notinbranch) if('fastmath')
63!GCC$ builtin (expm1) attributes simd (notinbranch) if('fastmath')
64!GCC$ builtin (expm1f) attributes simd (notinbranch) if('fastmath')
65!GCC$ builtin (hypot) attributes simd (notinbranch) if('fastmath')
66!GCC$ builtin (hypotf) attributes simd (notinbranch) if('fastmath')
67!GCC$ builtin (log) attributes simd (notinbranch) if('fastmath')
68!GCC$ builtin (log10) attributes simd (notinbranch) if('fastmath')
69!GCC$ builtin (log10f) attributes simd (notinbranch) if('fastmath')
70!GCC$ builtin (log10p1) attributes simd (notinbranch) if('fastmath')
71!GCC$ builtin (log10p1f) attributes simd (notinbranch) if('fastmath')
72!GCC$ builtin (log1p) attributes simd (notinbranch) if('fastmath')
73!GCC$ builtin (log1pf) attributes simd (notinbranch) if('fastmath')
74!GCC$ builtin (log2) attributes simd (notinbranch) if('fastmath')
75!GCC$ builtin (log2f) attributes simd (notinbranch) if('fastmath')
76!GCC$ builtin (log2p1) attributes simd (notinbranch) if('fastmath')
77!GCC$ builtin (log2p1f) attributes simd (notinbranch) if('fastmath')
78!GCC$ builtin (logf) attributes simd (notinbranch) if('fastmath')
79!GCC$ builtin (logp1) attributes simd (notinbranch) if('fastmath')
80!GCC$ builtin (logp1f) attributes simd (notinbranch) if('fastmath')
81!GCC$ builtin (pow) attributes simd (notinbranch) if('fastmath')
82!GCC$ builtin (powf) attributes simd (notinbranch) if('fastmath')
83!GCC$ builtin (powr) attributes simd (notinbranch) if('fastmath')
84!GCC$ builtin (powrf) attributes simd (notinbranch) if('fastmath')
85!GCC$ builtin (rsqrt) attributes simd (notinbranch) if('fastmath')
86!GCC$ builtin (rsqrtf) attributes simd (notinbranch) if('fastmath')
87!GCC$ builtin (sin) attributes simd (notinbranch) if('fastmath')
88!GCC$ builtin (sinf) attributes simd (notinbranch) if('fastmath')
89!GCC$ builtin (sinh) attributes simd (notinbranch) if('fastmath')
90!GCC$ builtin (sinhf) attributes simd (notinbranch) if('fastmath')
91!GCC$ builtin (sinpi) attributes simd (notinbranch) if('fastmath')
92!GCC$ builtin (sinpif) attributes simd (notinbranch) if('fastmath')
93!GCC$ builtin (tan) attributes simd (notinbranch) if('fastmath')
94!GCC$ builtin (tanf) attributes simd (notinbranch) if('fastmath')
95!GCC$ builtin (tanh) attributes simd (notinbranch) if('fastmath')
96!GCC$ builtin (tanhf) attributes simd (notinbranch) if('fastmath')
97!GCC$ builtin (tanpi) attributes simd (notinbranch) if('fastmath')
98!GCC$ builtin (tanpif) attributes simd (notinbranch) if('fastmath')
\ No newline at end of file
lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64_be.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/arc-linux-gnu/bits/struct_stat.h deleted-127
...@@ -1,127 +0,0 @@
1/* Definition for struct stat.
2 Copyright (C) 2020-2026 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#if !defined _SYS_STAT_H && !defined _FCNTL_H
20# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
21#endif
22
23#ifndef _BITS_STRUCT_STAT_H
24#define _BITS_STRUCT_STAT_H 1
25
26#include <bits/endian.h>
27#include <bits/wordsize.h>
28
29#if defined __USE_FILE_OFFSET64
30# define __field64(type, type64, name) type64 name
31#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
32# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
33# error "ino_t and off_t must both be the same type"
34# endif
35# define __field64(type, type64, name) type name
36#elif __BYTE_ORDER == __LITTLE_ENDIAN
37# define __field64(type, type64, name) \
38 type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
39#else
40# define __field64(type, type64, name) \
41 int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
42#endif
43
44struct stat
45 {
46 __dev_t st_dev; /* Device. */
47 __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */
48 __mode_t st_mode; /* File mode. */
49 __nlink_t st_nlink; /* Link count. */
50 __uid_t st_uid; /* User ID of the file's owner. */
51 __gid_t st_gid; /* Group ID of the file's group.*/
52 __dev_t st_rdev; /* Device number, if device. */
53 __dev_t __pad1;
54 __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */
55 __blksize_t st_blksize; /* Optimal block size for I/O. */
56 int __pad2;
57 __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */
58#ifdef __USE_XOPEN2K8
59 /* Nanosecond resolution timestamps are stored in a format
60 equivalent to 'struct timespec'. This is the type used
61 whenever possible but the Unix namespace rules do not allow the
62 identifier 'timespec' to appear in the <sys/stat.h> header.
63 Therefore we have to handle the use of this header in strictly
64 standard-compliant sources special. */
65 struct timespec st_atim; /* Time of last access. */
66 struct timespec st_mtim; /* Time of last modification. */
67 struct timespec st_ctim; /* Time of last status change. */
68# define st_atime st_atim.tv_sec /* Backward compatibility. */
69# define st_mtime st_mtim.tv_sec
70# define st_ctime st_ctim.tv_sec
71#else
72 __time_t st_atime; /* Time of last access. */
73 unsigned long int st_atimensec; /* Nscecs of last access. */
74 __time_t st_mtime; /* Time of last modification. */
75 unsigned long int st_mtimensec; /* Nsecs of last modification. */
76 __time_t st_ctime; /* Time of last status change. */
77 unsigned long int st_ctimensec; /* Nsecs of last status change. */
78#endif
79 int __glibc_reserved[2];
80 };
81
82#undef __field64
83
84#ifdef __USE_LARGEFILE64
85struct stat64
86 {
87 __dev_t st_dev; /* Device. */
88 __ino64_t st_ino; /* File serial number. */
89 __mode_t st_mode; /* File mode. */
90 __nlink_t st_nlink; /* Link count. */
91 __uid_t st_uid; /* User ID of the file's owner. */
92 __gid_t st_gid; /* Group ID of the file's group.*/
93 __dev_t st_rdev; /* Device number, if device. */
94 __dev_t __pad1;
95 __off64_t st_size; /* Size of file, in bytes. */
96 __blksize_t st_blksize; /* Optimal block size for I/O. */
97 int __pad2;
98 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
99#ifdef __USE_XOPEN2K8
100 /* Nanosecond resolution timestamps are stored in a format
101 equivalent to 'struct timespec'. This is the type used
102 whenever possible but the Unix namespace rules do not allow the
103 identifier 'timespec' to appear in the <sys/stat.h> header.
104 Therefore we have to handle the use of this header in strictly
105 standard-compliant sources special. */
106 struct timespec st_atim; /* Time of last access. */
107 struct timespec st_mtim; /* Time of last modification. */
108 struct timespec st_ctim; /* Time of last status change. */
109#else
110 __time_t st_atime; /* Time of last access. */
111 unsigned long int st_atimensec; /* Nscecs of last access. */
112 __time_t st_mtime; /* Time of last modification. */
113 unsigned long int st_mtimensec; /* Nsecs of last modification. */
114 __time_t st_ctime; /* Time of last status change. */
115 unsigned long int st_ctimensec; /* Nsecs of last status change. */
116#endif
117 int __glibc_reserved[2];
118 };
119#endif
120
121/* Tell code we have these members. */
122#define _STATBUF_ST_BLKSIZE
123#define _STATBUF_ST_RDEV
124/* Nanosecond resolution time values are supported. */
125#define _STATBUF_ST_NSEC
126
127#endif /* _BITS_STRUCT_STAT_H */
\ No newline at end of file
lib/libc/include/arc-linux-gnu/bits/timesize.h deleted-20
...@@ -1,20 +0,0 @@
1/* Bit size of the time_t type at glibc build time, general case.
2 Copyright (C) 2018-2026 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/* Size in bits of the 'time_t' type of the default ABI. */
20#define __TIMESIZE 64
\ No newline at end of file
lib/libc/include/arc-linux-gnu/gnu/lib-names.h+1
...@@ -25,6 +25,7 @@...@@ -25,6 +25,7 @@
25#define LIBRESOLV_SO "libresolv.so.2"25#define LIBRESOLV_SO "libresolv.so.2"
26#define LIBRT_SO "librt.so.1"26#define LIBRT_SO "librt.so.1"
27#define LIBTHREAD_DB_SO "libthread_db.so.1"27#define LIBTHREAD_DB_SO "libthread_db.so.1"
28#define LIBUNWIND_SO "libunwind.so.1"
28#define LIBUTIL_SO "libutil.so.1"29#define LIBUTIL_SO "libutil.so.1"
2930
30#endif /* gnu/lib-names.h */31#endif /* gnu/lib-names.h */
\ No newline at end of file
lib/libc/include/csky-linux-gnu/gnu/lib-names.h+2-1
...@@ -31,6 +31,7 @@...@@ -31,6 +31,7 @@
31#define LIBRESOLV_SO "libresolv.so.2"31#define LIBRESOLV_SO "libresolv.so.2"
32#define LIBRT_SO "librt.so.1"32#define LIBRT_SO "librt.so.1"
33#define LIBTHREAD_DB_SO "libthread_db.so.1"33#define LIBTHREAD_DB_SO "libthread_db.so.1"
34#define LIBUNWIND_SO "libunwind.so.1"
34#define LIBUTIL_SO "libutil.so.1"35#define LIBUTIL_SO "libutil.so.1"
3536
36#endif /* gnu/lib-names.h */37#endif /* gnu/lib-names.h */
\ No newline at end of file
lib/libc/include/generic-glibc/assert.h+19-9
...@@ -52,13 +52,12 @@...@@ -52,13 +52,12 @@
52 comma in the initializer list, can be passed to assert. This52 comma in the initializer list, can be passed to assert. This
53 depends on support for variadic macros (added in C99 and GCC 2.95),53 depends on support for variadic macros (added in C99 and GCC 2.95),
54 and on support for _Bool (added in C99 and GCC 3.0) in order to54 and on support for _Bool (added in C99 and GCC 3.0) in order to
55 validate that only a single expression is passed as an argument,55 validate that only a single expression is passed as an argument. */
56 and is currently implemented only for C. */56#if ((__GLIBC_USE (ISOC23) \
57#if (__GLIBC_USE (ISOC23) \57 && (defined __GNUC__ \
58 && (defined __GNUC__ \58 ? __GNUC_PREREQ (3, 0) \
59 ? __GNUC_PREREQ (3, 0) \59 : defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) \
60 : defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) \60 || (defined __cplusplus && __cplusplus > 202302L))
61 && !defined __cplusplus)
62# define __ASSERT_VARIADIC 161# define __ASSERT_VARIADIC 1
63#else62#else
64# define __ASSERT_VARIADIC 063# define __ASSERT_VARIADIC 0
...@@ -108,7 +107,7 @@ extern void __assert (const char *__assertion, const char *__file, int __line)...@@ -108,7 +107,7 @@ extern void __assert (const char *__assertion, const char *__file, int __line)
108 __THROW __attribute__ ((__noreturn__)) __COLD;107 __THROW __attribute__ ((__noreturn__)) __COLD;
109108
110109
111# if __ASSERT_VARIADIC110# if __ASSERT_VARIADIC && !defined __cplusplus
112/* This function is not defined and is not called outside of an111/* This function is not defined and is not called outside of an
113 unevaluated sizeof, but serves to verify that the argument to112 unevaluated sizeof, but serves to verify that the argument to
114 assert is a single expression. */113 assert is a single expression. */
...@@ -131,11 +130,22 @@ __END_DECLS...@@ -131,11 +130,22 @@ __END_DECLS
131# define __ASSERT_FILE __FILE__130# define __ASSERT_FILE __FILE__
132# define __ASSERT_LINE __LINE__131# define __ASSERT_LINE __LINE__
133# endif132# endif
134# define assert(expr) \133# if __ASSERT_VARIADIC
134/* The first test of __VA_ARGS__ evaluates it without converting scoped
135 enumeration values to bool, and the second test checks that it is a
136 single expression without evaluating it. */
137# define assert(...) \
138 ((__VA_ARGS__) \
139 ? void (1 ? 1 : bool (__VA_ARGS__)) \
140 : __assert_fail (#__VA_ARGS__, __ASSERT_FILE, __ASSERT_LINE, \
141 __ASSERT_FUNCTION))
142# else
143# define assert(expr) \
135 (static_cast <bool> (expr) \144 (static_cast <bool> (expr) \
136 ? void (0) \145 ? void (0) \
137 : __assert_fail (#expr, __ASSERT_FILE, __ASSERT_LINE, \146 : __assert_fail (#expr, __ASSERT_FILE, __ASSERT_LINE, \
138 __ASSERT_FUNCTION))147 __ASSERT_FUNCTION))
148# endif
139# elif !defined __GNUC__ || defined __STRICT_ANSI__149# elif !defined __GNUC__ || defined __STRICT_ANSI__
140# if __ASSERT_VARIADIC150# if __ASSERT_VARIADIC
141# define assert(...) \151# define assert(...) \
lib/libc/include/generic-glibc/bits/cloexec.h created+1
...@@ -0,0 +1 @@
1#define __O_CLOEXEC 02000000
\ No newline at end of file
lib/libc/include/generic-glibc/bits/fcntl-linux.h+11-10
...@@ -81,9 +81,7 @@...@@ -81,9 +81,7 @@
81#ifndef __O_NOFOLLOW81#ifndef __O_NOFOLLOW
82# define __O_NOFOLLOW 040000082# define __O_NOFOLLOW 0400000
83#endif83#endif
84#ifndef __O_CLOEXEC84#include <bits/cloexec.h>
85# define __O_CLOEXEC 02000000
86#endif
87#ifndef __O_DIRECT85#ifndef __O_DIRECT
88# define __O_DIRECT 04000086# define __O_DIRECT 040000
89#endif87#endif
...@@ -176,8 +174,8 @@...@@ -176,8 +174,8 @@
176#endif174#endif
177175
178#if defined __USE_UNIX98 || defined __USE_XOPEN2K8176#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
179# define F_SETOWN __F_SETOWN /* Get owner (process receiving SIGIO). */177# define F_SETOWN __F_SETOWN /* Set owner (process receiving SIGIO). */
180# define F_GETOWN __F_GETOWN /* Set owner (process receiving SIGIO). */178# define F_GETOWN __F_GETOWN /* Get owner (process receiving SIGIO). */
181#endif179#endif
182180
183#ifndef __F_SETSIG181#ifndef __F_SETSIG
...@@ -185,15 +183,15 @@...@@ -185,15 +183,15 @@
185# define __F_GETSIG 11 /* Get number of signal to be sent. */183# define __F_GETSIG 11 /* Get number of signal to be sent. */
186#endif184#endif
187#ifndef __F_SETOWN_EX185#ifndef __F_SETOWN_EX
188# define __F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */186# define __F_SETOWN_EX 15 /* Set owner (thread receiving SIGIO). */
189# define __F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */187# define __F_GETOWN_EX 16 /* Get owner (thread receiving SIGIO). */
190#endif188#endif
191189
192#ifdef __USE_GNU190#ifdef __USE_GNU
193# define F_SETSIG __F_SETSIG /* Set number of signal to be sent. */191# define F_SETSIG __F_SETSIG /* Set number of signal to be sent. */
194# define F_GETSIG __F_GETSIG /* Get number of signal to be sent. */192# define F_GETSIG __F_GETSIG /* Get number of signal to be sent. */
195# define F_SETOWN_EX __F_SETOWN_EX /* Get owner (thread receiving SIGIO). */193# define F_SETOWN_EX __F_SETOWN_EX /* Set owner (thread receiving SIGIO). */
196# define F_GETOWN_EX __F_GETOWN_EX /* Set owner (thread receiving SIGIO). */194# define F_GETOWN_EX __F_GETOWN_EX /* Get owner (thread receiving SIGIO). */
197#endif195#endif
198196
199#ifdef __USE_GNU197#ifdef __USE_GNU
...@@ -203,7 +201,7 @@...@@ -203,7 +201,7 @@
203# define F_DUPFD_QUERY 1027 /* Compare two file descriptors for sameness. */201# define F_DUPFD_QUERY 1027 /* Compare two file descriptors for sameness. */
204# define F_CREATED_QUERY 1028 /* Was the file just created? */202# define F_CREATED_QUERY 1028 /* Was the file just created? */
205# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */203# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
206# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */204# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
207# define F_ADD_SEALS 1033 /* Add seals to file. */205# define F_ADD_SEALS 1033 /* Add seals to file. */
208# define F_GET_SEALS 1034 /* Get seals for file. */206# define F_GET_SEALS 1034 /* Get seals for file. */
209/* Set / get write life time hints. */207/* Set / get write life time hints. */
...@@ -211,6 +209,8 @@...@@ -211,6 +209,8 @@
211# define F_SET_RW_HINT 1036209# define F_SET_RW_HINT 1036
212# define F_GET_FILE_RW_HINT 1037210# define F_GET_FILE_RW_HINT 1037
213# define F_SET_FILE_RW_HINT 1038211# define F_SET_FILE_RW_HINT 1038
212# define F_GETDELEG 1039 /* Get delegation. */
213# define F_SETDELEG 1040 /* Set delegation. */
214#endif214#endif
215#ifdef __USE_XOPEN2K8215#ifdef __USE_XOPEN2K8
216# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with216# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
...@@ -221,6 +221,7 @@...@@ -221,6 +221,7 @@
221#define FD_CLOEXEC 1 /* Actually anything with low bit set goes */221#define FD_CLOEXEC 1 /* Actually anything with low bit set goes */
222#ifdef __USE_GNU222#ifdef __USE_GNU
223# define FD_PIDFS_ROOT -10002 /* Root of the pidfs filesystem */223# define FD_PIDFS_ROOT -10002 /* Root of the pidfs filesystem */
224# define FD_NSFS_ROOT -10003 /* Root of the nsfs filesystem */
224#endif225#endif
225226
226#ifndef F_RDLCK227#ifndef F_RDLCK
lib/libc/include/generic-glibc/bits/libm-simd-decl-stubs.h+11
...@@ -99,6 +99,17 @@...@@ -99,6 +99,17 @@
99#define __DECL_SIMD_powf64x99#define __DECL_SIMD_powf64x
100#define __DECL_SIMD_powf128x100#define __DECL_SIMD_powf128x
101101
102#define __DECL_SIMD_powr
103#define __DECL_SIMD_powrf
104#define __DECL_SIMD_powrl
105#define __DECL_SIMD_powrf16
106#define __DECL_SIMD_powrf32
107#define __DECL_SIMD_powrf64
108#define __DECL_SIMD_powrf128
109#define __DECL_SIMD_powrf32x
110#define __DECL_SIMD_powrf64x
111#define __DECL_SIMD_powrf128x
112
102#define __DECL_SIMD_acos113#define __DECL_SIMD_acos
103#define __DECL_SIMD_acosf114#define __DECL_SIMD_acosf
104#define __DECL_SIMD_acosl115#define __DECL_SIMD_acosl
lib/libc/include/generic-glibc/bits/long-double.h+3-6
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Properties of long double type. MIPS version.1/* Properties of long double type. ldbl-128 version.
2 Copyright (C) 2016-2026 Free Software Foundation, Inc.2 Copyright (C) 2016-2026 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
...@@ -16,9 +16,6 @@...@@ -16,9 +16,6 @@
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#include <sgidefs.h>19/* long double is distinct from double, so there is nothing to
2020 define here. */
21#if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
22# define __NO_LONG_DOUBLE_MATH 1
23#endif
24#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 021#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0
\ No newline at end of file
lib/libc/include/generic-glibc/bits/mathcalls.h+1
...@@ -197,6 +197,7 @@ __MATHCALL (compoundn,, (_Mdouble_ __x, long long int __y));...@@ -197,6 +197,7 @@ __MATHCALL (compoundn,, (_Mdouble_ __x, long long int __y));
197__MATHCALL (pown,, (_Mdouble_ __x, long long int __y));197__MATHCALL (pown,, (_Mdouble_ __x, long long int __y));
198198
199/* Return X to the Y power. */199/* Return X to the Y power. */
200__MATHCALL_VEC (powr,, (_Mdouble_ __x, _Mdouble_ __y));
200__MATHCALL (powr,, (_Mdouble_ __x, _Mdouble_ __y));201__MATHCALL (powr,, (_Mdouble_ __x, _Mdouble_ __y));
201202
202/* Return the Yth root of X. */203/* Return the Yth root of X. */
lib/libc/include/generic-glibc/bits/ppc.h deleted-33
...@@ -1,33 +0,0 @@
1/* Facilities specific to the PowerPC architecture on Linux
2 Copyright (C) 2012-2026 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 _BITS_PPC_H
20#define _BITS_PPC_H
21
22#ifndef _SYS_PLATFORM_PPC_H
23# error "Never include this file directly; use <sys/platform/ppc.h> instead."
24#endif
25
26__BEGIN_DECLS
27
28/* Read the time base frequency. */
29extern uint64_t __ppc_get_timebase_freq (void);
30
31__END_DECLS
32
33#endif
\ No newline at end of file
lib/libc/include/generic-glibc/bits/sched.h+3
...@@ -54,6 +54,9 @@...@@ -54,6 +54,9 @@
54#define SCHED_FLAG_UTIL_CLAMP \54#define SCHED_FLAG_UTIL_CLAMP \
55 (SCHED_FLAG_UTIL_CLAMP_MIN | SCHED_FLAG_UTIL_CLAMP_MAX)55 (SCHED_FLAG_UTIL_CLAMP_MIN | SCHED_FLAG_UTIL_CLAMP_MAX)
5656
57/* Flags for the flags argument of sched_getattr. */
58#define SCHED_GETATTR_FLAG_DL_DYNAMIC 0x01
59
57/* Use "" to work around incorrect macro expansion of the60/* Use "" to work around incorrect macro expansion of the
58 __has_include argument (GCC PR 80005). */61 __has_include argument (GCC PR 80005). */
59# ifdef __has_include62# ifdef __has_include
lib/libc/include/generic-glibc/bits/struct_stat.h+54-164
...@@ -23,215 +23,105 @@...@@ -23,215 +23,105 @@
23#ifndef _BITS_STRUCT_STAT_H23#ifndef _BITS_STRUCT_STAT_H
24#define _BITS_STRUCT_STAT_H 124#define _BITS_STRUCT_STAT_H 1
2525
26#include <sgidefs.h>26#include <bits/endian.h>
27#include <bits/wordsize.h>
28
29#if defined __USE_FILE_OFFSET64
30# define __field64(type, type64, name) type64 name
31#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
32# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
33# error "ino_t and off_t must both be the same type"
34# endif
35# define __field64(type, type64, name) type name
36#elif __BYTE_ORDER == __LITTLE_ENDIAN
37# define __field64(type, type64, name) \
38 type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
39#else
40# define __field64(type, type64, name) \
41 int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
42#endif
2743
28#if _MIPS_SIM == _ABIO32
29/* Structure describing file characteristics. */
30struct stat44struct stat
31 {45 {
32# ifdef __USE_TIME64_REDIRECTS46 __dev_t st_dev; /* Device. */
33# include <bits/struct_stat_time64_helper.h>47 __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */
34# else
35 unsigned long int st_dev;
36 long int st_pad1[3];
37# ifndef __USE_FILE_OFFSET64
38 __ino_t st_ino; /* File serial number. */
39# else
40 __ino64_t st_ino; /* File serial number. */
41# endif
42 __mode_t st_mode; /* File mode. */48 __mode_t st_mode; /* File mode. */
43 __nlink_t st_nlink; /* Link count. */49 __nlink_t st_nlink; /* Link count. */
44 __uid_t st_uid; /* User ID of the file's owner. */50 __uid_t st_uid; /* User ID of the file's owner. */
45 __gid_t st_gid; /* Group ID of the file's group.*/51 __gid_t st_gid; /* Group ID of the file's group.*/
46 unsigned long int st_rdev; /* Device number, if device. */52 __dev_t st_rdev; /* Device number, if device. */
47# ifndef __USE_FILE_OFFSET6453 __dev_t __pad1;
48 long int st_pad2[2];54 __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */
49 __off_t st_size; /* Size of file, in bytes. */55 __blksize_t st_blksize; /* Optimal block size for I/O. */
50 /* SVR4 added this extra long to allow for expansion of off_t. */56 int __pad2;
51 long int st_pad3;57 __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */
52# else58#ifdef __USE_XOPEN2K8
53 long int st_pad2[3];
54 __off64_t st_size; /* Size of file, in bytes. */
55# endif
56# ifdef __USE_XOPEN2K8
57 /* Nanosecond resolution timestamps are stored in a format59 /* Nanosecond resolution timestamps are stored in a format
58 equivalent to 'struct timespec'. This is the type used60 equivalent to 'struct timespec'. This is the type used
59 whenever possible but the Unix namespace rules do not allow the61 whenever possible but the Unix namespace rules do not allow the
60 identifier 'timespec' to appear in the <sys/stat.h> header.62 identifier 'timespec' to appear in the <sys/stat.h> header.
61 Therefore we have to handle the use of this header in strictly63 Therefore we have to handle the use of this header in strictly
62 standard-compliant sources special. */64 standard-compliant sources special. */
63 struct timespec st_atim; /* Time of last access. */65 struct timespec st_atim; /* Time of last access. */
64 struct timespec st_mtim; /* Time of last modification. */66 struct timespec st_mtim; /* Time of last modification. */
65 struct timespec st_ctim; /* Time of last status change. */67 struct timespec st_ctim; /* Time of last status change. */
66# define st_atime st_atim.tv_sec /* Backward compatibility. */68# define st_atime st_atim.tv_sec /* Backward compatibility. */
67# define st_mtime st_mtim.tv_sec69# define st_mtime st_mtim.tv_sec
68# define st_ctime st_ctim.tv_sec70# define st_ctime st_ctim.tv_sec
69# else71#else
70 __time_t st_atime; /* Time of last access. */72 __time_t st_atime; /* Time of last access. */
71 unsigned long int st_atimensec; /* Nscecs of last access. */73 unsigned long int st_atimensec; /* Nscecs of last access. */
72 __time_t st_mtime; /* Time of last modification. */74 __time_t st_mtime; /* Time of last modification. */
73 unsigned long int st_mtimensec; /* Nsecs of last modification. */75 unsigned long int st_mtimensec; /* Nsecs of last modification. */
74 __time_t st_ctime; /* Time of last status change. */76 __time_t st_ctime; /* Time of last status change. */
75 unsigned long int st_ctimensec; /* Nsecs of last status change. */77 unsigned long int st_ctimensec; /* Nsecs of last status change. */
76# endif78#endif
77 __blksize_t st_blksize; /* Optimal block size for I/O. */79 int __glibc_reserved[2];
78# ifndef __USE_FILE_OFFSET64
79 __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
80# else
81 long int st_pad4;
82 __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
83# endif
84 long int st_pad5[14];
85# endif /* __USE_TIME64_REDIRECTS */
86 };80 };
8781
88# ifdef __USE_LARGEFILE6482#undef __field64
83
84#ifdef __USE_LARGEFILE64
89struct stat6485struct stat64
90 {86 {
91# ifdef __USE_TIME64_REDIRECTS87 __dev_t st_dev; /* Device. */
92# include <bits/struct_stat_time64_helper.h>88 __ino64_t st_ino; /* File serial number. */
93# else
94 unsigned long int st_dev;
95 long int st_pad1[3];
96 __ino64_t st_ino; /* File serial number. */
97 __mode_t st_mode; /* File mode. */89 __mode_t st_mode; /* File mode. */
98 __nlink_t st_nlink; /* Link count. */90 __nlink_t st_nlink; /* Link count. */
99 __uid_t st_uid; /* User ID of the file's owner. */91 __uid_t st_uid; /* User ID of the file's owner. */
100 __gid_t st_gid; /* Group ID of the file's group.*/92 __gid_t st_gid; /* Group ID of the file's group.*/
101 unsigned long int st_rdev; /* Device number, if device. */93 __dev_t st_rdev; /* Device number, if device. */
102 long int st_pad2[3];94 __dev_t __pad1;
103 __off64_t st_size; /* Size of file, in bytes. */95 __off64_t st_size; /* Size of file, in bytes. */
104# ifdef __USE_XOPEN2K8
105 /* Nanosecond resolution timestamps are stored in a format
106 equivalent to 'struct timespec'. This is the type used
107 whenever possible but the Unix namespace rules do not allow the
108 identifier 'timespec' to appear in the <sys/stat.h> header.
109 Therefore we have to handle the use of this header in strictly
110 standard-compliant sources special. */
111 struct timespec st_atim; /* Time of last access. */
112 struct timespec st_mtim; /* Time of last modification. */
113 struct timespec st_ctim; /* Time of last status change. */
114# else
115 __time_t st_atime; /* Time of last access. */
116 unsigned long int st_atimensec; /* Nscecs of last access. */
117 __time_t st_mtime; /* Time of last modification. */
118 unsigned long int st_mtimensec; /* Nsecs of last modification. */
119 __time_t st_ctime; /* Time of last status change. */
120 unsigned long int st_ctimensec; /* Nsecs of last status change. */
121# endif
122 __blksize_t st_blksize; /* Optimal block size for I/O. */96 __blksize_t st_blksize; /* Optimal block size for I/O. */
123 long int st_pad3;97 int __pad2;
124 __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */98 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
125 long int st_pad4[14];99#ifdef __USE_XOPEN2K8
126# endif /* __USE_TIME64_REDIRECTS */
127 };
128# endif /* __USE_LARGEFILE64 */
129
130#else /* _MIPS_SIM != _ABIO32 */
131
132struct stat
133 {
134# ifdef __USE_TIME64_REDIRECTS
135# include <bits/struct_stat_time64_helper.h>
136# else
137 __dev_t st_dev;
138 int st_pad1[3]; /* Reserved for st_dev expansion */
139# ifndef __USE_FILE_OFFSET64
140 __ino_t st_ino;
141# else
142 __ino64_t st_ino;
143# endif
144 __mode_t st_mode;
145 __nlink_t st_nlink;
146 __uid_t st_uid;
147 __gid_t st_gid;
148 __dev_t st_rdev;
149# if !defined __USE_FILE_OFFSET64
150 unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */
151 __off_t st_size;
152 int st_pad3;
153# else
154 unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */
155 __off64_t st_size;
156# endif
157# ifdef __USE_XOPEN2K8
158 /* Nanosecond resolution timestamps are stored in a format100 /* Nanosecond resolution timestamps are stored in a format
159 equivalent to 'struct timespec'. This is the type used101 equivalent to 'struct timespec'. This is the type used
160 whenever possible but the Unix namespace rules do not allow the102 whenever possible but the Unix namespace rules do not allow the
161 identifier 'timespec' to appear in the <sys/stat.h> header.103 identifier 'timespec' to appear in the <sys/stat.h> header.
162 Therefore we have to handle the use of this header in strictly104 Therefore we have to handle the use of this header in strictly
163 standard-compliant sources special. */105 standard-compliant sources special. */
164 struct timespec st_atim; /* Time of last access. */106 struct timespec st_atim; /* Time of last access. */
165 struct timespec st_mtim; /* Time of last modification. */107 struct timespec st_mtim; /* Time of last modification. */
166 struct timespec st_ctim; /* Time of last status change. */108 struct timespec st_ctim; /* Time of last status change. */
167# define st_atime st_atim.tv_sec /* Backward compatibility. */109#else
168# define st_mtime st_mtim.tv_sec
169# define st_ctime st_ctim.tv_sec
170# else
171 __time_t st_atime; /* Time of last access. */110 __time_t st_atime; /* Time of last access. */
172 unsigned long int st_atimensec; /* Nscecs of last access. */111 unsigned long int st_atimensec; /* Nscecs of last access. */
173 __time_t st_mtime; /* Time of last modification. */112 __time_t st_mtime; /* Time of last modification. */
174 unsigned long int st_mtimensec; /* Nsecs of last modification. */113 unsigned long int st_mtimensec; /* Nsecs of last modification. */
175 __time_t st_ctime; /* Time of last status change. */114 __time_t st_ctime; /* Time of last status change. */
176 unsigned long int st_ctimensec; /* Nsecs of last status change. */115 unsigned long int st_ctimensec; /* Nsecs of last status change. */
177# endif
178 __blksize_t st_blksize;
179 unsigned int st_pad4;
180# ifndef __USE_FILE_OFFSET64
181 __blkcnt_t st_blocks;
182# else
183 __blkcnt64_t st_blocks;
184# endif
185 int st_pad5[14];
186# endif
187 };
188
189#ifdef __USE_LARGEFILE64
190struct stat64
191 {
192# ifdef __USE_TIME64_REDIRECTS
193# include <bits/struct_stat_time64_helper.h>
194# else
195 __dev_t st_dev;
196 unsigned int st_pad1[3]; /* Reserved for st_dev expansion */
197 __ino64_t st_ino;
198 __mode_t st_mode;
199 __nlink_t st_nlink;
200 __uid_t st_uid;
201 __gid_t st_gid;
202 __dev_t st_rdev;
203 unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */
204 __off64_t st_size;
205# ifdef __USE_XOPEN2K8
206 /* Nanosecond resolution timestamps are stored in a format
207 equivalent to 'struct timespec'. This is the type used
208 whenever possible but the Unix namespace rules do not allow the
209 identifier 'timespec' to appear in the <sys/stat.h> header.
210 Therefore we have to handle the use of this header in strictly
211 standard-compliant sources special. */
212 struct timespec st_atim; /* Time of last access. */
213 struct timespec st_mtim; /* Time of last modification. */
214 struct timespec st_ctim; /* Time of last status change. */
215# else
216 __time_t st_atime; /* Time of last access. */
217 unsigned long int st_atimensec; /* Nscecs of last access. */
218 __time_t st_mtime; /* Time of last modification. */
219 unsigned long int st_mtimensec; /* Nsecs of last modification. */
220 __time_t st_ctime; /* Time of last status change. */
221 unsigned long int st_ctimensec; /* Nsecs of last status change. */
222# endif
223 __blksize_t st_blksize;
224 unsigned int st_pad3;
225 __blkcnt64_t st_blocks;
226 int st_pad4[14];
227# endif /* __USE_TIME64_REDIRECTS */
228};
229#endif116#endif
230117 int __glibc_reserved[2];
118 };
231#endif119#endif
232120
233/* Tell code we have these members. */121/* Tell code we have these members. */
234#define _STATBUF_ST_BLKSIZE122#define _STATBUF_ST_BLKSIZE
235#define _STATBUF_ST_RDEV123#define _STATBUF_ST_RDEV
124/* Nanosecond resolution time values are supported. */
125#define _STATBUF_ST_NSEC
236126
237#endif /* _BITS_STRUCT_STAT_H */127#endif /* _BITS_STRUCT_STAT_H */
\ No newline at end of file
lib/libc/include/generic-glibc/bits/syscall.h+14-2
...@@ -1,11 +1,11 @@...@@ -1,11 +1,11 @@
1/* Generated at libc build time from syscall list. */1/* Generated at libc build time from syscall list. */
2/* The system call list corresponds to kernel 6.17. */2/* The system call list corresponds to kernel 7.1. */
33
4#ifndef _SYSCALL_H4#ifndef _SYSCALL_H
5# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."5# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."
6#endif6#endif
77
8#define __GLIBC_LINUX_VERSION_CODE 3975688#define __GLIBC_LINUX_VERSION_CODE 459008
99
10#ifdef __NR_FAST_atomic_update10#ifdef __NR_FAST_atomic_update
11# define SYS_FAST_atomic_update __NR_FAST_atomic_update11# define SYS_FAST_atomic_update __NR_FAST_atomic_update
...@@ -883,6 +883,10 @@...@@ -883,6 +883,10 @@
883# define SYS_listmount __NR_listmount883# define SYS_listmount __NR_listmount
884#endif884#endif
885885
886#ifdef __NR_listns
887# define SYS_listns __NR_listns
888#endif
889
886#ifdef __NR_listxattr890#ifdef __NR_listxattr
887# define SYS_listxattr __NR_listxattr891# define SYS_listxattr __NR_listxattr
888#endif892#endif
...@@ -1899,6 +1903,10 @@...@@ -1899,6 +1903,10 @@
1899# define SYS_rseq __NR_rseq1903# define SYS_rseq __NR_rseq
1900#endif1904#endif
19011905
1906#ifdef __NR_rseq_slice_yield
1907# define SYS_rseq_slice_yield __NR_rseq_slice_yield
1908#endif
1909
1902#ifdef __NR_rt_sigaction1910#ifdef __NR_rt_sigaction
1903# define SYS_rt_sigaction __NR_rt_sigaction1911# define SYS_rt_sigaction __NR_rt_sigaction
1904#endif1912#endif
...@@ -2551,6 +2559,10 @@...@@ -2551,6 +2559,10 @@
2551# define SYS_unshare __NR_unshare2559# define SYS_unshare __NR_unshare
2552#endif2560#endif
25532561
2562#ifdef __NR_uprobe
2563# define SYS_uprobe __NR_uprobe
2564#endif
2565
2554#ifdef __NR_uretprobe2566#ifdef __NR_uretprobe
2555# define SYS_uretprobe __NR_uretprobe2567# define SYS_uretprobe __NR_uretprobe
2556#endif2568#endif
lib/libc/include/generic-glibc/bits/timesize.h+3-5
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Bit size of the time_t type at glibc build time, Linux/MIPS.1/* Bit size of the time_t type at glibc build time, general case.
2 Copyright (C) 2021-2026 Free Software Foundation, Inc.2 Copyright (C) 2018-2026 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,7 +16,5 @@...@@ -16,7 +16,5 @@
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#include <bits/wordsize.h>
20
21/* Size in bits of the 'time_t' type of the default ABI. */19/* Size in bits of the 'time_t' type of the default ABI. */
22#define __TIMESIZE __WORDSIZE
\ No newline at end of file
20#define __TIMESIZE 64
\ No newline at end of file
lib/libc/include/generic-glibc/bits/uio-ext.h+1
...@@ -51,6 +51,7 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,...@@ -51,6 +51,7 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
51#define RWF_ATOMIC 0x00000040 /* Write is to be issued with torn-write51#define RWF_ATOMIC 0x00000040 /* Write is to be issued with torn-write
52 prevention. */52 prevention. */
53#define RWF_DONTCACHE 0x00000080 /* Uncached buffered IO. */53#define RWF_DONTCACHE 0x00000080 /* Uncached buffered IO. */
54#define RWF_NOSIGNAL 0x00000100 /* Do not generate SIGPIPE on error. */
5455
55__END_DECLS56__END_DECLS
5657
lib/libc/include/generic-glibc/dlfcn.h+6-1
...@@ -167,7 +167,12 @@ enum...@@ -167,7 +167,12 @@ enum
167 the number of program headers in the array. */167 the number of program headers in the array. */
168 RTLD_DI_PHDR = 11,168 RTLD_DI_PHDR = 11,
169169
170 RTLD_DI_MAX = 11170 /* Treat ARG as `const char **' and at that location, store the address
171 of the directory name used to expand $ORIGIN in this shared object's
172 dependency file names. */
173 RTLD_DI_ORIGIN_PATH = 12,
174
175 RTLD_DI_MAX = 12
171 };176 };
172177
173178
lib/libc/include/generic-glibc/elf.h+6-2
...@@ -798,7 +798,8 @@ typedef struct...@@ -798,7 +798,8 @@ typedef struct
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_X86_XSAVE_LAYOUT 0x205 /* XSAVE layout description. */
801#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */801#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves. This was
802 used in now removed s390-32 arch. */
802#define NT_S390_TIMER 0x301 /* s390 timer register */803#define NT_S390_TIMER 0x301 /* s390 timer register */
803#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */804#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
804#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */805#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
...@@ -846,6 +847,7 @@ typedef struct...@@ -846,6 +847,7 @@ typedef struct
846#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */847#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */
847#define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged848#define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged
848 address control */849 address control */
850#define NT_RISCV_USER_CFI 0x903 /* RISC-V shadow stack state */
849#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */851#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */
850#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and852#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and
851 status registers. */853 status registers. */
...@@ -3470,7 +3472,9 @@ enum...@@ -3470,7 +3472,9 @@ enum
34703472
3471/* Valid values for the e_flags field. */3473/* Valid values for the e_flags field. */
34723474
3473#define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed. */3475#define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed.
3476 This was used in now removed s390-32
3477 arch. */
34743478
3475/* Additional s390 relocs */3479/* Additional s390 relocs */
34763480
lib/libc/include/generic-glibc/features.h+2-2
...@@ -162,7 +162,7 @@...@@ -162,7 +162,7 @@
162#undef __GLIBC_USE_DEPRECATED_SCANF162#undef __GLIBC_USE_DEPRECATED_SCANF
163#undef __GLIBC_USE_C23_STRTOL163#undef __GLIBC_USE_C23_STRTOL
164164
165/* Suppress kernel-name space pollution unless user expressedly asks165/* Suppress kernel-name space pollution unless user explicitly asks
166 for it. */166 for it. */
167#ifndef _LOOSE_KERNEL_NAMES167#ifndef _LOOSE_KERNEL_NAMES
168# define __KERNEL_STRICT_NAMES168# define __KERNEL_STRICT_NAMES
...@@ -580,4 +580,4 @@...@@ -580,4 +580,4 @@
580#include <gnu/stubs.h>580#include <gnu/stubs.h>
581581
582582
583#endif /* features.h */583#endif /* features.h */
\ No newline at end of file
lib/libc/include/generic-glibc/fts.h+126-2
...@@ -52,7 +52,29 @@...@@ -52,7 +52,29 @@
5252
53#include <features.h>53#include <features.h>
54#include <sys/types.h>54#include <sys/types.h>
5555#include <sys/stat.h>
56#include <dirent.h>
57#include <stdbool.h>
58
59enum { __I_RING_SIZE = 4 };
60
61/* When ir_empty is true, the ring is empty.
62 Otherwise, ir_data[B..F] are defined, where B..F is the contiguous
63 range of indices, modulo I_RING_SIZE, from back to front, inclusive.
64 Undefined elements of ir_data are always set to ir_default_val.
65 Popping from an empty ring aborts.
66 Pushing onto a full ring returns the displaced value.
67 An empty ring has F==B and ir_empty == true.
68 A ring with one entry still has F==B, but now ir_empty == false. */
69struct __I_ring
70{
71 int ir_data[__I_RING_SIZE];
72 int ir_default_val;
73 unsigned int ir_front;
74 unsigned int ir_back;
75 bool ir_empty;
76};
77typedef struct __I_ring __I_ring;
5678
57typedef struct {79typedef struct {
58 struct _ftsent *fts_cur; /* current node */80 struct _ftsent *fts_cur; /* current node */
...@@ -73,11 +95,106 @@ typedef struct {...@@ -73,11 +95,106 @@ typedef struct {
73#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */95#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */
74#define FTS_XDEV 0x0040 /* don't cross devices */96#define FTS_XDEV 0x0040 /* don't cross devices */
75#define FTS_WHITEOUT 0x0080 /* return whiteout information */97#define FTS_WHITEOUT 0x0080 /* return whiteout information */
76#define FTS_OPTIONMASK 0x00ff /* valid user option mask */98
99 /* There are two ways to detect cycles.
100 The lazy way (which works only with FTS_PHYSICAL),
101 with which one may process a directory that is a
102 part of the cycle several times before detecting the cycle.
103 The "tight" way, whereby fts uses more memory (proportional
104 to number of "active" directories, aka distance from root
105 of current tree to current directory -- see active_dir_ht)
106 to detect any cycle right away. For example, du must use
107 this option to avoid counting disk space in a cycle multiple
108 times, but chown -R need not.
109 The default is to use the constant-memory lazy way, when possible
110 (see below).
111
112 However, with FTS_LOGICAL (when following symlinks, e.g., chown -L)
113 using lazy cycle detection is inadequate. For example, traversing
114 a directory containing a symbolic link to a peer directory, it is
115 possible to encounter the same directory twice even though there
116 is no cycle:
117 dir
118 ...
119 slink -> dir
120 So, when FTS_LOGICAL is selected, we have to use a different
121 mode of cycle detection: FTS_TIGHT_CYCLE_CHECK. */
122#define FTS_TIGHT_CYCLE_CHECK 0x0400
123
124 /* Use this flag to enable semantics with which the parent
125 application may be made both more efficient and more robust.
126 Whereas the default is to visit each directory in a recursive
127 traversal (via chdir), using this flag makes it so the initial
128 working directory is never changed. Instead, these functions
129 perform the traversal via a virtual working directory, maintained
130 through the file descriptor member, fts_cwd_fd. */
131# define FTS_CWDFD 0x0800
132
133 /* Historically, for each directory that fts initially encounters, it would
134 open it, read all entries, and stat each entry, storing the results, and
135 then it would process the first entry. But that behavior is bad for
136 locality of reference, and also causes trouble with inode-simulating
137 file systems like FAT, CIFS, FUSE-based ones, etc., when entries from
138 their name/inode cache are flushed too early.
139 Use this flag to make fts_open and fts_read defer the stat/lstat/fststat
140 of each entry until it is actually processed. However, note that if you
141 use this option and also specify a comparison function, that function may
142 not examine any data via fts_statp. However, when fts_statp->st_mode is
143 nonzero, the S_IFMT type bits are valid, with mapped dirent.d_type data.
144 Of course, that happens only on file systems that provide useful
145 dirent.d_type data. */
146#define FTS_DEFER_STAT 0x1000
147
148 /* Use this flag to disable stripping of trailing slashes
149 from input path names during fts_open initialization. */
150#define FTS_VERBATIM 0x2000
151
152#define FTS_MOUNT 0x4000 /* skip other devices */
153#define FTS_OPTIONMASK 0x7fff /* valid user option mask */
77154
78#define FTS_NAMEONLY 0x0100 /* (private) child names only */155#define FTS_NAMEONLY 0x0100 /* (private) child names only */
79#define FTS_STOP 0x0200 /* (private) unrecoverable error */156#define FTS_STOP 0x0200 /* (private) unrecoverable error */
157
80 int fts_options; /* fts_open options, global flags */158 int fts_options; /* fts_open options, global flags */
159
160 int fts_cwd_fd; /* the file descriptor on which the
161 virtual cwd is open, or AT_FDCWD */
162
163 /* Map a directory's device number to a boolean. The boolean is
164 true if for that file system (type determined by a single fstatfs
165 call per FS) st_nlink can be used to calculate the number of
166 sub-directory entries in a directory.
167 Using this table is an optimization that permits us to look up
168 file system type on a per-inode basis at the minimal cost of
169 calling fstatfs only once per traversed device. */
170 struct hash_table *fts_leaf_optimization_works_ht;
171
172 union {
173 /* This data structure is used if FTS_TIGHT_CYCLE_CHECK is
174 specified. It records the directories between a starting
175 point and the current directory. I.e., a directory is
176 recorded here IFF we have visited it once, but we have not
177 yet completed processing of all its entries. Every time we
178 visit a new directory, we add that directory to this set.
179 When we finish with a directory (usually by visiting it a
180 second time), we remove it from this set. Each entry in
181 this data structure is a device/inode pair. This data
182 structure is used to detect directory cycles efficiently and
183 promptly even when the depth of a hierarchy is in the tens
184 of thousands. */
185 struct hash_table *ht;
186
187 /* FIXME: rename these two members to have the fts_ prefix */
188 /* This data structure uses a lazy cycle-detection algorithm,
189 as done by rm via cycle-check.c. It's the default,
190 but it's not appropriate for programs like du. */
191 struct cycle_check_state *state;
192 } fts_cycle;
193
194 /* A stack of the file descriptors corresponding to the
195 most-recently traversed parent directories.
196 Currently used only in FTS_CWDFD mode. */
197 __I_ring fts_fd_ring;
81} FTS;198} FTS;
82199
83#ifdef __USE_LARGEFILE64200#ifdef __USE_LARGEFILE64
...@@ -92,6 +209,13 @@ typedef struct {...@@ -92,6 +209,13 @@ typedef struct {
92 int fts_nitems; /* elements in the sort array */209 int fts_nitems; /* elements in the sort array */
93 int (*fts_compar) (const void *, const void *); /* compare fn */210 int (*fts_compar) (const void *, const void *); /* compare fn */
94 int fts_options; /* fts_open options, global flags */211 int fts_options; /* fts_open options, global flags */
212 int fts_cwd_fd;
213 struct hash_table *fts_leaf_optimization_works_ht;
214 union {
215 struct hash_table *ht;
216 struct cycle_check_state *state;
217 } fts_cycle;
218 __I_ring fts_fd_ring;
95} FTS64;219} FTS64;
96#endif220#endif
97221
lib/libc/include/generic-glibc/gnu/lib-names-32.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/generic-glibc/gnu/lib-names-hard.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h+1
...@@ -23,4 +23,5 @@...@@ -23,4 +23,5 @@
23#define LIBRESOLV_SO "libresolv.so.2"23#define LIBRESOLV_SO "libresolv.so.2"
24#define LIBRT_SO "librt.so.1"24#define LIBRT_SO "librt.so.1"
25#define LIBTHREAD_DB_SO "libthread_db.so.1"25#define LIBTHREAD_DB_SO "libthread_db.so.1"
26#define LIBUNWIND_SO "libunwind.so.1"
26#define LIBUTIL_SO "libutil.so.1"27#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h+1
...@@ -23,4 +23,5 @@...@@ -23,4 +23,5 @@
23#define LIBRESOLV_SO "libresolv.so.2"23#define LIBRESOLV_SO "libresolv.so.2"
24#define LIBRT_SO "librt.so.1"24#define LIBRT_SO "librt.so.1"
25#define LIBTHREAD_DB_SO "libthread_db.so.1"25#define LIBTHREAD_DB_SO "libthread_db.so.1"
26#define LIBUNWIND_SO "libunwind.so.1"
26#define LIBUTIL_SO "libutil.so.1"27#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h+1
...@@ -23,4 +23,5 @@...@@ -23,4 +23,5 @@
23#define LIBRESOLV_SO "libresolv.so.2"23#define LIBRESOLV_SO "libresolv.so.2"
24#define LIBRT_SO "librt.so.1"24#define LIBRT_SO "librt.so.1"
25#define LIBTHREAD_DB_SO "libthread_db.so.1"25#define LIBTHREAD_DB_SO "libthread_db.so.1"
26#define LIBUNWIND_SO "libunwind.so.1"
26#define LIBUTIL_SO "libutil.so.1"27#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/generic-glibc/gnu/lib-names-o32_soft.h+1
...@@ -23,4 +23,5 @@...@@ -23,4 +23,5 @@
23#define LIBRESOLV_SO "libresolv.so.2"23#define LIBRESOLV_SO "libresolv.so.2"
24#define LIBRT_SO "librt.so.1"24#define LIBRT_SO "librt.so.1"
25#define LIBTHREAD_DB_SO "libthread_db.so.1"25#define LIBTHREAD_DB_SO "libthread_db.so.1"
26#define LIBUNWIND_SO "libunwind.so.1"
26#define LIBUTIL_SO "libutil.so.1"27#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/generic-glibc/gnu/lib-names-soft.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/generic-glibc/gnu/stubs-64.h deleted-16
...@@ -1,16 +0,0 @@
1/* This file is automatically generated.
2 It defines a symbol `__stub_FUNCTION' for each function
3 in the C library which is a stub, meaning it will fail
4 every time called, usually setting errno to ENOSYS. */
5
6#ifdef _LIBC
7 #error Applications may not define the macro _LIBC
8#endif
9
10#define __stub_chflags
11#define __stub_fchflags
12#define __stub_gtty
13#define __stub_revoke
14#define __stub_setlogin
15#define __stub_sigreturn
16#define __stub_stty
\ No newline at end of file
lib/libc/include/generic-glibc/netinet/in.h+2
...@@ -91,6 +91,8 @@ enum...@@ -91,6 +91,8 @@ enum
91#define IPPROTO_MPLS IPPROTO_MPLS91#define IPPROTO_MPLS IPPROTO_MPLS
92 IPPROTO_ETHERNET = 143, /* Ethernet-within-IPv6 Encapsulation. */92 IPPROTO_ETHERNET = 143, /* Ethernet-within-IPv6 Encapsulation. */
93#define IPPROTO_ETHERNET IPPROTO_ETHERNET93#define IPPROTO_ETHERNET IPPROTO_ETHERNET
94 IPPROTO_AGGFRAG = 144, /* AGGFRAG in ESP (RFC 9347). */
95#define IPPROTO_AGGFRAG IPPROTO_AGGFRAG
94 IPPROTO_RAW = 255, /* Raw IP packets. */96 IPPROTO_RAW = 255, /* Raw IP packets. */
95#define IPPROTO_RAW IPPROTO_RAW97#define IPPROTO_RAW IPPROTO_RAW
96 IPPROTO_SMC = 256, /* Shared Memory Communications. */98 IPPROTO_SMC = 256, /* Shared Memory Communications. */
lib/libc/include/generic-glibc/netinet/tcp.h+25-2
...@@ -80,6 +80,9 @@...@@ -80,6 +80,9 @@
80 as a cmsg on read. */80 as a cmsg on read. */
81#define TCP_CM_INQ TCP_INQ81#define TCP_CM_INQ TCP_INQ
82#define TCP_TX_DELAY 37 /* Delay outgoing packets by XX usec. */82#define TCP_TX_DELAY 37 /* Delay outgoing packets by XX usec. */
83#define TCP_RTO_MAX_MS 44 /* Max time to retransmit (msec). */
84#define TCP_RTO_MIN_US 45 /* Min time to retransmit (usec). */
85#define TCP_DELACK_MAX_US 46 /* Max delayed ack time (usec). */
8386
84#define TCP_REPAIR_ON 187#define TCP_REPAIR_ON 1
85#define TCP_REPAIR_OFF 088#define TCP_REPAIR_OFF 0
...@@ -226,6 +229,24 @@ enum tcp_ca_state...@@ -226,6 +229,24 @@ enum tcp_ca_state
226 TCP_CA_Loss = 4229 TCP_CA_Loss = 4
227};230};
228231
232/* Values for tcpi_ecn_mode after negotiation. */
233#define TCPI_ECN_MODE_DISABLED 0x0
234#define TCPI_ECN_MODE_RFC3168 0x1
235#define TCPI_ECN_MODE_ACCECN 0x2
236#define TCPI_ECN_MODE_PENDING 0x3
237
238/* Values for tcpi_accecn_opt_seen. */
239#define TCP_ACCECN_OPT_NOT_SEEN 0x0
240#define TCP_ACCECN_OPT_EMPTY_SEEN 0x1
241#define TCP_ACCECN_OPT_COUNTER_SEEN 0x2
242#define TCP_ACCECN_OPT_FAIL_SEEN 0x3
243
244/* Values for tcpi_accecn_fail_mode. */
245#define TCP_ACCECN_ACE_FAIL_SEND 0x1
246#define TCP_ACCECN_ACE_FAIL_RECV 0x2
247#define TCP_ACCECN_OPT_FAIL_SEND 0x4
248#define TCP_ACCECN_OPT_FAIL_RECV 0x8
249
229struct tcp_info250struct tcp_info
230{251{
231 uint8_t tcpi_state;252 uint8_t tcpi_state;
...@@ -319,8 +340,10 @@ struct tcp_info...@@ -319,8 +340,10 @@ struct tcp_info
319 uint32_t tcpi_received_e1_bytes;340 uint32_t tcpi_received_e1_bytes;
320 uint32_t tcpi_received_e0_bytes;341 uint32_t tcpi_received_e0_bytes;
321 uint32_t tcpi_received_ce_bytes;342 uint32_t tcpi_received_ce_bytes;
322 uint16_t tcpi_accecn_fail_mode;343 uint32_t tcpi_ecn_mode:2,
323 uint16_t tcpi_accecn_opt_seen;344 tcpi_accecn_opt_seen:2,
345 tcpi_accecn_fail_mode:4,
346 tcpi_options2:24;
324};347};
325348
326/* Netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */349/* Netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
lib/libc/include/generic-glibc/regex.h+1-1
...@@ -74,7 +74,7 @@ typedef unsigned long int reg_syntax_t;...@@ -74,7 +74,7 @@ typedef unsigned long int reg_syntax_t;
74#ifdef __USE_GNU74#ifdef __USE_GNU
75/* If this bit is not set, then \ inside a bracket expression is literal.75/* If this bit is not set, then \ inside a bracket expression is literal.
76 If set, then such a \ quotes the following character. */76 If set, then such a \ quotes the following character. */
77# define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)77# define RE_BACKSLASH_ESCAPE_IN_LISTS 1ul
7878
79/* If this bit is not set, then + and ? are operators, and \+ and \? are79/* If this bit is not set, then + and ? are operators, and \+ and \? are
80 literals.80 literals.
lib/libc/include/generic-glibc/spawn.h+20
...@@ -200,6 +200,26 @@ extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *...@@ -200,6 +200,26 @@ extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *
200 int __fd, int __newfd)200 int __fd, int __newfd)
201 __THROW __nonnull ((1));201 __THROW __nonnull ((1));
202202
203#ifdef __USE_XOPEN2K24XSI
204
205/* Add an action changing the directory to PATH during spawn. This
206 affects the subsequent file actions.
207 Alias of posix_spawn_file_actions_addchdir_np. */
208extern int __REDIRECT_NTH (posix_spawn_file_actions_addchdir,
209 (posix_spawn_file_actions_t * __restrict __actions,
210 const char *__restrict __path),
211 posix_spawn_file_actions_addchdir_np);
212
213/* Add an action changing the directory to FD during spawn. This
214 affects the subsequent file actions. FD is not duplicated and must
215 be open when the file action is executed.
216 Alias of posix_spawn_file_actions_addfchdir_np. */
217extern int __REDIRECT_NTH (posix_spawn_file_actions_addfchdir,
218 (posix_spawn_file_actions_t *, int __fd),
219 posix_spawn_file_actions_addfchdir_np);
220
221#endif /* __USE_XOPEN2K24XSI */
222
203#ifdef __USE_MISC223#ifdef __USE_MISC
204/* Add an action changing the directory to PATH during spawn. This224/* Add an action changing the directory to PATH during spawn. This
205 affects the subsequent file actions. */225 affects the subsequent file actions. */
lib/libc/include/generic-glibc/stdlib.h+1-1
...@@ -1225,4 +1225,4 @@ extern size_t memalignment (const void *__p);...@@ -1225,4 +1225,4 @@ extern size_t memalignment (const void *__p);
12251225
1226__END_DECLS1226__END_DECLS
12271227
1228#endif /* stdlib.h */1228#endif /* stdlib.h */
\ No newline at end of file
lib/libc/include/generic-glibc/sys/mount.h+18-4
...@@ -21,7 +21,6 @@...@@ -21,7 +21,6 @@
21#ifndef _SYS_MOUNT_H21#ifndef _SYS_MOUNT_H
22#define _SYS_MOUNT_H 122#define _SYS_MOUNT_H 1
2323
24#include <fcntl.h>
25#include <features.h>24#include <features.h>
26#include <stdint.h>25#include <stdint.h>
27#include <stddef.h>26#include <stddef.h>
...@@ -190,6 +189,11 @@ enum...@@ -190,6 +189,11 @@ enum
190189
191/* fsmount flags. */190/* fsmount flags. */
192#define FSMOUNT_CLOEXEC 0x00000001191#define FSMOUNT_CLOEXEC 0x00000001
192// zig patch: check target glibc version
193#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2
194#define FSMOUNT_NAMESPACE 0x00000002 /* Create the mount in a new mount
195 namespace. */
196#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 */
193197
194/* mount attributes used on fsmount. */198/* mount attributes used on fsmount. */
195#define MOUNT_ATTR_RDONLY 0x00000001 /* Mount read-only. */199#define MOUNT_ATTR_RDONLY 0x00000001 /* Mount read-only. */
...@@ -267,10 +271,20 @@ enum fsconfig_command...@@ -267,10 +271,20 @@ enum fsconfig_command
267#define FSOPEN_CLOEXEC 0x00000001271#define FSOPEN_CLOEXEC 0x00000001
268272
269/* open_tree flags. */273/* open_tree flags. */
270#define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */274#ifndef OPEN_TREE_CLONE
271#define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */275# define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */
272276#endif
277#define OPEN_TREE_NAMESPACE (1 << 1) /* Clone the target tree into a new mount
278 namespace */
279#ifndef O_CLOEXEC
280# include <bits/cloexec.h>
281# define O_CLOEXEC __O_CLOEXEC
273#endif282#endif
283#ifndef OPEN_TREE_CLOEXEC
284# define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
285#endif
286
287#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2 */
274288
275__BEGIN_DECLS289__BEGIN_DECLS
276290
lib/libc/include/generic-glibc/sys/pidfd.h+26
...@@ -64,6 +64,15 @@...@@ -64,6 +64,15 @@
64#define PIDFD_INFO_EXIT (1UL << 3)64#define PIDFD_INFO_EXIT (1UL << 3)
65/* Only returned if requested. */65/* Only returned if requested. */
66#define PIDFD_INFO_COREDUMP (1UL << 4)66#define PIDFD_INFO_COREDUMP (1UL << 4)
67// zig patch: check target glibc version
68#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2
69/* Want/got supported mask flags */
70#define PIDFD_INFO_SUPPORTED_MASK (1UL << 5)
71/* Always returned if PIDFD_INFO_COREDUMP is requested. */
72#define PIDFD_INFO_COREDUMP_SIGNAL (1UL << 6)
73/* Always returned if PIDFD_INFO_COREDUMP is requested. */
74#define PIDFD_INFO_COREDUMP_CODE (1UL << 7)
75#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 */
6776
6877
69/* Value for coredump_mask in pidfd_info. Only valid if PIDFD_INFO_COREDUMP78/* Value for coredump_mask in pidfd_info. Only valid if PIDFD_INFO_COREDUMP
...@@ -95,11 +104,28 @@ struct pidfd_info...@@ -95,11 +104,28 @@ struct pidfd_info
95 __uint32_t fsgid;104 __uint32_t fsgid;
96 __int32_t exit_code;105 __int32_t exit_code;
97 __uint32_t coredump_mask;106 __uint32_t coredump_mask;
107// zig patch: check target glibc version
108#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2
109 __uint32_t coredump_signal;
110 __uint32_t coredump_code;
111 __uint32_t coredump_pad;
112 __uint64_t supported_mask;
113#else
98 __uint32_t __spare1;114 __uint32_t __spare1;
115#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 */
99};116};
100117
101/* sizeof first published struct */118/* sizeof first published struct */
102#define PIDFD_INFO_SIZE_VER0 64119#define PIDFD_INFO_SIZE_VER0 64
120// zig patch: check target glibc version
121#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2
122/* sizeof second published struct */
123#define PIDFD_INFO_SIZE_VER1 72
124/* sizeof third published struct */
125#define PIDFD_INFO_SIZE_VER2 80
126/* sizeof fourth published struct */
127#define PIDFD_INFO_SIZE_VER3 88
128#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 */
103129
104#define PIDFD_GET_INFO _IOWR(PIDFS_IOCTL_MAGIC, 11, struct pidfd_info)130#define PIDFD_GET_INFO _IOWR(PIDFS_IOCTL_MAGIC, 11, struct pidfd_info)
105131
lib/libc/include/generic-glibc/sys/platform/ppc.h deleted-146
...@@ -1,146 +0,0 @@
1/* Facilities specific to the PowerPC architecture
2 Copyright (C) 2012-2026 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 _SYS_PLATFORM_PPC_H
20#define _SYS_PLATFORM_PPC_H 1
21
22#include <features.h>
23#include <stdint.h>
24#include <bits/ppc.h>
25
26/* Read the Time Base Register. */
27static __inline__ uint64_t
28__ppc_get_timebase (void)
29{
30#if __GNUC_PREREQ (4, 8)
31 return __builtin_ppc_get_timebase ();
32#else
33# ifdef __powerpc64__
34 uint64_t __tb;
35 /* "volatile" is necessary here, because the user expects this assembly
36 isn't moved after an optimization. */
37 __asm__ volatile ("mfspr %0, 268" : "=r" (__tb));
38 return __tb;
39# else /* not __powerpc64__ */
40 uint32_t __tbu, __tbl, __tmp; \
41 __asm__ volatile ("0:\n\t"
42 "mftbu %0\n\t"
43 "mftbl %1\n\t"
44 "mftbu %2\n\t"
45 "cmpw %0, %2\n\t"
46 "bne- 0b"
47 : "=r" (__tbu), "=r" (__tbl), "=r" (__tmp));
48 return (((uint64_t) __tbu << 32) | __tbl);
49# endif /* not __powerpc64__ */
50#endif
51}
52
53/* The following functions provide hints about the usage of shared processor
54 resources, as defined in ISA 2.06 and newer. */
55
56/* Provides a hint that performance will probably be improved if shared
57 resources dedicated to the executing processor are released for use by other
58 processors. */
59static __inline__ void
60__ppc_yield (void)
61{
62 __asm__ volatile ("or 27,27,27");
63}
64
65/* Provides a hint that performance will probably be improved if shared
66 resources dedicated to the executing processor are released until
67 all outstanding storage accesses to caching-inhibited storage have been
68 completed. */
69static __inline__ void
70__ppc_mdoio (void)
71{
72 __asm__ volatile ("or 29,29,29");
73}
74
75/* Provides a hint that performance will probably be improved if shared
76 resources dedicated to the executing processor are released until all
77 outstanding storage accesses to cacheable storage for which the data is not
78 in the cache have been completed. */
79static __inline__ void
80__ppc_mdoom (void)
81{
82 __asm__ volatile ("or 30,30,30");
83}
84
85
86/* ISA 2.05 and beyond support the Program Priority Register (PPR) to adjust
87 thread priorities based on lock acquisition, wait and release. The ISA
88 defines the use of form 'or Rx,Rx,Rx' as the way to modify the PRI field.
89 The unprivileged priorities are:
90 Rx = 1 (low)
91 Rx = 2 (medium)
92 Rx = 6 (medium-low/normal)
93 The 'or' instruction form is a nop in previous hardware, so it is safe to
94 use unguarded. The default value is 'medium'.
95 */
96
97static __inline__ void
98__ppc_set_ppr_med (void)
99{
100 __asm__ volatile ("or 2,2,2");
101}
102
103static __inline__ void
104__ppc_set_ppr_med_low (void)
105{
106 __asm__ volatile ("or 6,6,6");
107}
108
109static __inline__ void
110__ppc_set_ppr_low (void)
111{
112 __asm__ volatile ("or 1,1,1");
113}
114
115/* Power ISA 2.07 (Book II, Chapter 3) extends the priorities that can be set
116 to the Program Priority Register (PPR). The form 'or Rx,Rx,Rx' is used to
117 modify the PRI field of the PPR, the same way as described above.
118 The new priority levels are:
119 Rx = 31 (very low)
120 Rx = 5 (medium high)
121 Any program can set the priority to very low, low, medium low, and medium,
122 as these are unprivileged.
123 The medium high priority, on the other hand, is privileged, and may only be
124 set during certain time intervals by problem-state programs. If the program
125 priority is medium high when the time interval expires or if an attempt is
126 made to set the priority to medium high when it is not allowed, the PRI
127 field is set to medium.
128 */
129
130#ifdef _ARCH_PWR8
131
132static __inline__ void
133__ppc_set_ppr_very_low (void)
134{
135 __asm__ volatile ("or 31,31,31");
136}
137
138static __inline__ void
139__ppc_set_ppr_med_high (void)
140{
141 __asm__ volatile ("or 5,5,5");
142}
143
144#endif
145
146#endif /* sys/platform/ppc.h */
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/bits/hwcap.h+3-1
...@@ -36,4 +36,6 @@...@@ -36,4 +36,6 @@
36#define HWCAP_LOONGARCH_LBT_ARM (1 << 11)36#define HWCAP_LOONGARCH_LBT_ARM (1 << 11)
37#define HWCAP_LOONGARCH_LBT_MIPS (1 << 12)37#define HWCAP_LOONGARCH_LBT_MIPS (1 << 12)
38#define HWCAP_LOONGARCH_PTW (1 << 13)38#define HWCAP_LOONGARCH_PTW (1 << 13)
39#define HWCAP_LOONGARCH_LSPW (1 << 14)
\ No newline at end of file
39#define HWCAP_LOONGARCH_LSPW (1 << 14)
40#define HWCAP_LOONGARCH_SCQ (1 << 15)
41#define HWCAP_LOONGARCH_LAM_BH (1 << 16)
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/bits/long-double.h deleted-21
...@@ -1,21 +0,0 @@
1/* Properties of long double type. ldbl-128 version.
2 Copyright (C) 2016-2026 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 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/* long double is distinct from double, so there is nothing to
20 define here. */
21#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/bits/struct_stat.h deleted-127
...@@ -1,127 +0,0 @@
1/* Definition for struct stat.
2 Copyright (C) 2020-2026 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#if !defined _SYS_STAT_H && !defined _FCNTL_H
20# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
21#endif
22
23#ifndef _BITS_STRUCT_STAT_H
24#define _BITS_STRUCT_STAT_H 1
25
26#include <bits/endian.h>
27#include <bits/wordsize.h>
28
29#if defined __USE_FILE_OFFSET64
30# define __field64(type, type64, name) type64 name
31#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
32# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
33# error "ino_t and off_t must both be the same type"
34# endif
35# define __field64(type, type64, name) type name
36#elif __BYTE_ORDER == __LITTLE_ENDIAN
37# define __field64(type, type64, name) \
38 type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
39#else
40# define __field64(type, type64, name) \
41 int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
42#endif
43
44struct stat
45 {
46 __dev_t st_dev; /* Device. */
47 __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */
48 __mode_t st_mode; /* File mode. */
49 __nlink_t st_nlink; /* Link count. */
50 __uid_t st_uid; /* User ID of the file's owner. */
51 __gid_t st_gid; /* Group ID of the file's group.*/
52 __dev_t st_rdev; /* Device number, if device. */
53 __dev_t __pad1;
54 __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */
55 __blksize_t st_blksize; /* Optimal block size for I/O. */
56 int __pad2;
57 __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */
58#ifdef __USE_XOPEN2K8
59 /* Nanosecond resolution timestamps are stored in a format
60 equivalent to 'struct timespec'. This is the type used
61 whenever possible but the Unix namespace rules do not allow the
62 identifier 'timespec' to appear in the <sys/stat.h> header.
63 Therefore we have to handle the use of this header in strictly
64 standard-compliant sources special. */
65 struct timespec st_atim; /* Time of last access. */
66 struct timespec st_mtim; /* Time of last modification. */
67 struct timespec st_ctim; /* Time of last status change. */
68# define st_atime st_atim.tv_sec /* Backward compatibility. */
69# define st_mtime st_mtim.tv_sec
70# define st_ctime st_ctim.tv_sec
71#else
72 __time_t st_atime; /* Time of last access. */
73 unsigned long int st_atimensec; /* Nscecs of last access. */
74 __time_t st_mtime; /* Time of last modification. */
75 unsigned long int st_mtimensec; /* Nsecs of last modification. */
76 __time_t st_ctime; /* Time of last status change. */
77 unsigned long int st_ctimensec; /* Nsecs of last status change. */
78#endif
79 int __glibc_reserved[2];
80 };
81
82#undef __field64
83
84#ifdef __USE_LARGEFILE64
85struct stat64
86 {
87 __dev_t st_dev; /* Device. */
88 __ino64_t st_ino; /* File serial number. */
89 __mode_t st_mode; /* File mode. */
90 __nlink_t st_nlink; /* Link count. */
91 __uid_t st_uid; /* User ID of the file's owner. */
92 __gid_t st_gid; /* Group ID of the file's group.*/
93 __dev_t st_rdev; /* Device number, if device. */
94 __dev_t __pad1;
95 __off64_t st_size; /* Size of file, in bytes. */
96 __blksize_t st_blksize; /* Optimal block size for I/O. */
97 int __pad2;
98 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
99#ifdef __USE_XOPEN2K8
100 /* Nanosecond resolution timestamps are stored in a format
101 equivalent to 'struct timespec'. This is the type used
102 whenever possible but the Unix namespace rules do not allow the
103 identifier 'timespec' to appear in the <sys/stat.h> header.
104 Therefore we have to handle the use of this header in strictly
105 standard-compliant sources special. */
106 struct timespec st_atim; /* Time of last access. */
107 struct timespec st_mtim; /* Time of last modification. */
108 struct timespec st_ctim; /* Time of last status change. */
109#else
110 __time_t st_atime; /* Time of last access. */
111 unsigned long int st_atimensec; /* Nscecs of last access. */
112 __time_t st_mtime; /* Time of last modification. */
113 unsigned long int st_mtimensec; /* Nsecs of last modification. */
114 __time_t st_ctime; /* Time of last status change. */
115 unsigned long int st_ctimensec; /* Nsecs of last status change. */
116#endif
117 int __glibc_reserved[2];
118 };
119#endif
120
121/* Tell code we have these members. */
122#define _STATBUF_ST_BLKSIZE
123#define _STATBUF_ST_RDEV
124/* Nanosecond resolution time values are supported. */
125#define _STATBUF_ST_NSEC
126
127#endif /* _BITS_STRUCT_STAT_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/bits/timesize.h deleted-20
...@@ -1,20 +0,0 @@
1/* Bit size of the time_t type at glibc build time, general case.
2 Copyright (C) 2018-2026 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/* Size in bits of the 'time_t' type of the default ABI. */
20#define __TIMESIZE 64
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/bits/wordsize.h+13-2
...@@ -15,5 +15,16 @@...@@ -15,5 +15,16 @@
15 License along with the GNU C Library; if not, see15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */16 <https://www.gnu.org/licenses/>. */
1717
18#define __WORDSIZE 64
19#define __WORDSIZE_TIME64_COMPAT32 0
\ No newline at end of file
18// zig patch: handle 32-bit and 64-bit in the same header
19#if __loongarch_grlen == (__SIZEOF_POINTER__ * 8)
20# define __WORDSIZE __loongarch_grlen
21#else
22# error unsupported ABI
23#endif
24
25#define __WORDSIZE_TIME64_COMPAT32 0
26
27#if __WORDSIZE == 32
28# define __WORDSIZE32_SIZE_ULONG 0
29# define __WORDSIZE32_PTRDIFF_LONG 0
30#endif
lib/libc/include/loongarch-linux-gnu/fpu_control.h+9
...@@ -94,6 +94,15 @@ extern void __loongarch_fpu_setcw (fpu_control_t) __THROW;...@@ -94,6 +94,15 @@ extern void __loongarch_fpu_setcw (fpu_control_t) __THROW;
94#define _FPU_GETCW(cw) __asm__ volatile ("movfcsr2gr %0,$fcsr0" : "=r"(cw))94#define _FPU_GETCW(cw) __asm__ volatile ("movfcsr2gr %0,$fcsr0" : "=r"(cw))
95#define _FPU_SETCW(cw) __asm__ volatile ("movgr2fcsr $fcsr0,%0" : : "r"(cw))95#define _FPU_SETCW(cw) __asm__ volatile ("movgr2fcsr $fcsr0,%0" : : "r"(cw))
9696
97#define _FPU_GET_ENABLES(cw) __asm__ volatile ("movfcsr2gr %0,$fcsr1" : "=r"(cw))
98#define _FPU_SET_ENABLES(cw) __asm__ volatile ("movgr2fcsr $fcsr1,%0" : : "r"(cw))
99
100#define _FPU_GET_FLAGS_CAUSE(cw) __asm__ volatile ("movfcsr2gr %0,$fcsr2" : "=r"(cw))
101#define _FPU_SET_FLAGS_CAUSE(cw) __asm__ volatile ("movgr2fcsr $fcsr2,%0" : : "r"(cw))
102
103#define _FPU_GET_RM(cw) __asm__ volatile ("movfcsr2gr %0,$fcsr3" : "=r"(cw))
104#define _FPU_SET_RM(cw) __asm__ volatile ("movgr2fcsr $fcsr3,%0" : : "r"(cw))
105
97/* Default control word set at startup. */106/* Default control word set at startup. */
98extern fpu_control_t __fpu_control;107extern fpu_control_t __fpu_control;
99108
lib/libc/include/loongarch-linux-gnu/gnu/lib-names-ilp32d.h created+28
...@@ -0,0 +1,28 @@
1/* This file is automatically generated. */
2#ifndef __GNU_LIB_NAMES_H
3# error "Never use <gnu/lib-names-ilp32d.h> directly; include <gnu/lib-names.h> instead."
4#endif
5
6#define LD_LINUX_LOONGARCH_ILP32D_SO "ld-linux-loongarch-ilp32d.so.1"
7#define LD_SO "ld-linux-loongarch-ilp32d.so.1"
8#define LIBANL_SO "libanl.so.1"
9#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
10#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
11#define LIBC_SO "libc.so.6"
12#define LIBDL_SO "libdl.so.2"
13#define LIBGCC_S_SO "libgcc_s.so.1"
14#define LIBMVEC_SO "libmvec.so.1"
15#define LIBM_SO "libm.so.6"
16#define LIBNSL_SO "libnsl.so.1"
17#define LIBNSS_COMPAT_SO "libnss_compat.so.2"
18#define LIBNSS_DB_SO "libnss_db.so.2"
19#define LIBNSS_DNS_SO "libnss_dns.so.2"
20#define LIBNSS_FILES_SO "libnss_files.so.2"
21#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2"
22#define LIBNSS_LDAP_SO "libnss_ldap.so.2"
23#define LIBPTHREAD_SO "libpthread.so.0"
24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/gnu/lib-names-ilp32s.h created+28
...@@ -0,0 +1,28 @@
1/* This file is automatically generated. */
2#ifndef __GNU_LIB_NAMES_H
3# error "Never use <gnu/lib-names-ilp32s.h> directly; include <gnu/lib-names.h> instead."
4#endif
5
6#define LD_LINUX_LOONGARCH_ILP32S_SO "ld-linux-loongarch-ilp32s.so.1"
7#define LD_SO "ld-linux-loongarch-ilp32s.so.1"
8#define LIBANL_SO "libanl.so.1"
9#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
10#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
11#define LIBC_SO "libc.so.6"
12#define LIBDL_SO "libdl.so.2"
13#define LIBGCC_S_SO "libgcc_s.so.1"
14#define LIBMVEC_SO "libmvec.so.1"
15#define LIBM_SO "libm.so.6"
16#define LIBNSL_SO "libnsl.so.1"
17#define LIBNSS_COMPAT_SO "libnss_compat.so.2"
18#define LIBNSS_DB_SO "libnss_db.so.2"
19#define LIBNSS_DNS_SO "libnss_dns.so.2"
20#define LIBNSS_FILES_SO "libnss_files.so.2"
21#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2"
22#define LIBNSS_LDAP_SO "libnss_ldap.so.2"
23#define LIBPTHREAD_SO "libpthread.so.0"
24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/gnu/lib-names-lp64d.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/gnu/lib-names-lp64s.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/gnu/lib-names.h+6
...@@ -6,6 +6,12 @@...@@ -6,6 +6,12 @@
66
7#include <bits/wordsize.h>7#include <bits/wordsize.h>
88
9#if __WORDSIZE == 32 && defined __loongarch_soft_float
10# include <gnu/lib-names-ilp32s.h>
11#endif
12#if __WORDSIZE == 32 && defined __loongarch_double_float
13# include <gnu/lib-names-ilp32d.h>
14#endif
9#if __WORDSIZE == 64 && defined __loongarch_soft_float15#if __WORDSIZE == 64 && defined __loongarch_soft_float
10# include <gnu/lib-names-lp64s.h>16# include <gnu/lib-names-lp64s.h>
11#endif17#endif
lib/libc/include/loongarch-linux-gnu/gnu/stubs-ilp32d.h created+21
...@@ -0,0 +1,21 @@
1/* This file is automatically generated.
2 It defines a symbol `__stub_FUNCTION' for each function
3 in the C library which is a stub, meaning it will fail
4 every time called, usually setting errno to ENOSYS. */
5
6#ifdef _LIBC
7 #error Applications may not define the macro _LIBC
8#endif
9
10#define __stub___compat_bdflush
11#define __stub___compat_create_module
12#define __stub___compat_get_kernel_syms
13#define __stub___compat_query_module
14#define __stub___compat_uselib
15#define __stub_chflags
16#define __stub_fchflags
17#define __stub_gtty
18#define __stub_revoke
19#define __stub_setlogin
20#define __stub_sigreturn
21#define __stub_stty
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/gnu/stubs-ilp32s.h created+38
...@@ -0,0 +1,38 @@
1/* This file is automatically generated.
2 It defines a symbol `__stub_FUNCTION' for each function
3 in the C library which is a stub, meaning it will fail
4 every time called, usually setting errno to ENOSYS. */
5
6#ifdef _LIBC
7 #error Applications may not define the macro _LIBC
8#endif
9
10#define __stub___compat_bdflush
11#define __stub___compat_create_module
12#define __stub___compat_get_kernel_syms
13#define __stub___compat_query_module
14#define __stub___compat_uselib
15#define __stub_chflags
16#define __stub_fchflags
17#define __stub_feclearexcept
18#define __stub_fedisableexcept
19#define __stub_feenableexcept
20#define __stub_fegetenv
21#define __stub_fegetexcept
22#define __stub_fegetexceptflag
23#define __stub_fegetmode
24#define __stub_fegetround
25#define __stub_feholdexcept
26#define __stub_feraiseexcept
27#define __stub_fesetenv
28#define __stub_fesetexcept
29#define __stub_fesetexceptflag
30#define __stub_fesetmode
31#define __stub_fesetround
32#define __stub_fetestexcept
33#define __stub_feupdateenv
34#define __stub_gtty
35#define __stub_revoke
36#define __stub_setlogin
37#define __stub_sigreturn
38#define __stub_stty
\ No newline at end of file
lib/libc/include/loongarch-linux-gnu/gnu/stubs.h+6
...@@ -4,6 +4,12 @@...@@ -4,6 +4,12 @@
44
5#include <bits/wordsize.h>5#include <bits/wordsize.h>
66
7#if __WORDSIZE == 32 && defined __loongarch_soft_float
8# include <gnu/stubs-ilp32s.h>
9#endif
10#if __WORDSIZE == 32 && defined __loongarch_double_float
11# include <gnu/stubs-ilp32d.h>
12#endif
7#if __WORDSIZE == 64 && defined __loongarch_soft_float13#if __WORDSIZE == 64 && defined __loongarch_soft_float
8# include <gnu/stubs-lp64s.h>14# include <gnu/stubs-lp64s.h>
9#endif15#endif
lib/libc/include/loongarch-linux-gnu/sys/asm.h+32-6
...@@ -23,10 +23,8 @@...@@ -23,10 +23,8 @@
23#include <sysdeps/generic/sysdep.h>23#include <sysdeps/generic/sysdep.h>
2424
25/* Macros to handle different pointer/register sizes for 32/64-bit code. */25/* Macros to handle different pointer/register sizes for 32/64-bit code. */
26#if __loongarch_grlen == 64
26#define SZREG 827#define SZREG 8
27#define SZFREG 8
28#define SZVREG 16
29#define SZXREG 32
30#define REG_L ld.d28#define REG_L ld.d
31#define REG_S st.d29#define REG_S st.d
32#define SRLI srli.d30#define SRLI srli.d
...@@ -34,10 +32,38 @@...@@ -34,10 +32,38 @@
34#define ADDI addi.d32#define ADDI addi.d
35#define ADD add.d33#define ADD add.d
36#define SUB sub.d34#define SUB sub.d
37#define BSTRINS bstrins.d
38#define LI li.d35#define LI li.d
39#define FREG_L fld.d36#define BSTRINS bstrins.d
40#define FREG_S fst.d37
38#elif __loongarch_grlen == 32
39
40#define SZREG 4
41#define REG_L ld.w
42#define REG_S st.w
43#define SRLI srli.w
44#define SLLI slli.w
45#define ADDI addi.w
46#define ADD add.w
47#define SUB sub.w
48#define LI li.w
49#define BSTRINS bstrins.w
50
51#else
52#error __loongarch_grlen must equal 32 or 64
53#endif
54
55#if __loongarch_frlen == 64
56 #define SZFREG 8
57 #define FREG_L fld.d
58 #define FREG_S fst.d
59#elif __loongarch_frlen == 32
60 #define SZFREG 4
61 #define FREG_L fld.s
62 #define FREG_S fst.s
63#endif
64
65#define SZVREG 16
66#define SZXREG 32
4167
42/* Declare leaf routine.68/* Declare leaf routine.
43 The usage of macro LEAF/ENTRY is as follows:69 The usage of macro LEAF/ENTRY is as follows:
lib/libc/include/m68k-linux-gnu/gnu/lib-names.h+1
...@@ -24,6 +24,7 @@...@@ -24,6 +24,7 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
2829
29#endif /* gnu/lib-names.h */30#endif /* gnu/lib-names.h */
\ No newline at end of file
lib/libc/include/mips-linux-gnu/bits/long-double.h created+24
...@@ -0,0 +1,24 @@
1/* Properties of long double type. MIPS version.
2 Copyright (C) 2016-2026 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 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#include <sgidefs.h>
20
21#if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
22# define __NO_LONG_DOUBLE_MATH 1
23#endif
24#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0
\ No newline at end of file
lib/libc/include/mips-linux-gnu/bits/struct_stat.h created+237
...@@ -0,0 +1,237 @@
1/* Definition for struct stat.
2 Copyright (C) 2020-2026 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#if !defined _SYS_STAT_H && !defined _FCNTL_H
20# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
21#endif
22
23#ifndef _BITS_STRUCT_STAT_H
24#define _BITS_STRUCT_STAT_H 1
25
26#include <sgidefs.h>
27
28#if _MIPS_SIM == _ABIO32
29/* Structure describing file characteristics. */
30struct stat
31 {
32# ifdef __USE_TIME64_REDIRECTS
33# include <bits/struct_stat_time64_helper.h>
34# else
35 unsigned long int st_dev;
36 long int st_pad1[3];
37# ifndef __USE_FILE_OFFSET64
38 __ino_t st_ino; /* File serial number. */
39# else
40 __ino64_t st_ino; /* File serial number. */
41# endif
42 __mode_t st_mode; /* File mode. */
43 __nlink_t st_nlink; /* Link count. */
44 __uid_t st_uid; /* User ID of the file's owner. */
45 __gid_t st_gid; /* Group ID of the file's group.*/
46 unsigned long int st_rdev; /* Device number, if device. */
47# ifndef __USE_FILE_OFFSET64
48 long int st_pad2[2];
49 __off_t st_size; /* Size of file, in bytes. */
50 /* SVR4 added this extra long to allow for expansion of off_t. */
51 long int st_pad3;
52# else
53 long int st_pad2[3];
54 __off64_t st_size; /* Size of file, in bytes. */
55# endif
56# ifdef __USE_XOPEN2K8
57 /* Nanosecond resolution timestamps are stored in a format
58 equivalent to 'struct timespec'. This is the type used
59 whenever possible but the Unix namespace rules do not allow the
60 identifier 'timespec' to appear in the <sys/stat.h> header.
61 Therefore we have to handle the use of this header in strictly
62 standard-compliant sources special. */
63 struct timespec st_atim; /* Time of last access. */
64 struct timespec st_mtim; /* Time of last modification. */
65 struct timespec st_ctim; /* Time of last status change. */
66# define st_atime st_atim.tv_sec /* Backward compatibility. */
67# define st_mtime st_mtim.tv_sec
68# define st_ctime st_ctim.tv_sec
69# else
70 __time_t st_atime; /* Time of last access. */
71 unsigned long int st_atimensec; /* Nscecs of last access. */
72 __time_t st_mtime; /* Time of last modification. */
73 unsigned long int st_mtimensec; /* Nsecs of last modification. */
74 __time_t st_ctime; /* Time of last status change. */
75 unsigned long int st_ctimensec; /* Nsecs of last status change. */
76# endif
77 __blksize_t st_blksize; /* Optimal block size for I/O. */
78# ifndef __USE_FILE_OFFSET64
79 __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
80# else
81 long int st_pad4;
82 __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
83# endif
84 long int st_pad5[14];
85# endif /* __USE_TIME64_REDIRECTS */
86 };
87
88# ifdef __USE_LARGEFILE64
89struct stat64
90 {
91# ifdef __USE_TIME64_REDIRECTS
92# include <bits/struct_stat_time64_helper.h>
93# else
94 unsigned long int st_dev;
95 long int st_pad1[3];
96 __ino64_t st_ino; /* File serial number. */
97 __mode_t st_mode; /* File mode. */
98 __nlink_t st_nlink; /* Link count. */
99 __uid_t st_uid; /* User ID of the file's owner. */
100 __gid_t st_gid; /* Group ID of the file's group.*/
101 unsigned long int st_rdev; /* Device number, if device. */
102 long int st_pad2[3];
103 __off64_t st_size; /* Size of file, in bytes. */
104# ifdef __USE_XOPEN2K8
105 /* Nanosecond resolution timestamps are stored in a format
106 equivalent to 'struct timespec'. This is the type used
107 whenever possible but the Unix namespace rules do not allow the
108 identifier 'timespec' to appear in the <sys/stat.h> header.
109 Therefore we have to handle the use of this header in strictly
110 standard-compliant sources special. */
111 struct timespec st_atim; /* Time of last access. */
112 struct timespec st_mtim; /* Time of last modification. */
113 struct timespec st_ctim; /* Time of last status change. */
114# else
115 __time_t st_atime; /* Time of last access. */
116 unsigned long int st_atimensec; /* Nscecs of last access. */
117 __time_t st_mtime; /* Time of last modification. */
118 unsigned long int st_mtimensec; /* Nsecs of last modification. */
119 __time_t st_ctime; /* Time of last status change. */
120 unsigned long int st_ctimensec; /* Nsecs of last status change. */
121# endif
122 __blksize_t st_blksize; /* Optimal block size for I/O. */
123 long int st_pad3;
124 __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
125 long int st_pad4[14];
126# endif /* __USE_TIME64_REDIRECTS */
127 };
128# endif /* __USE_LARGEFILE64 */
129
130#else /* _MIPS_SIM != _ABIO32 */
131
132struct stat
133 {
134# ifdef __USE_TIME64_REDIRECTS
135# include <bits/struct_stat_time64_helper.h>
136# else
137 __dev_t st_dev;
138 int st_pad1[3]; /* Reserved for st_dev expansion */
139# ifndef __USE_FILE_OFFSET64
140 __ino_t st_ino;
141# else
142 __ino64_t st_ino;
143# endif
144 __mode_t st_mode;
145 __nlink_t st_nlink;
146 __uid_t st_uid;
147 __gid_t st_gid;
148 __dev_t st_rdev;
149# if !defined __USE_FILE_OFFSET64
150 unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */
151 __off_t st_size;
152 int st_pad3;
153# else
154 unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */
155 __off64_t st_size;
156# endif
157# ifdef __USE_XOPEN2K8
158 /* Nanosecond resolution timestamps are stored in a format
159 equivalent to 'struct timespec'. This is the type used
160 whenever possible but the Unix namespace rules do not allow the
161 identifier 'timespec' to appear in the <sys/stat.h> header.
162 Therefore we have to handle the use of this header in strictly
163 standard-compliant sources special. */
164 struct timespec st_atim; /* Time of last access. */
165 struct timespec st_mtim; /* Time of last modification. */
166 struct timespec st_ctim; /* Time of last status change. */
167# define st_atime st_atim.tv_sec /* Backward compatibility. */
168# define st_mtime st_mtim.tv_sec
169# define st_ctime st_ctim.tv_sec
170# else
171 __time_t st_atime; /* Time of last access. */
172 unsigned long int st_atimensec; /* Nscecs of last access. */
173 __time_t st_mtime; /* Time of last modification. */
174 unsigned long int st_mtimensec; /* Nsecs of last modification. */
175 __time_t st_ctime; /* Time of last status change. */
176 unsigned long int st_ctimensec; /* Nsecs of last status change. */
177# endif
178 __blksize_t st_blksize;
179 unsigned int st_pad4;
180# ifndef __USE_FILE_OFFSET64
181 __blkcnt_t st_blocks;
182# else
183 __blkcnt64_t st_blocks;
184# endif
185 int st_pad5[14];
186# endif
187 };
188
189#ifdef __USE_LARGEFILE64
190struct stat64
191 {
192# ifdef __USE_TIME64_REDIRECTS
193# include <bits/struct_stat_time64_helper.h>
194# else
195 __dev_t st_dev;
196 unsigned int st_pad1[3]; /* Reserved for st_dev expansion */
197 __ino64_t st_ino;
198 __mode_t st_mode;
199 __nlink_t st_nlink;
200 __uid_t st_uid;
201 __gid_t st_gid;
202 __dev_t st_rdev;
203 unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */
204 __off64_t st_size;
205# ifdef __USE_XOPEN2K8
206 /* Nanosecond resolution timestamps are stored in a format
207 equivalent to 'struct timespec'. This is the type used
208 whenever possible but the Unix namespace rules do not allow the
209 identifier 'timespec' to appear in the <sys/stat.h> header.
210 Therefore we have to handle the use of this header in strictly
211 standard-compliant sources special. */
212 struct timespec st_atim; /* Time of last access. */
213 struct timespec st_mtim; /* Time of last modification. */
214 struct timespec st_ctim; /* Time of last status change. */
215# else
216 __time_t st_atime; /* Time of last access. */
217 unsigned long int st_atimensec; /* Nscecs of last access. */
218 __time_t st_mtime; /* Time of last modification. */
219 unsigned long int st_mtimensec; /* Nsecs of last modification. */
220 __time_t st_ctime; /* Time of last status change. */
221 unsigned long int st_ctimensec; /* Nsecs of last status change. */
222# endif
223 __blksize_t st_blksize;
224 unsigned int st_pad3;
225 __blkcnt64_t st_blocks;
226 int st_pad4[14];
227# endif /* __USE_TIME64_REDIRECTS */
228};
229#endif
230
231#endif
232
233/* Tell code we have these members. */
234#define _STATBUF_ST_BLKSIZE
235#define _STATBUF_ST_RDEV
236
237#endif /* _BITS_STRUCT_STAT_H */
\ No newline at end of file
lib/libc/include/mips-linux-gnu/bits/timesize.h created+22
...@@ -0,0 +1,22 @@
1/* Bit size of the time_t type at glibc build time, Linux/MIPS.
2 Copyright (C) 2021-2026 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#include <bits/wordsize.h>
20
21/* Size in bits of the 'time_t' type of the default ABI. */
22#define __TIMESIZE __WORDSIZE
\ No newline at end of file
lib/libc/include/mips-linux-gnu/bits/waitstatus.h created+68
...@@ -0,0 +1,68 @@
1/* Definitions of status bits for `wait' et al.
2 MIPS version, based on the generic version (bits/waitstatus.h).
3
4 Copyright (C) 1992-2026 Free Software Foundation, Inc.
5 This file is part of the GNU C Library.
6
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with the GNU C Library; if not, see
19 <https://www.gnu.org/licenses/>. */
20
21#if !defined _SYS_WAIT_H && !defined _STDLIB_H
22# error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
23#endif
24
25
26/* On MIPS SIGRTMAX is 127, so we need to handle the status code 127
27 which is impossible on other ports. */
28
29/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */
30#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8)
31
32/* If WIFSIGNALED(STATUS), the terminating signal. */
33#define __WTERMSIG(status) ((status) & 0x7f)
34
35/* If WIFSTOPPED(STATUS), the signal that stopped the child. */
36#define __WSTOPSIG(status) __WEXITSTATUS(status)
37
38/* Nonzero if STATUS indicates normal termination. */
39#define __WIFEXITED(status) (__WTERMSIG(status) == 0)
40
41/* Nonzero if STATUS indicates termination by a signal. */
42static __inline int
43__WIFSIGNALED (int __status)
44{
45 return ((signed char) ((__status & 0x7f) + 1) >> 1) > 0 || __status == 0x7f;
46}
47
48/* Nonzero if STATUS indicates the child is stopped. */
49static __inline int
50__WIFSTOPPED (int __status)
51{
52 return (__status & 0xff) == 0x7f && __status != 0x7f;
53}
54
55/* Nonzero if STATUS indicates the child continued after a stop. We only
56 define this if <bits/waitflags.h> provides the WCONTINUED flag bit. */
57#ifdef WCONTINUED
58# define __WIFCONTINUED(status) ((status) == __W_CONTINUED)
59#endif
60
61/* Nonzero if STATUS indicates the child dumped core. */
62#define __WCOREDUMP(status) ((status) & __WCOREFLAG)
63
64/* Macros for constructing status values. */
65#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
66#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f)
67#define __W_CONTINUED 0xffff
68#define __WCOREFLAG 0x80
\ No newline at end of file
lib/libc/include/powerpc-linux-gnu/bits/long-double.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/* Properties of long double type. ldbl-opt version.1/* Properties of long double type. ldbl-opt version.
2 Copyright (C) 2016-2026 Free Software Foundation, Inc.2 Copyright (C) 2019-2026 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/include/powerpc-linux-gnu/bits/ppc.h created+33
...@@ -0,0 +1,33 @@
1/* Facilities specific to the PowerPC architecture on Linux
2 Copyright (C) 2012-2026 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 _BITS_PPC_H
20#define _BITS_PPC_H
21
22#ifndef _SYS_PLATFORM_PPC_H
23# error "Never include this file directly; use <sys/platform/ppc.h> instead."
24#endif
25
26__BEGIN_DECLS
27
28/* Read the time base frequency. */
29extern uint64_t __ppc_get_timebase_freq (void);
30
31__END_DECLS
32
33#endif
\ No newline at end of file
lib/libc/include/powerpc-linux-gnu/bits/struct_mutex.h+1-1
...@@ -59,4 +59,4 @@ struct __pthread_mutex_s...@@ -59,4 +59,4 @@ struct __pthread_mutex_s
59 0, 0, 0, __kind, 0, { { 0, 0 } }59 0, 0, 0, __kind, 0, { { 0, 0 } }
60#endif60#endif
6161
62#endif62#endif
\ No newline at end of file
lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h deleted-26
...@@ -1,26 +0,0 @@
1/* This file is automatically generated. */
2#ifndef __GNU_LIB_NAMES_H
3# error "Never use <gnu/lib-names-32.h> directly; include <gnu/lib-names.h> instead."
4#endif
5
6#define LD_SO "ld.so.1"
7#define LIBANL_SO "libanl.so.1"
8#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
9#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
10#define LIBC_SO "libc.so.6"
11#define LIBDL_SO "libdl.so.2"
12#define LIBGCC_S_SO "libgcc_s.so.1"
13#define LIBMVEC_SO "libmvec.so.1"
14#define LIBM_SO "libm.so.6"
15#define LIBNSL_SO "libnsl.so.1"
16#define LIBNSS_COMPAT_SO "libnss_compat.so.2"
17#define LIBNSS_DB_SO "libnss_db.so.2"
18#define LIBNSS_DNS_SO "libnss_dns.so.2"
19#define LIBNSS_FILES_SO "libnss_files.so.2"
20#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2"
21#define LIBNSS_LDAP_SO "libnss_ldap.so.2"
22#define LIBPTHREAD_SO "libpthread.so.0"
23#define LIBRESOLV_SO "libresolv.so.2"
24#define LIBRT_SO "librt.so.1"
25#define LIBTHREAD_DB_SO "libthread_db.so.1"
26#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/powerpc-linux-gnu/gnu/lib-names-64-v1.h deleted-27
...@@ -1,27 +0,0 @@
1/* This file is automatically generated. */
2#ifndef __GNU_LIB_NAMES_H
3# error "Never use <gnu/lib-names-64-v1.h> directly; include <gnu/lib-names.h> instead."
4#endif
5
6#define LD64_SO "ld64.so.1"
7#define LD_SO "ld64.so.1"
8#define LIBANL_SO "libanl.so.1"
9#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
10#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
11#define LIBC_SO "libc.so.6"
12#define LIBDL_SO "libdl.so.2"
13#define LIBGCC_S_SO "libgcc_s.so.1"
14#define LIBMVEC_SO "libmvec.so.1"
15#define LIBM_SO "libm.so.6"
16#define LIBNSL_SO "libnsl.so.1"
17#define LIBNSS_COMPAT_SO "libnss_compat.so.2"
18#define LIBNSS_DB_SO "libnss_db.so.2"
19#define LIBNSS_DNS_SO "libnss_dns.so.2"
20#define LIBNSS_FILES_SO "libnss_files.so.2"
21#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2"
22#define LIBNSS_LDAP_SO "libnss_ldap.so.2"
23#define LIBPTHREAD_SO "libpthread.so.0"
24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/powerpc-linux-gnu/gnu/lib-names-64-v2.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/powerpc-linux-gnu/gnu/stubs-64-v1.h deleted-16
...@@ -1,16 +0,0 @@
1/* This file is automatically generated.
2 It defines a symbol `__stub_FUNCTION' for each function
3 in the C library which is a stub, meaning it will fail
4 every time called, usually setting errno to ENOSYS. */
5
6#ifdef _LIBC
7 #error Applications may not define the macro _LIBC
8#endif
9
10#define __stub_chflags
11#define __stub_fchflags
12#define __stub_gtty
13#define __stub_revoke
14#define __stub_setlogin
15#define __stub_sigreturn
16#define __stub_stty
\ No newline at end of file
lib/libc/include/powerpc-linux-gnu/sys/platform/ppc.h created+146
...@@ -0,0 +1,146 @@
1/* Facilities specific to the PowerPC architecture
2 Copyright (C) 2012-2026 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 _SYS_PLATFORM_PPC_H
20#define _SYS_PLATFORM_PPC_H 1
21
22#include <features.h>
23#include <stdint.h>
24#include <bits/ppc.h>
25
26/* Read the Time Base Register. */
27static __inline__ uint64_t
28__ppc_get_timebase (void)
29{
30#if __GNUC_PREREQ (4, 8)
31 return __builtin_ppc_get_timebase ();
32#else
33# ifdef __powerpc64__
34 uint64_t __tb;
35 /* "volatile" is necessary here, because the user expects this assembly
36 isn't moved after an optimization. */
37 __asm__ volatile ("mfspr %0, 268" : "=r" (__tb));
38 return __tb;
39# else /* not __powerpc64__ */
40 uint32_t __tbu, __tbl, __tmp; \
41 __asm__ volatile ("0:\n\t"
42 "mftbu %0\n\t"
43 "mftbl %1\n\t"
44 "mftbu %2\n\t"
45 "cmpw %0, %2\n\t"
46 "bne- 0b"
47 : "=r" (__tbu), "=r" (__tbl), "=r" (__tmp));
48 return (((uint64_t) __tbu << 32) | __tbl);
49# endif /* not __powerpc64__ */
50#endif
51}
52
53/* The following functions provide hints about the usage of shared processor
54 resources, as defined in ISA 2.06 and newer. */
55
56/* Provides a hint that performance will probably be improved if shared
57 resources dedicated to the executing processor are released for use by other
58 processors. */
59static __inline__ void
60__ppc_yield (void)
61{
62 __asm__ volatile ("or 27,27,27");
63}
64
65/* Provides a hint that performance will probably be improved if shared
66 resources dedicated to the executing processor are released until
67 all outstanding storage accesses to caching-inhibited storage have been
68 completed. */
69static __inline__ void
70__ppc_mdoio (void)
71{
72 __asm__ volatile ("or 29,29,29");
73}
74
75/* Provides a hint that performance will probably be improved if shared
76 resources dedicated to the executing processor are released until all
77 outstanding storage accesses to cacheable storage for which the data is not
78 in the cache have been completed. */
79static __inline__ void
80__ppc_mdoom (void)
81{
82 __asm__ volatile ("or 30,30,30");
83}
84
85
86/* ISA 2.05 and beyond support the Program Priority Register (PPR) to adjust
87 thread priorities based on lock acquisition, wait and release. The ISA
88 defines the use of form 'or Rx,Rx,Rx' as the way to modify the PRI field.
89 The unprivileged priorities are:
90 Rx = 1 (low)
91 Rx = 2 (medium)
92 Rx = 6 (medium-low/normal)
93 The 'or' instruction form is a nop in previous hardware, so it is safe to
94 use unguarded. The default value is 'medium'.
95 */
96
97static __inline__ void
98__ppc_set_ppr_med (void)
99{
100 __asm__ volatile ("or 2,2,2");
101}
102
103static __inline__ void
104__ppc_set_ppr_med_low (void)
105{
106 __asm__ volatile ("or 6,6,6");
107}
108
109static __inline__ void
110__ppc_set_ppr_low (void)
111{
112 __asm__ volatile ("or 1,1,1");
113}
114
115/* Power ISA 2.07 (Book II, Chapter 3) extends the priorities that can be set
116 to the Program Priority Register (PPR). The form 'or Rx,Rx,Rx' is used to
117 modify the PRI field of the PPR, the same way as described above.
118 The new priority levels are:
119 Rx = 31 (very low)
120 Rx = 5 (medium high)
121 Any program can set the priority to very low, low, medium low, and medium,
122 as these are unprivileged.
123 The medium high priority, on the other hand, is privileged, and may only be
124 set during certain time intervals by problem-state programs. If the program
125 priority is medium high when the time interval expires or if an attempt is
126 made to set the priority to medium high when it is not allowed, the PRI
127 field is set to medium.
128 */
129
130#ifdef _ARCH_PWR8
131
132static __inline__ void
133__ppc_set_ppr_very_low (void)
134{
135 __asm__ volatile ("or 31,31,31");
136}
137
138static __inline__ void
139__ppc_set_ppr_med_high (void)
140{
141 __asm__ volatile ("or 5,5,5");
142}
143
144#endif
145
146#endif /* sys/platform/ppc.h */
\ No newline at end of file
lib/libc/include/riscv-linux-gnu/bits/long-double.h deleted-21
...@@ -1,21 +0,0 @@
1/* Properties of long double type. ldbl-128 version.
2 Copyright (C) 2016-2026 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 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/* long double is distinct from double, so there is nothing to
20 define here. */
21#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0
\ No newline at end of file
lib/libc/include/riscv-linux-gnu/bits/struct_stat.h deleted-127
...@@ -1,127 +0,0 @@
1/* Definition for struct stat.
2 Copyright (C) 2020-2026 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#if !defined _SYS_STAT_H && !defined _FCNTL_H
20# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead."
21#endif
22
23#ifndef _BITS_STRUCT_STAT_H
24#define _BITS_STRUCT_STAT_H 1
25
26#include <bits/endian.h>
27#include <bits/wordsize.h>
28
29#if defined __USE_FILE_OFFSET64
30# define __field64(type, type64, name) type64 name
31#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T
32# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T
33# error "ino_t and off_t must both be the same type"
34# endif
35# define __field64(type, type64, name) type name
36#elif __BYTE_ORDER == __LITTLE_ENDIAN
37# define __field64(type, type64, name) \
38 type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
39#else
40# define __field64(type, type64, name) \
41 int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
42#endif
43
44struct stat
45 {
46 __dev_t st_dev; /* Device. */
47 __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */
48 __mode_t st_mode; /* File mode. */
49 __nlink_t st_nlink; /* Link count. */
50 __uid_t st_uid; /* User ID of the file's owner. */
51 __gid_t st_gid; /* Group ID of the file's group.*/
52 __dev_t st_rdev; /* Device number, if device. */
53 __dev_t __pad1;
54 __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */
55 __blksize_t st_blksize; /* Optimal block size for I/O. */
56 int __pad2;
57 __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */
58#ifdef __USE_XOPEN2K8
59 /* Nanosecond resolution timestamps are stored in a format
60 equivalent to 'struct timespec'. This is the type used
61 whenever possible but the Unix namespace rules do not allow the
62 identifier 'timespec' to appear in the <sys/stat.h> header.
63 Therefore we have to handle the use of this header in strictly
64 standard-compliant sources special. */
65 struct timespec st_atim; /* Time of last access. */
66 struct timespec st_mtim; /* Time of last modification. */
67 struct timespec st_ctim; /* Time of last status change. */
68# define st_atime st_atim.tv_sec /* Backward compatibility. */
69# define st_mtime st_mtim.tv_sec
70# define st_ctime st_ctim.tv_sec
71#else
72 __time_t st_atime; /* Time of last access. */
73 unsigned long int st_atimensec; /* Nscecs of last access. */
74 __time_t st_mtime; /* Time of last modification. */
75 unsigned long int st_mtimensec; /* Nsecs of last modification. */
76 __time_t st_ctime; /* Time of last status change. */
77 unsigned long int st_ctimensec; /* Nsecs of last status change. */
78#endif
79 int __glibc_reserved[2];
80 };
81
82#undef __field64
83
84#ifdef __USE_LARGEFILE64
85struct stat64
86 {
87 __dev_t st_dev; /* Device. */
88 __ino64_t st_ino; /* File serial number. */
89 __mode_t st_mode; /* File mode. */
90 __nlink_t st_nlink; /* Link count. */
91 __uid_t st_uid; /* User ID of the file's owner. */
92 __gid_t st_gid; /* Group ID of the file's group.*/
93 __dev_t st_rdev; /* Device number, if device. */
94 __dev_t __pad1;
95 __off64_t st_size; /* Size of file, in bytes. */
96 __blksize_t st_blksize; /* Optimal block size for I/O. */
97 int __pad2;
98 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
99#ifdef __USE_XOPEN2K8
100 /* Nanosecond resolution timestamps are stored in a format
101 equivalent to 'struct timespec'. This is the type used
102 whenever possible but the Unix namespace rules do not allow the
103 identifier 'timespec' to appear in the <sys/stat.h> header.
104 Therefore we have to handle the use of this header in strictly
105 standard-compliant sources special. */
106 struct timespec st_atim; /* Time of last access. */
107 struct timespec st_mtim; /* Time of last modification. */
108 struct timespec st_ctim; /* Time of last status change. */
109#else
110 __time_t st_atime; /* Time of last access. */
111 unsigned long int st_atimensec; /* Nscecs of last access. */
112 __time_t st_mtime; /* Time of last modification. */
113 unsigned long int st_mtimensec; /* Nsecs of last modification. */
114 __time_t st_ctime; /* Time of last status change. */
115 unsigned long int st_ctimensec; /* Nsecs of last status change. */
116#endif
117 int __glibc_reserved[2];
118 };
119#endif
120
121/* Tell code we have these members. */
122#define _STATBUF_ST_BLKSIZE
123#define _STATBUF_ST_RDEV
124/* Nanosecond resolution time values are supported. */
125#define _STATBUF_ST_NSEC
126
127#endif /* _BITS_STRUCT_STAT_H */
\ No newline at end of file
lib/libc/include/riscv-linux-gnu/bits/timesize.h deleted-20
...@@ -1,20 +0,0 @@
1/* Bit size of the time_t type at glibc build time, general case.
2 Copyright (C) 2018-2026 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/* Size in bits of the 'time_t' type of the default ABI. */
20#define __TIMESIZE 64
\ No newline at end of file
lib/libc/include/riscv-linux-gnu/gnu/lib-names-ilp32d.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/riscv-linux-gnu/gnu/lib-names-lp64d.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/elfclass.h+1-6
...@@ -27,11 +27,6 @@...@@ -27,11 +27,6 @@
2727
28#define __ELF_NATIVE_CLASS __WORDSIZE28#define __ELF_NATIVE_CLASS __WORDSIZE
2929
30#if __WORDSIZE == 64
31/* 64 bit Linux for S/390 is exceptional as it has .hash section with30/* 64 bit Linux for S/390 is exceptional as it has .hash section with
32 64 bit entries. */31 64 bit entries. */
33typedef uint64_t Elf_Symndx;
34#else
35/* 32 bit Linux for S/390 has normal .hash section entries with 32 bits. */
36typedef uint32_t Elf_Symndx;
37#endif
\ No newline at end of file
32typedef uint64_t Elf_Symndx;
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/environments.h deleted-96
...@@ -1,96 +0,0 @@
1/* Copyright (C) 1999-2026 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
17
18#ifndef _UNISTD_H
19# error "Never include this file directly. Use <unistd.h> instead"
20#endif
21
22#include <bits/wordsize.h>
23
24/* This header should define the following symbols under the described
25 situations. A value `1' means that the model is always supported,
26 `-1' means it is never supported. Undefined means it cannot be
27 statically decided.
28
29 _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type
30 _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type
31
32 _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type
33 _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type
34
35 The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG,
36 _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32,
37 _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were
38 used in previous versions of the Unix standard and are available
39 only for compatibility.
40*/
41
42#if __WORDSIZE == 64
43
44/* Environments with 32-bit wide pointers are optionally provided.
45 Therefore following macros aren't defined:
46 # undef _POSIX_V7_ILP32_OFF32
47 # undef _POSIX_V7_ILP32_OFFBIG
48 # undef _POSIX_V6_ILP32_OFF32
49 # undef _POSIX_V6_ILP32_OFFBIG
50 # undef _XBS5_ILP32_OFF32
51 # undef _XBS5_ILP32_OFFBIG
52 and users need to check at runtime. */
53
54/* We also have no use (for now) for an environment with bigger pointers
55 and offsets. */
56# define _POSIX_V7_LPBIG_OFFBIG -1
57# define _POSIX_V6_LPBIG_OFFBIG -1
58# define _XBS5_LPBIG_OFFBIG -1
59
60/* By default we have 64-bit wide `long int', pointers and `off_t'. */
61# define _POSIX_V7_LP64_OFF64 1
62# define _POSIX_V6_LP64_OFF64 1
63# define _XBS5_LP64_OFF64 1
64
65#else /* __WORDSIZE == 32 */
66
67/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
68 and all platforms support LFS. */
69# define _POSIX_V7_ILP32_OFF32 1
70# define _POSIX_V7_ILP32_OFFBIG 1
71# define _POSIX_V6_ILP32_OFF32 1
72# define _POSIX_V6_ILP32_OFFBIG 1
73# define _XBS5_ILP32_OFF32 1
74# define _XBS5_ILP32_OFFBIG 1
75
76/* We optionally provide an environment with the above size but an 64-bit
77 side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */
78
79/* Environments with 64-bit wide pointers can be provided,
80 so these macros aren't defined:
81 # undef _POSIX_V7_LP64_OFF64
82 # undef _POSIX_V7_LPBIG_OFFBIG
83 # undef _POSIX_V6_LP64_OFF64
84 # undef _POSIX_V6_LPBIG_OFFBIG
85 # undef _XBS5_LP64_OFF64
86 # undef _XBS5_LPBIG_OFFBIG
87 and sysconf tests for it at runtime. */
88
89#endif /* __WORDSIZE == 32 */
90
91#define __ILP32_OFF32_CFLAGS "-m31"
92#define __ILP32_OFFBIG_CFLAGS "-m31 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
93#define __ILP32_OFF32_LDFLAGS "-m31"
94#define __ILP32_OFFBIG_LDFLAGS "-m31"
95#define __LP64_OFF64_CFLAGS "-m64"
96#define __LP64_OFF64_LDFLAGS "-m64"
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/fcntl.h+6-20
...@@ -22,29 +22,20 @@...@@ -22,29 +22,20 @@
2222
23#include <bits/wordsize.h>23#include <bits/wordsize.h>
2424
25#if __WORDSIZE == 64
26/* Not necessary, files are always with 64bit off_t. */25/* Not necessary, files are always with 64bit off_t. */
27# define __O_LARGEFILE 026#define __O_LARGEFILE 0
28#endif
2927
30#if __WORDSIZE == 64
31/* Not necessary, we always have 64-bit offsets. */28/* Not necessary, we always have 64-bit offsets. */
32# define F_GETLK64 5 /* Get record locking info. */29#define F_GETLK64 5 /* Get record locking info. */
33# define F_SETLK64 6 /* Set record locking info (non-blocking). */30#define F_SETLK64 6 /* Set record locking info (non-blocking). */
34# define F_SETLKW64 7 /* Set record locking info (blocking). */31#define F_SETLKW64 7 /* Set record locking info (blocking). */
35#endif
3632
37struct flock33struct flock
38 {34 {
39 short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */35 short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
40 short int l_whence; /* Where `l_start' is relative to (like `lseek'). */36 short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
41#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
42 __off_t l_start; /* Offset where the lock begins. */37 __off_t l_start; /* Offset where the lock begins. */
43 __off_t l_len; /* Size of the locked area; zero means until EOF. */38 __off_t l_len; /* Size of the locked area; zero means until EOF. */
44#else
45 __off64_t l_start; /* Offset where the lock begins. */
46 __off64_t l_len; /* Size of the locked area; zero means until EOF. */
47#endif
48 __pid_t l_pid; /* Process holding the lock. */39 __pid_t l_pid; /* Process holding the lock. */
49 };40 };
5041
...@@ -59,13 +50,8 @@ struct flock64...@@ -59,13 +50,8 @@ struct flock64
59 };50 };
60#endif51#endif
6152
62#if __WORDSIZE == 6453#define __POSIX_FADV_DONTNEED 6 /* Don't need these pages. */
63# define __POSIX_FADV_DONTNEED 6 /* Don't need these pages. */54#define __POSIX_FADV_NOREUSE 7 /* Data will be accessed once. */
64# define __POSIX_FADV_NOREUSE 7 /* Data will be accessed once. */
65#else
66# define __POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
67# define __POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
68#endif
6955
70/* Include generic Linux declarations. */56/* Include generic Linux declarations. */
71#include <bits/fcntl-linux.h>57#include <bits/fcntl-linux.h>
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/fenv.h+4-4
...@@ -77,9 +77,9 @@ typedef struct...@@ -77,9 +77,9 @@ typedef struct
77{77{
78 fexcept_t __fpc;78 fexcept_t __fpc;
79 void *__glibc_reserved;79 void *__glibc_reserved;
80 /* The field __unused (formerly __ieee_instruction_pointer) is a relict from80 /* The field __glibc_reserved (formerly __ieee_instruction_pointer) is a
81 commit "Remove PTRACE_PEEKUSER" (87b9b50f0d4b92248905e95a06a13c513dc45e59)81 relict from commit "Remove PTRACE_PEEKUSER"
82 and isn't used anymore. */82 (87b9b50f0d4b92248905e95a06a13c513dc45e59) and isn't used anymore. */
83} fenv_t;83} fenv_t;
8484
85/* If the default argument is used we use this value. */85/* If the default argument is used we use this value. */
...@@ -96,4 +96,4 @@ typedef unsigned int femode_t;...@@ -96,4 +96,4 @@ typedef unsigned int femode_t;
9696
97/* Default floating-point control modes. */97/* Default floating-point control modes. */
98# define FE_DFL_MODE ((const femode_t *) -1L)98# define FE_DFL_MODE ((const femode_t *) -1L)
99#endif99#endif
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/link.h+1-61
...@@ -23,64 +23,6 @@...@@ -23,64 +23,6 @@
23typedef char La_s390_vr[16];23typedef char La_s390_vr[16];
24#endif24#endif
2525
26#if __ELF_NATIVE_CLASS == 32
27
28/* Registers for entry into PLT on s390-32. */
29typedef struct La_s390_32_regs
30{
31 uint32_t lr_r2;
32 uint32_t lr_r3;
33 uint32_t lr_r4;
34 uint32_t lr_r5;
35 uint32_t lr_r6;
36 double lr_fp0;
37 double lr_fp2;
38# if defined HAVE_S390_VX_ASM_SUPPORT
39 La_s390_vr lr_v24;
40 La_s390_vr lr_v25;
41 La_s390_vr lr_v26;
42 La_s390_vr lr_v27;
43 La_s390_vr lr_v28;
44 La_s390_vr lr_v29;
45 La_s390_vr lr_v30;
46 La_s390_vr lr_v31;
47# endif
48} La_s390_32_regs;
49
50/* Return values for calls from PLT on s390-32. */
51typedef struct La_s390_32_retval
52{
53 uint32_t lrv_r2;
54 uint32_t lrv_r3;
55 double lrv_fp0;
56# if defined HAVE_S390_VX_ASM_SUPPORT
57 La_s390_vr lrv_v24;
58# endif
59} La_s390_32_retval;
60
61
62__BEGIN_DECLS
63
64extern Elf32_Addr la_s390_32_gnu_pltenter (Elf32_Sym *__sym,
65 unsigned int __ndx,
66 uintptr_t *__refcook,
67 uintptr_t *__defcook,
68 La_s390_32_regs *__regs,
69 unsigned int *__flags,
70 const char *__symname,
71 long int *__framesizep);
72extern unsigned int la_s390_32_gnu_pltexit (Elf32_Sym *__sym,
73 unsigned int __ndx,
74 uintptr_t *__refcook,
75 uintptr_t *__defcook,
76 const La_s390_32_regs *__inregs,
77 La_s390_32_retval *__outregs,
78 const char *symname);
79
80__END_DECLS
81
82#else
83
84/* Registers for entry into PLT on s390-64. */26/* Registers for entry into PLT on s390-64. */
85typedef struct La_s390_64_regs27typedef struct La_s390_64_regs
86{28{
...@@ -134,6 +76,4 @@ extern unsigned int la_s390_64_gnu_pltexit (Elf64_Sym *__sym,...@@ -134,6 +76,4 @@ extern unsigned int la_s390_64_gnu_pltexit (Elf64_Sym *__sym,
134 La_s390_64_retval *__outregs,76 La_s390_64_retval *__outregs,
135 const char *__symname);77 const char *__symname);
13678
137__END_DECLS
138
139#endif
\ No newline at end of file
79__END_DECLS
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/procfs-extra.h deleted-75
...@@ -1,75 +0,0 @@
1/* Extra sys/procfs.h definitions. S/390 version.
2 Copyright (C) 2000-2026 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 _SYS_PROCFS_H
20# error "Never include <bits/procfs-extra.h> directly; use <sys/procfs.h> instead."
21#endif
22
23#if __WORDSIZE == 64
24
25/* Provide 32-bit variants so that BFD can read 32-bit
26 core files. */
27#define ELF_NGREG32 36
28typedef unsigned int elf_greg_t32;
29typedef elf_greg_t32
30 elf_gregset_t32[ELF_NGREG32] __attribute__ ((__aligned__ (8)));
31typedef elf_fpregset_t elf_fpregset_t32;
32
33struct elf_prstatus32
34 {
35 struct elf_siginfo pr_info; /* Info associated with signal. */
36 short int pr_cursig; /* Current signal. */
37 unsigned int pr_sigpend; /* Set of pending signals. */
38 unsigned int pr_sighold; /* Set of held signals. */
39 __pid_t pr_pid;
40 __pid_t pr_ppid;
41 __pid_t pr_pgrp;
42 __pid_t pr_sid;
43 struct
44 {
45 int tv_sec, tv_usec;
46 } pr_utime, /* User time. */
47 pr_stime, /* System time. */
48 pr_cutime, /* Cumulative user time. */
49 pr_cstime; /* Cumulative system time. */
50 elf_gregset_t32 pr_reg; /* GP registers. */
51 int pr_fpvalid; /* True if math copro being used. */
52 };
53
54struct elf_prpsinfo32
55 {
56 char pr_state; /* Numeric process state. */
57 char pr_sname; /* Char for pr_state. */
58 char pr_zomb; /* Zombie. */
59 char pr_nice; /* Nice val. */
60 unsigned int pr_flag; /* Flags. */
61 unsigned short int pr_uid;
62 unsigned short int pr_gid;
63 int pr_pid, pr_ppid, pr_pgrp, pr_sid;
64 /* Lots missing */
65 char pr_fname[16]; /* Filename of executable. */
66 char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
67 };
68
69typedef elf_gregset_t32 prgregset32_t;
70typedef elf_fpregset_t32 prfpregset32_t;
71
72typedef struct elf_prstatus32 prstatus32_t;
73typedef struct elf_prpsinfo32 prpsinfo32_t;
74
75#endif
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/procfs-id.h deleted-30
...@@ -1,30 +0,0 @@
1/* Types of pr_uid and pr_gid in struct elf_prpsinfo. S/390 version.
2 Copyright (C) 2018-2026 Free Software Foundation, Inc.
3
4 This file is part of the GNU C Library.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <https://www.gnu.org/licenses/>. */
19
20#ifndef _SYS_PROCFS_H
21# error "Never include <bits/procfs-id.h> directly; use <sys/procfs.h> instead."
22#endif
23
24#if __WORDSIZE == 64
25typedef unsigned int __pr_uid_t;
26typedef unsigned int __pr_gid_t;
27#else
28typedef unsigned short int __pr_uid_t;
29typedef unsigned short int __pr_gid_t;
30#endif
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/setjmp.h-6
...@@ -33,13 +33,7 @@ typedef struct __s390_jmp_buf...@@ -33,13 +33,7 @@ typedef struct __s390_jmp_buf
33 /* We save registers 6-15. */33 /* We save registers 6-15. */
34 long int __gregs[10];34 long int __gregs[10];
3535
36# if __WORDSIZE == 64
37 /* We save fpu registers f8 - f15. */
38 long __fpregs[8];36 long __fpregs[8];
39# else
40 /* We save fpu registers 4 and 6. */
41 long __fpregs[4];
42# endif
43} __jmp_buf[1];37} __jmp_buf[1];
4438
45#endif39#endif
lib/libc/include/s390x-linux-gnu/bits/sigaction.h+1-34
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* Definitions for 31 & 64 bit S/390 sigaction.1/* Definitions for 64 bit S/390 sigaction.
2 Copyright (C) 2001-2026 Free Software Foundation, Inc.2 Copyright (C) 2001-2026 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
...@@ -23,9 +23,6 @@...@@ -23,9 +23,6 @@
23# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."23# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
24#endif24#endif
2525
26#include <bits/wordsize.h>
27
28#if __WORDSIZE == 64
29/* Structure describing the action to be taken when a signal arrives. */26/* Structure describing the action to be taken when a signal arrives. */
30struct sigaction27struct sigaction
31 {28 {
...@@ -55,36 +52,6 @@ struct sigaction...@@ -55,36 +52,6 @@ struct sigaction
55 /* Additional set of signals to be blocked. */52 /* Additional set of signals to be blocked. */
56 __sigset_t sa_mask;53 __sigset_t sa_mask;
57 };54 };
58#else
59/* Structure describing the action to be taken when a signal arrives. */
60struct sigaction
61 {
62 /* Signal handler. */
63#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
64 union
65 {
66 /* Used if SA_SIGINFO is not set. */
67 __sighandler_t sa_handler;
68 /* Used if SA_SIGINFO is set. */
69 void (*sa_sigaction) (int, siginfo_t *, void *);
70 }
71 __sigaction_handler;
72# define sa_handler __sigaction_handler.sa_handler
73# define sa_sigaction __sigaction_handler.sa_sigaction
74#else
75 __sighandler_t sa_handler;
76#endif
77
78 /* Additional set of signals to be blocked. */
79 __sigset_t sa_mask;
80
81 /* Special flags. */
82 int sa_flags;
83
84 /* Restore handler. */
85 void (*sa_restorer) (void);
86 };
87#endif
8855
89/* Bits in `sa_flags'. */56/* Bits in `sa_flags'. */
90#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */57#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */
lib/libc/include/s390x-linux-gnu/bits/struct_mutex.h+2-24
...@@ -24,39 +24,17 @@ struct __pthread_mutex_s...@@ -24,39 +24,17 @@ struct __pthread_mutex_s
24 int __lock;24 int __lock;
25 unsigned int __count;25 unsigned int __count;
26 int __owner;26 int __owner;
27#if __WORDSIZE == 64
28 unsigned int __nusers;27 unsigned int __nusers;
29#endif
30 /* KIND must stay at this position in the structure to maintain28 /* KIND must stay at this position in the structure to maintain
31 binary compatibility with static initializers. */29 binary compatibility with static initializers. */
32 int __kind;30 int __kind;
33#if __WORDSIZE == 64
34 short __spins;31 short __spins;
35 short __glibc_reserved;32 short __glibc_reserved;
36 __pthread_list_t __list;33 __pthread_list_t __list;
37# define __PTHREAD_MUTEX_HAVE_PREV 134# define __PTHREAD_MUTEX_HAVE_PREV 1
38#else
39 unsigned int __nusers;
40 __extension__ union
41 {
42 struct
43 {
44 short __data_spins;
45 short __data_unused;
46 } __data;
47# define __spins __data.__data_spins
48 __pthread_slist_t __list;
49 };
50# define __PTHREAD_MUTEX_HAVE_PREV 0
51#endif
52};35};
5336
54#if __WORDSIZE == 6437#define __PTHREAD_MUTEX_INITIALIZER(__kind) \
55# define __PTHREAD_MUTEX_INITIALIZER(__kind) \
56 0, 0, 0, 0, __kind, 0, 0, { 0, 0 }38 0, 0, 0, 0, __kind, 0, 0, { 0, 0 }
57#else
58# define __PTHREAD_MUTEX_INITIALIZER(__kind) \
59 0, 0, 0, __kind, 0, { { 0, 0 } }
60#endif
6139
62#endif40#endif
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/struct_rwlock.h+1-16
...@@ -28,7 +28,6 @@ struct __pthread_rwlock_arch_t...@@ -28,7 +28,6 @@ struct __pthread_rwlock_arch_t
28 unsigned int __writers_futex;28 unsigned int __writers_futex;
29 unsigned int __pad3;29 unsigned int __pad3;
30 unsigned int __pad4;30 unsigned int __pad4;
31#if __WORDSIZE == 64
32 int __cur_writer;31 int __cur_writer;
33 int __shared;32 int __shared;
34 unsigned long int __pad1;33 unsigned long int __pad1;
...@@ -36,23 +35,9 @@ struct __pthread_rwlock_arch_t...@@ -36,23 +35,9 @@ struct __pthread_rwlock_arch_t
36 /* FLAGS must stay at this position in the structure to maintain35 /* FLAGS must stay at this position in the structure to maintain
37 binary compatibility. */36 binary compatibility. */
38 unsigned int __flags;37 unsigned int __flags;
39# else
40 unsigned char __pad1;
41 unsigned char __pad2;
42 unsigned char __shared;
43 /* FLAGS must stay at this position in the structure to maintain
44 binary compatibility. */
45 unsigned char __flags;
46 int __cur_writer;
47#endif
48};38};
4939
50#if __WORDSIZE == 6440#define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
51# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
52 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags41 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags
53#else
54# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \
55 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0
56#endif
5742
58#endif43#endif
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/struct_stat.h+6-114
...@@ -25,7 +25,6 @@...@@ -25,7 +25,6 @@
2525
26#include <bits/wordsize.h>26#include <bits/wordsize.h>
2727
28#if __WORDSIZE == 64
29struct stat28struct stat
30 {29 {
31 __dev_t st_dev; /* Device. */30 __dev_t st_dev; /* Device. */
...@@ -62,70 +61,8 @@ struct stat...@@ -62,70 +61,8 @@ struct stat
62 __blkcnt_t st_blocks; /* Nr. 512-byte blocks allocated. */61 __blkcnt_t st_blocks; /* Nr. 512-byte blocks allocated. */
63 long int __glibc_reserved[3];62 long int __glibc_reserved[3];
64 };63 };
65#else
66struct stat
67 {
68# ifdef __USE_TIME64_REDIRECTS
69# include <bits/struct_stat_time64_helper.h>
70# else
71 __dev_t st_dev; /* Device. */
72 unsigned int __pad1;
73# ifndef __USE_FILE_OFFSET64
74 __ino_t st_ino; /* File serial number. */
75# else
76 __ino_t __st_ino; /* 32bit file serial number. */
77# endif
78 __mode_t st_mode; /* File mode. */
79 __nlink_t st_nlink; /* Link count. */
80 __uid_t st_uid; /* User ID of the file's owner. */
81 __gid_t st_gid; /* Group ID of the file's group.*/
82 __dev_t st_rdev; /* Device number, if device. */
83 unsigned int __pad2;
84# ifndef __USE_FILE_OFFSET64
85 __off_t st_size; /* Size of file, in bytes. */
86# else
87 __off64_t st_size; /* Size of file, in bytes. */
88# endif
89 __blksize_t st_blksize; /* Optimal block size for I/O. */
90
91# ifndef __USE_FILE_OFFSET64
92 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
93# else
94 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
95# endif
96# ifdef __USE_XOPEN2K8
97 /* Nanosecond resolution timestamps are stored in a format
98 equivalent to 'struct timespec'. This is the type used
99 whenever possible but the Unix namespace rules do not allow the
100 identifier 'timespec' to appear in the <sys/stat.h> header.
101 Therefore we have to handle the use of this header in strictly
102 standard-compliant sources special. */
103 struct timespec st_atim; /* Time of last access. */
104 struct timespec st_mtim; /* Time of last modification. */
105 struct timespec st_ctim; /* Time of last status change. */
106# define st_atime st_atim.tv_sec /* Backward compatibility. */
107# define st_mtime st_mtim.tv_sec
108# define st_ctime st_ctim.tv_sec
109# else
110 __time_t st_atime; /* Time of last access. */
111 unsigned long int st_atimensec; /* Nscecs of last access. */
112 __time_t st_mtime; /* Time of last modification. */
113 unsigned long int st_mtimensec; /* Nsecs of last modification. */
114 __time_t st_ctime; /* Time of last status change. */
115 unsigned long int st_ctimensec; /* Nsecs of last status change. */
116# endif
117# ifndef __USE_FILE_OFFSET64
118 unsigned long int __glibc_reserved4;
119 unsigned long int __glibc_reserved5;
120# else
121 __ino64_t st_ino; /* File serial number. */
122# endif
123# endif
124 };
125# endif
12664
127#ifdef __USE_LARGEFILE6465#ifdef __USE_LARGEFILE64
128# if __WORDSIZE == 64
129/* Note stat64 is the same shape as stat. */66/* Note stat64 is the same shape as stat. */
130struct stat6467struct stat64
131 {68 {
...@@ -138,7 +75,7 @@ struct stat64...@@ -138,7 +75,7 @@ struct stat64
138 int __glibc_reserved0;75 int __glibc_reserved0;
139 __dev_t st_rdev; /* Device number, if device. */76 __dev_t st_rdev; /* Device number, if device. */
140 __off_t st_size; /* Size of file, in bytes. */77 __off_t st_size; /* Size of file, in bytes. */
141# ifdef __USE_XOPEN2K878# ifdef __USE_XOPEN2K8
142 /* Nanosecond resolution timestamps are stored in a format79 /* Nanosecond resolution timestamps are stored in a format
143 equivalent to 'struct timespec'. This is the type used80 equivalent to 'struct timespec'. This is the type used
144 whenever possible but the Unix namespace rules do not allow the81 whenever possible but the Unix namespace rules do not allow the
...@@ -148,66 +85,21 @@ struct stat64...@@ -148,66 +85,21 @@ struct stat64
148 struct timespec st_atim; /* Time of last access. */85 struct timespec st_atim; /* Time of last access. */
149 struct timespec st_mtim; /* Time of last modification. */86 struct timespec st_mtim; /* Time of last modification. */
150 struct timespec st_ctim; /* Time of last status change. */87 struct timespec st_ctim; /* Time of last status change. */
151# define st_atime st_atim.tv_sec /* Backward compatibility. */88# define st_atime st_atim.tv_sec /* Backward compatibility. */
152# define st_mtime st_mtim.tv_sec89# define st_mtime st_mtim.tv_sec
153# define st_ctime st_ctim.tv_sec90# define st_ctime st_ctim.tv_sec
154# else91# else
155 __time_t st_atime; /* Time of last access. */92 __time_t st_atime; /* Time of last access. */
156 unsigned long int st_atimensec; /* Nscecs of last access. */93 unsigned long int st_atimensec; /* Nscecs of last access. */
157 __time_t st_mtime; /* Time of last modification. */94 __time_t st_mtime; /* Time of last modification. */
158 unsigned long int st_mtimensec; /* Nsecs of last modification. */95 unsigned long int st_mtimensec; /* Nsecs of last modification. */
159 __time_t st_ctime; /* Time of last status change. */96 __time_t st_ctime; /* Time of last status change. */
160 unsigned long int st_ctimensec; /* Nsecs of last status change. */97 unsigned long int st_ctimensec; /* Nsecs of last status change. */
161# endif98# endif
162 __blksize_t st_blksize; /* Optimal block size for I/O. */99 __blksize_t st_blksize; /* Optimal block size for I/O. */
163 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */100 __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
164 long int __glibc_reserved[3];101 long int __glibc_reserved[3];
165 };102 };
166# else
167struct stat64
168 {
169# ifdef __USE_TIME64_REDIRECTS
170# include <bits/struct_stat_time64_helper.h>
171# else
172 __dev_t st_dev; /* Device. */
173 unsigned int __pad1;
174
175 __ino_t __st_ino; /* 32bit file serial number. */
176 __mode_t st_mode; /* File mode. */
177 __nlink_t st_nlink; /* Link count. */
178 __uid_t st_uid; /* User ID of the file's owner. */
179 __gid_t st_gid; /* Group ID of the file's group.*/
180 __dev_t st_rdev; /* Device number, if device. */
181 unsigned int __pad2;
182 __off64_t st_size; /* Size of file, in bytes. */
183 __blksize_t st_blksize; /* Optimal block size for I/O. */
184
185 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
186# ifdef __USE_XOPEN2K8
187 /* Nanosecond resolution timestamps are stored in a format
188 equivalent to 'struct timespec'. This is the type used
189 whenever possible but the Unix namespace rules do not allow the
190 identifier 'timespec' to appear in the <sys/stat.h> header.
191 Therefore we have to handle the use of this header in strictly
192 standard-compliant sources special. */
193 struct timespec st_atim; /* Time of last access. */
194 struct timespec st_mtim; /* Time of last modification. */
195 struct timespec st_ctim; /* Time of last status change. */
196# define st_atime st_atim.tv_sec /* Backward compatibility. */
197# define st_mtime st_mtim.tv_sec
198# define st_ctime st_ctim.tv_sec
199# else
200 __time_t st_atime; /* Time of last access. */
201 unsigned long int st_atimensec; /* Nscecs of last access. */
202 __time_t st_mtime; /* Time of last modification. */
203 unsigned long int st_mtimensec; /* Nsecs of last modification. */
204 __time_t st_ctime; /* Time of last status change. */
205 unsigned long int st_ctimensec; /* Nsecs of last status change. */
206# endif
207 __ino64_t st_ino; /* File serial number. */
208# endif
209 };
210# endif
211#endif103#endif
212104
213/* Tell code we have these members. */105/* Tell code we have these members. */
lib/libc/include/s390x-linux-gnu/bits/timesize.h deleted-22
...@@ -1,22 +0,0 @@
1/* Bit size of the time_t type at glibc build time, Linux/s390.
2 Copyright (C) 2021-2026 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#include <bits/wordsize.h>
20
21/* Size in bits of the 'time_t' type of the default ABI. */
22#define __TIMESIZE __WORDSIZE
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/typesizes.h+14-22
...@@ -57,42 +57,34 @@...@@ -57,42 +57,34 @@
57#define __TIMER_T_TYPE void *57#define __TIMER_T_TYPE void *
58#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE58#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
59#define __FSID_T_TYPE struct { int __val[2]; }59#define __FSID_T_TYPE struct { int __val[2]; }
60#if defined __GNUC__ && __GNUC__ <= 260
61/* Compatibility with g++ 2.95.x. */61/* With s390-32, __SSIZE_T_TYPE was __SWORD_TYPE for compatibility with
62#define __SSIZE_T_TYPE __SWORD_TYPE62 g++ 2.95.x. Afterwards __SLONGWORD_TYPE was needed as size_t was
63#else63 unsigned long int on s390-32.
64/* size_t is unsigned long int on s390 -m31. */64 Now as only s390-64 exists, __SWORD_TYPE can be used as also used in the
65#define __SSIZE_T_TYPE __SLONGWORD_TYPE65 generic version as both types result in long int. */
66#endif66#define __SSIZE_T_TYPE __SWORD_TYPE
67
67#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE68#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
68#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE69#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
69#define __CPU_MASK_TYPE __ULONGWORD_TYPE70#define __CPU_MASK_TYPE __ULONGWORD_TYPE
7071
71#ifdef __s390x__
72/* Tell the libc code that off_t and off64_t are actually the same type72/* Tell the libc code that off_t and off64_t are actually the same type
73 for all ABI purposes, even if possibly expressed as different base types73 for all ABI purposes, even if possibly expressed as different base types
74 for C type-checking purposes. */74 for C type-checking purposes. */
75# define __OFF_T_MATCHES_OFF64_T 175#define __OFF_T_MATCHES_OFF64_T 1
7676
77/* Same for ino_t and ino64_t. */77/* Same for ino_t and ino64_t. */
78# define __INO_T_MATCHES_INO64_T 178#define __INO_T_MATCHES_INO64_T 1
7979
80/* And for __rlim_t and __rlim64_t. */80/* And for __rlim_t and __rlim64_t. */
81# define __RLIM_T_MATCHES_RLIM64_T 181#define __RLIM_T_MATCHES_RLIM64_T 1
8282
83/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */83/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
84# define __STATFS_MATCHES_STATFS64 184#define __STATFS_MATCHES_STATFS64 1
8585
86/* And for getitimer, setitimer and rusage */86/* And for getitimer, setitimer and rusage */
87# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 187#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
88#else
89# define __RLIM_T_MATCHES_RLIM64_T 0
90
91# define __STATFS_MATCHES_STATFS64 0
92
93/* And for getitimer, setitimer and rusage */
94# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
95#endif
9688
97/* Number of descriptors that can fit in an `fd_set'. */89/* Number of descriptors that can fit in an `fd_set'. */
98#define __FD_SETSIZE 102490#define __FD_SETSIZE 1024
lib/libc/include/s390x-linux-gnu/bits/utmp.h deleted-127
...@@ -1,127 +0,0 @@
1/* The `struct utmp' type, describing entries in the utmp file. GNU version.
2 Copyright (C) 1993-2026 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 _UTMP_H
20# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
21#endif
22
23#include <paths.h>
24#include <sys/time.h>
25#include <sys/types.h>
26#include <bits/wordsize.h>
27
28
29#define UT_LINESIZE 32
30#define UT_NAMESIZE 32
31#define UT_HOSTSIZE 256
32
33
34/* The structure describing an entry in the database of
35 previous logins. */
36struct lastlog
37 {
38#if __WORDSIZE == 32
39 int64_t ll_time;
40#else
41 __time_t ll_time;
42#endif
43 char ll_line[UT_LINESIZE];
44 char ll_host[UT_HOSTSIZE];
45 };
46
47
48/* The structure describing the status of a terminated process. This
49 type is used in `struct utmp' below. */
50struct exit_status
51 {
52 short int e_termination; /* Process termination status. */
53 short int e_exit; /* Process exit status. */
54 };
55
56
57/* The structure describing an entry in the user accounting database. */
58struct utmp
59{
60 short int ut_type; /* Type of login. */
61 pid_t ut_pid; /* Process ID of login process. */
62 char ut_line[UT_LINESIZE]
63 __attribute_nonstring__; /* Devicename. */
64 char ut_id[4]
65 __attribute_nonstring__; /* Inittab ID. */
66 char ut_user[UT_NAMESIZE]
67 __attribute_nonstring__; /* Username. */
68 char ut_host[UT_HOSTSIZE]
69 __attribute_nonstring__; /* Hostname for remote login. */
70 struct exit_status ut_exit; /* Exit status of a process marked
71 as DEAD_PROCESS. */
72/* The ut_session and ut_tv fields must be the same size when compiled
73 32- and 64-bit. This allows data files and shared memory to be
74 shared between 32- and 64-bit applications. */
75#if __WORDSIZE == 32
76 int64_t ut_session; /* Session ID, used for windowing. */
77 struct
78 {
79 int64_t tv_sec; /* Seconds. */
80 int64_t tv_usec; /* Microseconds. */
81 } ut_tv; /* Time entry was made. */
82#else
83 long int ut_session; /* Session ID, used for windowing. */
84 struct timeval ut_tv; /* Time entry was made. */
85#endif
86
87 int32_t ut_addr_v6[4]; /* Internet address of remote host. */
88 char __glibc_reserved[20]; /* Reserved for future use. */
89};
90
91/* Backwards compatibility hacks. */
92#define ut_name ut_user
93#ifndef _NO_UT_TIME
94/* We have a problem here: `ut_time' is also used otherwise. Define
95 _NO_UT_TIME if the compiler complains. */
96# define ut_time ut_tv.tv_sec
97#endif
98#define ut_xtime ut_tv.tv_sec
99#define ut_addr ut_addr_v6[0]
100
101
102/* Values for the `ut_type' field of a `struct utmp'. */
103#define EMPTY 0 /* No valid user accounting information. */
104
105#define RUN_LVL 1 /* The system's runlevel. */
106#define BOOT_TIME 2 /* Time of system boot. */
107#define NEW_TIME 3 /* Time after system clock changed. */
108#define OLD_TIME 4 /* Time when system clock changed. */
109
110#define INIT_PROCESS 5 /* Process spawned by the init process. */
111#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
112#define USER_PROCESS 7 /* Normal process. */
113#define DEAD_PROCESS 8 /* Terminated process. */
114
115#define ACCOUNTING 9
116
117/* Old Linux name for the EMPTY type. */
118#define UT_UNKNOWN EMPTY
119
120
121/* Tell the user that we have a modern system with UT_HOST, UT_PID,
122 UT_TYPE, UT_ID and UT_TV fields. */
123#define _HAVE_UT_TYPE 1
124#define _HAVE_UT_PID 1
125#define _HAVE_UT_ID 1
126#define _HAVE_UT_TV 1
127#define _HAVE_UT_HOST 1
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/utmpx.h deleted-106
...@@ -1,106 +0,0 @@
1/* Structures and definitions for the user accounting database. GNU version.
2 Copyright (C) 1997-2026 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 _UTMPX_H
20# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
21#endif
22
23#include <bits/types.h>
24#include <sys/time.h>
25#include <bits/wordsize.h>
26
27
28#ifdef __USE_GNU
29# include <paths.h>
30# define _PATH_UTMPX _PATH_UTMP
31# define _PATH_WTMPX _PATH_WTMP
32#endif
33
34
35#define __UT_LINESIZE 32
36#define __UT_NAMESIZE 32
37#define __UT_HOSTSIZE 256
38
39
40/* The structure describing the status of a terminated process. This
41 type is used in `struct utmpx' below. */
42struct __exit_status
43 {
44#ifdef __USE_GNU
45 short int e_termination; /* Process termination status. */
46 short int e_exit; /* Process exit status. */
47#else
48 short int __e_termination; /* Process termination status. */
49 short int __e_exit; /* Process exit status. */
50#endif
51 };
52
53
54/* The structure describing an entry in the user accounting database. */
55struct utmpx
56{
57 short int ut_type; /* Type of login. */
58 __pid_t ut_pid; /* Process ID of login process. */
59 char ut_line[__UT_LINESIZE]
60 __attribute_nonstring__; /* Devicename. */
61 char ut_id[4]
62 __attribute_nonstring__; /* Inittab ID. */
63 char ut_user[__UT_NAMESIZE]
64 __attribute_nonstring__; /* Username. */
65 char ut_host[__UT_HOSTSIZE]
66 __attribute_nonstring__; /* Hostname for remote login. */
67 struct __exit_status ut_exit; /* Exit status of a process marked
68 as DEAD_PROCESS. */
69
70/* The fields ut_session and ut_tv must be the same size when compiled
71 32- and 64-bit. This allows files and shared memory to be shared
72 between 32- and 64-bit applications. */
73#if __WORDSIZE == 32
74 __int64_t ut_session; /* Session ID, used for windowing. */
75 struct
76 {
77 __int64_t tv_sec; /* Seconds. */
78 __int64_t tv_usec; /* Microseconds. */
79 } ut_tv; /* Time entry was made. */
80#else
81 long int ut_session; /* Session ID, used for windowing. */
82 struct timeval ut_tv; /* Time entry was made. */
83#endif
84 __int32_t ut_addr_v6[4]; /* Internet address of remote host. */
85 char __glibc_reserved[20]; /* Reserved for future use. */
86};
87
88
89/* Values for the `ut_type' field of a `struct utmpx'. */
90#define EMPTY 0 /* No valid user accounting information. */
91
92#ifdef __USE_GNU
93# define RUN_LVL 1 /* The system's runlevel. */
94#endif
95#define BOOT_TIME 2 /* Time of system boot. */
96#define NEW_TIME 3 /* Time after system clock changed. */
97#define OLD_TIME 4 /* Time when system clock changed. */
98
99#define INIT_PROCESS 5 /* Process spawned by the init process. */
100#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
101#define USER_PROCESS 7 /* Normal process. */
102#define DEAD_PROCESS 8 /* Terminated process. */
103
104#ifdef __USE_GNU
105# define ACCOUNTING 9 /* System accounting. */
106#endif
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/bits/wordsize.h+17-9
...@@ -1,11 +1,19 @@...@@ -1,11 +1,19 @@
1/* Determine the wordsize from the preprocessor defines. */1/* Copyright (C) 1999-2026 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
23
3#if defined __s390x__4 The GNU C Library is free software; you can redistribute it and/or
4# define __WORDSIZE 645 modify it under the terms of the GNU Lesser General Public
5#else6 License as published by the Free Software Foundation; either
6# define __WORDSIZE 327 version 2.1 of the License, or (at your option) any later version.
7# define __WORDSIZE32_SIZE_ULONG 1
8# define __WORDSIZE32_PTRDIFF_LONG 0
9#endif
108
11#define __WORDSIZE_TIME64_COMPAT32 0
\ No newline at end of file
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
17
18#define __WORDSIZE 64
19#define __WORDSIZE_TIME64_COMPAT32 0
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h deleted-27
...@@ -1,27 +0,0 @@
1/* This file is automatically generated. */
2#ifndef __GNU_LIB_NAMES_H
3# error "Never use <gnu/lib-names-64.h> directly; include <gnu/lib-names.h> instead."
4#endif
5
6#define LD64_SO "ld64.so.1"
7#define LD_SO "ld64.so.1"
8#define LIBANL_SO "libanl.so.1"
9#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
10#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
11#define LIBC_SO "libc.so.6"
12#define LIBDL_SO "libdl.so.2"
13#define LIBGCC_S_SO "libgcc_s.so.1"
14#define LIBMVEC_SO "libmvec.so.1"
15#define LIBM_SO "libm.so.6"
16#define LIBNSL_SO "libnsl.so.1"
17#define LIBNSS_COMPAT_SO "libnss_compat.so.2"
18#define LIBNSS_DB_SO "libnss_db.so.2"
19#define LIBNSS_DNS_SO "libnss_dns.so.2"
20#define LIBNSS_FILES_SO "libnss_files.so.2"
21#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2"
22#define LIBNSS_LDAP_SO "libnss_ldap.so.2"
23#define LIBPTHREAD_SO "libpthread.so.0"
24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/gnu/lib-names.h+23-8
...@@ -4,13 +4,28 @@...@@ -4,13 +4,28 @@
4#ifndef __GNU_LIB_NAMES_H4#ifndef __GNU_LIB_NAMES_H
5#define __GNU_LIB_NAMES_H 15#define __GNU_LIB_NAMES_H 1
66
7#include <bits/wordsize.h>7#define LD64_SO "ld64.so.1"
88#define LD_SO "ld64.so.1"
9#if __WORDSIZE == 329#define LIBANL_SO "libanl.so.1"
10# include <gnu/lib-names-32.h>10#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1"
11#endif11#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0"
12#if __WORDSIZE == 6412#define LIBC_SO "libc.so.6"
13# include <gnu/lib-names-64.h>13#define LIBDL_SO "libdl.so.2"
14#endif14#define LIBGCC_S_SO "libgcc_s.so.1"
15#define LIBMVEC_SO "libmvec.so.1"
16#define LIBM_SO "libm.so.6"
17#define LIBNSL_SO "libnsl.so.1"
18#define LIBNSS_COMPAT_SO "libnss_compat.so.2"
19#define LIBNSS_DB_SO "libnss_db.so.2"
20#define LIBNSS_DNS_SO "libnss_dns.so.2"
21#define LIBNSS_FILES_SO "libnss_files.so.2"
22#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2"
23#define LIBNSS_LDAP_SO "libnss_ldap.so.2"
24#define LIBPTHREAD_SO "libpthread.so.0"
25#define LIBRESOLV_SO "libresolv.so.2"
26#define LIBRT_SO "librt.so.1"
27#define LIBTHREAD_DB_SO "libthread_db.so.1"
28#define LIBUNWIND_SO "libunwind.so.1"
29#define LIBUTIL_SO "libutil.so.1"
1530
16#endif /* gnu/lib-names.h */31#endif /* gnu/lib-names.h */
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/gnu/stubs.h+13-9
...@@ -1,12 +1,16 @@...@@ -1,12 +1,16 @@
1/* This file is automatically generated.1/* This file is automatically generated.
2 This file selects the right generated file of `__stub_FUNCTION' macros2 It defines a symbol `__stub_FUNCTION' for each function
3 based on the architecture being compiled for. */3 in the C library which is a stub, meaning it will fail
4 every time called, usually setting errno to ENOSYS. */
45
5#include <bits/wordsize.h>6#ifdef _LIBC
67 #error Applications may not define the macro _LIBC
7#if __WORDSIZE == 32
8# include <gnu/stubs-32.h>
9#endif8#endif
10#if __WORDSIZE == 64
11# include <gnu/stubs-64.h>
12#endif
\ No newline at end of file
9
10#define __stub_chflags
11#define __stub_fchflags
12#define __stub_gtty
13#define __stub_revoke
14#define __stub_setlogin
15#define __stub_sigreturn
16#define __stub_stty
\ No newline at end of file
lib/libc/include/s390x-linux-gnu/sys/ucontext.h+1-5
...@@ -45,11 +45,7 @@ typedef unsigned long greg_t;...@@ -45,11 +45,7 @@ typedef unsigned long greg_t;
45 the register set is an array, we make gregset_t a simple array45 the register set is an array, we make gregset_t a simple array
46 that has the same size as s390_regs. This is needed for the46 that has the same size as s390_regs. This is needed for the
47 elf_prstatus structure. */47 elf_prstatus structure. */
48#if __WORDSIZE == 6448#define __NGREG 27
49# define __NGREG 27
50#else
51# define __NGREG 36
52#endif
53#ifdef __USE_MISC49#ifdef __USE_MISC
54# define NGREG __NGREG50# define NGREG __NGREG
55#endif51#endif
lib/libc/include/sparc-linux-gnu/bits/cloexec.h created+1
...@@ -0,0 +1 @@
1#define __O_CLOEXEC 0x400000
\ No newline at end of file
lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/sparc-linux-gnu/gnu/stubs-64.h created+16
...@@ -0,0 +1,16 @@
1/* This file is automatically generated.
2 It defines a symbol `__stub_FUNCTION' for each function
3 in the C library which is a stub, meaning it will fail
4 every time called, usually setting errno to ENOSYS. */
5
6#ifdef _LIBC
7 #error Applications may not define the macro _LIBC
8#endif
9
10#define __stub_chflags
11#define __stub_fchflags
12#define __stub_gtty
13#define __stub_revoke
14#define __stub_setlogin
15#define __stub_sigreturn
16#define __stub_stty
\ No newline at end of file
lib/libc/include/x86-linux-gnu/bits/struct_mutex.h+1-1
...@@ -59,4 +59,4 @@ struct __pthread_mutex_s...@@ -59,4 +59,4 @@ struct __pthread_mutex_s
59 0, 0, 0, __kind, 0, { { 0, 0 } }59 0, 0, 0, __kind, 0, { { 0, 0 } }
60#endif60#endif
6161
62#endif62#endif
\ No newline at end of file
lib/libc/include/x86-linux-gnu/gnu/lib-names-64.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/libc/include/x86-linux-gnu/gnu/lib-names-x32.h+1
...@@ -24,4 +24,5 @@...@@ -24,4 +24,5 @@
24#define LIBRESOLV_SO "libresolv.so.2"24#define LIBRESOLV_SO "libresolv.so.2"
25#define LIBRT_SO "librt.so.1"25#define LIBRT_SO "librt.so.1"
26#define LIBTHREAD_DB_SO "libthread_db.so.1"26#define LIBTHREAD_DB_SO "libthread_db.so.1"
27#define LIBUNWIND_SO "libunwind.so.1"
27#define LIBUTIL_SO "libutil.so.1"28#define LIBUTIL_SO "libutil.so.1"
\ No newline at end of file
lib/std/Target.zig+20-6
...@@ -2660,12 +2660,26 @@ pub const DynamicLinker = struct {...@@ -2660,12 +2660,26 @@ pub const DynamicLinker = struct {
2660 else => return none,2660 else => return none,
2661 }}),2661 }}),
26622662
2663 .loongarch64 => initFmt("/lib64/ld-linux-loongarch-{s}.so.1", .{switch (abi) {2663 .loongarch32,
2664 .gnu => "lp64d",2664 .loongarch64,
2665 .gnuf32 => "lp64f",2665 => |arch| initFmt("/lib{s}/ld-linux-{s}{s}.so.1", .{
2666 .gnusf => "lp64s",2666 switch (arch) {
2667 else => return none,2667 .loongarch32 => "32",
2668 }}),2668 .loongarch64 => "64",
2669 else => unreachable,
2670 },
2671 switch (arch) {
2672 .loongarch32 => "loongarch-ilp32",
2673 .loongarch64 => "loongarch-lp64",
2674 else => unreachable,
2675 },
2676 switch (abi) {
2677 .gnu => "d",
2678 .gnuf32 => "f",
2679 .gnusf => "s",
2680 else => return none,
2681 },
2682 }),
26692683
2670 .hppa,2684 .hppa,
2671 .m68k,2685 .m68k,
lib/std/zig/target.zig+2
...@@ -46,6 +46,8 @@ pub const available_libcs = [_]ArchOsAbi{...@@ -46,6 +46,8 @@ pub const available_libcs = [_]ArchOsAbi{
46 .{ .arch = .csky, .os = .linux, .abi = .gnueabi, .os_ver = .{ .major = 4, .minor = 20, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 29, .patch = 0 }, .glibc_triple = "csky-linux-gnuabiv2-soft" },46 .{ .arch = .csky, .os = .linux, .abi = .gnueabi, .os_ver = .{ .major = 4, .minor = 20, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 29, .patch = 0 }, .glibc_triple = "csky-linux-gnuabiv2-soft" },
47 .{ .arch = .csky, .os = .linux, .abi = .gnueabihf, .os_ver = .{ .major = 4, .minor = 20, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 29, .patch = 0 }, .glibc_triple = "csky-linux-gnuabiv2" },47 .{ .arch = .csky, .os = .linux, .abi = .gnueabihf, .os_ver = .{ .major = 4, .minor = 20, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 29, .patch = 0 }, .glibc_triple = "csky-linux-gnuabiv2" },
48 .{ .arch = .hexagon, .os = .linux, .abi = .musl, .os_ver = .{ .major = 3, .minor = 2, .patch = 102 } },48 .{ .arch = .hexagon, .os = .linux, .abi = .musl, .os_ver = .{ .major = 3, .minor = 2, .patch = 102 } },
49 .{ .arch = .loongarch32, .os = .linux, .abi = .gnu, .os_ver = .{ .major = 6, .minor = 19, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 44, .patch = 0 }, .glibc_triple = "loongarch32-linux-gnuf64" },
50 .{ .arch = .loongarch32, .os = .linux, .abi = .gnusf, .os_ver = .{ .major = 6, .minor = 19, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 44, .patch = 0 }, .glibc_triple = "loongarch32-linux-gnusf" },
49 .{ .arch = .loongarch64, .os = .linux, .abi = .gnu, .os_ver = .{ .major = 5, .minor = 19, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 36, .patch = 0 }, .glibc_triple = "loongarch64-linux-gnuf64" },51 .{ .arch = .loongarch64, .os = .linux, .abi = .gnu, .os_ver = .{ .major = 5, .minor = 19, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 36, .patch = 0 }, .glibc_triple = "loongarch64-linux-gnuf64" },
50 .{ .arch = .loongarch64, .os = .linux, .abi = .gnusf, .os_ver = .{ .major = 5, .minor = 19, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 36, .patch = 0 }, .glibc_triple = "loongarch64-linux-gnusf" },52 .{ .arch = .loongarch64, .os = .linux, .abi = .gnusf, .os_ver = .{ .major = 5, .minor = 19, .patch = 0 }, .glibc_min = .{ .major = 2, .minor = 36, .patch = 0 }, .glibc_triple = "loongarch64-linux-gnusf" },
51 .{ .arch = .loongarch64, .os = .linux, .abi = .musl, .os_ver = .{ .major = 5, .minor = 19, .patch = 0 } },53 .{ .arch = .loongarch64, .os = .linux, .abi = .musl, .os_ver = .{ .major = 5, .minor = 19, .patch = 0 } },
src/libs/glibc.zig+1-3
...@@ -398,7 +398,7 @@ fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![...@@ -398,7 +398,7 @@ fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![
398 try result.appendSlice("powerpc" ++ s ++ "powerpc32");398 try result.appendSlice("powerpc" ++ s ++ "powerpc32");
399 }399 }
400 } else if (arch == .s390x) {400 } else if (arch == .s390x) {
401 try result.appendSlice("s390" ++ s ++ "s390-64");401 try result.appendSlice("s390");
402 } else if (arch.isLoongArch()) {402 } else if (arch.isLoongArch()) {
403 try result.appendSlice("loongarch");403 try result.appendSlice("loongarch");
404 } else if (arch == .m68k) {404 } else if (arch == .m68k) {
...@@ -607,8 +607,6 @@ fn add_include_dirs_arch(...@@ -607,8 +607,6 @@ fn add_include_dirs_arch(
607 try args.append("-I");607 try args.append("-I");
608 try args.append(try path.join(arena, &[_][]const u8{ dir, "s390", nptl }));608 try args.append(try path.join(arena, &[_][]const u8{ dir, "s390", nptl }));
609 } else {609 } else {
610 try args.append("-I");
611 try args.append(try path.join(arena, &[_][]const u8{ dir, "s390" ++ s ++ "s390-64" }));
612 try args.append("-I");610 try args.append("-I");
613 try args.append(try path.join(arena, &[_][]const u8{ dir, "s390" }));611 try args.append(try path.join(arena, &[_][]const u8{ dir, "s390" }));
614 }612 }
test/llvm_targets.zig+2-2
...@@ -106,9 +106,9 @@ const targets = [_]std.Target.Query{...@@ -106,9 +106,9 @@ const targets = [_]std.Target.Query{
106 .{ .cpu_arch = .lanai, .os_tag = .freestanding, .abi = .none },106 .{ .cpu_arch = .lanai, .os_tag = .freestanding, .abi = .none },
107107
108 .{ .cpu_arch = .loongarch32, .os_tag = .freestanding, .abi = .none },108 .{ .cpu_arch = .loongarch32, .os_tag = .freestanding, .abi = .none },
109 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnu },109 .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnu },
110 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnuf32 },110 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnuf32 },
111 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnusf },111 .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnusf },
112 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .musl },112 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .musl },
113 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .muslf32 },113 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .muslf32 },
114 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .muslsf },114 // .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .muslsf },
test/standalone/glibc_compat/build.zig+2
...@@ -103,6 +103,8 @@ pub fn build(b: *std.Build) void {...@@ -103,6 +103,8 @@ pub fn build(b: *std.Build) void {
103 .{ .arch_os_abi = t },103 .{ .arch_os_abi = t },
104 ) catch unreachable);104 ) catch unreachable);
105105
106 if (target.result.cpu.arch.isLoongArch()) continue; // https://github.com/Vexu/arocc/issues/1096
107
106 const glibc_ver = target.result.os.version_range.linux.glibc;108 const glibc_ver = target.result.os.version_range.linux.glibc;
107109
108 // only build test if glibc version supports the architecture110 // only build test if glibc version supports the architecture
tools/process_headers.zig+2
...@@ -36,6 +36,8 @@ const glibc_targets = [_]LibCTarget{...@@ -36,6 +36,8 @@ const glibc_targets = [_]LibCTarget{
36 .{ .arch = .aarch64_be, .abi = .gnu, .dest = "aarch64-linux-gnu" },36 .{ .arch = .aarch64_be, .abi = .gnu, .dest = "aarch64-linux-gnu" },
37 .{ .arch = .csky, .abi = .gnueabi, .dest = "csky-linux-gnu" },37 .{ .arch = .csky, .abi = .gnueabi, .dest = "csky-linux-gnu" },
38 .{ .arch = .csky, .abi = .gnueabihf, .dest = "csky-linux-gnu" },38 .{ .arch = .csky, .abi = .gnueabihf, .dest = "csky-linux-gnu" },
39 .{ .arch = .loongarch32, .abi = .gnu, .dest = "loongarch-linux-gnu" },
40 .{ .arch = .loongarch32, .abi = .gnusf, .dest = "loongarch-linux-gnu" },
39 .{ .arch = .loongarch64, .abi = .gnu, .dest = "loongarch-linux-gnu" },41 .{ .arch = .loongarch64, .abi = .gnu, .dest = "loongarch-linux-gnu" },
40 .{ .arch = .loongarch64, .abi = .gnusf, .dest = "loongarch-linux-gnu" },42 .{ .arch = .loongarch64, .abi = .gnusf, .dest = "loongarch-linux-gnu" },
41 .{ .arch = .m68k, .abi = .gnu },43 .{ .arch = .m68k, .abi = .gnu },