authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-08-01 19:17:56+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-08-01 19:17:56+02:00
loga00edbd52d03645366c165e860d9e0ab89caa2fc
tree428907d4d7b7fe104f5f849e3b69eac80fedc1a4
parenta2d21d63270ebb5eec0d437f7726c261455da66b
parent675b1a15a17d796fa9e48902047c3c7b350a1d7e
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #24640 from alexrp/glibc-2.42

glibc 2.42

79 files changed, 864 insertions(+), 659 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+11-22
...@@ -837,12 +837,15 @@ typedef struct...@@ -837,12 +837,15 @@ typedef struct
837#define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */837#define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */
838#define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */838#define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */
839#define NT_ARM_POE 0x40f /* ARM POE registers. */839#define NT_ARM_POE 0x40f /* ARM POE registers. */
840#define NT_ARM_GCS 0x410 /* ARM GCS state. */
840#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */841#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */
841#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */842#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */
842#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */843#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */
843#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers. */844#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers. */
844#define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */845#define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */
845#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */846#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */
847#define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged
848 address control */
846#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */849#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */
847#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and850#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and
848 status registers. */851 status registers. */
...@@ -2906,19 +2909,6 @@ enum...@@ -2906,19 +2909,6 @@ enum
29062909
2907#define R_AARCH64_NONE 0 /* No relocation. */2910#define R_AARCH64_NONE 0 /* No relocation. */
29082911
2909/* ILP32 AArch64 relocs. */
2910#define R_AARCH64_P32_ABS32 1 /* Direct 32 bit. */
2911#define R_AARCH64_P32_COPY 180 /* Copy symbol at runtime. */
2912#define R_AARCH64_P32_GLOB_DAT 181 /* Create GOT entry. */
2913#define R_AARCH64_P32_JUMP_SLOT 182 /* Create PLT entry. */
2914#define R_AARCH64_P32_RELATIVE 183 /* Adjust by program base. */
2915#define R_AARCH64_P32_TLS_DTPMOD 184 /* Module number, 32 bit. */
2916#define R_AARCH64_P32_TLS_DTPREL 185 /* Module-relative offset, 32 bit. */
2917#define R_AARCH64_P32_TLS_TPREL 186 /* TP-relative offset, 32 bit. */
2918#define R_AARCH64_P32_TLSDESC 187 /* TLS Descriptor. */
2919#define R_AARCH64_P32_IRELATIVE 188 /* STT_GNU_IFUNC relocation. */
2920
2921/* LP64 AArch64 relocs. */
2922#define R_AARCH64_ABS64 257 /* Direct 64 bit. */2912#define R_AARCH64_ABS64 257 /* Direct 64 bit. */
2923#define R_AARCH64_ABS32 258 /* Direct 32 bit. */2913#define R_AARCH64_ABS32 258 /* Direct 32 bit. */
2924#define R_AARCH64_ABS16 259 /* Direct 16-bit. */2914#define R_AARCH64_ABS16 259 /* Direct 16-bit. */
...@@ -4091,6 +4081,7 @@ enum...@@ -4091,6 +4081,7 @@ enum
4091#define R_RISCV_TLS_DTPREL64 94081#define R_RISCV_TLS_DTPREL64 9
4092#define R_RISCV_TLS_TPREL32 104082#define R_RISCV_TLS_TPREL32 10
4093#define R_RISCV_TLS_TPREL64 114083#define R_RISCV_TLS_TPREL64 11
4084#define R_RISCV_TLSDESC 12
4094#define R_RISCV_BRANCH 164085#define R_RISCV_BRANCH 16
4095#define R_RISCV_JAL 174086#define R_RISCV_JAL 17
4096#define R_RISCV_CALL 184087#define R_RISCV_CALL 18
...@@ -4116,16 +4107,10 @@ enum...@@ -4116,16 +4107,10 @@ enum
4116#define R_RISCV_SUB16 384107#define R_RISCV_SUB16 38
4117#define R_RISCV_SUB32 394108#define R_RISCV_SUB32 39
4118#define R_RISCV_SUB64 404109#define R_RISCV_SUB64 40
4119#define R_RISCV_GNU_VTINHERIT 414110#define R_RISCV_GOT32_PCREL 41
4120#define R_RISCV_GNU_VTENTRY 42
4121#define R_RISCV_ALIGN 434111#define R_RISCV_ALIGN 43
4122#define R_RISCV_RVC_BRANCH 444112#define R_RISCV_RVC_BRANCH 44
4123#define R_RISCV_RVC_JUMP 454113#define R_RISCV_RVC_JUMP 45
4124#define R_RISCV_RVC_LUI 46
4125#define R_RISCV_GPREL_I 47
4126#define R_RISCV_GPREL_S 48
4127#define R_RISCV_TPREL_I 49
4128#define R_RISCV_TPREL_S 50
4129#define R_RISCV_RELAX 514114#define R_RISCV_RELAX 51
4130#define R_RISCV_SUB6 524115#define R_RISCV_SUB6 52
4131#define R_RISCV_SET6 534116#define R_RISCV_SET6 53
...@@ -4137,8 +4122,12 @@ enum...@@ -4137,8 +4122,12 @@ enum
4137#define R_RISCV_PLT32 594122#define R_RISCV_PLT32 59
4138#define R_RISCV_SET_ULEB128 604123#define R_RISCV_SET_ULEB128 60
4139#define R_RISCV_SUB_ULEB128 614124#define R_RISCV_SUB_ULEB128 61
4125#define R_RISCV_TLSDESC_HI20 62
4126#define R_RISCV_TLSDESC_LOAD_LO12 63
4127#define R_RISCV_TLSDESC_ADD_LO12 64
4128#define R_RISCV_TLSDESC_CALL 65
41404129
4141#define R_RISCV_NUM 624130#define R_RISCV_NUM 66
41424131
4143/* RISC-V specific values for the st_other field. */4132/* RISC-V specific values for the st_other field. */
4144#define STO_RISCV_VARIANT_CC 0x80 /* Function uses variant calling4133#define STO_RISCV_VARIANT_CC 0x80 /* Function uses variant calling
...@@ -4147,7 +4136,7 @@ enum...@@ -4147,7 +4136,7 @@ enum
4147/* RISC-V specific values for the sh_type field. */4136/* RISC-V specific values for the sh_type field. */
4148#define SHT_RISCV_ATTRIBUTES (SHT_LOPROC + 3)4137#define SHT_RISCV_ATTRIBUTES (SHT_LOPROC + 3)
41494138
4150/* RISC-V specific values for the p_type field. */4139/* RISC-V specific values for the p_type field (deprecated). */
4151#define PT_RISCV_ATTRIBUTES (PT_LOPROC + 3)4140#define PT_RISCV_ATTRIBUTES (PT_LOPROC + 3)
41524141
4153/* RISC-V specific values for the d_tag field. */4142/* RISC-V specific values for the d_tag field. */
lib/libc/glibc/include/elf.h+13
...@@ -15,6 +15,19 @@...@@ -15,6 +15,19 @@
15# define ELF_NOTE_NEXT_OFFSET(namesz, descsz, align) \15# define ELF_NOTE_NEXT_OFFSET(namesz, descsz, align) \
16 ALIGN_UP (ELF_NOTE_DESC_OFFSET ((namesz), (align)) + (descsz), (align))16 ALIGN_UP (ELF_NOTE_DESC_OFFSET ((namesz), (align)) + (descsz), (align))
1717
18# ifdef HIDDEN_VAR_NEEDS_DYNAMIC_RELOC
19# define DL_ADDRESS_WITHOUT_RELOC(expr) (expr)
20# else
21/* Evaluate EXPR without run-time relocation for it. EXPR should be an
22 array, an address of an object, or a string literal. */
23# define DL_ADDRESS_WITHOUT_RELOC(expr) \
24 ({ \
25 __auto_type _result = (expr); \
26 asm ("" : "+r" (_result)); \
27 _result; \
28 })
29# endif
30
18/* Some information which is not meant for the public and therefore not31/* Some information which is not meant for the public and therefore not
19 in <elf.h>. */32 in <elf.h>. */
20# include <dl-dtprocnum.h>33# include <dl-dtprocnum.h>
lib/libc/glibc/include/libc-symbols.h+4-4
...@@ -155,7 +155,7 @@...@@ -155,7 +155,7 @@
155 extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) \155 extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) \
156 __attribute_copy__ (name);156 __attribute_copy__ (name);
157157
158/* Zig patch. weak_hidden_alias was removed from glibc v2.36 (v2.37?), Zig158/* zig patch: weak_hidden_alias was removed from glibc v2.36 (v2.37?), Zig
159 needs it for the v2.32 and earlier {f,l,}stat wrappers, so only include159 needs it for the v2.32 and earlier {f,l,}stat wrappers, so only include
160 in this header for 2.32 and earlier. */160 in this header for 2.32 and earlier. */
161#if (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 32) || __GLIBC__ < 2161#if (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 32) || __GLIBC__ < 2
...@@ -220,7 +220,7 @@...@@ -220,7 +220,7 @@
220#define __make_section_unallocated(section_string) \220#define __make_section_unallocated(section_string) \
221 asm (".section " section_string "\n\t.previous");221 asm (".section " section_string "\n\t.previous");
222222
223/* Tacking on "\n\t#" to the section name makes gcc put it's bogus223/* Tacking on "\n\t#" to the section name makes gcc put its bogus
224 section attributes on what looks like a comment to the assembler. */224 section attributes on what looks like a comment to the assembler. */
225#ifdef HAVE_SECTION_QUOTES225#ifdef HAVE_SECTION_QUOTES
226# define __sec_comment "\"\n\t#\""226# define __sec_comment "\"\n\t#\""
...@@ -280,7 +280,7 @@ for linking")...@@ -280,7 +280,7 @@ for linking")
280280
281281
282/*282/*
283 283
284*/284*/
285285
286#ifdef HAVE_GNU_RETAIN286#ifdef HAVE_GNU_RETAIN
...@@ -807,7 +807,7 @@ for linking")...@@ -807,7 +807,7 @@ for linking")
807#define libm_ifunc_init()807#define libm_ifunc_init()
808#define libm_ifunc(name, expr) \808#define libm_ifunc(name, expr) \
809 __ifunc (name, name, expr, void, libm_ifunc_init)809 __ifunc (name, name, expr, void, libm_ifunc_init)
810 810
811/* These macros facilitate sharing source files with gnulib.811/* These macros facilitate sharing source files with gnulib.
812812
813 They are here instead of sys/cdefs.h because they should not be813 They are here instead of sys/cdefs.h because they should not be
lib/libc/glibc/include/stdlib.h+15
...@@ -368,6 +368,21 @@ struct abort_msg_s...@@ -368,6 +368,21 @@ struct abort_msg_s
368extern struct abort_msg_s *__abort_msg;368extern struct abort_msg_s *__abort_msg;
369libc_hidden_proto (__abort_msg)369libc_hidden_proto (__abort_msg)
370370
371enum readonly_error_type
372{
373 readonly_noerror,
374 readonly_area_writable,
375 readonly_procfs_inaccessible,
376 readonly_procfs_open_fail,
377};
378
379extern enum readonly_error_type __readonly_area (const void *ptr,
380 size_t size)
381 attribute_hidden;
382extern enum readonly_error_type __readonly_area_fallback (const void *ptr,
383 size_t size)
384 attribute_hidden;
385
371# if IS_IN (rtld)386# if IS_IN (rtld)
372extern __typeof (unsetenv) unsetenv attribute_hidden;387extern __typeof (unsetenv) unsetenv attribute_hidden;
373extern __typeof (__strtoul_internal) __strtoul_internal attribute_hidden;388extern __typeof (__strtoul_internal) __strtoul_internal attribute_hidden;
lib/libc/glibc/io/fcntl.h+5-4
...@@ -168,7 +168,7 @@ typedef __pid_t pid_t;...@@ -168,7 +168,7 @@ typedef __pid_t pid_t;
168#endif168#endif
169169
170170
171/* fcntl was a simple symbol until glibc 2.27 inclusive. glibc 2.28 onwards171/* zig patch: fcntl was a simple symbol until glibc 2.27 inclusive. glibc 2.28 onwards
172 * re-defines it to fcntl64 (via #define) if _FILE_OFFSET_BITS == 64. */172 * re-defines it to fcntl64 (via #define) if _FILE_OFFSET_BITS == 64. */
173#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 28) || __GLIBC__ > 2173#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 28) || __GLIBC__ > 2
174/* Do the file control operation described by CMD on FD.174/* Do the file control operation described by CMD on FD.
...@@ -288,16 +288,17 @@ extern int creat64 (const char *__file, mode_t __mode) __nonnull ((1));...@@ -288,16 +288,17 @@ extern int creat64 (const char *__file, mode_t __mode) __nonnull ((1));
288# define F_TEST 3 /* Test a region for other processes locks. */288# define F_TEST 3 /* Test a region for other processes locks. */
289289
290# ifndef __USE_FILE_OFFSET64290# ifndef __USE_FILE_OFFSET64
291extern int lockf (int __fd, int __cmd, off_t __len);291extern int lockf (int __fd, int __cmd, off_t __len) __wur;
292# else292# else
293# ifdef __REDIRECT293# ifdef __REDIRECT
294extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64);294extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len),
295 lockf64) __wur;
295# else296# else
296# define lockf lockf64297# define lockf lockf64
297# endif298# endif
298# endif299# endif
299# ifdef __USE_LARGEFILE64300# ifdef __USE_LARGEFILE64
300extern int lockf64 (int __fd, int __cmd, off64_t __len);301extern int lockf64 (int __fd, int __cmd, off64_t __len) __wur;
301# endif302# endif
302#endif303#endif
303304
lib/libc/glibc/posix/bits/types.h+1-1
...@@ -217,7 +217,7 @@ typedef int __sig_atomic_t;...@@ -217,7 +217,7 @@ typedef int __sig_atomic_t;
217/* Seconds since the Epoch, visible to user code when time_t is too217/* Seconds since the Epoch, visible to user code when time_t is too
218 narrow only for consistency with the old way of widening too-narrow218 narrow only for consistency with the old way of widening too-narrow
219 types. User code should never use __time64_t. */219 types. User code should never use __time64_t. */
220/* Zig patch: Don't check __LIBC here because it breaks fstatat.c on x86. */220/* zig patch: Don't check __LIBC here because it breaks fstatat.c on x86. */
221#if __TIMESIZE == 64221#if __TIMESIZE == 64
222# define __time64_t __time_t222# define __time64_t __time_t
223#elif __TIMESIZE != 64223#elif __TIMESIZE != 64
lib/libc/glibc/stdlib/stdlib.h+6
...@@ -985,6 +985,12 @@ __extension__ extern long long int llabs (long long int __x)...@@ -985,6 +985,12 @@ __extension__ extern long long int llabs (long long int __x)
985 __THROW __attribute__ ((__const__)) __wur;985 __THROW __attribute__ ((__const__)) __wur;
986#endif986#endif
987987
988#if __GLIBC_USE (ISOC2Y)
989extern unsigned int uabs (int __x) __THROW __attribute__ ((__const__)) __wur;
990extern unsigned long int ulabs (long int __x) __THROW __attribute__ ((__const__)) __wur;
991__extension__ extern unsigned long long int ullabs (long long int __x)
992 __THROW __attribute__ ((__const__)) __wur;
993#endif
988994
989/* Return the `div_t', `ldiv_t' or `lldiv_t' representation995/* Return the `div_t', `ldiv_t' or `lldiv_t' representation
990 of the value of NUMER over DENOM. */996 of the value of NUMER over DENOM. */
lib/libc/glibc/sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h+7-17
...@@ -21,23 +21,13 @@...@@ -21,23 +21,13 @@
2121
22#include <bits/endian.h>22#include <bits/endian.h>
2323
24#ifdef __ILP32__24#define __SIZEOF_PTHREAD_ATTR_T 64
25# define __SIZEOF_PTHREAD_ATTR_T 3225#define __SIZEOF_PTHREAD_MUTEX_T 48
26# define __SIZEOF_PTHREAD_MUTEX_T 3226#define __SIZEOF_PTHREAD_MUTEXATTR_T 8
27# define __SIZEOF_PTHREAD_MUTEXATTR_T 427#define __SIZEOF_PTHREAD_CONDATTR_T 8
28# define __SIZEOF_PTHREAD_CONDATTR_T 428#define __SIZEOF_PTHREAD_RWLOCK_T 56
29# define __SIZEOF_PTHREAD_RWLOCK_T 4829#define __SIZEOF_PTHREAD_BARRIER_T 32
30# define __SIZEOF_PTHREAD_BARRIER_T 2030#define __SIZEOF_PTHREAD_BARRIERATTR_T 8
31# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
32#else
33# define __SIZEOF_PTHREAD_ATTR_T 64
34# define __SIZEOF_PTHREAD_MUTEX_T 48
35# define __SIZEOF_PTHREAD_MUTEXATTR_T 8
36# define __SIZEOF_PTHREAD_CONDATTR_T 8
37# define __SIZEOF_PTHREAD_RWLOCK_T 56
38# define __SIZEOF_PTHREAD_BARRIER_T 32
39# define __SIZEOF_PTHREAD_BARRIERATTR_T 8
40#endif
41#define __SIZEOF_PTHREAD_COND_T 4831#define __SIZEOF_PTHREAD_COND_T 48
42#define __SIZEOF_PTHREAD_RWLOCKATTR_T 832#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
4333
lib/libc/glibc/sysdeps/aarch64/start-2.33.S+17-8
...@@ -54,8 +54,8 @@ _start:...@@ -54,8 +54,8 @@ _start:
54 mov x5, x054 mov x5, x0
5555
56 /* Load argc and a pointer to argv */56 /* Load argc and a pointer to argv */
57 ldr PTR_REG (1), [sp, #0]57 ldr x1, [sp, #0]
58 add x2, sp, #PTR_SIZE58 add x2, sp, 8
5959
60 /* Setup stack limit in argument register */60 /* Setup stack limit in argument register */
61 mov x6, sp61 mov x6, sp
...@@ -63,13 +63,13 @@ _start:...@@ -63,13 +63,13 @@ _start:
63#ifdef PIC63#ifdef PIC
64# ifdef SHARED64# ifdef SHARED
65 adrp x0, :got:main65 adrp x0, :got:main
66 ldr PTR_REG (0), [x0, #:got_lo12:main]66 ldr x0, [x0, #:got_lo12:main]
6767
68 adrp x3, :got:__libc_csu_init68 adrp x3, :got:__libc_csu_init
69 ldr PTR_REG (3), [x3, #:got_lo12:__libc_csu_init]69 ldr x3, [x3, #:got_lo12:__libc_csu_init]
7070
71 adrp x4, :got:__libc_csu_fini71 adrp x4, :got:__libc_csu_fini
72 ldr PTR_REG (4), [x4, #:got_lo12:__libc_csu_fini]72 ldr x4, [x4, #:got_lo12:__libc_csu_fini]
73# else73# else
74 adrp x0, __wrap_main74 adrp x0, __wrap_main
75 add x0, x0, :lo12:__wrap_main75 add x0, x0, :lo12:__wrap_main
...@@ -80,9 +80,18 @@ _start:...@@ -80,9 +80,18 @@ _start:
80# endif80# endif
81#else81#else
82 /* Set up the other arguments in registers */82 /* Set up the other arguments in registers */
83 MOVL (0, main)83 movz x0, :abs_g3:main
84 MOVL (3, __libc_csu_init)84 movk x0, :abs_g2_nc:main
85 MOVL (4, __libc_csu_fini)85 movk x0, :abs_g1_nc:main
86 movk x0, :abs_g0_nc:main
87 movz x3, :abs_g3:__libc_csu_init
88 movk x3, :abs_g2_nc:__libc_csu_init
89 movk x3, :abs_g1_nc:__libc_csu_init
90 movk x3, :abs_g0_nc:__libc_csu_init
91 movz x4, :abs_g3:__libc_csu_fini
92 movk x4, :abs_g2_nc:__libc_csu_fini
93 movk x4, :abs_g1_nc:__libc_csu_fini
94 movk x4, :abs_g0_nc:__libc_csu_fini
86#endif95#endif
8796
88 /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,97 /* __libc_start_main (main, argc, argv, init, fini, rtld_fini,
lib/libc/glibc/sysdeps/aarch64/start.S+8-6
...@@ -70,8 +70,8 @@ ENTRY(_start)...@@ -70,8 +70,8 @@ ENTRY(_start)
70 mov x5, x070 mov x5, x0
7171
72 /* Load argc and a pointer to argv */72 /* Load argc and a pointer to argv */
73 ldr PTR_REG (1), [sp, #0]73 ldr x1, [sp, #0]
74 add x2, sp, #PTR_SIZE74 add x2, sp, 8
7575
76 /* Setup stack limit in argument register */76 /* Setup stack limit in argument register */
77 mov x6, sp77 mov x6, sp
...@@ -79,14 +79,16 @@ ENTRY(_start)...@@ -79,14 +79,16 @@ ENTRY(_start)
79#ifdef PIC79#ifdef PIC
80# ifdef SHARED80# ifdef SHARED
81 adrp x0, :got:main81 adrp x0, :got:main
82 ldr PTR_REG (0), [x0, #:got_lo12:main]82 ldr x0, [x0, #:got_lo12:main]
83# else83# else
84 adrp x0, __wrap_main84 adrp x0, __wrap_main
85 add x0, x0, :lo12:__wrap_main85 add x0, x0, :lo12:__wrap_main
86# endif86# endif
87#else87#else
88 /* Set up the other arguments in registers */88 movz x0, :abs_g3:main
89 MOVL (0, main)89 movk x0, :abs_g2_nc:main
90 movk x0, :abs_g1_nc:main
91 movk x0, :abs_g0_nc:main
90#endif92#endif
91 mov x3, #0 /* Used to be init. */93 mov x3, #0 /* Used to be init. */
92 mov x4, #0 /* Used to be fini. */94 mov x4, #0 /* Used to be fini. */
...@@ -106,7 +108,7 @@ ENTRY(_start)...@@ -106,7 +108,7 @@ ENTRY(_start)
106 because crt1.o and rcrt1.o share code and the later must avoid the108 because crt1.o and rcrt1.o share code and the later must avoid the
107 use of GOT relocations before __libc_start_main is called. */109 use of GOT relocations before __libc_start_main is called. */
108__wrap_main:110__wrap_main:
109 BTI_C111 bti c
110 b main112 b main
111#endif113#endif
112END(_start)114END(_start)
lib/libc/glibc/sysdeps/aarch64/sysdep.h+6-81
...@@ -21,59 +21,15 @@...@@ -21,59 +21,15 @@
2121
22#include <sysdeps/generic/sysdep.h>22#include <sysdeps/generic/sysdep.h>
2323
24#ifdef __LP64__
25# define AARCH64_R(NAME) R_AARCH64_ ## NAME
26# define PTR_REG(n) x##n
27# define PTR_LOG_SIZE 3
28# define PTR_ARG(n)
29# define SIZE_ARG(n)
30#else
31# define AARCH64_R(NAME) R_AARCH64_P32_ ## NAME
32# define PTR_REG(n) w##n
33# define PTR_LOG_SIZE 2
34# define PTR_ARG(n) mov w##n, w##n
35# define SIZE_ARG(n) mov w##n, w##n
36#endif
37
38#define PTR_SIZE (1<<PTR_LOG_SIZE)
39
40#ifndef __ASSEMBLER__
41/* Strip pointer authentication code from pointer p. */
42static inline void *
43strip_pac (void *p)
44{
45 register void *ra asm ("x30") = (p);
46 asm ("hint 7 // xpaclri" : "+r"(ra));
47 return ra;
48}
49
50/* This is needed when glibc is built with -mbranch-protection=pac-ret
51 with a gcc that is affected by PR target/94891. */
52# if HAVE_AARCH64_PAC_RET
53# undef RETURN_ADDRESS
54# define RETURN_ADDRESS(n) strip_pac (__builtin_return_address (n))
55# endif
56#endif
57
58#ifdef __ASSEMBLER__24#ifdef __ASSEMBLER__
5925
26/* CFI directive for return address. */
27#define cfi_negate_ra_state .cfi_negate_ra_state
28
60/* Syntactic details of assembler. */29/* Syntactic details of assembler. */
6130
62#define ASM_SIZE_DIRECTIVE(name) .size name,.-name31#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
6332
64/* Branch Target Identitication support. */
65#if HAVE_AARCH64_BTI
66# define BTI_C hint 34
67# define BTI_J hint 36
68#else
69# define BTI_C nop
70# define BTI_J nop
71#endif
72
73/* Return address signing support (pac-ret). */
74#define PACIASP hint 25
75#define AUTIASP hint 29
76
77/* Guarded Control Stack support. */33/* Guarded Control Stack support. */
78#define CHKFEAT_X16 hint 4034#define CHKFEAT_X16 hint 40
79#define MRS_GCSPR(x) mrs x, s3_3_c2_c5_135#define MRS_GCSPR(x) mrs x, s3_3_c2_c5_1
...@@ -103,11 +59,7 @@ strip_pac (void *p)...@@ -103,11 +59,7 @@ strip_pac (void *p)
10359
104/* Add GNU property note with the supported features to all asm code60/* Add GNU property note with the supported features to all asm code
105 where sysdep.h is included. */61 where sysdep.h is included. */
106#if HAVE_AARCH64_BTI && HAVE_AARCH64_PAC_RET
107GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC|FEATURE_1_GCS)62GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC|FEATURE_1_GCS)
108#elif HAVE_AARCH64_BTI
109GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)
110#endif
11163
112/* Define an entry point visible from C. */64/* Define an entry point visible from C. */
113#define ENTRY(name) \65#define ENTRY(name) \
...@@ -116,7 +68,7 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)...@@ -116,7 +68,7 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)
116 .p2align 6; \68 .p2align 6; \
117 C_LABEL(name) \69 C_LABEL(name) \
118 cfi_startproc; \70 cfi_startproc; \
119 BTI_C; \71 bti c; \
120 CALL_MCOUNT72 CALL_MCOUNT
12173
122/* Define an entry point visible from C. */74/* Define an entry point visible from C. */
...@@ -126,7 +78,7 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)...@@ -126,7 +78,7 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)
126 .p2align align; \78 .p2align align; \
127 C_LABEL(name) \79 C_LABEL(name) \
128 cfi_startproc; \80 cfi_startproc; \
129 BTI_C; \81 bti c; \
130 CALL_MCOUNT82 CALL_MCOUNT
13183
132/* Define an entry point visible from C with a specified alignment and84/* Define an entry point visible from C with a specified alignment and
...@@ -143,7 +95,7 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)...@@ -143,7 +95,7 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)
143 .endr; \95 .endr; \
144 C_LABEL(name) \96 C_LABEL(name) \
145 cfi_startproc; \97 cfi_startproc; \
146 BTI_C; \98 bti c; \
147 CALL_MCOUNT99 CALL_MCOUNT
148100
149#undef END101#undef END
...@@ -195,33 +147,6 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)...@@ -195,33 +147,6 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_GCS)
195# define L(name) .L##name147# define L(name) .L##name
196#endif148#endif
197149
198/* Load or store to/from a pc-relative EXPR into/from R, using T.
199 Note R and T are register numbers and not register names. */
200#define LDST_PCREL(OP, R, T, EXPR) \
201 adrp x##T, EXPR; \
202 OP PTR_REG (R), [x##T, #:lo12:EXPR]; \
203
204/* Load or store to/from a got-relative EXPR into/from R, using T.
205 Note R and T are register numbers and not register names. */
206#define LDST_GLOBAL(OP, R, T, EXPR) \
207 adrp x##T, :got:EXPR; \
208 ldr PTR_REG (T), [x##T, #:got_lo12:EXPR]; \
209 OP PTR_REG (R), [x##T];
210
211/* Load an immediate into R.
212 Note R is a register number and not a register name. */
213#ifdef __LP64__
214# define MOVL(R, NAME) \
215 movz PTR_REG (R), #:abs_g3:NAME; \
216 movk PTR_REG (R), #:abs_g2_nc:NAME; \
217 movk PTR_REG (R), #:abs_g1_nc:NAME; \
218 movk PTR_REG (R), #:abs_g0_nc:NAME;
219#else
220# define MOVL(R, NAME) \
221 movz PTR_REG (R), #:abs_g1:NAME; \
222 movk PTR_REG (R), #:abs_g0_nc:NAME;
223#endif
224
225/* Since C identifiers are not normally prefixed with an underscore150/* Since C identifiers are not normally prefixed with an underscore
226 on this system, the asm identifier `syscall_error' intrudes on the151 on this system, the asm identifier `syscall_error' intrudes on the
227 C name space. Make sure we use an innocuous name. */152 C name space. Make sure we use an innocuous name. */
lib/libc/glibc/sysdeps/generic/sysdep.h+3
...@@ -45,6 +45,7 @@...@@ -45,6 +45,7 @@
45# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off45# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
46# define cfi_offset(reg, off) .cfi_offset reg, off46# define cfi_offset(reg, off) .cfi_offset reg, off
47# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off47# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
48# define cfi_val_offset(reg, off) .cfi_val_offset reg, off
48# define cfi_register(r1, r2) .cfi_register r1, r249# define cfi_register(r1, r2) .cfi_register r1, r2
49# define cfi_return_column(reg) .cfi_return_column reg50# define cfi_return_column(reg) .cfi_return_column reg
50# define cfi_restore(reg) .cfi_restore reg51# define cfi_restore(reg) .cfi_restore reg
...@@ -74,6 +75,8 @@...@@ -74,6 +75,8 @@
74 ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)75 ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
75# define CFI_REL_OFFSET(reg, off) \76# define CFI_REL_OFFSET(reg, off) \
76 ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)77 ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
78# define CFI_VAL_OFFSET(reg, off) \
79 ".cfi_val_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
77# define CFI_REGISTER(r1, r2) \80# define CFI_REGISTER(r1, r2) \
78 ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)81 ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
79# define CFI_RETURN_COLUMN(reg) \82# define CFI_RETURN_COLUMN(reg) \
lib/libc/glibc/sysdeps/htl/libc-lockP.h+10-39
...@@ -75,7 +75,6 @@...@@ -75,7 +75,6 @@
7575
76extern int __pthread_mutex_init (pthread_mutex_t *__mutex,76extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
77 const pthread_mutexattr_t *__mutex_attr);77 const pthread_mutexattr_t *__mutex_attr);
78
79extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);78extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
80libc_hidden_proto (__pthread_mutex_destroy)79libc_hidden_proto (__pthread_mutex_destroy)
8180
...@@ -91,75 +90,47 @@ libc_hidden_proto (__pthread_mutexattr_init)...@@ -91,75 +90,47 @@ libc_hidden_proto (__pthread_mutexattr_init)
91extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr);90extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr);
92libc_hidden_proto (__pthread_mutexattr_destroy)91libc_hidden_proto (__pthread_mutexattr_destroy)
9392
94extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr,
95 int __kind);
96
97extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock,93extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock,
98 const pthread_rwlockattr_t *__attr);94 const pthread_rwlockattr_t *__attr);
95libc_hidden_proto (__pthread_rwlock_init)
9996
100extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock);97extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock);
98libc_hidden_proto (__pthread_rwlock_destroy)
10199
102extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock);100extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock);
101libc_hidden_proto (__pthread_rwlock_rdlock)
103102
104extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock);103extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock);
104libc_hidden_proto (__pthread_rwlock_tryrdlock)
105105
106extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock);106extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock);
107libc_hidden_proto (__pthread_rwlock_wrlock)
107108
108extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock);109extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock);
110libc_hidden_proto (__pthread_rwlock_trywrlock)
109111
110extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);112extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
113libc_hidden_proto (__pthread_rwlock_unlock)
111114
112extern int __pthread_once (pthread_once_t *__once_control,115extern int __pthread_once (pthread_once_t *__once_control,
113 void (*__init_routine) (void));116 void (*__init_routine) (void));
117libc_hidden_proto (__pthread_once);
114118
115extern int __pthread_atfork (void (*__prepare) (void),119extern int __pthread_atfork (void (*__prepare) (void),
116 void (*__parent) (void),120 void (*__parent) (void),
117 void (*__child) (void));121 void (*__child) (void));
118122
123extern int __pthread_setcancelstate (int state, int *oldstate);
124libc_hidden_proto (__pthread_setcancelstate)
119/* Make the pthread functions weak so that we can elide them from125/* Make the pthread functions weak so that we can elide them from
120 single-threaded processes. */126 single-threaded processes. */
121#if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread)127#if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread)
122# ifdef weak_extern128# ifdef weak_extern
123weak_extern (__pthread_mutex_init)
124weak_extern (__pthread_mutex_destroy)
125weak_extern (__pthread_mutex_lock)
126weak_extern (__pthread_mutex_trylock)
127weak_extern (__pthread_mutex_unlock)
128weak_extern (__pthread_mutexattr_settype)
129weak_extern (__pthread_rwlock_init)
130weak_extern (__pthread_rwlock_destroy)
131weak_extern (__pthread_rwlock_rdlock)
132weak_extern (__pthread_rwlock_tryrdlock)
133weak_extern (__pthread_rwlock_wrlock)
134weak_extern (__pthread_rwlock_trywrlock)
135weak_extern (__pthread_rwlock_unlock)
136weak_extern (__pthread_key_create)
137weak_extern (__pthread_setspecific)
138weak_extern (__pthread_getspecific)
139weak_extern (__pthread_once)
140weak_extern (__pthread_initialize)129weak_extern (__pthread_initialize)
141weak_extern (__pthread_atfork)130weak_extern (__pthread_atfork)
142weak_extern (__pthread_setcancelstate)
143# else131# else
144# pragma weak __pthread_mutex_init
145# pragma weak __pthread_mutex_destroy
146# pragma weak __pthread_mutex_lock
147# pragma weak __pthread_mutex_trylock
148# pragma weak __pthread_mutex_unlock
149# pragma weak __pthread_mutexattr_settype
150# pragma weak __pthread_rwlock_destroy
151# pragma weak __pthread_rwlock_rdlock
152# pragma weak __pthread_rwlock_tryrdlock
153# pragma weak __pthread_rwlock_wrlock
154# pragma weak __pthread_rwlock_trywrlock
155# pragma weak __pthread_rwlock_unlock
156# pragma weak __pthread_key_create
157# pragma weak __pthread_setspecific
158# pragma weak __pthread_getspecific
159# pragma weak __pthread_once
160# pragma weak __pthread_initialize132# pragma weak __pthread_initialize
161# pragma weak __pthread_atfork133# pragma weak __pthread_atfork
162# pragma weak __pthread_setcancelstate
163# endif134# endif
164#endif135#endif
165136
lib/libc/glibc/sysdeps/mach/sysdep.h+5
...@@ -20,6 +20,11 @@...@@ -20,6 +20,11 @@
20/* Get the Mach definitions of ENTRY and kernel_trap. */20/* Get the Mach definitions of ENTRY and kernel_trap. */
21#include <mach/machine/syscall_sw.h>21#include <mach/machine/syscall_sw.h>
2222
23/* This macro is defined in Mach system headers, but string functions use it
24 with different definitions depending on whether being compiled for
25 wide-characters or not. */
26#undef P2ALIGN
27
23/* The Mach definitions assume underscores should be prepended to28/* The Mach definitions assume underscores should be prepended to
24 symbol names. Redefine them to do so only when appropriate. */29 symbol names. Redefine them to do so only when appropriate. */
25#undef EXT30#undef EXT
lib/libc/glibc/sysdeps/nptl/pthread.h+5
...@@ -1317,6 +1317,11 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,...@@ -1317,6 +1317,11 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,
1317 __THROW __nonnull ((2));1317 __THROW __nonnull ((2));
1318#endif1318#endif
13191319
1320#ifdef __USE_GNU
1321/* Return the Linux TID for THREAD_ID. Returns -1 on failure. */
1322extern pid_t pthread_gettid_np (pthread_t __thread_id);
1323#endif
1324
13201325
1321/* Install handlers to be called when a new process is created with FORK.1326/* Install handlers to be called when a new process is created with FORK.
1322 The PREPARE handler is called in the parent process just before performing1327 The PREPARE handler is called in the parent process just before performing
lib/libc/glibc/sysdeps/sparc/sparc32/start.S+8-3
...@@ -35,6 +35,7 @@...@@ -35,6 +35,7 @@
3535
36#include <sysdep.h>36#include <sysdep.h>
3737
38#define FRAME_SIZE 104
3839
39 .section ".text"40 .section ".text"
40 .align 441 .align 4
...@@ -48,12 +49,12 @@ _start:...@@ -48,12 +49,12 @@ _start:
48 /* Terminate the stack frame, and reserve space for functions to49 /* Terminate the stack frame, and reserve space for functions to
49 drop their arguments. */50 drop their arguments. */
50 mov %g0, %fp51 mov %g0, %fp
51 sub %sp, 6*4, %sp52 sub %sp, FRAME_SIZE, %sp
5253
53 /* Extract the arguments and environment as encoded on the stack. The54 /* Extract the arguments and environment as encoded on the stack. The
54 argument info starts after one register window (16 words) past the SP. */55 argument info starts after one register window (16 words) past the SP. */
55 ld [%sp+22*4], %o156 ld [%sp+168], %o1
56 add %sp, 23*4, %o257 add %sp, 172, %o2
5758
58 /* Load the addresses of the user entry points. */59 /* Load the addresses of the user entry points. */
59#ifndef PIC60#ifndef PIC
...@@ -73,6 +74,10 @@ _start:...@@ -73,6 +74,10 @@ _start:
73 be NULL. */74 be NULL. */
74 mov %g1, %o575 mov %g1, %o5
7576
77 /* Provide the highest stack address to update the __libc_stack_end (used
78 to enable executable stacks if required). */
79 st %sp, [%sp+23*4]
80
76 /* Let libc do the rest of the initialization, and call main. */81 /* Let libc do the rest of the initialization, and call main. */
77 call __libc_start_main82 call __libc_start_main
78 nop83 nop
lib/libc/glibc/sysdeps/sparc/sparc64/start.S+4
...@@ -74,6 +74,10 @@ _start:...@@ -74,6 +74,10 @@ _start:
74 be NULL. */74 be NULL. */
75 mov %g1, %o575 mov %g1, %o5
7676
77 /* Provide the highest stack address to update the __libc_stack_end (used
78 to enable executable stacks if required). */
79 stx %sp, [%sp+STACK_BIAS+22*8]
80
77 /* Let libc do the rest of the initialization, and call main. */81 /* Let libc do the rest of the initialization, and call main. */
78 call __libc_start_main82 call __libc_start_main
79 nop83 nop
lib/libc/glibc/sysdeps/unix/sysv/linux/aarch64/sysdep.h+2-7
...@@ -152,13 +152,8 @@...@@ -152,13 +152,8 @@
152152
153#else /* not __ASSEMBLER__ */153#else /* not __ASSEMBLER__ */
154154
155# ifdef __LP64__155# define VDSO_NAME "LINUX_2.6.39"
156# define VDSO_NAME "LINUX_2.6.39"156# define VDSO_HASH 123718537
157# define VDSO_HASH 123718537
158# else
159# define VDSO_NAME "LINUX_4.9"
160# define VDSO_HASH 61765625
161# endif
162157
163/* List of system calls which are supported as vsyscalls. */158/* List of system calls which are supported as vsyscalls. */
164# define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"159# define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"
lib/libc/glibc/sysdeps/unix/sysv/linux/kernel-features.h+4
...@@ -54,6 +54,10 @@...@@ -54,6 +54,10 @@
54 configurations). */54 configurations). */
55#define __ASSUME_SET_ROBUST_LIST 155#define __ASSUME_SET_ROBUST_LIST 1
5656
57/* The termios2 interface was introduced across all architectures except
58 Alpha in kernel 2.6.22. */
59#define __ASSUME_TERMIOS2 1
60
57/* Support for various CLOEXEC and NONBLOCK flags was added in61/* Support for various CLOEXEC and NONBLOCK flags was added in
58 2.6.27. */62 2.6.27. */
59#define __ASSUME_IN_NONBLOCK 163#define __ASSUME_IN_NONBLOCK 1
lib/libc/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h+2-1
...@@ -145,11 +145,12 @@...@@ -145,11 +145,12 @@
145# define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres"145# define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres"
146# define HAVE_CLOCK_GETTIME64_VSYSCALL "__vdso_clock_gettime"146# define HAVE_CLOCK_GETTIME64_VSYSCALL "__vdso_clock_gettime"
147# define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday"147# define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday"
148# define HAVE_GETRANDOM_VSYSCALL "__vdso_getrandom"
148# else149# else
149# define VDSO_NAME "LINUX_5.4"150# define VDSO_NAME "LINUX_5.4"
150# define VDSO_HASH 61765876151# define VDSO_HASH 61765876
151152
152/* RV32 does not support the gettime VDSO syscalls. */153/* RV32 does not support the gettime and getrandom VDSO syscalls. */
153# endif154# endif
154# define HAVE_CLONE3_WRAPPER 1155# define HAVE_CLONE3_WRAPPER 1
155156
lib/libc/glibc/sysdeps/x86/sysdep.h+29
...@@ -102,6 +102,9 @@...@@ -102,6 +102,9 @@
102 | (1 << X86_XSTATE_ZMM_ID) \102 | (1 << X86_XSTATE_ZMM_ID) \
103 | (1 << X86_XSTATE_APX_F_ID))103 | (1 << X86_XSTATE_APX_F_ID))
104104
105/* The maximum supported xstate ID. */
106# define X86_XSTATE_MAX_ID X86_XSTATE_APX_F_ID
107
105/* AMX state mask. */108/* AMX state mask. */
106# define AMX_STATE_SAVE_MASK \109# define AMX_STATE_SAVE_MASK \
107 ((1 << X86_XSTATE_TILECFG_ID) | (1 << X86_XSTATE_TILEDATA_ID))110 ((1 << X86_XSTATE_TILECFG_ID) | (1 << X86_XSTATE_TILEDATA_ID))
...@@ -123,6 +126,9 @@...@@ -123,6 +126,9 @@
123 | (1 << X86_XSTATE_K_ID) \126 | (1 << X86_XSTATE_K_ID) \
124 | (1 << X86_XSTATE_ZMM_H_ID))127 | (1 << X86_XSTATE_ZMM_H_ID))
125128
129/* The maximum supported xstate ID. */
130# define X86_XSTATE_MAX_ID X86_XSTATE_ZMM_H_ID
131
126/* States to be included in xsave_state_size. */132/* States to be included in xsave_state_size. */
127# define FULL_STATE_SAVE_MASK STATE_SAVE_MASK133# define FULL_STATE_SAVE_MASK STATE_SAVE_MASK
128#endif134#endif
...@@ -177,6 +183,29 @@...@@ -177,6 +183,29 @@
177183
178#define atom_text_section .section ".text.atom", "ax"184#define atom_text_section .section ".text.atom", "ax"
179185
186#ifndef DL_STACK_ALIGNMENT
187/* Due to GCC bug:
188
189 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066
190
191 __tls_get_addr may be called with 8-byte/4-byte stack alignment.
192 Although this bug has been fixed in GCC 4.9.4, 5.3 and 6, we can't
193 assume that stack will be always aligned at 16 bytes. */
194# ifdef __x86_64__
195# define DL_STACK_ALIGNMENT 8
196# define MINIMUM_ALIGNMENT 16
197# else
198# define DL_STACK_ALIGNMENT 4
199# endif
200#endif
201
202/* True if _dl_runtime_resolve/_dl_tlsdesc_dynamic should align stack for
203 STATE_SAVE or align stack to MINIMUM_ALIGNMENT bytes before calling
204 _dl_fixup/__tls_get_addr. */
205#define DL_RUNTIME_RESOLVE_REALIGN_STACK \
206 (STATE_SAVE_ALIGNMENT > DL_STACK_ALIGNMENT \
207 || MINIMUM_ALIGNMENT > DL_STACK_ALIGNMENT)
208
180#endif /* __ASSEMBLER__ */209#endif /* __ASSEMBLER__ */
181210
182#endif /* _X86_SYSDEP_H */211#endif /* _X86_SYSDEP_H */
lib/libc/include/aarch64-linux-gnu/bits/fcntl.h+4-10
...@@ -25,17 +25,11 @@...@@ -25,17 +25,11 @@
25#define __O_NOFOLLOW 010000025#define __O_NOFOLLOW 0100000
26#define __O_DIRECT 020000026#define __O_DIRECT 0200000
2727
28#ifdef __ILP32__28#define __O_LARGEFILE 0
29# define __O_LARGEFILE 0400000
30#else
31# define __O_LARGEFILE 0
32#endif
3329
34#ifdef __LP64__30#define F_GETLK64 5
35# define F_GETLK64 531#define F_SETLK64 6
36# define F_SETLK64 632#define F_SETLKW64 7
37# define F_SETLKW64 7
38#endif
3933
40struct flock34struct flock
41 {35 {
lib/libc/include/aarch64-linux-gnu/bits/math-vector.h+32
...@@ -37,6 +37,10 @@...@@ -37,6 +37,10 @@
37# define __DECL_SIMD_acosh __DECL_SIMD_aarch6437# define __DECL_SIMD_acosh __DECL_SIMD_aarch64
38# undef __DECL_SIMD_acoshf38# undef __DECL_SIMD_acoshf
39# define __DECL_SIMD_acoshf __DECL_SIMD_aarch6439# define __DECL_SIMD_acoshf __DECL_SIMD_aarch64
40# undef __DECL_SIMD_acospi
41# define __DECL_SIMD_acospi __DECL_SIMD_aarch64
42# undef __DECL_SIMD_acospif
43# define __DECL_SIMD_acospif __DECL_SIMD_aarch64
40# undef __DECL_SIMD_asin44# undef __DECL_SIMD_asin
41# define __DECL_SIMD_asin __DECL_SIMD_aarch6445# define __DECL_SIMD_asin __DECL_SIMD_aarch64
42# undef __DECL_SIMD_asinf46# undef __DECL_SIMD_asinf
...@@ -45,6 +49,10 @@...@@ -45,6 +49,10 @@
45# define __DECL_SIMD_asinh __DECL_SIMD_aarch6449# define __DECL_SIMD_asinh __DECL_SIMD_aarch64
46# undef __DECL_SIMD_asinhf50# undef __DECL_SIMD_asinhf
47# define __DECL_SIMD_asinhf __DECL_SIMD_aarch6451# define __DECL_SIMD_asinhf __DECL_SIMD_aarch64
52# undef __DECL_SIMD_asinpi
53# define __DECL_SIMD_asinpi __DECL_SIMD_aarch64
54# undef __DECL_SIMD_asinpif
55# define __DECL_SIMD_asinpif __DECL_SIMD_aarch64
48# undef __DECL_SIMD_atan56# undef __DECL_SIMD_atan
49# define __DECL_SIMD_atan __DECL_SIMD_aarch6457# define __DECL_SIMD_atan __DECL_SIMD_aarch64
50# undef __DECL_SIMD_atanf58# undef __DECL_SIMD_atanf
...@@ -53,10 +61,18 @@...@@ -53,10 +61,18 @@
53# define __DECL_SIMD_atanh __DECL_SIMD_aarch6461# define __DECL_SIMD_atanh __DECL_SIMD_aarch64
54# undef __DECL_SIMD_atanhf62# undef __DECL_SIMD_atanhf
55# define __DECL_SIMD_atanhf __DECL_SIMD_aarch6463# define __DECL_SIMD_atanhf __DECL_SIMD_aarch64
64# undef __DECL_SIMD_atanpi
65# define __DECL_SIMD_atanpi __DECL_SIMD_aarch64
66# undef __DECL_SIMD_atanpif
67# define __DECL_SIMD_atanpif __DECL_SIMD_aarch64
56# undef __DECL_SIMD_atan268# undef __DECL_SIMD_atan2
57# define __DECL_SIMD_atan2 __DECL_SIMD_aarch6469# define __DECL_SIMD_atan2 __DECL_SIMD_aarch64
58# undef __DECL_SIMD_atan2f70# undef __DECL_SIMD_atan2f
59# define __DECL_SIMD_atan2f __DECL_SIMD_aarch6471# define __DECL_SIMD_atan2f __DECL_SIMD_aarch64
72# undef __DECL_SIMD_atan2pi
73# define __DECL_SIMD_atan2pi __DECL_SIMD_aarch64
74# undef __DECL_SIMD_atan2pif
75# define __DECL_SIMD_atan2pif __DECL_SIMD_aarch64
60# undef __DECL_SIMD_cbrt76# undef __DECL_SIMD_cbrt
61# define __DECL_SIMD_cbrt __DECL_SIMD_aarch6477# define __DECL_SIMD_cbrt __DECL_SIMD_aarch64
62# undef __DECL_SIMD_cbrtf78# undef __DECL_SIMD_cbrtf
...@@ -176,12 +192,16 @@ typedef __SVBool_t __sv_bool_t;...@@ -176,12 +192,16 @@ typedef __SVBool_t __sv_bool_t;
176# define __vpcs __attribute__ ((__aarch64_vector_pcs__))192# define __vpcs __attribute__ ((__aarch64_vector_pcs__))
177193
178__vpcs __f32x4_t _ZGVnN4vv_atan2f (__f32x4_t, __f32x4_t);194__vpcs __f32x4_t _ZGVnN4vv_atan2f (__f32x4_t, __f32x4_t);
195__vpcs __f32x4_t _ZGVnN4vv_atan2pif (__f32x4_t, __f32x4_t);
179__vpcs __f32x4_t _ZGVnN4v_acosf (__f32x4_t);196__vpcs __f32x4_t _ZGVnN4v_acosf (__f32x4_t);
180__vpcs __f32x4_t _ZGVnN4v_acoshf (__f32x4_t);197__vpcs __f32x4_t _ZGVnN4v_acoshf (__f32x4_t);
198__vpcs __f32x4_t _ZGVnN4v_acospif (__f32x4_t);
181__vpcs __f32x4_t _ZGVnN4v_asinf (__f32x4_t);199__vpcs __f32x4_t _ZGVnN4v_asinf (__f32x4_t);
182__vpcs __f32x4_t _ZGVnN4v_asinhf (__f32x4_t);200__vpcs __f32x4_t _ZGVnN4v_asinhf (__f32x4_t);
201__vpcs __f32x4_t _ZGVnN4v_asinpif (__f32x4_t);
183__vpcs __f32x4_t _ZGVnN4v_atanf (__f32x4_t);202__vpcs __f32x4_t _ZGVnN4v_atanf (__f32x4_t);
184__vpcs __f32x4_t _ZGVnN4v_atanhf (__f32x4_t);203__vpcs __f32x4_t _ZGVnN4v_atanhf (__f32x4_t);
204__vpcs __f32x4_t _ZGVnN4v_atanpif (__f32x4_t);
185__vpcs __f32x4_t _ZGVnN4v_cbrtf (__f32x4_t);205__vpcs __f32x4_t _ZGVnN4v_cbrtf (__f32x4_t);
186__vpcs __f32x4_t _ZGVnN4v_cosf (__f32x4_t);206__vpcs __f32x4_t _ZGVnN4v_cosf (__f32x4_t);
187__vpcs __f32x4_t _ZGVnN4v_coshf (__f32x4_t);207__vpcs __f32x4_t _ZGVnN4v_coshf (__f32x4_t);
...@@ -207,12 +227,16 @@ __vpcs __f32x4_t _ZGVnN4v_tanhf (__f32x4_t);...@@ -207,12 +227,16 @@ __vpcs __f32x4_t _ZGVnN4v_tanhf (__f32x4_t);
207__vpcs __f32x4_t _ZGVnN4v_tanpif (__f32x4_t);227__vpcs __f32x4_t _ZGVnN4v_tanpif (__f32x4_t);
208228
209__vpcs __f64x2_t _ZGVnN2vv_atan2 (__f64x2_t, __f64x2_t);229__vpcs __f64x2_t _ZGVnN2vv_atan2 (__f64x2_t, __f64x2_t);
230__vpcs __f64x2_t _ZGVnN2vv_atan2pi (__f64x2_t, __f64x2_t);
210__vpcs __f64x2_t _ZGVnN2v_acos (__f64x2_t);231__vpcs __f64x2_t _ZGVnN2v_acos (__f64x2_t);
211__vpcs __f64x2_t _ZGVnN2v_acosh (__f64x2_t);232__vpcs __f64x2_t _ZGVnN2v_acosh (__f64x2_t);
233__vpcs __f64x2_t _ZGVnN2v_acospi (__f64x2_t);
212__vpcs __f64x2_t _ZGVnN2v_asin (__f64x2_t);234__vpcs __f64x2_t _ZGVnN2v_asin (__f64x2_t);
213__vpcs __f64x2_t _ZGVnN2v_asinh (__f64x2_t);235__vpcs __f64x2_t _ZGVnN2v_asinh (__f64x2_t);
236__vpcs __f64x2_t _ZGVnN2v_asinpi (__f64x2_t);
214__vpcs __f64x2_t _ZGVnN2v_atan (__f64x2_t);237__vpcs __f64x2_t _ZGVnN2v_atan (__f64x2_t);
215__vpcs __f64x2_t _ZGVnN2v_atanh (__f64x2_t);238__vpcs __f64x2_t _ZGVnN2v_atanh (__f64x2_t);
239__vpcs __f64x2_t _ZGVnN2v_atanpi (__f64x2_t);
216__vpcs __f64x2_t _ZGVnN2v_cbrt (__f64x2_t);240__vpcs __f64x2_t _ZGVnN2v_cbrt (__f64x2_t);
217__vpcs __f64x2_t _ZGVnN2v_cos (__f64x2_t);241__vpcs __f64x2_t _ZGVnN2v_cos (__f64x2_t);
218__vpcs __f64x2_t _ZGVnN2v_cosh (__f64x2_t);242__vpcs __f64x2_t _ZGVnN2v_cosh (__f64x2_t);
...@@ -243,12 +267,16 @@ __vpcs __f64x2_t _ZGVnN2v_tanpi (__f64x2_t);...@@ -243,12 +267,16 @@ __vpcs __f64x2_t _ZGVnN2v_tanpi (__f64x2_t);
243#ifdef __SVE_VEC_MATH_SUPPORTED267#ifdef __SVE_VEC_MATH_SUPPORTED
244268
245__sv_f32_t _ZGVsMxvv_atan2f (__sv_f32_t, __sv_f32_t, __sv_bool_t);269__sv_f32_t _ZGVsMxvv_atan2f (__sv_f32_t, __sv_f32_t, __sv_bool_t);
270__sv_f32_t _ZGVsMxvv_atan2pif (__sv_f32_t, __sv_f32_t, __sv_bool_t);
246__sv_f32_t _ZGVsMxv_acosf (__sv_f32_t, __sv_bool_t);271__sv_f32_t _ZGVsMxv_acosf (__sv_f32_t, __sv_bool_t);
247__sv_f32_t _ZGVsMxv_acoshf (__sv_f32_t, __sv_bool_t);272__sv_f32_t _ZGVsMxv_acoshf (__sv_f32_t, __sv_bool_t);
273__sv_f32_t _ZGVsMxv_acospif (__sv_f32_t, __sv_bool_t);
248__sv_f32_t _ZGVsMxv_asinf (__sv_f32_t, __sv_bool_t);274__sv_f32_t _ZGVsMxv_asinf (__sv_f32_t, __sv_bool_t);
249__sv_f32_t _ZGVsMxv_asinhf (__sv_f32_t, __sv_bool_t);275__sv_f32_t _ZGVsMxv_asinhf (__sv_f32_t, __sv_bool_t);
276__sv_f32_t _ZGVsMxv_asinpif (__sv_f32_t, __sv_bool_t);
250__sv_f32_t _ZGVsMxv_atanf (__sv_f32_t, __sv_bool_t);277__sv_f32_t _ZGVsMxv_atanf (__sv_f32_t, __sv_bool_t);
251__sv_f32_t _ZGVsMxv_atanhf (__sv_f32_t, __sv_bool_t);278__sv_f32_t _ZGVsMxv_atanhf (__sv_f32_t, __sv_bool_t);
279__sv_f32_t _ZGVsMxv_atanpif (__sv_f32_t, __sv_bool_t);
252__sv_f32_t _ZGVsMxv_cbrtf (__sv_f32_t, __sv_bool_t);280__sv_f32_t _ZGVsMxv_cbrtf (__sv_f32_t, __sv_bool_t);
253__sv_f32_t _ZGVsMxv_cosf (__sv_f32_t, __sv_bool_t);281__sv_f32_t _ZGVsMxv_cosf (__sv_f32_t, __sv_bool_t);
254__sv_f32_t _ZGVsMxv_coshf (__sv_f32_t, __sv_bool_t);282__sv_f32_t _ZGVsMxv_coshf (__sv_f32_t, __sv_bool_t);
...@@ -274,12 +302,16 @@ __sv_f32_t _ZGVsMxv_tanhf (__sv_f32_t, __sv_bool_t);...@@ -274,12 +302,16 @@ __sv_f32_t _ZGVsMxv_tanhf (__sv_f32_t, __sv_bool_t);
274__sv_f32_t _ZGVsMxv_tanpif (__sv_f32_t, __sv_bool_t);302__sv_f32_t _ZGVsMxv_tanpif (__sv_f32_t, __sv_bool_t);
275303
276__sv_f64_t _ZGVsMxvv_atan2 (__sv_f64_t, __sv_f64_t, __sv_bool_t);304__sv_f64_t _ZGVsMxvv_atan2 (__sv_f64_t, __sv_f64_t, __sv_bool_t);
305__sv_f64_t _ZGVsMxvv_atan2pi (__sv_f64_t, __sv_f64_t, __sv_bool_t);
277__sv_f64_t _ZGVsMxv_acos (__sv_f64_t, __sv_bool_t);306__sv_f64_t _ZGVsMxv_acos (__sv_f64_t, __sv_bool_t);
278__sv_f64_t _ZGVsMxv_acosh (__sv_f64_t, __sv_bool_t);307__sv_f64_t _ZGVsMxv_acosh (__sv_f64_t, __sv_bool_t);
308__sv_f64_t _ZGVsMxv_acospi (__sv_f64_t, __sv_bool_t);
279__sv_f64_t _ZGVsMxv_asin (__sv_f64_t, __sv_bool_t);309__sv_f64_t _ZGVsMxv_asin (__sv_f64_t, __sv_bool_t);
280__sv_f64_t _ZGVsMxv_asinh (__sv_f64_t, __sv_bool_t);310__sv_f64_t _ZGVsMxv_asinh (__sv_f64_t, __sv_bool_t);
311__sv_f64_t _ZGVsMxv_asinpi (__sv_f64_t, __sv_bool_t);
281__sv_f64_t _ZGVsMxv_atan (__sv_f64_t, __sv_bool_t);312__sv_f64_t _ZGVsMxv_atan (__sv_f64_t, __sv_bool_t);
282__sv_f64_t _ZGVsMxv_atanh (__sv_f64_t, __sv_bool_t);313__sv_f64_t _ZGVsMxv_atanh (__sv_f64_t, __sv_bool_t);
314__sv_f64_t _ZGVsMxv_atanpi (__sv_f64_t, __sv_bool_t);
283__sv_f64_t _ZGVsMxv_cbrt (__sv_f64_t, __sv_bool_t);315__sv_f64_t _ZGVsMxv_cbrt (__sv_f64_t, __sv_bool_t);
284__sv_f64_t _ZGVsMxv_cos (__sv_f64_t, __sv_bool_t);316__sv_f64_t _ZGVsMxv_cos (__sv_f64_t, __sv_bool_t);
285__sv_f64_t _ZGVsMxv_cosh (__sv_f64_t, __sv_bool_t);317__sv_f64_t _ZGVsMxv_cosh (__sv_f64_t, __sv_bool_t);
lib/libc/include/aarch64-linux-gnu/bits/pthreadtypes-arch.h+7-17
...@@ -21,23 +21,13 @@...@@ -21,23 +21,13 @@
2121
22#include <bits/endian.h>22#include <bits/endian.h>
2323
24#ifdef __ILP32__24#define __SIZEOF_PTHREAD_ATTR_T 64
25# define __SIZEOF_PTHREAD_ATTR_T 3225#define __SIZEOF_PTHREAD_MUTEX_T 48
26# define __SIZEOF_PTHREAD_MUTEX_T 3226#define __SIZEOF_PTHREAD_MUTEXATTR_T 8
27# define __SIZEOF_PTHREAD_MUTEXATTR_T 427#define __SIZEOF_PTHREAD_CONDATTR_T 8
28# define __SIZEOF_PTHREAD_CONDATTR_T 428#define __SIZEOF_PTHREAD_RWLOCK_T 56
29# define __SIZEOF_PTHREAD_RWLOCK_T 4829#define __SIZEOF_PTHREAD_BARRIER_T 32
30# define __SIZEOF_PTHREAD_BARRIER_T 2030#define __SIZEOF_PTHREAD_BARRIERATTR_T 8
31# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
32#else
33# define __SIZEOF_PTHREAD_ATTR_T 64
34# define __SIZEOF_PTHREAD_MUTEX_T 48
35# define __SIZEOF_PTHREAD_MUTEXATTR_T 8
36# define __SIZEOF_PTHREAD_CONDATTR_T 8
37# define __SIZEOF_PTHREAD_RWLOCK_T 56
38# define __SIZEOF_PTHREAD_BARRIER_T 32
39# define __SIZEOF_PTHREAD_BARRIERATTR_T 8
40#endif
41#define __SIZEOF_PTHREAD_COND_T 4831#define __SIZEOF_PTHREAD_COND_T 48
42#define __SIZEOF_PTHREAD_RWLOCKATTR_T 832#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
4333
lib/libc/include/aarch64-linux-gnu/bits/semaphore.h+1-7
...@@ -20,13 +20,7 @@...@@ -20,13 +20,7 @@
20# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."20# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
21#endif21#endif
2222
2323#define __SIZEOF_SEM_T 32
24#ifdef __ILP32__
25# define __SIZEOF_SEM_T 16
26#else
27# define __SIZEOF_SEM_T 32
28#endif
29
3024
31/* Value returned if `sem_open' failed. */25/* Value returned if `sem_open' failed. */
32#define SEM_FAILED ((sem_t *) 0)26#define SEM_FAILED ((sem_t *) 0)
lib/libc/include/aarch64-linux-gnu/bits/wordsize.h+1-8
...@@ -17,12 +17,5 @@...@@ -17,12 +17,5 @@
17 License along with the GNU C Library; if not, see17 License along with the GNU C Library; if not, see
18 <https://www.gnu.org/licenses/>. */18 <https://www.gnu.org/licenses/>. */
1919
20#ifdef __LP64__20#define __WORDSIZE 64
21# define __WORDSIZE 64
22#else
23# define __WORDSIZE 32
24# define __WORDSIZE32_SIZE_ULONG 1
25# define __WORDSIZE32_PTRDIFF_LONG 1
26#endif
27
28#define __WORDSIZE_TIME64_COMPAT32 021#define __WORDSIZE_TIME64_COMPAT32 0
\ No newline at end of file
lib/libc/include/generic-glibc/arpa/inet.h+5
...@@ -101,6 +101,11 @@ extern char *inet_nsap_ntoa (int __len, const unsigned char *__cp,...@@ -101,6 +101,11 @@ extern char *inet_nsap_ntoa (int __len, const unsigned char *__cp,
101 char *__buf) __THROW;101 char *__buf) __THROW;
102#endif102#endif
103103
104#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
105/* Include functions with security checks. */
106# include <bits/inet-fortified.h>
107#endif
108
104__END_DECLS109__END_DECLS
105110
106#endif /* arpa/inet.h */111#endif /* arpa/inet.h */
\ No newline at end of file
lib/libc/include/generic-glibc/bits/fcntl-linux.h+2
...@@ -379,6 +379,8 @@ struct file_handle...@@ -379,6 +379,8 @@ struct file_handle
379 identity and may not379 identity and may not
380 be usable to380 be usable to
381 open_by_handle_at. */381 open_by_handle_at. */
382# define AT_HANDLE_MNT_ID_UNIQUE 1 /* Return the 64-bit unique mount
383 ID. */
382#endif384#endif
383385
384__BEGIN_DECLS386__BEGIN_DECLS
lib/libc/include/generic-glibc/bits/inet-fortified-decl.h created+42
...@@ -0,0 +1,42 @@
1/* Declarations of checking macros for inet functions.
2 Copyright (C) 2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _BITS_INET_FORTIFIED_DEC_H
20#define _BITS_INET_FORTIFIED_DEC_H 1
21
22#ifndef _ARPA_INET_H
23# error "Never include <bits/inet-fortified-decl.h> directly; use <arpa/inet.h> instead."
24#endif
25
26extern const char *__inet_ntop_chk (int, const void *, char *, socklen_t, size_t);
27
28extern const char *__REDIRECT_FORTIFY_NTH (__inet_ntop_alias,
29 (int, const void *, char *, socklen_t), inet_ntop);
30extern const char *__REDIRECT_NTH (__inet_ntop_chk_warn,
31 (int, const void *, char *, socklen_t, size_t), __inet_ntop_chk)
32 __warnattr ("inet_ntop called with bigger length than "
33 "size of destination buffer");
34
35extern int __inet_pton_chk (int, const char *, void *, size_t);
36
37extern int __REDIRECT_FORTIFY_NTH (__inet_pton_alias,
38 (int, const char *, void *), inet_pton);
39extern int __REDIRECT_NTH (__inet_pton_chk_warn,
40 (int, const char *, void *, size_t), __inet_pton_chk)
41 __warnattr ("inet_pton called with a destination buffer size too small");
42#endif /* bits/inet-fortified-decl.h. */
\ No newline at end of file
lib/libc/include/generic-glibc/bits/inet-fortified.h created+61
...@@ -0,0 +1,61 @@
1/* Checking macros for inet functions.
2 Copyright (C) 2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _BITS_INET_FORTIFIED_H
20#define _BITS_INET_FORTIFIED_H 1
21
22#ifndef _ARPA_INET_H
23# error "Never include <bits/inet-fortified.h> directly; use <arpa/inet.h> instead."
24#endif
25
26#include <bits/inet-fortified-decl.h>
27
28__fortify_function __attribute_overloadable__ const char *
29__NTH (inet_ntop (int __af,
30 __fortify_clang_overload_arg (const void *, __restrict, __src),
31 char *__restrict __dst, socklen_t __dst_size))
32 __fortify_clang_warning_only_if_bos_lt (__dst_size, __dst,
33 "inet_ntop called with bigger length "
34 "than size of destination buffer")
35{
36 return __glibc_fortify (inet_ntop, __dst_size, sizeof (char),
37 __glibc_objsize (__dst),
38 __af, __src, __dst, __dst_size);
39};
40
41__fortify_function __attribute_overloadable__ int
42__NTH (inet_pton (int __af,
43 const char *__restrict __src,
44 __fortify_clang_overload_arg (void *, __restrict, __dst)))
45 __fortify_clang_warning_only_if_bos0_lt
46 (4, __dst, "inet_pton called with destination buffer size less than 4")
47{
48 size_t sz = 0;
49 if (__af == AF_INET)
50 sz = sizeof (struct in_addr);
51 else if (__af == AF_INET6)
52 sz = sizeof (struct in6_addr);
53 else
54 return __inet_pton_alias (__af, __src, __dst);
55
56 return __glibc_fortify (inet_pton, sz, sizeof (char),
57 __glibc_objsize (__dst),
58 __af, __src, __dst);
59};
60
61#endif /* bits/inet-fortified.h. */
\ No newline at end of file
lib/libc/include/generic-glibc/bits/ioctl-types.h-11
...@@ -32,17 +32,6 @@ struct winsize...@@ -32,17 +32,6 @@ struct winsize
32 unsigned short int ws_ypixel;32 unsigned short int ws_ypixel;
33 };33 };
3434
35#define NCC 8
36struct termio
37 {
38 unsigned short int c_iflag; /* input mode flags */
39 unsigned short int c_oflag; /* output mode flags */
40 unsigned short int c_cflag; /* control mode flags */
41 unsigned short int c_lflag; /* local mode flags */
42 unsigned char c_line; /* line discipline */
43 unsigned char c_cc[NCC]; /* control characters */
44};
45
46/* modem lines */35/* modem lines */
47#define TIOCM_LE 0x00136#define TIOCM_LE 0x001
48#define TIOCM_DTR 0x00237#define TIOCM_DTR 0x002
lib/libc/include/generic-glibc/bits/ioctls.h+1-84
...@@ -22,87 +22,4 @@...@@ -22,87 +22,4 @@
22/* Use the definitions from the kernel header files. */22/* Use the definitions from the kernel header files. */
23#include <asm/ioctls.h>23#include <asm/ioctls.h>
2424
25/* Routing table calls. */
26#define SIOCADDRT 0x890B /* add routing table entry */
27#define SIOCDELRT 0x890C /* delete routing table entry */
28#define SIOCRTMSG 0x890D /* call to routing system */
29
30/* Socket configuration controls. */
31#define SIOCGIFNAME 0x8910 /* get iface name */
32#define SIOCSIFLINK 0x8911 /* set iface channel */
33#define SIOCGIFCONF 0x8912 /* get iface list */
34#define SIOCGIFFLAGS 0x8913 /* get flags */
35#define SIOCSIFFLAGS 0x8914 /* set flags */
36#define SIOCGIFADDR 0x8915 /* get PA address */
37#define SIOCSIFADDR 0x8916 /* set PA address */
38#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
39#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
40#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
41#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
42#define SIOCGIFNETMASK 0x891b /* get network PA mask */
43#define SIOCSIFNETMASK 0x891c /* set network PA mask */
44#define SIOCGIFMETRIC 0x891d /* get metric */
45#define SIOCSIFMETRIC 0x891e /* set metric */
46#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
47#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
48#define SIOCGIFMTU 0x8921 /* get MTU size */
49#define SIOCSIFMTU 0x8922 /* set MTU size */
50#define SIOCSIFNAME 0x8923 /* set interface name */
51#define SIOCSIFHWADDR 0x8924 /* set hardware address */
52#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
53#define SIOCSIFENCAP 0x8926
54#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
55#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
56#define SIOCSIFSLAVE 0x8930
57#define SIOCADDMULTI 0x8931 /* Multicast address lists */
58#define SIOCDELMULTI 0x8932
59#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
60#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
61#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
62#define SIOCGIFPFLAGS 0x8935
63#define SIOCDIFADDR 0x8936 /* delete PA address */
64#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
65#define SIOCGIFCOUNT 0x8938 /* get number of devices */
66
67#define SIOCGIFBR 0x8940 /* Bridging support */
68#define SIOCSIFBR 0x8941 /* Set bridging options */
69
70#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
71#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
72
73
74/* ARP cache control calls. */
75 /* 0x8950 - 0x8952 * obsolete calls, don't re-use */
76#define SIOCDARP 0x8953 /* delete ARP table entry */
77#define SIOCGARP 0x8954 /* get ARP table entry */
78#define SIOCSARP 0x8955 /* set ARP table entry */
79
80/* RARP cache control calls. */
81#define SIOCDRARP 0x8960 /* delete RARP table entry */
82#define SIOCGRARP 0x8961 /* get RARP table entry */
83#define SIOCSRARP 0x8962 /* set RARP table entry */
84
85/* Driver configuration calls */
86
87#define SIOCGIFMAP 0x8970 /* Get device parameters */
88#define SIOCSIFMAP 0x8971 /* Set device parameters */
89
90/* DLCI configuration calls */
91
92#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
93#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
94
95/* Device private ioctl calls. */
96
97/* These 16 ioctls are available to devices via the do_ioctl() device
98 vector. Each device should include this file and redefine these
99 names as their own. Because these are device dependent it is a good
100 idea _NOT_ to issue them to random objects and hope. */
101
102#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
103
104/*
105 * These 16 ioctl calls are protocol private
106 */
107
108#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
\ No newline at end of file
25#include <linux/sockios.h>
\ No newline at end of file
lib/libc/include/generic-glibc/bits/libm-simd-decl-stubs.h+44
...@@ -373,4 +373,48 @@...@@ -373,4 +373,48 @@
373#define __DECL_SIMD_tanpif32x373#define __DECL_SIMD_tanpif32x
374#define __DECL_SIMD_tanpif64x374#define __DECL_SIMD_tanpif64x
375#define __DECL_SIMD_tanpif128x375#define __DECL_SIMD_tanpif128x
376
377#define __DECL_SIMD_acospi
378#define __DECL_SIMD_acospif
379#define __DECL_SIMD_acospil
380#define __DECL_SIMD_acospif16
381#define __DECL_SIMD_acospif32
382#define __DECL_SIMD_acospif64
383#define __DECL_SIMD_acospif128
384#define __DECL_SIMD_acospif32x
385#define __DECL_SIMD_acospif64x
386#define __DECL_SIMD_acospif128x
387
388#define __DECL_SIMD_asinpi
389#define __DECL_SIMD_asinpif
390#define __DECL_SIMD_asinpil
391#define __DECL_SIMD_asinpif16
392#define __DECL_SIMD_asinpif32
393#define __DECL_SIMD_asinpif64
394#define __DECL_SIMD_asinpif128
395#define __DECL_SIMD_asinpif32x
396#define __DECL_SIMD_asinpif64x
397#define __DECL_SIMD_asinpif128x
398
399#define __DECL_SIMD_atanpi
400#define __DECL_SIMD_atanpif
401#define __DECL_SIMD_atanpil
402#define __DECL_SIMD_atanpif16
403#define __DECL_SIMD_atanpif32
404#define __DECL_SIMD_atanpif64
405#define __DECL_SIMD_atanpif128
406#define __DECL_SIMD_atanpif32x
407#define __DECL_SIMD_atanpif64x
408#define __DECL_SIMD_atanpif128x
409
410#define __DECL_SIMD_atan2pi
411#define __DECL_SIMD_atan2pif
412#define __DECL_SIMD_atan2pil
413#define __DECL_SIMD_atan2pif16
414#define __DECL_SIMD_atan2pif32
415#define __DECL_SIMD_atan2pif64
416#define __DECL_SIMD_atan2pif128
417#define __DECL_SIMD_atan2pif32x
418#define __DECL_SIMD_atan2pif64x
419#define __DECL_SIMD_atan2pif128x
376#endif420#endif
\ No newline at end of file
lib/libc/include/generic-glibc/bits/mathcalls-macros.h+1-1
...@@ -34,7 +34,7 @@...@@ -34,7 +34,7 @@
34#define __MATHCALLX(function,suffix, args, attrib) \34#define __MATHCALLX(function,suffix, args, attrib) \
35 __MATHDECLX (_Mdouble_,function,suffix, args, attrib)35 __MATHDECLX (_Mdouble_,function,suffix, args, attrib)
36#define __MATHDECLX(type, function,suffix, args, attrib) \36#define __MATHDECLX(type, function,suffix, args, attrib) \
37 __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib);37 __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib)
38#define __MATHDECL_1_IMPL(type, function, suffix, args) \38#define __MATHDECL_1_IMPL(type, function, suffix, args) \
39 extern type __MATH_PRECNAME(function,suffix) args __THROW39 extern type __MATH_PRECNAME(function,suffix) args __THROW
40#define __MATHDECL_1(type, function, suffix, args) \40#define __MATHDECL_1(type, function, suffix, args) \
lib/libc/include/generic-glibc/bits/mathcalls.h+21
...@@ -68,12 +68,16 @@ __MATHCALL_VEC (tan,, (_Mdouble_ __x));...@@ -68,12 +68,16 @@ __MATHCALL_VEC (tan,, (_Mdouble_ __x));
68#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23)68#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23)
69/* Arc cosine of X, divided by pi. */69/* Arc cosine of X, divided by pi. */
70__MATHCALL (acospi,, (_Mdouble_ __x));70__MATHCALL (acospi,, (_Mdouble_ __x));
71__MATHCALL_VEC (acospi,, (_Mdouble_ __x));
71/* Arc sine of X, divided by pi. */72/* Arc sine of X, divided by pi. */
72__MATHCALL (asinpi,, (_Mdouble_ __x));73__MATHCALL (asinpi,, (_Mdouble_ __x));
74__MATHCALL_VEC (asinpi,, (_Mdouble_ __x));
73/* Arc tangent of X, divided by pi. */75/* Arc tangent of X, divided by pi. */
74__MATHCALL (atanpi,, (_Mdouble_ __x));76__MATHCALL (atanpi,, (_Mdouble_ __x));
77__MATHCALL_VEC (atanpi,, (_Mdouble_ __x));
75/* Arc tangent of Y/X, divided by pi. */78/* Arc tangent of Y/X, divided by pi. */
76__MATHCALL (atan2pi,, (_Mdouble_ __y, _Mdouble_ __x));79__MATHCALL (atan2pi,, (_Mdouble_ __y, _Mdouble_ __x));
80__MATHCALL_VEC (atan2pi,, (_Mdouble_ __y, _Mdouble_ __x));
7781
78/* Cosine of pi * X. */82/* Cosine of pi * X. */
79__MATHCALL_VEC (cospi,, (_Mdouble_ __x));83__MATHCALL_VEC (cospi,, (_Mdouble_ __x));
...@@ -185,6 +189,23 @@ __MATHCALL_VEC (hypot,, (_Mdouble_ __x, _Mdouble_ __y));...@@ -185,6 +189,23 @@ __MATHCALL_VEC (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
185__MATHCALL_VEC (cbrt,, (_Mdouble_ __x));189__MATHCALL_VEC (cbrt,, (_Mdouble_ __x));
186#endif190#endif
187191
192#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23)
193/* Return 1+X to the Y power. */
194__MATHCALL (compoundn,, (_Mdouble_ __x, long long int __y));
195
196/* Return X to the Y power. */
197__MATHCALL (pown,, (_Mdouble_ __x, long long int __y));
198
199/* Return X to the Y power. */
200__MATHCALL (powr,, (_Mdouble_ __x, _Mdouble_ __y));
201
202/* Return the Yth root of X. */
203__MATHCALL (rootn,, (_Mdouble_ __x, long long int __y));
204
205/* Return the reciprocal of the square root of X. */
206__MATHCALL (rsqrt,, (_Mdouble_ __x));
207#endif
208
188209
189/* Nearest integer, absolute value, and remainder functions. */210/* Nearest integer, absolute value, and remainder functions. */
190211
lib/libc/include/generic-glibc/bits/mman-linux.h+2
...@@ -113,6 +113,8 @@...@@ -113,6 +113,8 @@
113 locked pages too. */113 locked pages too. */
114# define MADV_COLLAPSE 25 /* Synchronous hugepage collapse. */114# define MADV_COLLAPSE 25 /* Synchronous hugepage collapse. */
115# define MADV_HWPOISON 100 /* Poison a page for testing. */115# define MADV_HWPOISON 100 /* Poison a page for testing. */
116# define MADV_GUARD_INSTALL 102 /* Fatal signal on access to range */
117# define MADV_GUARD_REMOVE 103 /* Unguard range */
116#endif118#endif
117119
118/* The POSIX people had to invent similar names for the same things. */120/* The POSIX people had to invent similar names for the same things. */
lib/libc/include/generic-glibc/bits/mman-shared.h+3-4
...@@ -43,10 +43,9 @@...@@ -43,10 +43,9 @@
43# endif43# endif
4444
45/* Access restrictions for pkey_alloc. */45/* Access restrictions for pkey_alloc. */
46# ifndef PKEY_DISABLE_ACCESS46# define PKEY_UNRESTRICTED 0x0
47# define PKEY_DISABLE_ACCESS 0x147# define PKEY_DISABLE_ACCESS 0x1
48# define PKEY_DISABLE_WRITE 0x248# define PKEY_DISABLE_WRITE 0x2
49# endif
5049
51__BEGIN_DECLS50__BEGIN_DECLS
5251
lib/libc/include/generic-glibc/bits/sched.h+1-1
...@@ -152,7 +152,7 @@ int sched_setattr (pid_t tid, struct sched_attr *attr, unsigned int flags)...@@ -152,7 +152,7 @@ int sched_setattr (pid_t tid, struct sched_attr *attr, unsigned int flags)
152 store it in *ATTR. */152 store it in *ATTR. */
153int sched_getattr (pid_t tid, struct sched_attr *attr, unsigned int size,153int sched_getattr (pid_t tid, struct sched_attr *attr, unsigned int size,
154 unsigned int flags)154 unsigned int flags)
155 __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3));155 __THROW __nonnull ((2));
156156
157#endif157#endif
158158
lib/libc/include/generic-glibc/bits/string_fortified.h+1-1
...@@ -151,7 +151,7 @@ __NTH (strncat (__fortify_clang_overload_arg (char *, __restrict, __dest),...@@ -151,7 +151,7 @@ __NTH (strncat (__fortify_clang_overload_arg (char *, __restrict, __dest),
151}151}
152152
153/*153/*
154 * strlcpy and strlcat introduced in glibc 2.38154 * zig patch: strlcpy and strlcat introduced in glibc 2.38
155 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da155 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da
156 */156 */
157#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2157#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2
lib/libc/include/generic-glibc/bits/syscall.h+22-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.12. */2/* The system call list corresponds to kernel 6.15. */
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 3962888#define __GLIBC_LINUX_VERSION_CODE 397056
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
...@@ -703,6 +703,10 @@...@@ -703,6 +703,10 @@
703# define SYS_getxattr __NR_getxattr703# define SYS_getxattr __NR_getxattr
704#endif704#endif
705705
706#ifdef __NR_getxattrat
707# define SYS_getxattrat __NR_getxattrat
708#endif
709
706#ifdef __NR_getxgid710#ifdef __NR_getxgid
707# define SYS_getxgid __NR_getxgid711# define SYS_getxgid __NR_getxgid
708#endif712#endif
...@@ -875,6 +879,10 @@...@@ -875,6 +879,10 @@
875# define SYS_listxattr __NR_listxattr879# define SYS_listxattr __NR_listxattr
876#endif880#endif
877881
882#ifdef __NR_listxattrat
883# define SYS_listxattrat __NR_listxattrat
884#endif
885
878#ifdef __NR_llistxattr886#ifdef __NR_llistxattr
879# define SYS_llistxattr __NR_llistxattr887# define SYS_llistxattr __NR_llistxattr
880#endif888#endif
...@@ -1167,6 +1175,10 @@...@@ -1167,6 +1175,10 @@
1167# define SYS_open_tree __NR_open_tree1175# define SYS_open_tree __NR_open_tree
1168#endif1176#endif
11691177
1178#ifdef __NR_open_tree_attr
1179# define SYS_open_tree_attr __NR_open_tree_attr
1180#endif
1181
1170#ifdef __NR_openat1182#ifdef __NR_openat
1171# define SYS_openat __NR_openat1183# define SYS_openat __NR_openat
1172#endif1184#endif
...@@ -1839,6 +1851,10 @@...@@ -1839,6 +1851,10 @@
1839# define SYS_removexattr __NR_removexattr1851# define SYS_removexattr __NR_removexattr
1840#endif1852#endif
18411853
1854#ifdef __NR_removexattrat
1855# define SYS_removexattrat __NR_removexattrat
1856#endif
1857
1842#ifdef __NR_rename1858#ifdef __NR_rename
1843# define SYS_rename __NR_rename1859# define SYS_rename __NR_rename
1844#endif1860#endif
...@@ -2199,6 +2215,10 @@...@@ -2199,6 +2215,10 @@
2199# define SYS_setxattr __NR_setxattr2215# define SYS_setxattr __NR_setxattr
2200#endif2216#endif
22012217
2218#ifdef __NR_setxattrat
2219# define SYS_setxattrat __NR_setxattrat
2220#endif
2221
2202#ifdef __NR_sgetmask2222#ifdef __NR_sgetmask
2203# define SYS_sgetmask __NR_sgetmask2223# define SYS_sgetmask __NR_sgetmask
2204#endif2224#endif
lib/libc/include/generic-glibc/bits/termios-baud.h+52-25
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/* termios baud rate selection definitions. Linux/generic version.1/* termios baud rate selection definitions. Universal version for sane speed_t.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.3 This file is part of the GNU C Library.
44
...@@ -20,29 +20,56 @@...@@ -20,29 +20,56 @@
20# error "Never include <bits/termios-baud.h> directly; use <termios.h> instead."20# error "Never include <bits/termios-baud.h> directly; use <termios.h> instead."
21#endif21#endif
2222
23#ifdef __USE_MISC23/* POSIX required baud rates */
24# define CBAUD 000000010017 /* Baud speed mask (not in POSIX). */24#define B0 0U /* Hang up or ispeed == ospeed */
25# define CBAUDEX 000000010000 /* Extra baud speed mask, included in CBAUD.25#define B50 50U
26 (not in POSIX). */26#define B75 75U
27# define CIBAUD 002003600000 /* Input baud rate (not used). */27#define B110 110U
28# define CMSPAR 010000000000 /* Mark or space (stick) parity. */28#define B134 134U /* Really 134.5 baud by POSIX spec */
29# define CRTSCTS 020000000000 /* Flow control. */29#define B150 150U
30#define B200 200U
31#define B300 300U
32#define B600 600U
33#define B1200 1200U
34#define B1800 1800U
35#define B2400 2400U
36#define B4800 4800U
37#define B9600 9600U
38#define B19200 19200U
39#define B38400 38400U
40#ifdef __USE_MISC
41# define EXTA B19200
42# define EXTB B38400
30#endif43#endif
3144
32/* Extra output baud rates (not in POSIX). */
33#define B57600 0010001
34#define B115200 0010002
35#define B230400 0010003
36#define B460800 0010004
37#define B500000 0010005
38#define B576000 0010006
39#define B921600 0010007
40#define B1000000 0010010
41#define B1152000 0010011
42#define B1500000 0010012
43#define B2000000 0010013
44#define B2500000 0010014
45#define B3000000 0010015
46#define B3500000 0010016
47#define B4000000 0010017
48#define __MAX_BAUD B4000000
\ No newline at end of file
45/* Other baud rates, "nonstandard" but known to be used */
46#define B7200 7200U
47#define B14400 14400U
48#define B28800 28800U
49#define B33600 33600U
50#define B57600 57600U
51#define B76800 76800U
52#define B115200 115200U
53#define B153600 153600U
54#define B230400 230400U
55#define B307200 307200U
56#define B460800 460800U
57#define B500000 500000U
58#define B576000 576000U
59#define B614400 614400U
60#define B921600 921600U
61#define B1000000 1000000U
62#define B1152000 1152000U
63#define B1500000 1500000U
64#define B2000000 2000000U
65#define B2500000 2500000U
66#define B3000000 3000000U
67#define B3500000 3500000U
68#define B4000000 4000000U
69#define B5000000 5000000U
70#define B10000000 10000000U
71
72#ifdef __USE_GNU
73#define SPEED_MAX 4294967295U /* maximum valid speed_t value */
74#endif
75#define __MAX_BAUD 4294967295U /* legacy alias for SPEED_MAX */
\ No newline at end of file
lib/libc/include/generic-glibc/bits/termios-c_cflag.h+3-1
...@@ -34,5 +34,7 @@...@@ -34,5 +34,7 @@
34#define CLOCAL 000400034#define CLOCAL 0004000
3535
36#ifdef __USE_MISC36#ifdef __USE_MISC
37# define ADDRB 0400000000037# define ADDRB 04000000000
38# define CMSPAR 010000000000 /* Mark or space (stick) parity. */
39# define CRTSCTS 020000000000 /* Flow control. */
38#endif40#endif
\ No newline at end of file
lib/libc/include/generic-glibc/bits/termios-cbaud.h created+47
...@@ -0,0 +1,47 @@
1/* termios baud rate selection definitions. Linux/generic version.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _TERMIOS_H
20# error "Never include <bits/termios-cbaud.h> directly; use <termios.h> instead."
21#endif
22
23#ifdef __USE_MISC
24# define CBAUD 000000010017 /* Baud speed mask (not in POSIX). */
25# define CBAUDEX 000000010000 /* Extra baud speed mask, included in CBAUD.
26 (not in POSIX). */
27# define CIBAUD 002003600000 /* Input baud rate. */
28# define IBSHIFT 16
29#endif
30
31/* Extra output baud rates (not in POSIX). */
32#define __BOTHER 0010000
33#define __B57600 0010001
34#define __B115200 0010002
35#define __B230400 0010003
36#define __B460800 0010004
37#define __B500000 0010005
38#define __B576000 0010006
39#define __B921600 0010007
40#define __B1000000 0010010
41#define __B1152000 0010011
42#define __B1500000 0010012
43#define __B2000000 0010013
44#define __B2500000 0010014
45#define __B3000000 0010015
46#define __B3500000 0010016
47#define __B4000000 0010017
\ No newline at end of file
lib/libc/include/generic-glibc/bits/termios-struct.h+9-2
...@@ -29,8 +29,15 @@ struct termios...@@ -29,8 +29,15 @@ struct termios
29 tcflag_t c_lflag; /* local mode flags */29 tcflag_t c_lflag; /* local mode flags */
30 cc_t c_line; /* line discipline */30 cc_t c_line; /* line discipline */
31 cc_t c_cc[NCCS]; /* control characters */31 cc_t c_cc[NCCS]; /* control characters */
32 speed_t c_ispeed; /* input speed */32 /* Input and output baud rates. */
33 speed_t c_ospeed; /* output speed */33 __extension__ union {
34 speed_t __ispeed;
35 speed_t c_ispeed;
36 };
34#define _HAVE_STRUCT_TERMIOS_C_ISPEED 137#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
38 __extension__ union {
39 speed_t __ospeed;
40 speed_t c_ospeed;
41 };
35#define _HAVE_STRUCT_TERMIOS_C_OSPEED 142#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
36 };43 };
\ No newline at end of file
lib/libc/include/generic-glibc/bits/termios.h+30-22
...@@ -24,35 +24,41 @@ typedef unsigned char cc_t;...@@ -24,35 +24,41 @@ typedef unsigned char cc_t;
24typedef unsigned int speed_t;24typedef unsigned int speed_t;
25typedef unsigned int tcflag_t;25typedef unsigned int tcflag_t;
2626
27#include <bits/termios-struct.h>27#ifdef _TERMIOS_H
28# include <bits/termios-struct.h>
29#endif
30
28#include <bits/termios-c_cc.h>31#include <bits/termios-c_cc.h>
29#include <bits/termios-c_iflag.h>32#include <bits/termios-c_iflag.h>
30#include <bits/termios-c_oflag.h>33#include <bits/termios-c_oflag.h>
3134
32/* c_cflag bit meaning */35/* c_cflag bit meaning */
33#define B0 0000000 /* hang up */36#include <bits/termios-c_cflag.h>
34#define B50 000000137
35#define B75 0000002
36#define B110 0000003
37#define B134 0000004
38#define B150 0000005
39#define B200 0000006
40#define B300 0000007
41#define B600 0000010
42#define B1200 0000011
43#define B1800 0000012
44#define B2400 0000013
45#define B4800 0000014
46#define B9600 0000015
47#define B19200 0000016
48#define B38400 0000017
49#ifdef __USE_MISC38#ifdef __USE_MISC
50# define EXTA B1920039#define __B0 0000000 /* hang up */
51# define EXTB B3840040#define __B50 0000001
41#define __B75 0000002
42#define __B110 0000003
43#define __B134 0000004
44#define __B150 0000005
45#define __B200 0000006
46#define __B300 0000007
47#define __B600 0000010
48#define __B1200 0000011
49#define __B1800 0000012
50#define __B2400 0000013
51#define __B4800 0000014
52#define __B9600 0000015
53#define __B19200 0000016
54#define __B38400 0000017
55#include <bits/termios-cbaud.h>
56
57# define __EXTA __B19200
58# define __EXTB __B38400
59# define BOTHER __BOTHER
52#endif60#endif
53#include <bits/termios-baud.h>
5461
55#include <bits/termios-c_cflag.h>
56#include <bits/termios-c_lflag.h>62#include <bits/termios-c_lflag.h>
5763
58#ifdef __USE_MISC64#ifdef __USE_MISC
...@@ -73,4 +79,6 @@ typedef unsigned int tcflag_t;...@@ -73,4 +79,6 @@ typedef unsigned int tcflag_t;
7379
74#include <bits/termios-tcflow.h>80#include <bits/termios-tcflow.h>
7581
76#include <bits/termios-misc.h>
\ No newline at end of file
82#include <bits/termios-misc.h>
83
84#include <bits/termios-baud.h>
\ No newline at end of file
lib/libc/include/generic-glibc/bits/types/struct_FILE.h+9-1
...@@ -32,6 +32,7 @@...@@ -32,6 +32,7 @@
32#endif32#endif
3333
34#include <bits/types.h>34#include <bits/types.h>
35#include <bits/wordsize.h>
3536
36struct _IO_FILE;37struct _IO_FILE;
37struct _IO_marker;38struct _IO_marker;
...@@ -97,8 +98,15 @@ struct _IO_FILE_complete...@@ -97,8 +98,15 @@ struct _IO_FILE_complete
97 void *_freeres_buf;98 void *_freeres_buf;
98 struct _IO_FILE **_prevchain;99 struct _IO_FILE **_prevchain;
99 int _mode;100 int _mode;
101#if __WORDSIZE == 64
102 int _unused3;
103#endif
104 __uint64_t _total_written;
105#if __WORDSIZE == 32
106 int _unused3;
107#endif
100 /* Make sure we don't get into trouble again. */108 /* Make sure we don't get into trouble again. */
101 char _unused2[15 * sizeof (int) - 5 * sizeof (void *)];109 char _unused2[12 * sizeof (int) - 5 * sizeof (void *)];
102};110};
103111
104/* These macros are used by bits/stdio.h and internal headers. */112/* These macros are used by bits/stdio.h and internal headers. */
lib/libc/include/generic-glibc/dlfcn.h+8-2
...@@ -217,15 +217,21 @@ struct dl_find_object...@@ -217,15 +217,21 @@ struct dl_find_object
217 int dlfo_eh_count; /* Number of exception handling entries. */217 int dlfo_eh_count; /* Number of exception handling entries. */
218 unsigned int __dlfo_eh_count_pad;218 unsigned int __dlfo_eh_count_pad;
219# endif219# endif
220 __extension__ unsigned long long int __dflo_reserved[7];220 void *dlfo_sframe; /* SFrame stack trace data of the object. */
221#if __WORDSIZE == 32
222 unsigned int __dlfo_sframe_pad;
223#endif
224 __extension__ unsigned long long int __dlfo_reserved[6];
221};225};
222226
223/* If ADDRESS is found in an object, fill in *RESULT and return 0.227/* If ADDRESS is found in an object, fill in *RESULT and return 0.
224 Otherwise, return -1. */228 Otherwise, return -1. */
225int _dl_find_object (void *__address, struct dl_find_object *__result) __THROW;229int _dl_find_object (void *__address, struct dl_find_object *__result) __THROW;
226230
227#endif /* __USE_GNU */231/* SFrame stack trace data is valid. */
232#define DLFO_FLAG_SFRAME (1ULL << 0)
228233
234#endif /* __USE_GNU */
229235
230__END_DECLS236__END_DECLS
231237
lib/libc/include/generic-glibc/elf.h+11-22
...@@ -837,12 +837,15 @@ typedef struct...@@ -837,12 +837,15 @@ typedef struct
837#define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */837#define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */
838#define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */838#define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */
839#define NT_ARM_POE 0x40f /* ARM POE registers. */839#define NT_ARM_POE 0x40f /* ARM POE registers. */
840#define NT_ARM_GCS 0x410 /* ARM GCS state. */
840#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */841#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */
841#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */842#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */
842#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */843#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */
843#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers. */844#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers. */
844#define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */845#define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */
845#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */846#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */
847#define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged
848 address control */
846#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */849#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */
847#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and850#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and
848 status registers. */851 status registers. */
...@@ -2906,19 +2909,6 @@ enum...@@ -2906,19 +2909,6 @@ enum
29062909
2907#define R_AARCH64_NONE 0 /* No relocation. */2910#define R_AARCH64_NONE 0 /* No relocation. */
29082911
2909/* ILP32 AArch64 relocs. */
2910#define R_AARCH64_P32_ABS32 1 /* Direct 32 bit. */
2911#define R_AARCH64_P32_COPY 180 /* Copy symbol at runtime. */
2912#define R_AARCH64_P32_GLOB_DAT 181 /* Create GOT entry. */
2913#define R_AARCH64_P32_JUMP_SLOT 182 /* Create PLT entry. */
2914#define R_AARCH64_P32_RELATIVE 183 /* Adjust by program base. */
2915#define R_AARCH64_P32_TLS_DTPMOD 184 /* Module number, 32 bit. */
2916#define R_AARCH64_P32_TLS_DTPREL 185 /* Module-relative offset, 32 bit. */
2917#define R_AARCH64_P32_TLS_TPREL 186 /* TP-relative offset, 32 bit. */
2918#define R_AARCH64_P32_TLSDESC 187 /* TLS Descriptor. */
2919#define R_AARCH64_P32_IRELATIVE 188 /* STT_GNU_IFUNC relocation. */
2920
2921/* LP64 AArch64 relocs. */
2922#define R_AARCH64_ABS64 257 /* Direct 64 bit. */2912#define R_AARCH64_ABS64 257 /* Direct 64 bit. */
2923#define R_AARCH64_ABS32 258 /* Direct 32 bit. */2913#define R_AARCH64_ABS32 258 /* Direct 32 bit. */
2924#define R_AARCH64_ABS16 259 /* Direct 16-bit. */2914#define R_AARCH64_ABS16 259 /* Direct 16-bit. */
...@@ -4091,6 +4081,7 @@ enum...@@ -4091,6 +4081,7 @@ enum
4091#define R_RISCV_TLS_DTPREL64 94081#define R_RISCV_TLS_DTPREL64 9
4092#define R_RISCV_TLS_TPREL32 104082#define R_RISCV_TLS_TPREL32 10
4093#define R_RISCV_TLS_TPREL64 114083#define R_RISCV_TLS_TPREL64 11
4084#define R_RISCV_TLSDESC 12
4094#define R_RISCV_BRANCH 164085#define R_RISCV_BRANCH 16
4095#define R_RISCV_JAL 174086#define R_RISCV_JAL 17
4096#define R_RISCV_CALL 184087#define R_RISCV_CALL 18
...@@ -4116,16 +4107,10 @@ enum...@@ -4116,16 +4107,10 @@ enum
4116#define R_RISCV_SUB16 384107#define R_RISCV_SUB16 38
4117#define R_RISCV_SUB32 394108#define R_RISCV_SUB32 39
4118#define R_RISCV_SUB64 404109#define R_RISCV_SUB64 40
4119#define R_RISCV_GNU_VTINHERIT 414110#define R_RISCV_GOT32_PCREL 41
4120#define R_RISCV_GNU_VTENTRY 42
4121#define R_RISCV_ALIGN 434111#define R_RISCV_ALIGN 43
4122#define R_RISCV_RVC_BRANCH 444112#define R_RISCV_RVC_BRANCH 44
4123#define R_RISCV_RVC_JUMP 454113#define R_RISCV_RVC_JUMP 45
4124#define R_RISCV_RVC_LUI 46
4125#define R_RISCV_GPREL_I 47
4126#define R_RISCV_GPREL_S 48
4127#define R_RISCV_TPREL_I 49
4128#define R_RISCV_TPREL_S 50
4129#define R_RISCV_RELAX 514114#define R_RISCV_RELAX 51
4130#define R_RISCV_SUB6 524115#define R_RISCV_SUB6 52
4131#define R_RISCV_SET6 534116#define R_RISCV_SET6 53
...@@ -4137,8 +4122,12 @@ enum...@@ -4137,8 +4122,12 @@ enum
4137#define R_RISCV_PLT32 594122#define R_RISCV_PLT32 59
4138#define R_RISCV_SET_ULEB128 604123#define R_RISCV_SET_ULEB128 60
4139#define R_RISCV_SUB_ULEB128 614124#define R_RISCV_SUB_ULEB128 61
4125#define R_RISCV_TLSDESC_HI20 62
4126#define R_RISCV_TLSDESC_LOAD_LO12 63
4127#define R_RISCV_TLSDESC_ADD_LO12 64
4128#define R_RISCV_TLSDESC_CALL 65
41404129
4141#define R_RISCV_NUM 624130#define R_RISCV_NUM 66
41424131
4143/* RISC-V specific values for the st_other field. */4132/* RISC-V specific values for the st_other field. */
4144#define STO_RISCV_VARIANT_CC 0x80 /* Function uses variant calling4133#define STO_RISCV_VARIANT_CC 0x80 /* Function uses variant calling
...@@ -4147,7 +4136,7 @@ enum...@@ -4147,7 +4136,7 @@ enum
4147/* RISC-V specific values for the sh_type field. */4136/* RISC-V specific values for the sh_type field. */
4148#define SHT_RISCV_ATTRIBUTES (SHT_LOPROC + 3)4137#define SHT_RISCV_ATTRIBUTES (SHT_LOPROC + 3)
41494138
4150/* RISC-V specific values for the p_type field. */4139/* RISC-V specific values for the p_type field (deprecated). */
4151#define PT_RISCV_ATTRIBUTES (PT_LOPROC + 3)4140#define PT_RISCV_ATTRIBUTES (PT_LOPROC + 3)
41524141
4153/* RISC-V specific values for the d_tag field. */4142/* RISC-V specific values for the d_tag field. */
lib/libc/include/generic-glibc/fcntl.h+6-5
...@@ -168,7 +168,7 @@ typedef __pid_t pid_t;...@@ -168,7 +168,7 @@ typedef __pid_t pid_t;
168#endif168#endif
169169
170170
171/* fcntl was a simple symbol until glibc 2.27 inclusive.171/* zig patch: fcntl was a simple symbol until glibc 2.27 inclusive.
172 * glibc 2.28 onwards converted it to a macro when compiled with172 * glibc 2.28 onwards converted it to a macro when compiled with
173 * USE_LARGEFILE64. */173 * USE_LARGEFILE64. */
174#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 28) || __GLIBC__ > 2174#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 28) || __GLIBC__ > 2
...@@ -289,16 +289,17 @@ extern int creat64 (const char *__file, mode_t __mode) __nonnull ((1));...@@ -289,16 +289,17 @@ extern int creat64 (const char *__file, mode_t __mode) __nonnull ((1));
289# define F_TEST 3 /* Test a region for other processes locks. */289# define F_TEST 3 /* Test a region for other processes locks. */
290290
291# ifndef __USE_FILE_OFFSET64291# ifndef __USE_FILE_OFFSET64
292extern int lockf (int __fd, int __cmd, off_t __len);292extern int lockf (int __fd, int __cmd, off_t __len) __wur;
293# else293# else
294# ifdef __REDIRECT294# ifdef __REDIRECT
295extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64);295extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len),
296 lockf64) __wur;
296# else297# else
297# define lockf lockf64298# define lockf lockf64
298# endif299# endif
299# endif300# endif
300# ifdef __USE_LARGEFILE64301# ifdef __USE_LARGEFILE64
301extern int lockf64 (int __fd, int __cmd, off64_t __len);302extern int lockf64 (int __fd, int __cmd, off64_t __len) __wur;
302# endif303# endif
303#endif304#endif
304305
...@@ -351,4 +352,4 @@ extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);...@@ -351,4 +352,4 @@ extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
351352
352__END_DECLS353__END_DECLS
353354
354#endif /* fcntl.h */
\ No newline at end of file
355#endif /* fcntl.h */
lib/libc/include/generic-glibc/features.h+3-3
...@@ -491,7 +491,7 @@...@@ -491,7 +491,7 @@
491 or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the491 or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the
492 old extension. */492 old extension. */
493#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)493#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
494/* support for ISOC99 was added in glibc-2.7 */494/* zig patch: support for ISOC99 was added in glibc-2.7 */
495# define __GLIBC_USE_DEPRECATED_SCANF 1495# define __GLIBC_USE_DEPRECATED_SCANF 1
496#elif (defined __USE_GNU \496#elif (defined __USE_GNU \
497 && (defined __cplusplus \497 && (defined __cplusplus \
...@@ -503,7 +503,7 @@...@@ -503,7 +503,7 @@
503#endif503#endif
504504
505505
506/* support for ISO C2X strtol was added in 2.38506/* zig patch: support for ISO C2X strtol was added in 2.38
507 * glibc commit 64924422a99690d147a166b4de3103f3bf3eaf6c507 * glibc commit 64924422a99690d147a166b4de3103f3bf3eaf6c
508 */508 */
509#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2509#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2
...@@ -564,4 +564,4 @@...@@ -564,4 +564,4 @@
564#include <gnu/stubs.h>564#include <gnu/stubs.h>
565565
566566
567#endif /* features.h */
\ No newline at end of file
567#endif /* features.h */
lib/libc/include/generic-glibc/glob.h+2-1
...@@ -195,7 +195,8 @@ extern void globfree64 (glob64_t *__pglob) __THROW;...@@ -195,7 +195,8 @@ extern void globfree64 (glob64_t *__pglob) __THROW;
195195
196 This function is not part of the interface specified by POSIX.2196 This function is not part of the interface specified by POSIX.2
197 but several programs want to use it. */197 but several programs want to use it. */
198extern int glob_pattern_p (const char *__pattern, int __quote) __THROW;198extern int glob_pattern_p (const char *__pattern, int __quote) __THROW
199 __nonnull ((1));
199#endif200#endif
200201
201__END_DECLS202__END_DECLS
lib/libc/include/generic-glibc/inttypes.h+5
...@@ -350,6 +350,11 @@ typedef struct...@@ -350,6 +350,11 @@ typedef struct
350/* Compute absolute value of N. */350/* Compute absolute value of N. */
351extern intmax_t imaxabs (intmax_t __n) __THROW __attribute__ ((__const__));351extern intmax_t imaxabs (intmax_t __n) __THROW __attribute__ ((__const__));
352352
353
354#if __GLIBC_USE (ISOC2Y)
355extern uintmax_t uimaxabs (intmax_t __n) __THROW __attribute__ ((__const__));
356#endif
357
353/* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */358/* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */
354extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)359extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
355 __THROW __attribute__ ((__const__));360 __THROW __attribute__ ((__const__));
lib/libc/include/generic-glibc/malloc.h+2-2
...@@ -52,7 +52,7 @@ extern void *realloc (void *__ptr, size_t __size)...@@ -52,7 +52,7 @@ extern void *realloc (void *__ptr, size_t __size)
52__THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2));52__THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2));
5353
54/*54/*
55 * reallocarray introduced in glibc 2.2655 * zig patch: reallocarray introduced in glibc 2.26
56 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da56 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da
57 */57 */
58#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 26) || __GLIBC__ > 258#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 26) || __GLIBC__ > 2
...@@ -164,4 +164,4 @@ extern void malloc_stats (void) __THROW;...@@ -164,4 +164,4 @@ extern void malloc_stats (void) __THROW;
164extern int malloc_info (int __options, FILE *__fp) __THROW;164extern int malloc_info (int __options, FILE *__fp) __THROW;
165165
166__END_DECLS166__END_DECLS
167#endif /* malloc.h */
\ No newline at end of file
167#endif /* malloc.h */
lib/libc/include/generic-glibc/netinet/tcp.h+3
...@@ -212,6 +212,9 @@ enum...@@ -212,6 +212,9 @@ enum
212# define TCPI_OPT_ECN 8 /* ECN was negotiated at TCP session init */212# define TCPI_OPT_ECN 8 /* ECN was negotiated at TCP session init */
213# define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */213# define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
214# define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */214# define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */
215# define TCPI_OPT_USEC_TS 64 /* usec timestamps */
216# define TCPI_OPT_TFO_CHILD 128 /* child from a Fast Open option on SYN */
217
215218
216/* Values for tcpi_state. */219/* Values for tcpi_state. */
217enum tcp_ca_state220enum tcp_ca_state
lib/libc/include/generic-glibc/pthread.h+5
...@@ -1317,6 +1317,11 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,...@@ -1317,6 +1317,11 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,
1317 __THROW __nonnull ((2));1317 __THROW __nonnull ((2));
1318#endif1318#endif
13191319
1320#ifdef __USE_GNU
1321/* Return the Linux TID for THREAD_ID. Returns -1 on failure. */
1322extern pid_t pthread_gettid_np (pthread_t __thread_id);
1323#endif
1324
13201325
1321/* Install handlers to be called when a new process is created with FORK.1326/* Install handlers to be called when a new process is created with FORK.
1322 The PREPARE handler is called in the parent process just before performing1327 The PREPARE handler is called in the parent process just before performing
lib/libc/include/generic-glibc/resolv.h+2-2
...@@ -171,7 +171,7 @@ __END_DECLS...@@ -171,7 +171,7 @@ __END_DECLS
171#define res_init __res_init171#define res_init __res_init
172#define res_isourserver __res_isourserver172#define res_isourserver __res_isourserver
173173
174/* In glibc 2.33 and earlier res_search, res_nsearch, res_query, res_nquery,174/* zig patch: In glibc 2.33 and earlier res_search, res_nsearch, res_query, res_nquery,
175 * res_querydomain, res_nquerydomain, dn_skipname, dn_comp, dn_expand were175 * res_querydomain, res_nquerydomain, dn_skipname, dn_comp, dn_expand were
176 * #define'd to __res_search, __res_nsearch, etc. glibc 2.34 onwards removes176 * #define'd to __res_search, __res_nsearch, etc. glibc 2.34 onwards removes
177 * the macros and exposes the symbols directly. New glibc exposes compat177 * the macros and exposes the symbols directly. New glibc exposes compat
...@@ -336,4 +336,4 @@ void res_nclose (res_state) __THROW;...@@ -336,4 +336,4 @@ void res_nclose (res_state) __THROW;
336336
337__END_DECLS337__END_DECLS
338338
339#endif /* !_RESOLV_H_ */
\ No newline at end of file
339#endif /* !_RESOLV_H_ */
lib/libc/include/generic-glibc/stdio.h+3-3
...@@ -168,8 +168,11 @@ extern int renameat (int __oldfd, const char *__old, int __newfd,...@@ -168,8 +168,11 @@ extern int renameat (int __oldfd, const char *__old, int __newfd,
168#ifdef __USE_GNU168#ifdef __USE_GNU
169/* Flags for renameat2. */169/* Flags for renameat2. */
170# define RENAME_NOREPLACE (1 << 0)170# define RENAME_NOREPLACE (1 << 0)
171# define AT_RENAME_NOREPLACE RENAME_NOREPLACE
171# define RENAME_EXCHANGE (1 << 1)172# define RENAME_EXCHANGE (1 << 1)
173# define AT_RENAME_EXCHANGE RENAME_EXCHANGE
172# define RENAME_WHITEOUT (1 << 2)174# define RENAME_WHITEOUT (1 << 2)
175# define AT_RENAME_WHITEOUT RENAME_WHITEOUT
173176
174/* Rename file OLD relative to OLDFD to NEW relative to NEWFD, with177/* Rename file OLD relative to OLDFD to NEW relative to NEWFD, with
175 additional flags. */178 additional flags. */
...@@ -604,9 +607,6 @@ extern int fgetc_unlocked (FILE *__stream) __nonnull ((1));...@@ -604,9 +607,6 @@ extern int fgetc_unlocked (FILE *__stream) __nonnull ((1));
604/* Write a character to STREAM.607/* Write a character to STREAM.
605608
606 These functions are possible cancellation points and therefore not609 These functions are possible cancellation points and therefore not
607 marked with __THROW.
608
609 These functions is a possible cancellation point and therefore not
610 marked with __THROW. */610 marked with __THROW. */
611extern int fputc (int __c, FILE *__stream) __nonnull ((2));611extern int fputc (int __c, FILE *__stream) __nonnull ((2));
612extern int putc (int __c, FILE *__stream) __nonnull ((2));612extern int putc (int __c, FILE *__stream) __nonnull ((2));
lib/libc/include/generic-glibc/stdio_ext.h+9-9
...@@ -43,43 +43,43 @@ __BEGIN_DECLS...@@ -43,43 +43,43 @@ __BEGIN_DECLS
4343
44/* Return the size of the buffer of FP in bytes currently in use by44/* Return the size of the buffer of FP in bytes currently in use by
45 the given stream. */45 the given stream. */
46extern size_t __fbufsize (FILE *__fp) __THROW;46extern size_t __fbufsize (FILE *__fp) __THROW __nonnull ((1));
4747
4848
49/* Return non-zero value iff the stream FP is opened readonly, or if the49/* Return non-zero value iff the stream FP is opened readonly, or if the
50 last operation on the stream was a read operation. */50 last operation on the stream was a read operation. */
51extern int __freading (FILE *__fp) __THROW;51extern int __freading (FILE *__fp) __THROW __nonnull ((1));
5252
53/* Return non-zero value iff the stream FP is opened write-only or53/* Return non-zero value iff the stream FP is opened write-only or
54 append-only, or if the last operation on the stream was a write54 append-only, or if the last operation on the stream was a write
55 operation. */55 operation. */
56extern int __fwriting (FILE *__fp) __THROW;56extern int __fwriting (FILE *__fp) __THROW __nonnull ((1));
5757
5858
59/* Return non-zero value iff stream FP is not opened write-only or59/* Return non-zero value iff stream FP is not opened write-only or
60 append-only. */60 append-only. */
61extern int __freadable (FILE *__fp) __THROW;61extern int __freadable (FILE *__fp) __THROW __nonnull ((1));
6262
63/* Return non-zero value iff stream FP is not opened read-only. */63/* Return non-zero value iff stream FP is not opened read-only. */
64extern int __fwritable (FILE *__fp) __THROW;64extern int __fwritable (FILE *__fp) __THROW __nonnull ((1));
6565
6666
67/* Return non-zero value iff the stream FP is line-buffered. */67/* Return non-zero value iff the stream FP is line-buffered. */
68extern int __flbf (FILE *__fp) __THROW;68extern int __flbf (FILE *__fp) __THROW __nonnull ((1));
6969
7070
71/* Discard all pending buffered I/O on the stream FP. */71/* Discard all pending buffered I/O on the stream FP. */
72extern void __fpurge (FILE *__fp) __THROW;72extern void __fpurge (FILE *__fp) __THROW __nonnull ((1));
7373
74/* Return amount of output in bytes pending on a stream FP. */74/* Return amount of output in bytes pending on a stream FP. */
75extern size_t __fpending (FILE *__fp) __THROW;75extern size_t __fpending (FILE *__fp) __THROW __nonnull ((1));
7676
77/* Flush all line-buffered files. */77/* Flush all line-buffered files. */
78extern void _flushlbf (void);78extern void _flushlbf (void);
7979
8080
81/* Set locking status of stream FP to TYPE. */81/* Set locking status of stream FP to TYPE. */
82extern int __fsetlocking (FILE *__fp, int __type) __THROW;82extern int __fsetlocking (FILE *__fp, int __type) __THROW __nonnull ((1));
8383
84__END_DECLS84__END_DECLS
8585
lib/libc/include/generic-glibc/stdlib.h+9-3
...@@ -654,7 +654,7 @@ extern int lcong48_r (unsigned short int __param[7],...@@ -654,7 +654,7 @@ extern int lcong48_r (unsigned short int __param[7],
654 __THROW __nonnull ((1, 2));654 __THROW __nonnull ((1, 2));
655655
656/*656/*
657 * arc4random* symbols introduced in glibc 2.36:657 * zig patch: arc4random* symbols introduced in glibc 2.36:
658 * https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=8420a65cd06874ee09518366b8fba746a557212a;hb=6f4e0fcfa2d2b0915816a3a3a1d48b4763a7dee2658 * https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=8420a65cd06874ee09518366b8fba746a557212a;hb=6f4e0fcfa2d2b0915816a3a3a1d48b4763a7dee2
659 */659 */
660# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2660# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2
...@@ -693,7 +693,7 @@ extern void *realloc (void *__ptr, size_t __size)...@@ -693,7 +693,7 @@ extern void *realloc (void *__ptr, size_t __size)
693extern void free (void *__ptr) __THROW;693extern void free (void *__ptr) __THROW;
694694
695/*695/*
696 * reallocarray introduced in glibc 2.26696 * zig patch: reallocarray introduced in glibc 2.26
697 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da697 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da
698 */698 */
699#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 26) || __GLIBC__ > 2699#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 26) || __GLIBC__ > 2
...@@ -997,6 +997,12 @@ __extension__ extern long long int llabs (long long int __x)...@@ -997,6 +997,12 @@ __extension__ extern long long int llabs (long long int __x)
997 __THROW __attribute__ ((__const__)) __wur;997 __THROW __attribute__ ((__const__)) __wur;
998#endif998#endif
999999
1000#if __GLIBC_USE (ISOC2Y)
1001extern unsigned int uabs (int __x) __THROW __attribute__ ((__const__)) __wur;
1002extern unsigned long int ulabs (long int __x) __THROW __attribute__ ((__const__)) __wur;
1003__extension__ extern unsigned long long int ullabs (long long int __x)
1004 __THROW __attribute__ ((__const__)) __wur;
1005#endif
10001006
1001/* Return the `div_t', `ldiv_t' or `lldiv_t' representation1007/* Return the `div_t', `ldiv_t' or `lldiv_t' representation
1002 of the value of NUMER over DENOM. */1008 of the value of NUMER over DENOM. */
...@@ -1178,4 +1184,4 @@ extern int ttyslot (void) __THROW;...@@ -1178,4 +1184,4 @@ extern int ttyslot (void) __THROW;
11781184
1179__END_DECLS1185__END_DECLS
11801186
1181#endif /* stdlib.h */
\ No newline at end of file
1187#endif /* stdlib.h */
lib/libc/include/generic-glibc/string.h+2-2
...@@ -502,7 +502,7 @@ extern char *stpncpy (char *__restrict __dest,...@@ -502,7 +502,7 @@ extern char *stpncpy (char *__restrict __dest,
502#endif502#endif
503503
504/*504/*
505 * strlcpy and strlcat introduced in glibc 2.38505 * zig patch: strlcpy and strlcat introduced in glibc 2.38
506 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da506 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da
507 */507 */
508#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2508#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2
...@@ -557,4 +557,4 @@ extern char *basename (const char *__filename) __THROW __nonnull ((1));...@@ -557,4 +557,4 @@ extern char *basename (const char *__filename) __THROW __nonnull ((1));
557557
558__END_DECLS558__END_DECLS
559559
560#endif /* string.h */
\ No newline at end of file
560#endif /* string.h */
lib/libc/include/generic-glibc/sys/hwprobe.h+29-11
...@@ -21,6 +21,7 @@...@@ -21,6 +21,7 @@
21#define _SYS_HWPROBE_H 121#define _SYS_HWPROBE_H 1
2222
23#include <features.h>23#include <features.h>
24#include <sched.h>
24#include <stddef.h>25#include <stddef.h>
25#include <errno.h>26#include <errno.h>
26#ifdef __has_include27#ifdef __has_include
...@@ -63,22 +64,39 @@ struct riscv_hwprobe {...@@ -63,22 +64,39 @@ struct riscv_hwprobe {
6364
64__BEGIN_DECLS65__BEGIN_DECLS
6566
66extern int __riscv_hwprobe (struct riscv_hwprobe *__pairs, size_t __pair_count,67#if defined __cplusplus || !__GNUC_PREREQ (2, 7)
67 size_t __cpu_count, unsigned long int *__cpus,68# define __RISCV_HWPROBE_CPUS_TYPE cpu_set_t *
69#else
70/* The fourth argument to __riscv_hwprobe should be a null pointer or a
71 pointer to a cpu_set_t (either the fixed-size type or allocated with
72 CPU_ALLOC). However, early versions of this header file used the
73 argument type unsigned long int *. The transparent union allows
74 the argument to be either cpu_set_t * or unsigned long int * for
75 compatibility. The older header file requiring unsigned long int *
76 can be identified by the lack of the __RISCV_HWPROBE_CPUS_TYPE macro.
77 In C++ and with compilers that do not support transparent unions, the
78 argument type must be cpu_set_t *. */
79typedef union {
80 cpu_set_t *__cs;
81 unsigned long int *__ul;
82} __RISCV_HWPROBE_CPUS_TYPE __attribute__ ((__transparent_union__));
83# define __RISCV_HWPROBE_CPUS_TYPE __RISCV_HWPROBE_CPUS_TYPE
84#endif
85
86extern int __riscv_hwprobe (struct riscv_hwprobe *__pairs,
87 size_t __pair_count, size_t __cpusetsize,
88 __RISCV_HWPROBE_CPUS_TYPE __cpus,
68 unsigned int __flags)89 unsigned int __flags)
69 __nonnull ((1)) __wur90 __THROW __nonnull ((1)) __attr_access ((__read_write__, 1, 2));
70 __fortified_attr_access (__read_write__, 1, 2)
71 __fortified_attr_access (__read_only__, 4, 3);
7291
73/* A pointer to the __riscv_hwprobe vDSO function is passed as the second92/* A pointer to the __riscv_hwprobe function is passed as the second
74 argument to ifunc selector routines. Include a function pointer type for93 argument to ifunc selector routines. Include a function pointer type for
75 convenience in calling the function in those settings. */94 convenience in calling the function in those settings. */
76typedef int (*__riscv_hwprobe_t) (struct riscv_hwprobe *__pairs, size_t __pair_count,95typedef int (*__riscv_hwprobe_t) (struct riscv_hwprobe *__pairs,
77 size_t __cpu_count, unsigned long int *__cpus,96 size_t __pair_count, size_t __cpusetsize,
97 __RISCV_HWPROBE_CPUS_TYPE __cpus,
78 unsigned int __flags)98 unsigned int __flags)
79 __nonnull ((1)) __wur99 __nonnull ((1)) __attr_access ((__read_write__, 1, 2));
80 __fortified_attr_access (__read_write__, 1, 2)
81 __fortified_attr_access (__read_only__, 4, 3);
82100
83/* Helper function usable from ifunc selectors that probes a single key. */101/* Helper function usable from ifunc selectors that probes a single key. */
84static __inline int102static __inline int
lib/libc/include/generic-glibc/sys/ifunc.h+59-6
...@@ -19,24 +19,77 @@...@@ -19,24 +19,77 @@
19#ifndef _SYS_IFUNC_H19#ifndef _SYS_IFUNC_H
20#define _SYS_IFUNC_H20#define _SYS_IFUNC_H
2121
22#include <sys/cdefs.h>
23
22/* A second argument is passed to the ifunc resolver. */24/* A second argument is passed to the ifunc resolver. */
23#define _IFUNC_ARG_HWCAP (1ULL << 62)25#define _IFUNC_ARG_HWCAP (1ULL << 62)
2426
25/* The prototype of a gnu indirect function resolver on AArch64 is27/* Maximum number of HWCAP elements that are currently supported. */
28#define _IFUNC_HWCAP_MAX 4
29
30/* The prototype of a GNU indirect function resolver on AArch64 is
31
32 ElfW(Addr) ifunc_resolver (uint64_t, const uint64_t *);
33
34 The following prototype is also compatible:
2635
27 ElfW(Addr) ifunc_resolver (uint64_t, const __ifunc_arg_t *);36 ElfW(Addr) ifunc_resolver (uint64_t, const __ifunc_arg_t *);
2837
29 the first argument should have the _IFUNC_ARG_HWCAP bit set and38 The first argument might have the _IFUNC_ARG_HWCAP bit set and
30 the remaining bits should match the AT_HWCAP settings. */39 the remaining bits should match the AT_HWCAP settings.
40
41 If the _IFUNC_ARG_HWCAP bit is set in the first argument, then
42 the second argument is passed to the resolver function. In
43 this case, the second argument is a const pointer to a buffer
44 that allows to access all available HWCAP elements.
45
46 This buffer has its size in bytes at offset 0. The HWCAP elements
47 are available at offsets 8, 16, 24, 32... respectively for AT_HWCAP,
48 AT_HWCAP2, AT_HWCAP3, AT_HWCAP4... (these offsets are multiples of
49 sizeof (unsigned long)).
50
51 Indirect function resolvers must check availability of HWCAP
52 elements at runtime before accessing them using the size of the
53 buffer. */
3154
32/* Second argument to an ifunc resolver. */
33struct __ifunc_arg_t55struct __ifunc_arg_t
34{56{
35 unsigned long _size; /* Size of the struct, so it can grow. */57 unsigned long _size; /* Size of the struct, so it can grow. */
36 unsigned long _hwcap;58 unsigned long _hwcap;
37 unsigned long _hwcap2;59 unsigned long _hwcap2; /* End of 1st published struct. */
60 unsigned long _hwcap3;
61 unsigned long _hwcap4; /* End of 2nd published struct. */
38};62};
3963
40typedef struct __ifunc_arg_t __ifunc_arg_t;64typedef struct __ifunc_arg_t __ifunc_arg_t;
4165
66/* Constants for IDs of HWCAP elements to be used with the
67 __ifunc_hwcap function below. */
68enum
69{
70 _IFUNC_ARG_AT_HWCAP = 1,
71 _IFUNC_ARG_AT_HWCAP2 = 2,
72 _IFUNC_ARG_AT_HWCAP3 = 3,
73 _IFUNC_ARG_AT_HWCAP4 = 4,
74};
75
76/* A helper function to obtain HWCAP element by its ID from the
77 parameters ARG0 and ARG1 passed to the ifunc resolver. Note that
78 ID 1 corresponds to AT_HWCAP, ID 2 corresponds to AT_HWCAP2, etc.
79 If there is no element available for the requested ID then 0 is
80 returned. If ID doesn't much any supported AT_HWCAP{,2,...} value,
81 then 0 is also returned. */
82static __inline unsigned long __attribute__ ((unused, always_inline))
83__ifunc_hwcap (unsigned long __id,
84 unsigned long __arg0, const unsigned long *__arg1)
85{
86 if (__glibc_likely (__arg0 & _IFUNC_ARG_HWCAP))
87 {
88 const unsigned long size = __arg1[0];
89 const unsigned long offset = __id * sizeof (unsigned long);
90 return offset < size && __id > 0 ? __arg1[__id] : 0;
91 }
92 return __id == 1 ? __arg0 : 0;
93}
94
42#endif95#endif
\ No newline at end of file
lib/libc/include/generic-glibc/sys/mount.h+1-1
...@@ -121,7 +121,7 @@ enum...@@ -121,7 +121,7 @@ enum
121 MS_ACTIVE = 1 << 30,121 MS_ACTIVE = 1 << 30,
122#define MS_ACTIVE MS_ACTIVE122#define MS_ACTIVE MS_ACTIVE
123#undef MS_NOUSER123#undef MS_NOUSER
124 MS_NOUSER = 1 << 31124 MS_NOUSER = 1U << 31
125#define MS_NOUSER MS_NOUSER125#define MS_NOUSER MS_NOUSER
126};126};
127127
lib/libc/include/generic-glibc/sys/ttychars.h-4
...@@ -54,8 +54,4 @@ struct ttychars {...@@ -54,8 +54,4 @@ struct ttychars {
54 char tc_lnextc; /* literal next character */54 char tc_lnextc; /* literal next character */
55};55};
5656
57#ifdef __USE_OLD_TTY
58#include <sys/ttydefaults.h> /* to pick up character defaults */
59#endif
60
61#endif /* sys/ttychars.h */57#endif /* sys/ttychars.h */
\ No newline at end of file
lib/libc/include/generic-glibc/termio.h deleted-6
...@@ -1,6 +0,0 @@
1/* Compatible <termio.h> for old `struct termio' ioctl interface.
2 This is obsolete; use the POSIX.1 `struct termios' interface
3 defined in <termios.h> instead. */
4
5#include <termios.h>
6#include <sys/ioctl.h>
\ No newline at end of file
lib/libc/include/generic-glibc/termios.h+20
...@@ -61,6 +61,26 @@ extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW;...@@ -61,6 +61,26 @@ extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW;
61extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __THROW;61extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __THROW;
62#endif62#endif
6363
64#ifdef __USE_GNU
65/* Interfaces that are explicitly numeric representations of baud rates */
66typedef speed_t baud_t;
67#define BAUD_MAX SPEED_MAX
68
69/* Return the output baud rate stored in *TERMIOS_P. */
70extern baud_t cfgetobaud (const struct termios *__termios_p) __THROW;
71
72/* Return the input baud rate stored in *TERMIOS_P. */
73extern baud_t cfgetibaud (const struct termios *__termios_p) __THROW;
74
75/* Set the output baud rate stored in *TERMIOS_P to BAUD. */
76extern int cfsetobaud (struct termios *__termios_p, baud_t __baud) __THROW;
77
78/* Set the input baud rate stored in *TERMIOS_P to BAUD. */
79extern int cfsetibaud (struct termios *__termios_p, baud_t __baud) __THROW;
80
81/* Set both the input and output baud rates in *TERMIOS_OP to BAUD. */
82extern int cfsetbaud (struct termios *__termios_p, baud_t __baud) __THROW;
83#endif
6484
65/* Put the state of FD into *TERMIOS_P. */85/* Put the state of FD into *TERMIOS_P. */
66extern int tcgetattr (int __fd, struct termios *__termios_p) __THROW;86extern int tcgetattr (int __fd, struct termios *__termios_p) __THROW;
lib/libc/include/generic-glibc/tgmath.h+18
...@@ -923,6 +923,24 @@...@@ -923,6 +923,24 @@
923/* Return the cube root of X. */923/* Return the cube root of X. */
924#define cbrt(Val) __TGMATH_UNARY_REAL_ONLY (Val, cbrt)924#define cbrt(Val) __TGMATH_UNARY_REAL_ONLY (Val, cbrt)
925925
926#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23)
927/* Return 1+X to the Y power. */
928# define compoundn(Val1, Val2) \
929 __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, compoundn)
930
931/* Return X to the Y power. */
932# define pown(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, pown)
933
934/* Return X to the Y power. */
935# define powr(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, powr)
936
937/* Return the Yth root of X. */
938# define rootn(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, rootn)
939
940/* Return 1/sqrt(X). */
941# define rsqrt(Val) __TGMATH_UNARY_REAL_ONLY (Val, rsqrt)
942#endif
943
926944
927/* Nearest integer, absolute value, and remainder functions. */945/* Nearest integer, absolute value, and remainder functions. */
928946
lib/libc/include/generic-glibc/unistd.h+1-1
...@@ -1231,4 +1231,4 @@ extern int close_range (unsigned int __fd, unsigned int __max_fd,...@@ -1231,4 +1231,4 @@ extern int close_range (unsigned int __fd, unsigned int __max_fd,
12311231
1232__END_DECLS1232__END_DECLS
12331233
1234#endif /* unistd.h */1234#endif /* unistd.h */
\ No newline at end of file
lib/libc/include/mips-linux-gnu/bits/ioctl-types.h-12
...@@ -31,18 +31,6 @@ struct winsize...@@ -31,18 +31,6 @@ struct winsize
31 unsigned short int ws_ypixel;31 unsigned short int ws_ypixel;
32 };32 };
3333
34#define NCC 8
35struct termio
36 {
37 unsigned short int c_iflag; /* input mode flags */
38 unsigned short int c_oflag; /* output mode flags */
39 unsigned short int c_cflag; /* control mode flags */
40 unsigned short int c_lflag; /* local mode flags */
41 char c_line; /* line discipline */
42 /* Yes, this is really NCCS. */
43 unsigned char c_cc[32 /* NCCS */]; /* control characters */
44 };
45
46/* modem lines */34/* modem lines */
47#define TIOCM_LE 0x001 /* line enable */35#define TIOCM_LE 0x001 /* line enable */
48#define TIOCM_DTR 0x002 /* data terminal ready */36#define TIOCM_DTR 0x002 /* data terminal ready */
lib/libc/include/mips-linux-gnu/bits/termios-struct.h deleted-34
...@@ -1,34 +0,0 @@
1/* struct termios definition. Linux/mips version.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _TERMIOS_H
20# error "Never include <bits/termios-struct.h> directly; use <termios.h> instead."
21#endif
22
23#define NCCS 32
24struct termios
25 {
26 tcflag_t c_iflag; /* input mode flags */
27 tcflag_t c_oflag; /* output mode flags */
28 tcflag_t c_cflag; /* control mode flags */
29 tcflag_t c_lflag; /* local mode flags */
30 cc_t c_line; /* line discipline */
31 cc_t c_cc[NCCS]; /* control characters */
32#define _HAVE_STRUCT_TERMIOS_C_ISPEED 0
33#define _HAVE_STRUCT_TERMIOS_C_OSPEED 0
34 };
\ No newline at end of file
lib/libc/include/powerpc-linux-gnu/bits/ioctl-types.h-11
...@@ -32,17 +32,6 @@ struct winsize...@@ -32,17 +32,6 @@ struct winsize
32 unsigned short int ws_ypixel;32 unsigned short int ws_ypixel;
33 };33 };
3434
35#define NCC 10
36struct termio
37 {
38 unsigned short int c_iflag; /* input mode flags */
39 unsigned short int c_oflag; /* output mode flags */
40 unsigned short int c_cflag; /* control mode flags */
41 unsigned short int c_lflag; /* local mode flags */
42 unsigned char c_line; /* line discipline */
43 unsigned char c_cc[NCC]; /* control characters */
44};
45
46/* modem lines */35/* modem lines */
47#define TIOCM_LE 0x00136#define TIOCM_LE 0x001
48#define TIOCM_DTR 0x00237#define TIOCM_DTR 0x002
lib/libc/include/powerpc-linux-gnu/bits/termios-baud.h deleted-45
...@@ -1,45 +0,0 @@
1/* termios baud rate selection definitions. Linux/powerpc version.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _TERMIOS_H
20# error "Never include <bits/termios-baud.h> directly; use <termios.h> instead."
21#endif
22
23#ifdef __USE_MISC
24# define CBAUD 0000377
25# define CBAUDEX 0000020
26# define CMSPAR 010000000000 /* mark or space (stick) parity */
27# define CRTSCTS 020000000000 /* flow control */
28#endif
29
30#define B57600 00020
31#define B115200 00021
32#define B230400 00022
33#define B460800 00023
34#define B500000 00024
35#define B576000 00025
36#define B921600 00026
37#define B1000000 00027
38#define B1152000 00030
39#define B1500000 00031
40#define B2000000 00032
41#define B2500000 00033
42#define B3000000 00034
43#define B3500000 00035
44#define B4000000 00036
45#define __MAX_BAUD B4000000
\ No newline at end of file
lib/libc/include/powerpc-linux-gnu/bits/termios-c_cflag.h+3-1
...@@ -35,5 +35,7 @@...@@ -35,5 +35,7 @@
35#define CLOCAL 0010000035#define CLOCAL 00100000
3636
37#ifdef __USE_MISC37#ifdef __USE_MISC
38# define ADDRB 0400000000038# define ADDRB 04000000000
39# define CMSPAR 010000000000 /* Mark or space (stick) parity. */
40# define CRTSCTS 020000000000 /* Flow control. */
39#endif41#endif
\ No newline at end of file
lib/libc/include/powerpc-linux-gnu/bits/termios-cbaud.h created+45
...@@ -0,0 +1,45 @@
1/* termios baud rate selection definitions. Linux/powerpc version.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _TERMIOS_H
20# error "Never include <bits/termios-cbaud.h> directly; use <termios.h> instead."
21#endif
22
23#ifdef __USE_MISC
24# define CBAUD 000000377
25# define CBAUDEX 000000020
26# define CIBAUD 077600000
27# define IBSHIFT 16
28#endif
29
30#define __B57600 00020
31#define __B115200 00021
32#define __B230400 00022
33#define __B460800 00023
34#define __B500000 00024
35#define __B576000 00025
36#define __B921600 00026
37#define __B1000000 00027
38#define __B1152000 00030
39#define __B1500000 00031
40#define __B2000000 00032
41#define __B2500000 00033
42#define __B3000000 00034
43#define __B3500000 00035
44#define __B4000000 00036
45#define __BOTHER 00037
\ No newline at end of file
lib/libc/include/sparc-linux-gnu/bits/termios-baud.h deleted-46
...@@ -1,46 +0,0 @@
1/* termios baud rate selection definitions. Linux/sparc version.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _TERMIOS_H
20# error "Never include <bits/termios-baud.h> directly; use <termios.h> instead."
21#endif
22
23#ifdef __USE_MISC
24# define CBAUD 0x0000100f
25# define CBAUDEX 0x00001000
26# define CIBAUD 0x100f0000 /* input baud rate (not used) */
27# define CMSPAR 0x40000000 /* mark or space (stick) parity */
28# define CRTSCTS 0x80000000 /* flow control */
29#endif
30
31#define B57600 0x00001001
32#define B115200 0x00001002
33#define B230400 0x00001003
34#define B460800 0x00001004
35#define B76800 0x00001005
36#define B153600 0x00001006
37#define B307200 0x00001007
38#define B614400 0x00001008
39#define B921600 0x00001009
40#define B500000 0x0000100a
41#define B576000 0x0000100b
42#define B1000000 0x0000100c
43#define B1152000 0x0000100d
44#define B1500000 0x0000100e
45#define B2000000 0x0000100f
46#define __MAX_BAUD B2000000
\ No newline at end of file
lib/libc/include/sparc-linux-gnu/bits/termios-cbaud.h created+45
...@@ -0,0 +1,45 @@
1/* termios baud rate selection definitions. Linux/sparc version.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _TERMIOS_H
20# error "Never include <bits/termios-cbaud.h> directly; use <termios.h> instead."
21#endif
22
23#ifdef __USE_MISC
24# define CBAUD 0x0000100f
25# define CBAUDEX 0x00001000
26# define CIBAUD 0x100f0000 /* input baud rate */
27# define IBSHIFT 16
28#endif
29
30#define __B57600 0x00001001
31#define __B115200 0x00001002
32#define __B230400 0x00001003
33#define __B460800 0x00001004
34#define __B76800 0x00001005
35#define __B153600 0x00001006
36#define __B307200 0x00001007
37#define __B614400 0x00001008
38#define __B921600 0x00001009
39#define __B500000 0x0000100a
40#define __B576000 0x0000100b
41#define __B1000000 0x0000100c
42#define __B1152000 0x0000100d
43#define __B1500000 0x0000100e
44#define __B2000000 0x0000100f
45#define __BOTHER 0x00001000
\ No newline at end of file
lib/libc/include/sparc-linux-gnu/bits/termios-struct.h deleted-34
...@@ -1,34 +0,0 @@
1/* struct termios definition. Linux/sparc version.
2 Copyright (C) 2019-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _TERMIOS_H
20# error "Never include <bits/termios-struct.h> directly; use <termios.h> instead."
21#endif
22
23#define NCCS 17
24struct termios
25 {
26 tcflag_t c_iflag; /* input mode flags */
27 tcflag_t c_oflag; /* output mode flags */
28 tcflag_t c_cflag; /* control mode flags */
29 tcflag_t c_lflag; /* local mode flags */
30 cc_t c_line; /* line discipline */
31 cc_t c_cc[NCCS]; /* control characters */
32#define _HAVE_STRUCT_TERMIOS_C_ISPEED 0
33#define _HAVE_STRUCT_TERMIOS_C_OSPEED 0
34 };
\ No newline at end of file
lib/libc/include/x86-linux-gnu/bits/floatn.h+7-3
...@@ -25,11 +25,15 @@...@@ -25,11 +25,15 @@
25 floating-point type with the IEEE 754 binary128 format, and this25 floating-point type with the IEEE 754 binary128 format, and this
26 glibc includes corresponding *f128 interfaces for it. The required26 glibc includes corresponding *f128 interfaces for it. The required
27 libgcc support was added some time after the basic compiler27 libgcc support was added some time after the basic compiler
28 support, for x86_64 and x86. */28 support, for x86_64 and x86. Intel SYCL compiler doesn't support
29 _Float128: https://github.com/intel/llvm/issues/16903
30 */
29#if (defined __x86_64__ \31#if (defined __x86_64__ \
30 ? __GNUC_PREREQ (4, 3) \32 ? __GNUC_PREREQ (4, 3) \
31 : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \33 : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \
32 || __glibc_clang_prereq (3, 4)34 || (__glibc_clang_prereq (3, 9) \
35 && (!defined __INTEL_LLVM_COMPILER \
36 || !defined SYCL_LANGUAGE_VERSION))
33# define __HAVE_FLOAT128 137# define __HAVE_FLOAT128 1
34#else38#else
35# define __HAVE_FLOAT128 039# define __HAVE_FLOAT128 0
...@@ -89,7 +93,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));...@@ -89,7 +93,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
89/* The type _Float128 exists only since GCC 7.0. */93/* The type _Float128 exists only since GCC 7.0. */
90# if !__GNUC_PREREQ (7, 0) \94# if !__GNUC_PREREQ (7, 0) \
91 || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) \95 || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) \
92 || __glibc_clang_prereq (3, 4)96 || __glibc_clang_prereq (3, 9)
93typedef __float128 _Float128;97typedef __float128 _Float128;
94# endif98# endif
9599