From 1804251dfb5b1a5699371735aac138b3a2d6c3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 31 Jul 2025 22:02:37 +0200 Subject: [PATCH] glibc: update headers to 2.42 --- .../include/aarch64-linux-gnu/bits/fcntl.h | 14 +-- .../aarch64-linux-gnu/bits/math-vector.h | 32 +++++++ .../bits/pthreadtypes-arch.h | 24 ++---- .../aarch64-linux-gnu/bits/semaphore.h | 8 +- .../include/aarch64-linux-gnu/bits/wordsize.h | 9 +- lib/libc/include/generic-glibc/arpa/inet.h | 5 ++ .../include/generic-glibc/bits/fcntl-linux.h | 2 + .../generic-glibc/bits/inet-fortified-decl.h | 42 +++++++++ .../generic-glibc/bits/inet-fortified.h | 61 +++++++++++++ .../include/generic-glibc/bits/ioctl-types.h | 11 --- lib/libc/include/generic-glibc/bits/ioctls.h | 85 +------------------ .../generic-glibc/bits/libm-simd-decl-stubs.h | 44 ++++++++++ .../generic-glibc/bits/mathcalls-macros.h | 2 +- .../include/generic-glibc/bits/mathcalls.h | 21 +++++ .../include/generic-glibc/bits/mman-linux.h | 2 + .../include/generic-glibc/bits/mman-shared.h | 7 +- lib/libc/include/generic-glibc/bits/sched.h | 2 +- .../generic-glibc/bits/string_fortified.h | 2 +- lib/libc/include/generic-glibc/bits/syscall.h | 24 +++++- .../include/generic-glibc/bits/termios-baud.h | 77 +++++++++++------ .../generic-glibc/bits/termios-c_cflag.h | 4 +- .../generic-glibc/bits/termios-cbaud.h | 47 ++++++++++ .../generic-glibc/bits/termios-struct.h | 11 ++- lib/libc/include/generic-glibc/bits/termios.h | 56 ++++++------ .../generic-glibc/bits/types/struct_FILE.h | 10 ++- lib/libc/include/generic-glibc/dlfcn.h | 10 ++- lib/libc/include/generic-glibc/elf.h | 33 +++---- lib/libc/include/generic-glibc/fcntl.h | 11 +-- lib/libc/include/generic-glibc/features.h | 6 +- lib/libc/include/generic-glibc/glob.h | 3 +- lib/libc/include/generic-glibc/inttypes.h | 5 ++ lib/libc/include/generic-glibc/malloc.h | 4 +- lib/libc/include/generic-glibc/netinet/tcp.h | 3 + lib/libc/include/generic-glibc/pthread.h | 5 ++ lib/libc/include/generic-glibc/resolv.h | 4 +- lib/libc/include/generic-glibc/stdio.h | 6 +- lib/libc/include/generic-glibc/stdio_ext.h | 18 ++-- lib/libc/include/generic-glibc/stdlib.h | 12 ++- lib/libc/include/generic-glibc/string.h | 4 +- lib/libc/include/generic-glibc/sys/hwprobe.h | 40 ++++++--- lib/libc/include/generic-glibc/sys/ifunc.h | 65 ++++++++++++-- lib/libc/include/generic-glibc/sys/mount.h | 2 +- lib/libc/include/generic-glibc/sys/ttychars.h | 4 - lib/libc/include/generic-glibc/termio.h | 6 -- lib/libc/include/generic-glibc/termios.h | 20 +++++ lib/libc/include/generic-glibc/tgmath.h | 18 ++++ lib/libc/include/generic-glibc/unistd.h | 2 +- .../include/mips-linux-gnu/bits/ioctl-types.h | 12 --- .../mips-linux-gnu/bits/termios-struct.h | 34 -------- .../powerpc-linux-gnu/bits/ioctl-types.h | 11 --- .../powerpc-linux-gnu/bits/termios-c_cflag.h | 4 +- .../bits/{termios-baud.h => termios-cbaud.h} | 42 ++++----- .../bits/{termios-baud.h => termios-cbaud.h} | 39 +++++---- .../sparc-linux-gnu/bits/termios-struct.h | 34 -------- lib/libc/include/x86-linux-gnu/bits/floatn.h | 10 ++- 55 files changed, 651 insertions(+), 418 deletions(-) create mode 100644 lib/libc/include/generic-glibc/bits/inet-fortified-decl.h create mode 100644 lib/libc/include/generic-glibc/bits/inet-fortified.h create mode 100644 lib/libc/include/generic-glibc/bits/termios-cbaud.h delete mode 100644 lib/libc/include/generic-glibc/termio.h delete mode 100644 lib/libc/include/mips-linux-gnu/bits/termios-struct.h rename lib/libc/include/powerpc-linux-gnu/bits/{termios-baud.h => termios-cbaud.h} (58%) rename lib/libc/include/sparc-linux-gnu/bits/{termios-baud.h => termios-cbaud.h} (58%) delete mode 100644 lib/libc/include/sparc-linux-gnu/bits/termios-struct.h diff --git a/lib/libc/include/aarch64-linux-gnu/bits/fcntl.h b/lib/libc/include/aarch64-linux-gnu/bits/fcntl.h index aaecf2bbc04527dc74d67713c87ce7371c5bba02..52dee64f6f1db38ed4cfb31c5463206d8cb459c7 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/fcntl.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/fcntl.h @@ -25,17 +25,11 @@ #define __O_NOFOLLOW 0100000 #define __O_DIRECT 0200000 -#ifdef __ILP32__ -# define __O_LARGEFILE 0400000 -#else -# define __O_LARGEFILE 0 -#endif +#define __O_LARGEFILE 0 -#ifdef __LP64__ -# define F_GETLK64 5 -# define F_SETLK64 6 -# define F_SETLKW64 7 -#endif +#define F_GETLK64 5 +#define F_SETLK64 6 +#define F_SETLKW64 7 struct flock { diff --git a/lib/libc/include/aarch64-linux-gnu/bits/math-vector.h b/lib/libc/include/aarch64-linux-gnu/bits/math-vector.h index 95d52f96fc412d13acfc0845af569f792c8903e6..c4506228796577d29ffb3feef1ae910a36221004 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/math-vector.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/math-vector.h @@ -37,6 +37,10 @@ # define __DECL_SIMD_acosh __DECL_SIMD_aarch64 # undef __DECL_SIMD_acoshf # define __DECL_SIMD_acoshf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_acospi +# define __DECL_SIMD_acospi __DECL_SIMD_aarch64 +# undef __DECL_SIMD_acospif +# define __DECL_SIMD_acospif __DECL_SIMD_aarch64 # undef __DECL_SIMD_asin # define __DECL_SIMD_asin __DECL_SIMD_aarch64 # undef __DECL_SIMD_asinf @@ -45,6 +49,10 @@ # define __DECL_SIMD_asinh __DECL_SIMD_aarch64 # undef __DECL_SIMD_asinhf # define __DECL_SIMD_asinhf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_asinpi +# define __DECL_SIMD_asinpi __DECL_SIMD_aarch64 +# undef __DECL_SIMD_asinpif +# define __DECL_SIMD_asinpif __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan # define __DECL_SIMD_atan __DECL_SIMD_aarch64 # undef __DECL_SIMD_atanf @@ -53,10 +61,18 @@ # define __DECL_SIMD_atanh __DECL_SIMD_aarch64 # undef __DECL_SIMD_atanhf # define __DECL_SIMD_atanhf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_atanpi +# define __DECL_SIMD_atanpi __DECL_SIMD_aarch64 +# undef __DECL_SIMD_atanpif +# define __DECL_SIMD_atanpif __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan2 # define __DECL_SIMD_atan2 __DECL_SIMD_aarch64 # undef __DECL_SIMD_atan2f # define __DECL_SIMD_atan2f __DECL_SIMD_aarch64 +# undef __DECL_SIMD_atan2pi +# define __DECL_SIMD_atan2pi __DECL_SIMD_aarch64 +# undef __DECL_SIMD_atan2pif +# define __DECL_SIMD_atan2pif __DECL_SIMD_aarch64 # undef __DECL_SIMD_cbrt # define __DECL_SIMD_cbrt __DECL_SIMD_aarch64 # undef __DECL_SIMD_cbrtf @@ -176,12 +192,16 @@ typedef __SVBool_t __sv_bool_t; # define __vpcs __attribute__ ((__aarch64_vector_pcs__)) __vpcs __f32x4_t _ZGVnN4vv_atan2f (__f32x4_t, __f32x4_t); +__vpcs __f32x4_t _ZGVnN4vv_atan2pif (__f32x4_t, __f32x4_t); __vpcs __f32x4_t _ZGVnN4v_acosf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_acoshf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_acospif (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_asinf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_asinhf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_asinpif (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_atanf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_atanhf (__f32x4_t); +__vpcs __f32x4_t _ZGVnN4v_atanpif (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_cbrtf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_cosf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_coshf (__f32x4_t); @@ -207,12 +227,16 @@ __vpcs __f32x4_t _ZGVnN4v_tanhf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_tanpif (__f32x4_t); __vpcs __f64x2_t _ZGVnN2vv_atan2 (__f64x2_t, __f64x2_t); +__vpcs __f64x2_t _ZGVnN2vv_atan2pi (__f64x2_t, __f64x2_t); __vpcs __f64x2_t _ZGVnN2v_acos (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_acosh (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_acospi (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_asin (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_asinh (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_asinpi (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_atan (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_atanh (__f64x2_t); +__vpcs __f64x2_t _ZGVnN2v_atanpi (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_cbrt (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_cos (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_cosh (__f64x2_t); @@ -243,12 +267,16 @@ __vpcs __f64x2_t _ZGVnN2v_tanpi (__f64x2_t); #ifdef __SVE_VEC_MATH_SUPPORTED __sv_f32_t _ZGVsMxvv_atan2f (__sv_f32_t, __sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxvv_atan2pif (__sv_f32_t, __sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_acosf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_acoshf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_acospif (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_asinf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_asinhf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_asinpif (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_atanf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_atanhf (__sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxv_atanpif (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_cbrtf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_cosf (__sv_f32_t, __sv_bool_t); __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); __sv_f32_t _ZGVsMxv_tanpif (__sv_f32_t, __sv_bool_t); __sv_f64_t _ZGVsMxvv_atan2 (__sv_f64_t, __sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxvv_atan2pi (__sv_f64_t, __sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_acos (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_acosh (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_acospi (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_asin (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_asinh (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_asinpi (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_atan (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_atanh (__sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxv_atanpi (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_cbrt (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_cos (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_cosh (__sv_f64_t, __sv_bool_t); diff --git a/lib/libc/include/aarch64-linux-gnu/bits/pthreadtypes-arch.h b/lib/libc/include/aarch64-linux-gnu/bits/pthreadtypes-arch.h index bee5cc5acf9d45fe5cd16f30ba13016ba0d4e3c7..2dbe12da0ca4cdde3426daf253d84375a36b9bd1 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/pthreadtypes-arch.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/pthreadtypes-arch.h @@ -21,23 +21,13 @@ #include -#ifdef __ILP32__ -# define __SIZEOF_PTHREAD_ATTR_T 32 -# define __SIZEOF_PTHREAD_MUTEX_T 32 -# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -# define __SIZEOF_PTHREAD_CONDATTR_T 4 -# define __SIZEOF_PTHREAD_RWLOCK_T 48 -# define __SIZEOF_PTHREAD_BARRIER_T 20 -# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 -#else -# define __SIZEOF_PTHREAD_ATTR_T 64 -# define __SIZEOF_PTHREAD_MUTEX_T 48 -# define __SIZEOF_PTHREAD_MUTEXATTR_T 8 -# define __SIZEOF_PTHREAD_CONDATTR_T 8 -# define __SIZEOF_PTHREAD_RWLOCK_T 56 -# define __SIZEOF_PTHREAD_BARRIER_T 32 -# define __SIZEOF_PTHREAD_BARRIERATTR_T 8 -#endif +#define __SIZEOF_PTHREAD_ATTR_T 64 +#define __SIZEOF_PTHREAD_MUTEX_T 48 +#define __SIZEOF_PTHREAD_MUTEXATTR_T 8 +#define __SIZEOF_PTHREAD_CONDATTR_T 8 +#define __SIZEOF_PTHREAD_RWLOCK_T 56 +#define __SIZEOF_PTHREAD_BARRIER_T 32 +#define __SIZEOF_PTHREAD_BARRIERATTR_T 8 #define __SIZEOF_PTHREAD_COND_T 48 #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 diff --git a/lib/libc/include/aarch64-linux-gnu/bits/semaphore.h b/lib/libc/include/aarch64-linux-gnu/bits/semaphore.h index 256f68bbfc7506da0744597c30f474d40a3dae30..7d3d93431e67f2a62e40c4fdc1c4e169aa71e096 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/semaphore.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/semaphore.h @@ -20,13 +20,7 @@ # error "Never use directly; include instead." #endif - -#ifdef __ILP32__ -# define __SIZEOF_SEM_T 16 -#else -# define __SIZEOF_SEM_T 32 -#endif - +#define __SIZEOF_SEM_T 32 /* Value returned if `sem_open' failed. */ #define SEM_FAILED ((sem_t *) 0) diff --git a/lib/libc/include/aarch64-linux-gnu/bits/wordsize.h b/lib/libc/include/aarch64-linux-gnu/bits/wordsize.h index 30b14a9b640f351a7c4a7d030f7a5168213a7a38..3f84507cc16e18556599b2f90bda882e6e283173 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/wordsize.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/wordsize.h @@ -17,12 +17,5 @@ License along with the GNU C Library; if not, see . */ -#ifdef __LP64__ -# define __WORDSIZE 64 -#else -# define __WORDSIZE 32 -# define __WORDSIZE32_SIZE_ULONG 1 -# define __WORDSIZE32_PTRDIFF_LONG 1 -#endif - +#define __WORDSIZE 64 #define __WORDSIZE_TIME64_COMPAT32 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/arpa/inet.h b/lib/libc/include/generic-glibc/arpa/inet.h index 8d6490ef478cf3d243fd37dfcc496d0681dae311..84602130a9351f781e05e8fa551464150e8d67c8 100644 --- a/lib/libc/include/generic-glibc/arpa/inet.h +++ b/lib/libc/include/generic-glibc/arpa/inet.h @@ -101,6 +101,11 @@ extern char *inet_nsap_ntoa (int __len, const unsigned char *__cp, char *__buf) __THROW; #endif +#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function +/* Include functions with security checks. */ +# include +#endif + __END_DECLS #endif /* arpa/inet.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/fcntl-linux.h b/lib/libc/include/generic-glibc/bits/fcntl-linux.h index 8ebc3319b61e54b55af352975418758ef52e366f..56169a7ba49047e7442aadc3593b6592c04c028b 100644 --- a/lib/libc/include/generic-glibc/bits/fcntl-linux.h +++ b/lib/libc/include/generic-glibc/bits/fcntl-linux.h @@ -379,6 +379,8 @@ struct file_handle identity and may not be usable to open_by_handle_at. */ +# define AT_HANDLE_MNT_ID_UNIQUE 1 /* Return the 64-bit unique mount + ID. */ #endif __BEGIN_DECLS diff --git a/lib/libc/include/generic-glibc/bits/inet-fortified-decl.h b/lib/libc/include/generic-glibc/bits/inet-fortified-decl.h new file mode 100644 index 0000000000000000000000000000000000000000..a77a0477cda6cc1ee8f12046c3ae501db9eccf2c --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/inet-fortified-decl.h @@ -0,0 +1,42 @@ +/* Declarations of checking macros for inet functions. + Copyright (C) 2025 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_INET_FORTIFIED_DEC_H +#define _BITS_INET_FORTIFIED_DEC_H 1 + +#ifndef _ARPA_INET_H +# error "Never include directly; use instead." +#endif + +extern const char *__inet_ntop_chk (int, const void *, char *, socklen_t, size_t); + +extern const char *__REDIRECT_FORTIFY_NTH (__inet_ntop_alias, + (int, const void *, char *, socklen_t), inet_ntop); +extern const char *__REDIRECT_NTH (__inet_ntop_chk_warn, + (int, const void *, char *, socklen_t, size_t), __inet_ntop_chk) + __warnattr ("inet_ntop called with bigger length than " + "size of destination buffer"); + +extern int __inet_pton_chk (int, const char *, void *, size_t); + +extern int __REDIRECT_FORTIFY_NTH (__inet_pton_alias, + (int, const char *, void *), inet_pton); +extern int __REDIRECT_NTH (__inet_pton_chk_warn, + (int, const char *, void *, size_t), __inet_pton_chk) + __warnattr ("inet_pton called with a destination buffer size too small"); +#endif /* bits/inet-fortified-decl.h. */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/inet-fortified.h b/lib/libc/include/generic-glibc/bits/inet-fortified.h new file mode 100644 index 0000000000000000000000000000000000000000..88aafbe8b20b48dde9190733f0a80561259f4f66 --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/inet-fortified.h @@ -0,0 +1,61 @@ +/* Checking macros for inet functions. + Copyright (C) 2025 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _BITS_INET_FORTIFIED_H +#define _BITS_INET_FORTIFIED_H 1 + +#ifndef _ARPA_INET_H +# error "Never include directly; use instead." +#endif + +#include + +__fortify_function __attribute_overloadable__ const char * +__NTH (inet_ntop (int __af, + __fortify_clang_overload_arg (const void *, __restrict, __src), + char *__restrict __dst, socklen_t __dst_size)) + __fortify_clang_warning_only_if_bos_lt (__dst_size, __dst, + "inet_ntop called with bigger length " + "than size of destination buffer") +{ + return __glibc_fortify (inet_ntop, __dst_size, sizeof (char), + __glibc_objsize (__dst), + __af, __src, __dst, __dst_size); +}; + +__fortify_function __attribute_overloadable__ int +__NTH (inet_pton (int __af, + const char *__restrict __src, + __fortify_clang_overload_arg (void *, __restrict, __dst))) + __fortify_clang_warning_only_if_bos0_lt + (4, __dst, "inet_pton called with destination buffer size less than 4") +{ + size_t sz = 0; + if (__af == AF_INET) + sz = sizeof (struct in_addr); + else if (__af == AF_INET6) + sz = sizeof (struct in6_addr); + else + return __inet_pton_alias (__af, __src, __dst); + + return __glibc_fortify (inet_pton, sz, sizeof (char), + __glibc_objsize (__dst), + __af, __src, __dst); +}; + +#endif /* bits/inet-fortified.h. */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/ioctl-types.h b/lib/libc/include/generic-glibc/bits/ioctl-types.h index 08562e7ba199d0bb18616dc8d16003904d41fb37..13c5bc0d455f20c1beedf540540d869e075f9c7f 100644 --- a/lib/libc/include/generic-glibc/bits/ioctl-types.h +++ b/lib/libc/include/generic-glibc/bits/ioctl-types.h @@ -32,17 +32,6 @@ struct winsize unsigned short int ws_ypixel; }; -#define NCC 8 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - /* modem lines */ #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 diff --git a/lib/libc/include/generic-glibc/bits/ioctls.h b/lib/libc/include/generic-glibc/bits/ioctls.h index 915563810f358d892ae659da462c7c559918c267..84594dd239475382b220094e13d871dd45b58682 100644 --- a/lib/libc/include/generic-glibc/bits/ioctls.h +++ b/lib/libc/include/generic-glibc/bits/ioctls.h @@ -22,87 +22,4 @@ /* Use the definitions from the kernel header files. */ #include -/* Routing table calls. */ -#define SIOCADDRT 0x890B /* add routing table entry */ -#define SIOCDELRT 0x890C /* delete routing table entry */ -#define SIOCRTMSG 0x890D /* call to routing system */ - -/* Socket configuration controls. */ -#define SIOCGIFNAME 0x8910 /* get iface name */ -#define SIOCSIFLINK 0x8911 /* set iface channel */ -#define SIOCGIFCONF 0x8912 /* get iface list */ -#define SIOCGIFFLAGS 0x8913 /* get flags */ -#define SIOCSIFFLAGS 0x8914 /* set flags */ -#define SIOCGIFADDR 0x8915 /* get PA address */ -#define SIOCSIFADDR 0x8916 /* set PA address */ -#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */ -#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */ -#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */ -#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */ -#define SIOCGIFNETMASK 0x891b /* get network PA mask */ -#define SIOCSIFNETMASK 0x891c /* set network PA mask */ -#define SIOCGIFMETRIC 0x891d /* get metric */ -#define SIOCSIFMETRIC 0x891e /* set metric */ -#define SIOCGIFMEM 0x891f /* get memory address (BSD) */ -#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */ -#define SIOCGIFMTU 0x8921 /* get MTU size */ -#define SIOCSIFMTU 0x8922 /* set MTU size */ -#define SIOCSIFNAME 0x8923 /* set interface name */ -#define SIOCSIFHWADDR 0x8924 /* set hardware address */ -#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */ -#define SIOCSIFENCAP 0x8926 -#define SIOCGIFHWADDR 0x8927 /* Get hardware address */ -#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */ -#define SIOCSIFSLAVE 0x8930 -#define SIOCADDMULTI 0x8931 /* Multicast address lists */ -#define SIOCDELMULTI 0x8932 -#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */ -#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */ -#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */ -#define SIOCGIFPFLAGS 0x8935 -#define SIOCDIFADDR 0x8936 /* delete PA address */ -#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */ -#define SIOCGIFCOUNT 0x8938 /* get number of devices */ - -#define SIOCGIFBR 0x8940 /* Bridging support */ -#define SIOCSIFBR 0x8941 /* Set bridging options */ - -#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ -#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ - - -/* ARP cache control calls. */ - /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ -#define SIOCDARP 0x8953 /* delete ARP table entry */ -#define SIOCGARP 0x8954 /* get ARP table entry */ -#define SIOCSARP 0x8955 /* set ARP table entry */ - -/* RARP cache control calls. */ -#define SIOCDRARP 0x8960 /* delete RARP table entry */ -#define SIOCGRARP 0x8961 /* get RARP table entry */ -#define SIOCSRARP 0x8962 /* set RARP table entry */ - -/* Driver configuration calls */ - -#define SIOCGIFMAP 0x8970 /* Get device parameters */ -#define SIOCSIFMAP 0x8971 /* Set device parameters */ - -/* DLCI configuration calls */ - -#define SIOCADDDLCI 0x8980 /* Create new DLCI device */ -#define SIOCDELDLCI 0x8981 /* Delete DLCI device */ - -/* Device private ioctl calls. */ - -/* These 16 ioctls are available to devices via the do_ioctl() device - vector. Each device should include this file and redefine these - names as their own. Because these are device dependent it is a good - idea _NOT_ to issue them to random objects and hope. */ - -#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */ - -/* - * These 16 ioctl calls are protocol private - */ - -#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */ \ No newline at end of file +#include \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/libm-simd-decl-stubs.h b/lib/libc/include/generic-glibc/bits/libm-simd-decl-stubs.h index 436770e11f0aab84911a46f494a1f5dbe8eb7119..15df4ea88fd10afc9e4a47cbce89951aa76477b1 100644 --- a/lib/libc/include/generic-glibc/bits/libm-simd-decl-stubs.h +++ b/lib/libc/include/generic-glibc/bits/libm-simd-decl-stubs.h @@ -373,4 +373,48 @@ #define __DECL_SIMD_tanpif32x #define __DECL_SIMD_tanpif64x #define __DECL_SIMD_tanpif128x + +#define __DECL_SIMD_acospi +#define __DECL_SIMD_acospif +#define __DECL_SIMD_acospil +#define __DECL_SIMD_acospif16 +#define __DECL_SIMD_acospif32 +#define __DECL_SIMD_acospif64 +#define __DECL_SIMD_acospif128 +#define __DECL_SIMD_acospif32x +#define __DECL_SIMD_acospif64x +#define __DECL_SIMD_acospif128x + +#define __DECL_SIMD_asinpi +#define __DECL_SIMD_asinpif +#define __DECL_SIMD_asinpil +#define __DECL_SIMD_asinpif16 +#define __DECL_SIMD_asinpif32 +#define __DECL_SIMD_asinpif64 +#define __DECL_SIMD_asinpif128 +#define __DECL_SIMD_asinpif32x +#define __DECL_SIMD_asinpif64x +#define __DECL_SIMD_asinpif128x + +#define __DECL_SIMD_atanpi +#define __DECL_SIMD_atanpif +#define __DECL_SIMD_atanpil +#define __DECL_SIMD_atanpif16 +#define __DECL_SIMD_atanpif32 +#define __DECL_SIMD_atanpif64 +#define __DECL_SIMD_atanpif128 +#define __DECL_SIMD_atanpif32x +#define __DECL_SIMD_atanpif64x +#define __DECL_SIMD_atanpif128x + +#define __DECL_SIMD_atan2pi +#define __DECL_SIMD_atan2pif +#define __DECL_SIMD_atan2pil +#define __DECL_SIMD_atan2pif16 +#define __DECL_SIMD_atan2pif32 +#define __DECL_SIMD_atan2pif64 +#define __DECL_SIMD_atan2pif128 +#define __DECL_SIMD_atan2pif32x +#define __DECL_SIMD_atan2pif64x +#define __DECL_SIMD_atan2pif128x #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mathcalls-macros.h b/lib/libc/include/generic-glibc/bits/mathcalls-macros.h index 6c29a7785c1a046491258aa5f67f7d348942eb3b..d5b71472bb53796288a42f51a99525beefe49a70 100644 --- a/lib/libc/include/generic-glibc/bits/mathcalls-macros.h +++ b/lib/libc/include/generic-glibc/bits/mathcalls-macros.h @@ -34,7 +34,7 @@ #define __MATHCALLX(function,suffix, args, attrib) \ __MATHDECLX (_Mdouble_,function,suffix, args, attrib) #define __MATHDECLX(type, function,suffix, args, attrib) \ - __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); + __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib) #define __MATHDECL_1_IMPL(type, function, suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW #define __MATHDECL_1(type, function, suffix, args) \ diff --git a/lib/libc/include/generic-glibc/bits/mathcalls.h b/lib/libc/include/generic-glibc/bits/mathcalls.h index 4f93b693d825492d18b14311537fa626e9699d72..265c1b867503e5f4a763f9c7ae99f3251590667b 100644 --- a/lib/libc/include/generic-glibc/bits/mathcalls.h +++ b/lib/libc/include/generic-glibc/bits/mathcalls.h @@ -68,12 +68,16 @@ __MATHCALL_VEC (tan,, (_Mdouble_ __x)); #if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) /* Arc cosine of X, divided by pi. */ __MATHCALL (acospi,, (_Mdouble_ __x)); +__MATHCALL_VEC (acospi,, (_Mdouble_ __x)); /* Arc sine of X, divided by pi. */ __MATHCALL (asinpi,, (_Mdouble_ __x)); +__MATHCALL_VEC (asinpi,, (_Mdouble_ __x)); /* Arc tangent of X, divided by pi. */ __MATHCALL (atanpi,, (_Mdouble_ __x)); +__MATHCALL_VEC (atanpi,, (_Mdouble_ __x)); /* Arc tangent of Y/X, divided by pi. */ __MATHCALL (atan2pi,, (_Mdouble_ __y, _Mdouble_ __x)); +__MATHCALL_VEC (atan2pi,, (_Mdouble_ __y, _Mdouble_ __x)); /* Cosine of pi * X. */ __MATHCALL_VEC (cospi,, (_Mdouble_ __x)); @@ -185,6 +189,23 @@ __MATHCALL_VEC (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); __MATHCALL_VEC (cbrt,, (_Mdouble_ __x)); #endif +#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) +/* Return 1+X to the Y power. */ +__MATHCALL (compoundn,, (_Mdouble_ __x, long long int __y)); + +/* Return X to the Y power. */ +__MATHCALL (pown,, (_Mdouble_ __x, long long int __y)); + +/* Return X to the Y power. */ +__MATHCALL (powr,, (_Mdouble_ __x, _Mdouble_ __y)); + +/* Return the Yth root of X. */ +__MATHCALL (rootn,, (_Mdouble_ __x, long long int __y)); + +/* Return the reciprocal of the square root of X. */ +__MATHCALL (rsqrt,, (_Mdouble_ __x)); +#endif + /* Nearest integer, absolute value, and remainder functions. */ diff --git a/lib/libc/include/generic-glibc/bits/mman-linux.h b/lib/libc/include/generic-glibc/bits/mman-linux.h index 58ea3d02c80affa7089e9c200a900460e8071b1e..2dbd4d3a06f73383b43724bd45a013a488363277 100644 --- a/lib/libc/include/generic-glibc/bits/mman-linux.h +++ b/lib/libc/include/generic-glibc/bits/mman-linux.h @@ -113,6 +113,8 @@ locked pages too. */ # define MADV_COLLAPSE 25 /* Synchronous hugepage collapse. */ # define MADV_HWPOISON 100 /* Poison a page for testing. */ +# define MADV_GUARD_INSTALL 102 /* Fatal signal on access to range */ +# define MADV_GUARD_REMOVE 103 /* Unguard range */ #endif /* The POSIX people had to invent similar names for the same things. */ diff --git a/lib/libc/include/generic-glibc/bits/mman-shared.h b/lib/libc/include/generic-glibc/bits/mman-shared.h index a43ef000be1a7741b506cc906c3816ac163dc582..39e82407cd5a9c722e74b81db37c7c5895187457 100644 --- a/lib/libc/include/generic-glibc/bits/mman-shared.h +++ b/lib/libc/include/generic-glibc/bits/mman-shared.h @@ -43,10 +43,9 @@ # endif /* Access restrictions for pkey_alloc. */ -# ifndef PKEY_DISABLE_ACCESS -# define PKEY_DISABLE_ACCESS 0x1 -# define PKEY_DISABLE_WRITE 0x2 -# endif +# define PKEY_UNRESTRICTED 0x0 +# define PKEY_DISABLE_ACCESS 0x1 +# define PKEY_DISABLE_WRITE 0x2 __BEGIN_DECLS diff --git a/lib/libc/include/generic-glibc/bits/sched.h b/lib/libc/include/generic-glibc/bits/sched.h index 3ac3e6c15330018dfa844fddb60c6129463a3616..c0e7cd3ead0630fcec65b47a0878b5e57a27c581 100644 --- a/lib/libc/include/generic-glibc/bits/sched.h +++ b/lib/libc/include/generic-glibc/bits/sched.h @@ -152,7 +152,7 @@ int sched_setattr (pid_t tid, struct sched_attr *attr, unsigned int flags) store it in *ATTR. */ int sched_getattr (pid_t tid, struct sched_attr *attr, unsigned int size, unsigned int flags) - __THROW __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); + __THROW __nonnull ((2)); #endif diff --git a/lib/libc/include/generic-glibc/bits/string_fortified.h b/lib/libc/include/generic-glibc/bits/string_fortified.h index 076ca3942d41c98cf1227cf7457b2eb1978c054c..9c36d02fb1c87876117aef872b857fdef724b000 100644 --- a/lib/libc/include/generic-glibc/bits/string_fortified.h +++ b/lib/libc/include/generic-glibc/bits/string_fortified.h @@ -151,7 +151,7 @@ __NTH (strncat (__fortify_clang_overload_arg (char *, __restrict, __dest), } /* - * strlcpy and strlcat introduced in glibc 2.38 + * zig patch: strlcpy and strlcat introduced in glibc 2.38 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da */ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2 diff --git a/lib/libc/include/generic-glibc/bits/syscall.h b/lib/libc/include/generic-glibc/bits/syscall.h index 4594b36b79d5389d8d4cd176112c9486a899db35..3c70ff32d493f92febe6d4aaf567c305e35844b9 100644 --- a/lib/libc/include/generic-glibc/bits/syscall.h +++ b/lib/libc/include/generic-glibc/bits/syscall.h @@ -1,11 +1,11 @@ /* Generated at libc build time from syscall list. */ -/* The system call list corresponds to kernel 6.12. */ +/* The system call list corresponds to kernel 6.15. */ #ifndef _SYSCALL_H # error "Never use directly; include instead." #endif -#define __GLIBC_LINUX_VERSION_CODE 396288 +#define __GLIBC_LINUX_VERSION_CODE 397056 #ifdef __NR_FAST_atomic_update # define SYS_FAST_atomic_update __NR_FAST_atomic_update @@ -703,6 +703,10 @@ # define SYS_getxattr __NR_getxattr #endif +#ifdef __NR_getxattrat +# define SYS_getxattrat __NR_getxattrat +#endif + #ifdef __NR_getxgid # define SYS_getxgid __NR_getxgid #endif @@ -875,6 +879,10 @@ # define SYS_listxattr __NR_listxattr #endif +#ifdef __NR_listxattrat +# define SYS_listxattrat __NR_listxattrat +#endif + #ifdef __NR_llistxattr # define SYS_llistxattr __NR_llistxattr #endif @@ -1167,6 +1175,10 @@ # define SYS_open_tree __NR_open_tree #endif +#ifdef __NR_open_tree_attr +# define SYS_open_tree_attr __NR_open_tree_attr +#endif + #ifdef __NR_openat # define SYS_openat __NR_openat #endif @@ -1839,6 +1851,10 @@ # define SYS_removexattr __NR_removexattr #endif +#ifdef __NR_removexattrat +# define SYS_removexattrat __NR_removexattrat +#endif + #ifdef __NR_rename # define SYS_rename __NR_rename #endif @@ -2199,6 +2215,10 @@ # define SYS_setxattr __NR_setxattr #endif +#ifdef __NR_setxattrat +# define SYS_setxattrat __NR_setxattrat +#endif + #ifdef __NR_sgetmask # define SYS_sgetmask __NR_sgetmask #endif diff --git a/lib/libc/include/generic-glibc/bits/termios-baud.h b/lib/libc/include/generic-glibc/bits/termios-baud.h index dcd8be77901a91a84fbd0e7d0dde059cc8adc3d6..cd11a7e55b5d5a6454b20d66b51ca731104e4102 100644 --- a/lib/libc/include/generic-glibc/bits/termios-baud.h +++ b/lib/libc/include/generic-glibc/bits/termios-baud.h @@ -1,4 +1,4 @@ -/* termios baud rate selection definitions. Linux/generic version. +/* termios baud rate selection definitions. Universal version for sane speed_t. Copyright (C) 2019-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,29 +20,56 @@ # error "Never include directly; use instead." #endif -#ifdef __USE_MISC -# define CBAUD 000000010017 /* Baud speed mask (not in POSIX). */ -# define CBAUDEX 000000010000 /* Extra baud speed mask, included in CBAUD. - (not in POSIX). */ -# define CIBAUD 002003600000 /* Input baud rate (not used). */ -# define CMSPAR 010000000000 /* Mark or space (stick) parity. */ -# define CRTSCTS 020000000000 /* Flow control. */ +/* POSIX required baud rates */ +#define B0 0U /* Hang up or ispeed == ospeed */ +#define B50 50U +#define B75 75U +#define B110 110U +#define B134 134U /* Really 134.5 baud by POSIX spec */ +#define B150 150U +#define B200 200U +#define B300 300U +#define B600 600U +#define B1200 1200U +#define B1800 1800U +#define B2400 2400U +#define B4800 4800U +#define B9600 9600U +#define B19200 19200U +#define B38400 38400U +#ifdef __USE_MISC +# define EXTA B19200 +# define EXTB B38400 #endif -/* Extra output baud rates (not in POSIX). */ -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 -#define __MAX_BAUD B4000000 \ No newline at end of file +/* Other baud rates, "nonstandard" but known to be used */ +#define B7200 7200U +#define B14400 14400U +#define B28800 28800U +#define B33600 33600U +#define B57600 57600U +#define B76800 76800U +#define B115200 115200U +#define B153600 153600U +#define B230400 230400U +#define B307200 307200U +#define B460800 460800U +#define B500000 500000U +#define B576000 576000U +#define B614400 614400U +#define B921600 921600U +#define B1000000 1000000U +#define B1152000 1152000U +#define B1500000 1500000U +#define B2000000 2000000U +#define B2500000 2500000U +#define B3000000 3000000U +#define B3500000 3500000U +#define B4000000 4000000U +#define B5000000 5000000U +#define B10000000 10000000U + +#ifdef __USE_GNU +#define SPEED_MAX 4294967295U /* maximum valid speed_t value */ +#endif +#define __MAX_BAUD 4294967295U /* legacy alias for SPEED_MAX */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/termios-c_cflag.h b/lib/libc/include/generic-glibc/bits/termios-c_cflag.h index 0b0e40cd8a962b334b3a17cb74f2dafb54f14567..7a4c0a53fe348037f5412d2785151aa1c04fcc1e 100644 --- a/lib/libc/include/generic-glibc/bits/termios-c_cflag.h +++ b/lib/libc/include/generic-glibc/bits/termios-c_cflag.h @@ -34,5 +34,7 @@ #define CLOCAL 0004000 #ifdef __USE_MISC -# define ADDRB 04000000000 +# define ADDRB 04000000000 +# define CMSPAR 010000000000 /* Mark or space (stick) parity. */ +# define CRTSCTS 020000000000 /* Flow control. */ #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/termios-cbaud.h b/lib/libc/include/generic-glibc/bits/termios-cbaud.h new file mode 100644 index 0000000000000000000000000000000000000000..38bf2ec1aae085543a8e9290793ebf14f6503de9 --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/termios-cbaud.h @@ -0,0 +1,47 @@ +/* termios baud rate selection definitions. Linux/generic version. + Copyright (C) 2019-2025 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#ifdef __USE_MISC +# define CBAUD 000000010017 /* Baud speed mask (not in POSIX). */ +# define CBAUDEX 000000010000 /* Extra baud speed mask, included in CBAUD. + (not in POSIX). */ +# define CIBAUD 002003600000 /* Input baud rate. */ +# define IBSHIFT 16 +#endif + +/* Extra output baud rates (not in POSIX). */ +#define __BOTHER 0010000 +#define __B57600 0010001 +#define __B115200 0010002 +#define __B230400 0010003 +#define __B460800 0010004 +#define __B500000 0010005 +#define __B576000 0010006 +#define __B921600 0010007 +#define __B1000000 0010010 +#define __B1152000 0010011 +#define __B1500000 0010012 +#define __B2000000 0010013 +#define __B2500000 0010014 +#define __B3000000 0010015 +#define __B3500000 0010016 +#define __B4000000 0010017 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/termios-struct.h b/lib/libc/include/generic-glibc/bits/termios-struct.h index 51dda8eda38e4f17342da6ee41d1ee7277e13ec5..40d20e442d494026e28ffc6813a69f033beaddcf 100644 --- a/lib/libc/include/generic-glibc/bits/termios-struct.h +++ b/lib/libc/include/generic-glibc/bits/termios-struct.h @@ -29,8 +29,15 @@ struct termios tcflag_t c_lflag; /* local mode flags */ cc_t c_line; /* line discipline */ cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ + /* Input and output baud rates. */ + __extension__ union { + speed_t __ispeed; + speed_t c_ispeed; + }; #define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 + __extension__ union { + speed_t __ospeed; + speed_t c_ospeed; + }; #define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 }; \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/termios.h b/lib/libc/include/generic-glibc/bits/termios.h index 5433d2d4554fa7874f4e877dfd5478a1a12d55f4..4af6204a30b0b073221afe8f85ee9209881a0e15 100644 --- a/lib/libc/include/generic-glibc/bits/termios.h +++ b/lib/libc/include/generic-glibc/bits/termios.h @@ -24,35 +24,41 @@ typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; -#include +#ifdef _TERMIOS_H +# include +#endif + #include #include #include /* c_cflag bit meaning */ -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#ifdef __USE_MISC -# define EXTA B19200 -# define EXTB B38400 -#endif -#include - #include + +#ifdef __USE_MISC +#define __B0 0000000 /* hang up */ +#define __B50 0000001 +#define __B75 0000002 +#define __B110 0000003 +#define __B134 0000004 +#define __B150 0000005 +#define __B200 0000006 +#define __B300 0000007 +#define __B600 0000010 +#define __B1200 0000011 +#define __B1800 0000012 +#define __B2400 0000013 +#define __B4800 0000014 +#define __B9600 0000015 +#define __B19200 0000016 +#define __B38400 0000017 +#include + +# define __EXTA __B19200 +# define __EXTB __B38400 +# define BOTHER __BOTHER +#endif + #include #ifdef __USE_MISC @@ -73,4 +79,6 @@ typedef unsigned int tcflag_t; #include -#include \ No newline at end of file +#include + +#include \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/types/struct_FILE.h b/lib/libc/include/generic-glibc/bits/types/struct_FILE.h index 9dfac48cb75baaa6add238093417d5920058c124..b02bb0c15400c5e8d177cbe0ab006b3c4427e4b6 100644 --- a/lib/libc/include/generic-glibc/bits/types/struct_FILE.h +++ b/lib/libc/include/generic-glibc/bits/types/struct_FILE.h @@ -32,6 +32,7 @@ #endif #include +#include struct _IO_FILE; struct _IO_marker; @@ -97,8 +98,15 @@ struct _IO_FILE_complete void *_freeres_buf; struct _IO_FILE **_prevchain; int _mode; +#if __WORDSIZE == 64 + int _unused3; +#endif + __uint64_t _total_written; +#if __WORDSIZE == 32 + int _unused3; +#endif /* Make sure we don't get into trouble again. */ - char _unused2[15 * sizeof (int) - 5 * sizeof (void *)]; + char _unused2[12 * sizeof (int) - 5 * sizeof (void *)]; }; /* These macros are used by bits/stdio.h and internal headers. */ diff --git a/lib/libc/include/generic-glibc/dlfcn.h b/lib/libc/include/generic-glibc/dlfcn.h index d1e540fc8aab5cbeb0efc48fc44bc2d847e9bdc8..fe5059b8d53fa8b6efecdf8a3f6d34c9b99c3134 100644 --- a/lib/libc/include/generic-glibc/dlfcn.h +++ b/lib/libc/include/generic-glibc/dlfcn.h @@ -217,16 +217,22 @@ struct dl_find_object int dlfo_eh_count; /* Number of exception handling entries. */ unsigned int __dlfo_eh_count_pad; # endif - __extension__ unsigned long long int __dflo_reserved[7]; + void *dlfo_sframe; /* SFrame stack trace data of the object. */ +#if __WORDSIZE == 32 + unsigned int __dlfo_sframe_pad; +#endif + __extension__ unsigned long long int __dlfo_reserved[6]; }; /* If ADDRESS is found in an object, fill in *RESULT and return 0. Otherwise, return -1. */ int _dl_find_object (void *__address, struct dl_find_object *__result) __THROW; +/* SFrame stack trace data is valid. */ +#define DLFO_FLAG_SFRAME (1ULL << 0) + #endif /* __USE_GNU */ - __END_DECLS #endif /* dlfcn.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/elf.h b/lib/libc/include/generic-glibc/elf.h index 690b047978d0456b868bc893b41559e125f4d426..11dc6453b50e5ac3fd639598dfb28ecb9253ab8f 100644 --- a/lib/libc/include/generic-glibc/elf.h +++ b/lib/libc/include/generic-glibc/elf.h @@ -837,12 +837,15 @@ typedef struct #define NT_ARM_ZT 0x40d /* ARM SME ZT registers. */ #define NT_ARM_FPMR 0x40e /* ARM floating point mode register. */ #define NT_ARM_POE 0x40f /* ARM POE registers. */ +#define NT_ARM_GCS 0x410 /* ARM GCS state. */ #define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note. */ #define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers. */ #define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode. */ #define NT_MIPS_MSA 0x802 /* MIPS SIMD registers. */ #define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */ #define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */ +#define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged + address control */ #define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */ #define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and status registers. */ @@ -2906,19 +2909,6 @@ enum #define R_AARCH64_NONE 0 /* No relocation. */ -/* ILP32 AArch64 relocs. */ -#define R_AARCH64_P32_ABS32 1 /* Direct 32 bit. */ -#define R_AARCH64_P32_COPY 180 /* Copy symbol at runtime. */ -#define R_AARCH64_P32_GLOB_DAT 181 /* Create GOT entry. */ -#define R_AARCH64_P32_JUMP_SLOT 182 /* Create PLT entry. */ -#define R_AARCH64_P32_RELATIVE 183 /* Adjust by program base. */ -#define R_AARCH64_P32_TLS_DTPMOD 184 /* Module number, 32 bit. */ -#define R_AARCH64_P32_TLS_DTPREL 185 /* Module-relative offset, 32 bit. */ -#define R_AARCH64_P32_TLS_TPREL 186 /* TP-relative offset, 32 bit. */ -#define R_AARCH64_P32_TLSDESC 187 /* TLS Descriptor. */ -#define R_AARCH64_P32_IRELATIVE 188 /* STT_GNU_IFUNC relocation. */ - -/* LP64 AArch64 relocs. */ #define R_AARCH64_ABS64 257 /* Direct 64 bit. */ #define R_AARCH64_ABS32 258 /* Direct 32 bit. */ #define R_AARCH64_ABS16 259 /* Direct 16-bit. */ @@ -4091,6 +4081,7 @@ enum #define R_RISCV_TLS_DTPREL64 9 #define R_RISCV_TLS_TPREL32 10 #define R_RISCV_TLS_TPREL64 11 +#define R_RISCV_TLSDESC 12 #define R_RISCV_BRANCH 16 #define R_RISCV_JAL 17 #define R_RISCV_CALL 18 @@ -4116,16 +4107,10 @@ enum #define R_RISCV_SUB16 38 #define R_RISCV_SUB32 39 #define R_RISCV_SUB64 40 -#define R_RISCV_GNU_VTINHERIT 41 -#define R_RISCV_GNU_VTENTRY 42 +#define R_RISCV_GOT32_PCREL 41 #define R_RISCV_ALIGN 43 #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 -#define R_RISCV_RVC_LUI 46 -#define R_RISCV_GPREL_I 47 -#define R_RISCV_GPREL_S 48 -#define R_RISCV_TPREL_I 49 -#define R_RISCV_TPREL_S 50 #define R_RISCV_RELAX 51 #define R_RISCV_SUB6 52 #define R_RISCV_SET6 53 @@ -4137,8 +4122,12 @@ enum #define R_RISCV_PLT32 59 #define R_RISCV_SET_ULEB128 60 #define R_RISCV_SUB_ULEB128 61 +#define R_RISCV_TLSDESC_HI20 62 +#define R_RISCV_TLSDESC_LOAD_LO12 63 +#define R_RISCV_TLSDESC_ADD_LO12 64 +#define R_RISCV_TLSDESC_CALL 65 -#define R_RISCV_NUM 62 +#define R_RISCV_NUM 66 /* RISC-V specific values for the st_other field. */ #define STO_RISCV_VARIANT_CC 0x80 /* Function uses variant calling @@ -4147,7 +4136,7 @@ enum /* RISC-V specific values for the sh_type field. */ #define SHT_RISCV_ATTRIBUTES (SHT_LOPROC + 3) -/* RISC-V specific values for the p_type field. */ +/* RISC-V specific values for the p_type field (deprecated). */ #define PT_RISCV_ATTRIBUTES (PT_LOPROC + 3) /* RISC-V specific values for the d_tag field. */ diff --git a/lib/libc/include/generic-glibc/fcntl.h b/lib/libc/include/generic-glibc/fcntl.h index 117f1c3647cecbd112f230ffcb902dc3c3456f0e..51add4e1464e936bddd102d0cd39af9b9e023812 100644 --- a/lib/libc/include/generic-glibc/fcntl.h +++ b/lib/libc/include/generic-glibc/fcntl.h @@ -168,7 +168,7 @@ typedef __pid_t pid_t; #endif -/* fcntl was a simple symbol until glibc 2.27 inclusive. +/* zig patch: fcntl was a simple symbol until glibc 2.27 inclusive. * glibc 2.28 onwards converted it to a macro when compiled with * USE_LARGEFILE64. */ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 28) || __GLIBC__ > 2 @@ -289,16 +289,17 @@ extern int creat64 (const char *__file, mode_t __mode) __nonnull ((1)); # define F_TEST 3 /* Test a region for other processes locks. */ # ifndef __USE_FILE_OFFSET64 -extern int lockf (int __fd, int __cmd, off_t __len); +extern int lockf (int __fd, int __cmd, off_t __len) __wur; # else # ifdef __REDIRECT -extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64); +extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), + lockf64) __wur; # else # define lockf lockf64 # endif # endif # ifdef __USE_LARGEFILE64 -extern int lockf64 (int __fd, int __cmd, off64_t __len); +extern int lockf64 (int __fd, int __cmd, off64_t __len) __wur; # endif #endif @@ -351,4 +352,4 @@ extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len); __END_DECLS -#endif /* fcntl.h */ \ No newline at end of file +#endif /* fcntl.h */ diff --git a/lib/libc/include/generic-glibc/features.h b/lib/libc/include/generic-glibc/features.h index 7a830cdbac96ac28814cdc03c47d5310247487b2..8a918c60176d685f3d151830a0c173691f88538d 100644 --- a/lib/libc/include/generic-glibc/features.h +++ b/lib/libc/include/generic-glibc/features.h @@ -491,7 +491,7 @@ or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the old extension. */ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) -/* support for ISOC99 was added in glibc-2.7 */ +/* zig patch: support for ISOC99 was added in glibc-2.7 */ # define __GLIBC_USE_DEPRECATED_SCANF 1 #elif (defined __USE_GNU \ && (defined __cplusplus \ @@ -503,7 +503,7 @@ #endif -/* support for ISO C2X strtol was added in 2.38 +/* zig patch: support for ISO C2X strtol was added in 2.38 * glibc commit 64924422a99690d147a166b4de3103f3bf3eaf6c */ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2 @@ -564,4 +564,4 @@ #include -#endif /* features.h */ \ No newline at end of file +#endif /* features.h */ diff --git a/lib/libc/include/generic-glibc/glob.h b/lib/libc/include/generic-glibc/glob.h index 3577c9c7c4fef696a357c35f81f036483bc0cad2..14340f5fae38311cc1fdb7d72943fe30f037a626 100644 --- a/lib/libc/include/generic-glibc/glob.h +++ b/lib/libc/include/generic-glibc/glob.h @@ -195,7 +195,8 @@ extern void globfree64 (glob64_t *__pglob) __THROW; This function is not part of the interface specified by POSIX.2 but several programs want to use it. */ -extern int glob_pattern_p (const char *__pattern, int __quote) __THROW; +extern int glob_pattern_p (const char *__pattern, int __quote) __THROW + __nonnull ((1)); #endif __END_DECLS diff --git a/lib/libc/include/generic-glibc/inttypes.h b/lib/libc/include/generic-glibc/inttypes.h index 3127d5637e1525353510f4745f7b4eb4ab3afe09..be384f223e52627c68d4feb99c08ab0b3e282ed5 100644 --- a/lib/libc/include/generic-glibc/inttypes.h +++ b/lib/libc/include/generic-glibc/inttypes.h @@ -350,6 +350,11 @@ typedef struct /* Compute absolute value of N. */ extern intmax_t imaxabs (intmax_t __n) __THROW __attribute__ ((__const__)); + +#if __GLIBC_USE (ISOC2Y) +extern uintmax_t uimaxabs (intmax_t __n) __THROW __attribute__ ((__const__)); +#endif + /* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */ extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom) __THROW __attribute__ ((__const__)); diff --git a/lib/libc/include/generic-glibc/malloc.h b/lib/libc/include/generic-glibc/malloc.h index a24d43c295d28ccafd580158e0ce70515be1b319..187457d42131e12c92649a85f52ef0d62c5ca5f9 100644 --- a/lib/libc/include/generic-glibc/malloc.h +++ b/lib/libc/include/generic-glibc/malloc.h @@ -52,7 +52,7 @@ extern void *realloc (void *__ptr, size_t __size) __THROW __attribute_warn_unused_result__ __attribute_alloc_size__ ((2)); /* - * reallocarray introduced in glibc 2.26 + * zig patch: reallocarray introduced in glibc 2.26 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da */ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 26) || __GLIBC__ > 2 @@ -164,4 +164,4 @@ extern void malloc_stats (void) __THROW; extern int malloc_info (int __options, FILE *__fp) __THROW; __END_DECLS -#endif /* malloc.h */ \ No newline at end of file +#endif /* malloc.h */ diff --git a/lib/libc/include/generic-glibc/netinet/tcp.h b/lib/libc/include/generic-glibc/netinet/tcp.h index 65ee87a04126063108243ce773562ba50ff1ffb4..357da4371277a57ef430bd1adf5e55affc1d9d45 100644 --- a/lib/libc/include/generic-glibc/netinet/tcp.h +++ b/lib/libc/include/generic-glibc/netinet/tcp.h @@ -212,6 +212,9 @@ enum # define TCPI_OPT_ECN 8 /* ECN was negotiated at TCP session init */ # define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ # define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */ +# define TCPI_OPT_USEC_TS 64 /* usec timestamps */ +# define TCPI_OPT_TFO_CHILD 128 /* child from a Fast Open option on SYN */ + /* Values for tcpi_state. */ enum tcp_ca_state diff --git a/lib/libc/include/generic-glibc/pthread.h b/lib/libc/include/generic-glibc/pthread.h index 1c7bf92e8cca40069049f8a3753a0e0de868af23..cfce06cef914646764069c7dfbf367fbe76f280e 100644 --- a/lib/libc/include/generic-glibc/pthread.h +++ b/lib/libc/include/generic-glibc/pthread.h @@ -1317,6 +1317,11 @@ extern int pthread_getcpuclockid (pthread_t __thread_id, __THROW __nonnull ((2)); #endif +#ifdef __USE_GNU +/* Return the Linux TID for THREAD_ID. Returns -1 on failure. */ +extern pid_t pthread_gettid_np (pthread_t __thread_id); +#endif + /* Install handlers to be called when a new process is created with FORK. The PREPARE handler is called in the parent process just before performing diff --git a/lib/libc/include/generic-glibc/resolv.h b/lib/libc/include/generic-glibc/resolv.h index 9bdbc09e1d6cfa47525616228d9dc5c5236ade0f..206ff771fb87c2372501d9d7a6345033c628c181 100644 --- a/lib/libc/include/generic-glibc/resolv.h +++ b/lib/libc/include/generic-glibc/resolv.h @@ -171,7 +171,7 @@ __END_DECLS #define res_init __res_init #define res_isourserver __res_isourserver -/* In glibc 2.33 and earlier res_search, res_nsearch, res_query, res_nquery, +/* zig patch: In glibc 2.33 and earlier res_search, res_nsearch, res_query, res_nquery, * res_querydomain, res_nquerydomain, dn_skipname, dn_comp, dn_expand were * #define'd to __res_search, __res_nsearch, etc. glibc 2.34 onwards removes * the macros and exposes the symbols directly. New glibc exposes compat @@ -336,4 +336,4 @@ void res_nclose (res_state) __THROW; __END_DECLS -#endif /* !_RESOLV_H_ */ \ No newline at end of file +#endif /* !_RESOLV_H_ */ diff --git a/lib/libc/include/generic-glibc/stdio.h b/lib/libc/include/generic-glibc/stdio.h index ad7dd9eb8e49baf44c2efff43fea02b23e86dda3..e80e85755094b569778e697af1a6c1f6bdfcb342 100644 --- a/lib/libc/include/generic-glibc/stdio.h +++ b/lib/libc/include/generic-glibc/stdio.h @@ -168,8 +168,11 @@ extern int renameat (int __oldfd, const char *__old, int __newfd, #ifdef __USE_GNU /* Flags for renameat2. */ # define RENAME_NOREPLACE (1 << 0) +# define AT_RENAME_NOREPLACE RENAME_NOREPLACE # define RENAME_EXCHANGE (1 << 1) +# define AT_RENAME_EXCHANGE RENAME_EXCHANGE # define RENAME_WHITEOUT (1 << 2) +# define AT_RENAME_WHITEOUT RENAME_WHITEOUT /* Rename file OLD relative to OLDFD to NEW relative to NEWFD, with additional flags. */ @@ -604,9 +607,6 @@ extern int fgetc_unlocked (FILE *__stream) __nonnull ((1)); /* Write a character to STREAM. These functions are possible cancellation points and therefore not - marked with __THROW. - - These functions is a possible cancellation point and therefore not marked with __THROW. */ extern int fputc (int __c, FILE *__stream) __nonnull ((2)); extern int putc (int __c, FILE *__stream) __nonnull ((2)); diff --git a/lib/libc/include/generic-glibc/stdio_ext.h b/lib/libc/include/generic-glibc/stdio_ext.h index 37c30ce0fa592cf4698667d491defbd5ed22bef9..35ba67d43e0065b63d01429884bec7883ff0c94f 100644 --- a/lib/libc/include/generic-glibc/stdio_ext.h +++ b/lib/libc/include/generic-glibc/stdio_ext.h @@ -43,43 +43,43 @@ __BEGIN_DECLS /* Return the size of the buffer of FP in bytes currently in use by the given stream. */ -extern size_t __fbufsize (FILE *__fp) __THROW; +extern size_t __fbufsize (FILE *__fp) __THROW __nonnull ((1)); /* Return non-zero value iff the stream FP is opened readonly, or if the last operation on the stream was a read operation. */ -extern int __freading (FILE *__fp) __THROW; +extern int __freading (FILE *__fp) __THROW __nonnull ((1)); /* Return non-zero value iff the stream FP is opened write-only or append-only, or if the last operation on the stream was a write operation. */ -extern int __fwriting (FILE *__fp) __THROW; +extern int __fwriting (FILE *__fp) __THROW __nonnull ((1)); /* Return non-zero value iff stream FP is not opened write-only or append-only. */ -extern int __freadable (FILE *__fp) __THROW; +extern int __freadable (FILE *__fp) __THROW __nonnull ((1)); /* Return non-zero value iff stream FP is not opened read-only. */ -extern int __fwritable (FILE *__fp) __THROW; +extern int __fwritable (FILE *__fp) __THROW __nonnull ((1)); /* Return non-zero value iff the stream FP is line-buffered. */ -extern int __flbf (FILE *__fp) __THROW; +extern int __flbf (FILE *__fp) __THROW __nonnull ((1)); /* Discard all pending buffered I/O on the stream FP. */ -extern void __fpurge (FILE *__fp) __THROW; +extern void __fpurge (FILE *__fp) __THROW __nonnull ((1)); /* Return amount of output in bytes pending on a stream FP. */ -extern size_t __fpending (FILE *__fp) __THROW; +extern size_t __fpending (FILE *__fp) __THROW __nonnull ((1)); /* Flush all line-buffered files. */ extern void _flushlbf (void); /* Set locking status of stream FP to TYPE. */ -extern int __fsetlocking (FILE *__fp, int __type) __THROW; +extern int __fsetlocking (FILE *__fp, int __type) __THROW __nonnull ((1)); __END_DECLS diff --git a/lib/libc/include/generic-glibc/stdlib.h b/lib/libc/include/generic-glibc/stdlib.h index 7ae0c0f7e9964063ea368b4a66f7094a2be6309a..b6b4ff601ff8b673f9a3de1cacf25723884c2c9d 100644 --- a/lib/libc/include/generic-glibc/stdlib.h +++ b/lib/libc/include/generic-glibc/stdlib.h @@ -654,7 +654,7 @@ extern int lcong48_r (unsigned short int __param[7], __THROW __nonnull ((1, 2)); /* - * arc4random* symbols introduced in glibc 2.36: + * zig patch: arc4random* symbols introduced in glibc 2.36: * https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=8420a65cd06874ee09518366b8fba746a557212a;hb=6f4e0fcfa2d2b0915816a3a3a1d48b4763a7dee2 */ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2 @@ -693,7 +693,7 @@ extern void *realloc (void *__ptr, size_t __size) extern void free (void *__ptr) __THROW; /* - * reallocarray introduced in glibc 2.26 + * zig patch: reallocarray introduced in glibc 2.26 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da */ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 26) || __GLIBC__ > 2 @@ -997,6 +997,12 @@ __extension__ extern long long int llabs (long long int __x) __THROW __attribute__ ((__const__)) __wur; #endif +#if __GLIBC_USE (ISOC2Y) +extern unsigned int uabs (int __x) __THROW __attribute__ ((__const__)) __wur; +extern unsigned long int ulabs (long int __x) __THROW __attribute__ ((__const__)) __wur; +__extension__ extern unsigned long long int ullabs (long long int __x) + __THROW __attribute__ ((__const__)) __wur; +#endif /* Return the `div_t', `ldiv_t' or `lldiv_t' representation of the value of NUMER over DENOM. */ @@ -1178,4 +1184,4 @@ extern int ttyslot (void) __THROW; __END_DECLS -#endif /* stdlib.h */ \ No newline at end of file +#endif /* stdlib.h */ diff --git a/lib/libc/include/generic-glibc/string.h b/lib/libc/include/generic-glibc/string.h index 68f695cc425cb2b07ed3e932c40c8498ce18f269..d6794d21d1763e1a946e3897e5b30ce8a3bca169 100644 --- a/lib/libc/include/generic-glibc/string.h +++ b/lib/libc/include/generic-glibc/string.h @@ -502,7 +502,7 @@ extern char *stpncpy (char *__restrict __dest, #endif /* - * strlcpy and strlcat introduced in glibc 2.38 + * zig patch: strlcpy and strlcat introduced in glibc 2.38 * https://sourceware.org/git/?p=glibc.git;a=commit;h=2e0bbbfbf95fc9e22692e93658a6fbdd2d4554da */ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2 @@ -557,4 +557,4 @@ extern char *basename (const char *__filename) __THROW __nonnull ((1)); __END_DECLS -#endif /* string.h */ \ No newline at end of file +#endif /* string.h */ diff --git a/lib/libc/include/generic-glibc/sys/hwprobe.h b/lib/libc/include/generic-glibc/sys/hwprobe.h index 63986df08f2ffd69683fca0c6a6f11d39257b747..056a98dc5182784e8c74c40331cb5a8b4e7bb00d 100644 --- a/lib/libc/include/generic-glibc/sys/hwprobe.h +++ b/lib/libc/include/generic-glibc/sys/hwprobe.h @@ -21,6 +21,7 @@ #define _SYS_HWPROBE_H 1 #include +#include #include #include #ifdef __has_include @@ -63,22 +64,39 @@ struct riscv_hwprobe { __BEGIN_DECLS -extern int __riscv_hwprobe (struct riscv_hwprobe *__pairs, size_t __pair_count, - size_t __cpu_count, unsigned long int *__cpus, +#if defined __cplusplus || !__GNUC_PREREQ (2, 7) +# define __RISCV_HWPROBE_CPUS_TYPE cpu_set_t * +#else +/* The fourth argument to __riscv_hwprobe should be a null pointer or a + pointer to a cpu_set_t (either the fixed-size type or allocated with + CPU_ALLOC). However, early versions of this header file used the + argument type unsigned long int *. The transparent union allows + the argument to be either cpu_set_t * or unsigned long int * for + compatibility. The older header file requiring unsigned long int * + can be identified by the lack of the __RISCV_HWPROBE_CPUS_TYPE macro. + In C++ and with compilers that do not support transparent unions, the + argument type must be cpu_set_t *. */ +typedef union { + cpu_set_t *__cs; + unsigned long int *__ul; +} __RISCV_HWPROBE_CPUS_TYPE __attribute__ ((__transparent_union__)); +# define __RISCV_HWPROBE_CPUS_TYPE __RISCV_HWPROBE_CPUS_TYPE +#endif + +extern int __riscv_hwprobe (struct riscv_hwprobe *__pairs, + size_t __pair_count, size_t __cpusetsize, + __RISCV_HWPROBE_CPUS_TYPE __cpus, unsigned int __flags) - __nonnull ((1)) __wur - __fortified_attr_access (__read_write__, 1, 2) - __fortified_attr_access (__read_only__, 4, 3); + __THROW __nonnull ((1)) __attr_access ((__read_write__, 1, 2)); -/* A pointer to the __riscv_hwprobe vDSO function is passed as the second +/* A pointer to the __riscv_hwprobe function is passed as the second argument to ifunc selector routines. Include a function pointer type for convenience in calling the function in those settings. */ -typedef int (*__riscv_hwprobe_t) (struct riscv_hwprobe *__pairs, size_t __pair_count, - size_t __cpu_count, unsigned long int *__cpus, +typedef int (*__riscv_hwprobe_t) (struct riscv_hwprobe *__pairs, + size_t __pair_count, size_t __cpusetsize, + __RISCV_HWPROBE_CPUS_TYPE __cpus, unsigned int __flags) - __nonnull ((1)) __wur - __fortified_attr_access (__read_write__, 1, 2) - __fortified_attr_access (__read_only__, 4, 3); + __nonnull ((1)) __attr_access ((__read_write__, 1, 2)); /* Helper function usable from ifunc selectors that probes a single key. */ static __inline int diff --git a/lib/libc/include/generic-glibc/sys/ifunc.h b/lib/libc/include/generic-glibc/sys/ifunc.h index d86de9707de293ccb23b0fbca64043b6e6b5d08d..c4ca0a983ccc513588dc84ce3821e5b0086a7c32 100644 --- a/lib/libc/include/generic-glibc/sys/ifunc.h +++ b/lib/libc/include/generic-glibc/sys/ifunc.h @@ -19,24 +19,77 @@ #ifndef _SYS_IFUNC_H #define _SYS_IFUNC_H +#include + /* A second argument is passed to the ifunc resolver. */ #define _IFUNC_ARG_HWCAP (1ULL << 62) -/* The prototype of a gnu indirect function resolver on AArch64 is +/* Maximum number of HWCAP elements that are currently supported. */ +#define _IFUNC_HWCAP_MAX 4 + +/* The prototype of a GNU indirect function resolver on AArch64 is + + ElfW(Addr) ifunc_resolver (uint64_t, const uint64_t *); + + The following prototype is also compatible: ElfW(Addr) ifunc_resolver (uint64_t, const __ifunc_arg_t *); - the first argument should have the _IFUNC_ARG_HWCAP bit set and - the remaining bits should match the AT_HWCAP settings. */ + The first argument might have the _IFUNC_ARG_HWCAP bit set and + the remaining bits should match the AT_HWCAP settings. + + If the _IFUNC_ARG_HWCAP bit is set in the first argument, then + the second argument is passed to the resolver function. In + this case, the second argument is a const pointer to a buffer + that allows to access all available HWCAP elements. + + This buffer has its size in bytes at offset 0. The HWCAP elements + are available at offsets 8, 16, 24, 32... respectively for AT_HWCAP, + AT_HWCAP2, AT_HWCAP3, AT_HWCAP4... (these offsets are multiples of + sizeof (unsigned long)). + + Indirect function resolvers must check availability of HWCAP + elements at runtime before accessing them using the size of the + buffer. */ -/* Second argument to an ifunc resolver. */ struct __ifunc_arg_t { - unsigned long _size; /* Size of the struct, so it can grow. */ + unsigned long _size; /* Size of the struct, so it can grow. */ unsigned long _hwcap; - unsigned long _hwcap2; + unsigned long _hwcap2; /* End of 1st published struct. */ + unsigned long _hwcap3; + unsigned long _hwcap4; /* End of 2nd published struct. */ }; typedef struct __ifunc_arg_t __ifunc_arg_t; +/* Constants for IDs of HWCAP elements to be used with the + __ifunc_hwcap function below. */ +enum +{ + _IFUNC_ARG_AT_HWCAP = 1, + _IFUNC_ARG_AT_HWCAP2 = 2, + _IFUNC_ARG_AT_HWCAP3 = 3, + _IFUNC_ARG_AT_HWCAP4 = 4, +}; + +/* A helper function to obtain HWCAP element by its ID from the + parameters ARG0 and ARG1 passed to the ifunc resolver. Note that + ID 1 corresponds to AT_HWCAP, ID 2 corresponds to AT_HWCAP2, etc. + If there is no element available for the requested ID then 0 is + returned. If ID doesn't much any supported AT_HWCAP{,2,...} value, + then 0 is also returned. */ +static __inline unsigned long __attribute__ ((unused, always_inline)) +__ifunc_hwcap (unsigned long __id, + unsigned long __arg0, const unsigned long *__arg1) +{ + if (__glibc_likely (__arg0 & _IFUNC_ARG_HWCAP)) + { + const unsigned long size = __arg1[0]; + const unsigned long offset = __id * sizeof (unsigned long); + return offset < size && __id > 0 ? __arg1[__id] : 0; + } + return __id == 1 ? __arg0 : 0; +} + #endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/sys/mount.h b/lib/libc/include/generic-glibc/sys/mount.h index b3f0cd64ecab74495f8fa1cbf4bd566ca17ece1f..fbb157810e243939be3b90310458ee8eec739f6e 100644 --- a/lib/libc/include/generic-glibc/sys/mount.h +++ b/lib/libc/include/generic-glibc/sys/mount.h @@ -121,7 +121,7 @@ enum MS_ACTIVE = 1 << 30, #define MS_ACTIVE MS_ACTIVE #undef MS_NOUSER - MS_NOUSER = 1 << 31 + MS_NOUSER = 1U << 31 #define MS_NOUSER MS_NOUSER }; diff --git a/lib/libc/include/generic-glibc/sys/ttychars.h b/lib/libc/include/generic-glibc/sys/ttychars.h index 492732666731848889e2773637676d7176d414a3..c187c170c65a2b6f0b8ab3dad0eadec7d921312b 100644 --- a/lib/libc/include/generic-glibc/sys/ttychars.h +++ b/lib/libc/include/generic-glibc/sys/ttychars.h @@ -54,8 +54,4 @@ struct ttychars { char tc_lnextc; /* literal next character */ }; -#ifdef __USE_OLD_TTY -#include /* to pick up character defaults */ -#endif - #endif /* sys/ttychars.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/termio.h b/lib/libc/include/generic-glibc/termio.h deleted file mode 100644 index a3f32a79f55c72f8d94f3c23b999cf6f252e5704..0000000000000000000000000000000000000000 --- a/lib/libc/include/generic-glibc/termio.h +++ /dev/null @@ -1,6 +0,0 @@ -/* Compatible for old `struct termio' ioctl interface. - This is obsolete; use the POSIX.1 `struct termios' interface - defined in instead. */ - -#include -#include \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/termios.h b/lib/libc/include/generic-glibc/termios.h index 94624586e7b414f52f17cfd492eecb071cb3679c..ef7b166b4c422e51270f1409f7c2abf8d546a797 100644 --- a/lib/libc/include/generic-glibc/termios.h +++ b/lib/libc/include/generic-glibc/termios.h @@ -61,6 +61,26 @@ extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW; extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __THROW; #endif +#ifdef __USE_GNU +/* Interfaces that are explicitly numeric representations of baud rates */ +typedef speed_t baud_t; +#define BAUD_MAX SPEED_MAX + +/* Return the output baud rate stored in *TERMIOS_P. */ +extern baud_t cfgetobaud (const struct termios *__termios_p) __THROW; + +/* Return the input baud rate stored in *TERMIOS_P. */ +extern baud_t cfgetibaud (const struct termios *__termios_p) __THROW; + +/* Set the output baud rate stored in *TERMIOS_P to BAUD. */ +extern int cfsetobaud (struct termios *__termios_p, baud_t __baud) __THROW; + +/* Set the input baud rate stored in *TERMIOS_P to BAUD. */ +extern int cfsetibaud (struct termios *__termios_p, baud_t __baud) __THROW; + +/* Set both the input and output baud rates in *TERMIOS_OP to BAUD. */ +extern int cfsetbaud (struct termios *__termios_p, baud_t __baud) __THROW; +#endif /* Put the state of FD into *TERMIOS_P. */ extern int tcgetattr (int __fd, struct termios *__termios_p) __THROW; diff --git a/lib/libc/include/generic-glibc/tgmath.h b/lib/libc/include/generic-glibc/tgmath.h index c90b783891bf3803e28ab07742b1377f26b2ff7d..4eae43da5e045050d1b0652a308e74ae6c38fee0 100644 --- a/lib/libc/include/generic-glibc/tgmath.h +++ b/lib/libc/include/generic-glibc/tgmath.h @@ -923,6 +923,24 @@ /* Return the cube root of X. */ #define cbrt(Val) __TGMATH_UNARY_REAL_ONLY (Val, cbrt) +#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) +/* Return 1+X to the Y power. */ +# define compoundn(Val1, Val2) \ + __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, compoundn) + +/* Return X to the Y power. */ +# define pown(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, pown) + +/* Return X to the Y power. */ +# define powr(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, powr) + +/* Return the Yth root of X. */ +# define rootn(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, rootn) + +/* Return 1/sqrt(X). */ +# define rsqrt(Val) __TGMATH_UNARY_REAL_ONLY (Val, rsqrt) +#endif + /* Nearest integer, absolute value, and remainder functions. */ diff --git a/lib/libc/include/generic-glibc/unistd.h b/lib/libc/include/generic-glibc/unistd.h index 7bc48ec48bdecb03ef83a2cf19933f1b60977113..6aaa1bfa90b37f2ad0071fe5eb3a5fb76623e1cd 100644 --- a/lib/libc/include/generic-glibc/unistd.h +++ b/lib/libc/include/generic-glibc/unistd.h @@ -1231,4 +1231,4 @@ extern int close_range (unsigned int __fd, unsigned int __max_fd, __END_DECLS -#endif /* unistd.h */ +#endif /* unistd.h */ \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/ioctl-types.h b/lib/libc/include/mips-linux-gnu/bits/ioctl-types.h index 0b157b683cf8d9776513b0d912904889770ec06a..511fe1c96b30153f8acf0c2c8ca845dbb8e1bb3a 100644 --- a/lib/libc/include/mips-linux-gnu/bits/ioctl-types.h +++ b/lib/libc/include/mips-linux-gnu/bits/ioctl-types.h @@ -31,18 +31,6 @@ struct winsize unsigned short int ws_ypixel; }; -#define NCC 8 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - char c_line; /* line discipline */ - /* Yes, this is really NCCS. */ - unsigned char c_cc[32 /* NCCS */]; /* control characters */ - }; - /* modem lines */ #define TIOCM_LE 0x001 /* line enable */ #define TIOCM_DTR 0x002 /* data terminal ready */ diff --git a/lib/libc/include/mips-linux-gnu/bits/termios-struct.h b/lib/libc/include/mips-linux-gnu/bits/termios-struct.h deleted file mode 100644 index f6dd2de6185b1376ba29c62ab4d481187982462c..0000000000000000000000000000000000000000 --- a/lib/libc/include/mips-linux-gnu/bits/termios-struct.h +++ /dev/null @@ -1,34 +0,0 @@ -/* struct termios definition. Linux/mips version. - Copyright (C) 2019-2025 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _TERMIOS_H -# error "Never include directly; use instead." -#endif - -#define NCCS 32 -struct termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ -#define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 -#define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 - }; \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/ioctl-types.h b/lib/libc/include/powerpc-linux-gnu/bits/ioctl-types.h index 1744e55f3e05aa4b465b8c6c2d7d6dbc25cb7e78..ecb6295b249bb7a28b282c979ed11a8f38c4ad81 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/ioctl-types.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/ioctl-types.h @@ -32,17 +32,6 @@ struct winsize unsigned short int ws_ypixel; }; -#define NCC 10 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - /* modem lines */ #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 diff --git a/lib/libc/include/powerpc-linux-gnu/bits/termios-c_cflag.h b/lib/libc/include/powerpc-linux-gnu/bits/termios-c_cflag.h index 1532bbe4a7f1aac192ce7c46021c4b85dab5bb2c..86d5639c460e9a1b398633b1345c3f1fae8e5baf 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/termios-c_cflag.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/termios-c_cflag.h @@ -35,5 +35,7 @@ #define CLOCAL 00100000 #ifdef __USE_MISC -# define ADDRB 04000000000 +# define ADDRB 04000000000 +# define CMSPAR 010000000000 /* Mark or space (stick) parity. */ +# define CRTSCTS 020000000000 /* Flow control. */ #endif \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/termios-baud.h b/lib/libc/include/powerpc-linux-gnu/bits/termios-cbaud.h similarity index 58% rename from lib/libc/include/powerpc-linux-gnu/bits/termios-baud.h rename to lib/libc/include/powerpc-linux-gnu/bits/termios-cbaud.h index b61756d302d47ebf6654e8f1362b6804e3c24fcb..6e0257e59d42ad45f0ab7bd0e226195a9cb87c02 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/termios-baud.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/termios-cbaud.h @@ -17,29 +17,29 @@ . */ #ifndef _TERMIOS_H -# error "Never include directly; use instead." +# error "Never include directly; use instead." #endif #ifdef __USE_MISC -# define CBAUD 0000377 -# define CBAUDEX 0000020 -# define CMSPAR 010000000000 /* mark or space (stick) parity */ -# define CRTSCTS 020000000000 /* flow control */ +# define CBAUD 000000377 +# define CBAUDEX 000000020 +# define CIBAUD 077600000 +# define IBSHIFT 16 #endif -#define B57600 00020 -#define B115200 00021 -#define B230400 00022 -#define B460800 00023 -#define B500000 00024 -#define B576000 00025 -#define B921600 00026 -#define B1000000 00027 -#define B1152000 00030 -#define B1500000 00031 -#define B2000000 00032 -#define B2500000 00033 -#define B3000000 00034 -#define B3500000 00035 -#define B4000000 00036 -#define __MAX_BAUD B4000000 \ No newline at end of file +#define __B57600 00020 +#define __B115200 00021 +#define __B230400 00022 +#define __B460800 00023 +#define __B500000 00024 +#define __B576000 00025 +#define __B921600 00026 +#define __B1000000 00027 +#define __B1152000 00030 +#define __B1500000 00031 +#define __B2000000 00032 +#define __B2500000 00033 +#define __B3000000 00034 +#define __B3500000 00035 +#define __B4000000 00036 +#define __BOTHER 00037 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/termios-baud.h b/lib/libc/include/sparc-linux-gnu/bits/termios-cbaud.h similarity index 58% rename from lib/libc/include/sparc-linux-gnu/bits/termios-baud.h rename to lib/libc/include/sparc-linux-gnu/bits/termios-cbaud.h index 465e9bbb0065167445acb8e2dc21c6f0f926c754..e848a18538c9fb8c5880fc6f9cd76cf3e160b07d 100644 --- a/lib/libc/include/sparc-linux-gnu/bits/termios-baud.h +++ b/lib/libc/include/sparc-linux-gnu/bits/termios-cbaud.h @@ -17,30 +17,29 @@ . */ #ifndef _TERMIOS_H -# error "Never include directly; use instead." +# error "Never include directly; use instead." #endif #ifdef __USE_MISC # define CBAUD 0x0000100f # define CBAUDEX 0x00001000 -# define CIBAUD 0x100f0000 /* input baud rate (not used) */ -# define CMSPAR 0x40000000 /* mark or space (stick) parity */ -# define CRTSCTS 0x80000000 /* flow control */ +# define CIBAUD 0x100f0000 /* input baud rate */ +# define IBSHIFT 16 #endif -#define B57600 0x00001001 -#define B115200 0x00001002 -#define B230400 0x00001003 -#define B460800 0x00001004 -#define B76800 0x00001005 -#define B153600 0x00001006 -#define B307200 0x00001007 -#define B614400 0x00001008 -#define B921600 0x00001009 -#define B500000 0x0000100a -#define B576000 0x0000100b -#define B1000000 0x0000100c -#define B1152000 0x0000100d -#define B1500000 0x0000100e -#define B2000000 0x0000100f -#define __MAX_BAUD B2000000 \ No newline at end of file +#define __B57600 0x00001001 +#define __B115200 0x00001002 +#define __B230400 0x00001003 +#define __B460800 0x00001004 +#define __B76800 0x00001005 +#define __B153600 0x00001006 +#define __B307200 0x00001007 +#define __B614400 0x00001008 +#define __B921600 0x00001009 +#define __B500000 0x0000100a +#define __B576000 0x0000100b +#define __B1000000 0x0000100c +#define __B1152000 0x0000100d +#define __B1500000 0x0000100e +#define __B2000000 0x0000100f +#define __BOTHER 0x00001000 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/bits/termios-struct.h b/lib/libc/include/sparc-linux-gnu/bits/termios-struct.h deleted file mode 100644 index 815227e7d4156a648150a98d2d0cc739f8a7a98d..0000000000000000000000000000000000000000 --- a/lib/libc/include/sparc-linux-gnu/bits/termios-struct.h +++ /dev/null @@ -1,34 +0,0 @@ -/* struct termios definition. Linux/sparc version. - Copyright (C) 2019-2025 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _TERMIOS_H -# error "Never include directly; use instead." -#endif - -#define NCCS 17 -struct termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ -#define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 -#define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 - }; \ No newline at end of file diff --git a/lib/libc/include/x86-linux-gnu/bits/floatn.h b/lib/libc/include/x86-linux-gnu/bits/floatn.h index b2716390f8c5457259a5a8bfe21f81ebc9d7ffb7..b0bab474a1aaffa8ded90c4e5426662d23a080d8 100644 --- a/lib/libc/include/x86-linux-gnu/bits/floatn.h +++ b/lib/libc/include/x86-linux-gnu/bits/floatn.h @@ -25,11 +25,15 @@ floating-point type with the IEEE 754 binary128 format, and this glibc includes corresponding *f128 interfaces for it. The required libgcc support was added some time after the basic compiler - support, for x86_64 and x86. */ + support, for x86_64 and x86. Intel SYCL compiler doesn't support + _Float128: https://github.com/intel/llvm/issues/16903 + */ #if (defined __x86_64__ \ ? __GNUC_PREREQ (4, 3) \ : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \ - || __glibc_clang_prereq (3, 4) + || (__glibc_clang_prereq (3, 9) \ + && (!defined __INTEL_LLVM_COMPILER \ + || !defined SYCL_LANGUAGE_VERSION)) # define __HAVE_FLOAT128 1 #else # define __HAVE_FLOAT128 0 @@ -89,7 +93,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); /* The type _Float128 exists only since GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) \ || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) \ - || __glibc_clang_prereq (3, 4) + || __glibc_clang_prereq (3, 9) typedef __float128 _Float128; # endif -- 2.54.0