diff --git a/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h b/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h index f4189aa1bfca6909be4967e00821932faf753c7a..ea1c9e30bc803d6c5eb0396d62a46707ca7bdddd 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/hwcap.h @@ -55,6 +55,21 @@ #define HWCAP_PACA (1 << 30) #define HWCAP_PACG (1UL << 31) #define HWCAP_GCS (1UL << 32) +#define HWCAP_CMPBR (1UL << 33) +#define HWCAP_FPRCVT (1UL << 34) +#define HWCAP_F8MM8 (1UL << 35) +#define HWCAP_F8MM4 (1UL << 36) +#define HWCAP_SVE_F16MM (1UL << 37) +#define HWCAP_SVE_ELTPERM (1UL << 38) +#define HWCAP_SVE_AES2 (1UL << 39) +#define HWCAP_SVE_BFSCALE (1UL << 40) +#define HWCAP_SVE2P2 (1UL << 41) +#define HWCAP_SME2P2 (1UL << 42) +#define HWCAP_SME_SBITPERM (1UL << 43) +#define HWCAP_SME_AES (1UL << 44) +#define HWCAP_SME_SFEXPA (1UL << 45) +#define HWCAP_SME_STMOP (1UL << 46) +#define HWCAP_SME_SMOP4 (1UL << 47) #define HWCAP2_DCPODP (1 << 0) #define HWCAP2_SVE2 (1 << 1) @@ -122,4 +137,6 @@ #define HWCAP2_POE (1UL << 63) #define HWCAP3_MTE_FAR (1UL << 0) -#define HWCAP3_MTE_STORE_ONLY (1UL << 1) \ No newline at end of file +#define HWCAP3_MTE_STORE_ONLY (1UL << 1) +#define HWCAP3_LSFE (1UL << 2) +#define HWCAP3_LS64 (1UL << 3) \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/bits/long-double.h b/lib/libc/include/aarch64-linux-gnu/bits/long-double.h deleted file mode 100644 index af7784dbe6dd85cd9538b5a7b437ab45de22eeb8..0000000000000000000000000000000000000000 --- a/lib/libc/include/aarch64-linux-gnu/bits/long-double.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Properties of long double type. ldbl-128 version. - Copyright (C) 2016-2026 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 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 - . */ - -/* long double is distinct from double, so there is nothing to - define here. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file 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 68043a976c58a8f126799f7c386006471a4996eb..c83fbc235bcaefcba343ec5122af94a316e67c57 100644 --- a/lib/libc/include/aarch64-linux-gnu/bits/math-vector.h +++ b/lib/libc/include/aarch64-linux-gnu/bits/math-vector.h @@ -157,6 +157,10 @@ # define __DECL_SIMD_pow __DECL_SIMD_aarch64 # undef __DECL_SIMD_powf # define __DECL_SIMD_powf __DECL_SIMD_aarch64 +# undef __DECL_SIMD_powr +# define __DECL_SIMD_powr __DECL_SIMD_aarch64 +# undef __DECL_SIMD_powrf +# define __DECL_SIMD_powrf __DECL_SIMD_aarch64 # undef __DECL_SIMD_rsqrt # define __DECL_SIMD_rsqrt __DECL_SIMD_aarch64 # undef __DECL_SIMD_rsqrtf @@ -243,6 +247,7 @@ __vpcs __f32x4_t _ZGVnN4v_log2f (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_log2p1f (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_logp1f (__f32x4_t); __vpcs __f32x4_t _ZGVnN4vv_powf (__f32x4_t, __f32x4_t); +__vpcs __f32x4_t _ZGVnN4vv_powrf (__f32x4_t, __f32x4_t); __vpcs __f32x4_t _ZGVnN4v_rsqrtf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_sinf (__f32x4_t); __vpcs __f32x4_t _ZGVnN4v_sinhf (__f32x4_t); @@ -283,6 +288,7 @@ __vpcs __f64x2_t _ZGVnN2v_log2 (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_log2p1 (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_logp1 (__f64x2_t); __vpcs __f64x2_t _ZGVnN2vv_pow (__f64x2_t, __f64x2_t); +__vpcs __f64x2_t _ZGVnN2vv_powr (__f64x2_t, __f64x2_t); __vpcs __f64x2_t _ZGVnN2v_rsqrt (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_sin (__f64x2_t); __vpcs __f64x2_t _ZGVnN2v_sinh (__f64x2_t); @@ -328,6 +334,7 @@ __sv_f32_t _ZGVsMxv_log2f (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_log2p1f (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_logp1f (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxvv_powf (__sv_f32_t, __sv_f32_t, __sv_bool_t); +__sv_f32_t _ZGVsMxvv_powrf (__sv_f32_t, __sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_rsqrtf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_sinf (__sv_f32_t, __sv_bool_t); __sv_f32_t _ZGVsMxv_sinhf (__sv_f32_t, __sv_bool_t); @@ -368,6 +375,7 @@ __sv_f64_t _ZGVsMxv_log2 (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_log2p1 (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_logp1 (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxvv_pow (__sv_f64_t, __sv_f64_t, __sv_bool_t); +__sv_f64_t _ZGVsMxvv_powr (__sv_f64_t, __sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_rsqrt (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_sin (__sv_f64_t, __sv_bool_t); __sv_f64_t _ZGVsMxv_sinh (__sv_f64_t, __sv_bool_t); diff --git a/lib/libc/include/aarch64-linux-gnu/bits/struct_stat.h b/lib/libc/include/aarch64-linux-gnu/bits/struct_stat.h deleted file mode 100644 index 0462d37a6849812f485a6830a7c0dca303332636..0000000000000000000000000000000000000000 --- a/lib/libc/include/aarch64-linux-gnu/bits/struct_stat.h +++ /dev/null @@ -1,127 +0,0 @@ -/* Definition for struct stat. - Copyright (C) 2020-2026 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 - . */ - -#if !defined _SYS_STAT_H && !defined _FCNTL_H -# error "Never include directly; use instead." -#endif - -#ifndef _BITS_STRUCT_STAT_H -#define _BITS_STRUCT_STAT_H 1 - -#include -#include - -#if defined __USE_FILE_OFFSET64 -# define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T -# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T -# error "ino_t and off_t must both be the same type" -# endif -# define __field64(type, type64, name) type name -#elif __BYTE_ORDER == __LITTLE_ENDIAN -# define __field64(type, type64, name) \ - type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad -#else -# define __field64(type, type64, name) \ - int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name -#endif - -struct stat - { - __dev_t st_dev; /* Device. */ - __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __dev_t __pad1; - __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - int __pad2; - __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - int __glibc_reserved[2]; - }; - -#undef __field64 - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - __dev_t st_dev; /* Device. */ - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __dev_t __pad1; - __off64_t st_size; /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - int __pad2; - __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - int __glibc_reserved[2]; - }; -#endif - -/* Tell code we have these members. */ -#define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV -/* Nanosecond resolution time values are supported. */ -#define _STATBUF_ST_NSEC - -#endif /* _BITS_STRUCT_STAT_H */ \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/bits/timesize.h b/lib/libc/include/aarch64-linux-gnu/bits/timesize.h deleted file mode 100644 index dff2da5ed6bf30ce6f5580aee352e0958d58b623..0000000000000000000000000000000000000000 --- a/lib/libc/include/aarch64-linux-gnu/bits/timesize.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Bit size of the time_t type at glibc build time, general case. - Copyright (C) 2018-2026 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 - . */ - -/* Size in bits of the 'time_t' type of the default ABI. */ -#define __TIMESIZE 64 \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/finclude/math-vector-fortran.h b/lib/libc/include/aarch64-linux-gnu/finclude/math-vector-fortran.h index 59c7f2db4a8dfefe910714f9a659b8e61680df63..2af413c57c6ec176e65b5555ff2394df576a96c6 100644 --- a/lib/libc/include/aarch64-linux-gnu/finclude/math-vector-fortran.h +++ b/lib/libc/include/aarch64-linux-gnu/finclude/math-vector-fortran.h @@ -16,81 +16,83 @@ ! License along with the GNU C Library; if not, see ! . -!GCC$ builtin (acos) attributes simd (notinbranch) -!GCC$ builtin (acosf) attributes simd (notinbranch) -!GCC$ builtin (acosh) attributes simd (notinbranch) -!GCC$ builtin (acoshf) attributes simd (notinbranch) -!GCC$ builtin (acospi) attributes simd (notinbranch) -!GCC$ builtin (acospif) attributes simd (notinbranch) -!GCC$ builtin (asin) attributes simd (notinbranch) -!GCC$ builtin (asinf) attributes simd (notinbranch) -!GCC$ builtin (asinh) attributes simd (notinbranch) -!GCC$ builtin (asinhf) attributes simd (notinbranch) -!GCC$ builtin (asinpi) attributes simd (notinbranch) -!GCC$ builtin (asinpif) attributes simd (notinbranch) -!GCC$ builtin (atan) attributes simd (notinbranch) -!GCC$ builtin (atan2) attributes simd (notinbranch) -!GCC$ builtin (atan2f) attributes simd (notinbranch) -!GCC$ builtin (atan2pi) attributes simd (notinbranch) -!GCC$ builtin (atan2pif) attributes simd (notinbranch) -!GCC$ builtin (atanf) attributes simd (notinbranch) -!GCC$ builtin (atanh) attributes simd (notinbranch) -!GCC$ builtin (atanhf) attributes simd (notinbranch) -!GCC$ builtin (atanpi) attributes simd (notinbranch) -!GCC$ builtin (atanpif) attributes simd (notinbranch) -!GCC$ builtin (cbrt) attributes simd (notinbranch) -!GCC$ builtin (cbrtf) attributes simd (notinbranch) -!GCC$ builtin (cos) attributes simd (notinbranch) -!GCC$ builtin (cosf) attributes simd (notinbranch) -!GCC$ builtin (cosh) attributes simd (notinbranch) -!GCC$ builtin (coshf) attributes simd (notinbranch) -!GCC$ builtin (cospi) attributes simd (notinbranch) -!GCC$ builtin (cospif) attributes simd (notinbranch) -!GCC$ builtin (erf) attributes simd (notinbranch) -!GCC$ builtin (erfc) attributes simd (notinbranch) -!GCC$ builtin (erfcf) attributes simd (notinbranch) -!GCC$ builtin (erff) attributes simd (notinbranch) -!GCC$ builtin (exp) attributes simd (notinbranch) -!GCC$ builtin (exp10) attributes simd (notinbranch) -!GCC$ builtin (exp10f) attributes simd (notinbranch) -!GCC$ builtin (exp10m1) attributes simd (notinbranch) -!GCC$ builtin (exp10m1f) attributes simd (notinbranch) -!GCC$ builtin (exp2) attributes simd (notinbranch) -!GCC$ builtin (exp2f) attributes simd (notinbranch) -!GCC$ builtin (exp2m1) attributes simd (notinbranch) -!GCC$ builtin (exp2m1f) attributes simd (notinbranch) -!GCC$ builtin (expf) attributes simd (notinbranch) -!GCC$ builtin (expm1) attributes simd (notinbranch) -!GCC$ builtin (expm1f) attributes simd (notinbranch) -!GCC$ builtin (hypot) attributes simd (notinbranch) -!GCC$ builtin (hypotf) attributes simd (notinbranch) -!GCC$ builtin (log) attributes simd (notinbranch) -!GCC$ builtin (log10) attributes simd (notinbranch) -!GCC$ builtin (log10f) attributes simd (notinbranch) -!GCC$ builtin (log10p1) attributes simd (notinbranch) -!GCC$ builtin (log10p1f) attributes simd (notinbranch) -!GCC$ builtin (log1p) attributes simd (notinbranch) -!GCC$ builtin (log1pf) attributes simd (notinbranch) -!GCC$ builtin (log2) attributes simd (notinbranch) -!GCC$ builtin (log2f) attributes simd (notinbranch) -!GCC$ builtin (log2p1) attributes simd (notinbranch) -!GCC$ builtin (log2p1f) attributes simd (notinbranch) -!GCC$ builtin (logf) attributes simd (notinbranch) -!GCC$ builtin (logp1) attributes simd (notinbranch) -!GCC$ builtin (logp1f) attributes simd (notinbranch) -!GCC$ builtin (pow) attributes simd (notinbranch) -!GCC$ builtin (powf) attributes simd (notinbranch) -!GCC$ builtin (rsqrt) attributes simd (notinbranch) -!GCC$ builtin (rsqrtf) attributes simd (notinbranch) -!GCC$ builtin (sin) attributes simd (notinbranch) -!GCC$ builtin (sinf) attributes simd (notinbranch) -!GCC$ builtin (sinh) attributes simd (notinbranch) -!GCC$ builtin (sinhf) attributes simd (notinbranch) -!GCC$ builtin (sinpi) attributes simd (notinbranch) -!GCC$ builtin (sinpif) attributes simd (notinbranch) -!GCC$ builtin (tan) attributes simd (notinbranch) -!GCC$ builtin (tanf) attributes simd (notinbranch) -!GCC$ builtin (tanh) attributes simd (notinbranch) -!GCC$ builtin (tanhf) attributes simd (notinbranch) -!GCC$ builtin (tanpi) attributes simd (notinbranch) -!GCC$ builtin (tanpif) attributes simd (notinbranch) \ No newline at end of file +!GCC$ builtin (acos) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (acosf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (acosh) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (acoshf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (acospi) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (acospif) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (asin) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (asinf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (asinh) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (asinhf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (asinpi) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (asinpif) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (atan) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (atan2) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (atan2f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (atan2pi) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (atan2pif) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (atanf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (atanh) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (atanhf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (atanpi) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (atanpif) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (cbrt) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (cbrtf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (cos) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (cosf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (cosh) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (coshf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (cospi) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (cospif) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (erf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (erfc) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (erfcf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (erff) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (exp) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (exp10) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (exp10f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (exp10m1) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (exp10m1f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (exp2) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (exp2f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (exp2m1) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (exp2m1f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (expf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (expm1) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (expm1f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (hypot) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (hypotf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log10) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log10f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log10p1) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log10p1f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log1p) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log1pf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log2) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log2f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log2p1) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (log2p1f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (logf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (logp1) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (logp1f) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (pow) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (powf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (powr) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (powrf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (rsqrt) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (rsqrtf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (sin) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (sinf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (sinh) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (sinhf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (sinpi) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (sinpif) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (tan) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (tanf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (tanh) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (tanhf) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (tanpi) attributes simd (notinbranch) if('fastmath') +!GCC$ builtin (tanpif) attributes simd (notinbranch) if('fastmath') \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h b/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h index e34eb75134323543b3d8d8807e0bc3c7a3c31abd..46acbc27479223aa3abfe70175255d2b346e9cac 100644 --- a/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h +++ b/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64_be.h b/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64_be.h index 2fba436ba35ca351e3c28abeda69028774654a92..ad55fcf123ad4488d626ece14689abda37598381 100644 --- a/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64_be.h +++ b/lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64_be.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/struct_stat.h b/lib/libc/include/arc-linux-gnu/bits/struct_stat.h deleted file mode 100644 index 0462d37a6849812f485a6830a7c0dca303332636..0000000000000000000000000000000000000000 --- a/lib/libc/include/arc-linux-gnu/bits/struct_stat.h +++ /dev/null @@ -1,127 +0,0 @@ -/* Definition for struct stat. - Copyright (C) 2020-2026 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 - . */ - -#if !defined _SYS_STAT_H && !defined _FCNTL_H -# error "Never include directly; use instead." -#endif - -#ifndef _BITS_STRUCT_STAT_H -#define _BITS_STRUCT_STAT_H 1 - -#include -#include - -#if defined __USE_FILE_OFFSET64 -# define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T -# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T -# error "ino_t and off_t must both be the same type" -# endif -# define __field64(type, type64, name) type name -#elif __BYTE_ORDER == __LITTLE_ENDIAN -# define __field64(type, type64, name) \ - type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad -#else -# define __field64(type, type64, name) \ - int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name -#endif - -struct stat - { - __dev_t st_dev; /* Device. */ - __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __dev_t __pad1; - __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - int __pad2; - __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - int __glibc_reserved[2]; - }; - -#undef __field64 - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - __dev_t st_dev; /* Device. */ - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __dev_t __pad1; - __off64_t st_size; /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - int __pad2; - __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - int __glibc_reserved[2]; - }; -#endif - -/* Tell code we have these members. */ -#define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV -/* Nanosecond resolution time values are supported. */ -#define _STATBUF_ST_NSEC - -#endif /* _BITS_STRUCT_STAT_H */ \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/bits/timesize.h b/lib/libc/include/arc-linux-gnu/bits/timesize.h deleted file mode 100644 index dff2da5ed6bf30ce6f5580aee352e0958d58b623..0000000000000000000000000000000000000000 --- a/lib/libc/include/arc-linux-gnu/bits/timesize.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Bit size of the time_t type at glibc build time, general case. - Copyright (C) 2018-2026 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 - . */ - -/* Size in bits of the 'time_t' type of the default ABI. */ -#define __TIMESIZE 64 \ No newline at end of file diff --git a/lib/libc/include/arc-linux-gnu/gnu/lib-names.h b/lib/libc/include/arc-linux-gnu/gnu/lib-names.h index 68bed2a1a178f5003654ea064883559b08d5242e..5e617b3a49ddd6da357923e3cfdae83ef4a189fb 100644 --- a/lib/libc/include/arc-linux-gnu/gnu/lib-names.h +++ b/lib/libc/include/arc-linux-gnu/gnu/lib-names.h @@ -25,6 +25,7 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" #endif /* gnu/lib-names.h */ \ No newline at end of file diff --git a/lib/libc/include/csky-linux-gnu/gnu/lib-names.h b/lib/libc/include/csky-linux-gnu/gnu/lib-names.h index fbe1a718fbeb97c65267676396b656897ac0b648..f63e5133babbdfd1309f38fe281c0d29c1ef8a64 100644 --- a/lib/libc/include/csky-linux-gnu/gnu/lib-names.h +++ b/lib/libc/include/csky-linux-gnu/gnu/lib-names.h @@ -31,6 +31,7 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" -#endif /* gnu/lib-names.h */ +#endif /* gnu/lib-names.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/assert.h b/lib/libc/include/generic-glibc/assert.h index 73562fec4b9cf794aeb03cc1f3e4c5988eeb42cf..11c3cec04420eb0925d865ed489f911f4e29de37 100644 --- a/lib/libc/include/generic-glibc/assert.h +++ b/lib/libc/include/generic-glibc/assert.h @@ -52,13 +52,12 @@ comma in the initializer list, can be passed to assert. This depends on support for variadic macros (added in C99 and GCC 2.95), and on support for _Bool (added in C99 and GCC 3.0) in order to - validate that only a single expression is passed as an argument, - and is currently implemented only for C. */ -#if (__GLIBC_USE (ISOC23) \ - && (defined __GNUC__ \ - ? __GNUC_PREREQ (3, 0) \ - : defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) \ - && !defined __cplusplus) + validate that only a single expression is passed as an argument. */ +#if ((__GLIBC_USE (ISOC23) \ + && (defined __GNUC__ \ + ? __GNUC_PREREQ (3, 0) \ + : defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) \ + || (defined __cplusplus && __cplusplus > 202302L)) # define __ASSERT_VARIADIC 1 #else # define __ASSERT_VARIADIC 0 @@ -108,7 +107,7 @@ extern void __assert (const char *__assertion, const char *__file, int __line) __THROW __attribute__ ((__noreturn__)) __COLD; -# if __ASSERT_VARIADIC +# if __ASSERT_VARIADIC && !defined __cplusplus /* This function is not defined and is not called outside of an unevaluated sizeof, but serves to verify that the argument to assert is a single expression. */ @@ -131,11 +130,22 @@ __END_DECLS # define __ASSERT_FILE __FILE__ # define __ASSERT_LINE __LINE__ # endif -# define assert(expr) \ +# if __ASSERT_VARIADIC +/* The first test of __VA_ARGS__ evaluates it without converting scoped + enumeration values to bool, and the second test checks that it is a + single expression without evaluating it. */ +# define assert(...) \ + ((__VA_ARGS__) \ + ? void (1 ? 1 : bool (__VA_ARGS__)) \ + : __assert_fail (#__VA_ARGS__, __ASSERT_FILE, __ASSERT_LINE, \ + __ASSERT_FUNCTION)) +# else +# define assert(expr) \ (static_cast (expr) \ ? void (0) \ : __assert_fail (#expr, __ASSERT_FILE, __ASSERT_LINE, \ __ASSERT_FUNCTION)) +# endif # elif !defined __GNUC__ || defined __STRICT_ANSI__ # if __ASSERT_VARIADIC # define assert(...) \ diff --git a/lib/libc/include/generic-glibc/bits/cloexec.h b/lib/libc/include/generic-glibc/bits/cloexec.h new file mode 100644 index 0000000000000000000000000000000000000000..030893ff8723fd0d1dfe500c88bbc290d01cc292 --- /dev/null +++ b/lib/libc/include/generic-glibc/bits/cloexec.h @@ -0,0 +1 @@ +#define __O_CLOEXEC 02000000 \ 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 b6a2979287a93d686f1ca0b44b9faf511eea6b9f..894a22c8ba99c3a72413feca4dcf25c676177510 100644 --- a/lib/libc/include/generic-glibc/bits/fcntl-linux.h +++ b/lib/libc/include/generic-glibc/bits/fcntl-linux.h @@ -81,9 +81,7 @@ #ifndef __O_NOFOLLOW # define __O_NOFOLLOW 0400000 #endif -#ifndef __O_CLOEXEC -# define __O_CLOEXEC 02000000 -#endif +#include #ifndef __O_DIRECT # define __O_DIRECT 040000 #endif @@ -176,8 +174,8 @@ #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 -# define F_SETOWN __F_SETOWN /* Get owner (process receiving SIGIO). */ -# define F_GETOWN __F_GETOWN /* Set owner (process receiving SIGIO). */ +# define F_SETOWN __F_SETOWN /* Set owner (process receiving SIGIO). */ +# define F_GETOWN __F_GETOWN /* Get owner (process receiving SIGIO). */ #endif #ifndef __F_SETSIG @@ -185,15 +183,15 @@ # define __F_GETSIG 11 /* Get number of signal to be sent. */ #endif #ifndef __F_SETOWN_EX -# define __F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */ -# define __F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */ +# define __F_SETOWN_EX 15 /* Set owner (thread receiving SIGIO). */ +# define __F_GETOWN_EX 16 /* Get owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU # define F_SETSIG __F_SETSIG /* Set number of signal to be sent. */ # define F_GETSIG __F_GETSIG /* Get number of signal to be sent. */ -# define F_SETOWN_EX __F_SETOWN_EX /* Get owner (thread receiving SIGIO). */ -# define F_GETOWN_EX __F_GETOWN_EX /* Set owner (thread receiving SIGIO). */ +# define F_SETOWN_EX __F_SETOWN_EX /* Set owner (thread receiving SIGIO). */ +# define F_GETOWN_EX __F_GETOWN_EX /* Get owner (thread receiving SIGIO). */ #endif #ifdef __USE_GNU @@ -203,7 +201,7 @@ # define F_DUPFD_QUERY 1027 /* Compare two file descriptors for sameness. */ # define F_CREATED_QUERY 1028 /* Was the file just created? */ # define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ -# define F_GETPIPE_SZ 1032 /* Set pipe page size array. */ +# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ # define F_ADD_SEALS 1033 /* Add seals to file. */ # define F_GET_SEALS 1034 /* Get seals for file. */ /* Set / get write life time hints. */ @@ -211,6 +209,8 @@ # define F_SET_RW_HINT 1036 # define F_GET_FILE_RW_HINT 1037 # define F_SET_FILE_RW_HINT 1038 +# define F_GETDELEG 1039 /* Get delegation. */ +# define F_SETDELEG 1040 /* Set delegation. */ #endif #ifdef __USE_XOPEN2K8 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with @@ -221,6 +221,7 @@ #define FD_CLOEXEC 1 /* Actually anything with low bit set goes */ #ifdef __USE_GNU # define FD_PIDFS_ROOT -10002 /* Root of the pidfs filesystem */ +# define FD_NSFS_ROOT -10003 /* Root of the nsfs filesystem */ #endif #ifndef F_RDLCK 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 d3b43f59cc01e21655c009ec365eb49b30d15e03..1ae3bf4992d67a9881cd05ea47f64dc4c752ec0c 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 @@ -99,6 +99,17 @@ #define __DECL_SIMD_powf64x #define __DECL_SIMD_powf128x +#define __DECL_SIMD_powr +#define __DECL_SIMD_powrf +#define __DECL_SIMD_powrl +#define __DECL_SIMD_powrf16 +#define __DECL_SIMD_powrf32 +#define __DECL_SIMD_powrf64 +#define __DECL_SIMD_powrf128 +#define __DECL_SIMD_powrf32x +#define __DECL_SIMD_powrf64x +#define __DECL_SIMD_powrf128x + #define __DECL_SIMD_acos #define __DECL_SIMD_acosf #define __DECL_SIMD_acosl diff --git a/lib/libc/include/generic-glibc/bits/long-double.h b/lib/libc/include/generic-glibc/bits/long-double.h index ebf6ac878fbf42241d0b2bcaf8c6049d08d827c5..af7784dbe6dd85cd9538b5a7b437ab45de22eeb8 100644 --- a/lib/libc/include/generic-glibc/bits/long-double.h +++ b/lib/libc/include/generic-glibc/bits/long-double.h @@ -1,4 +1,4 @@ -/* Properties of long double type. MIPS version. +/* Properties of long double type. ldbl-128 version. Copyright (C) 2016-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,9 +16,6 @@ License along with the GNU C Library; if not, see . */ -#include - -#if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 -# define __NO_LONG_DOUBLE_MATH 1 -#endif +/* long double is distinct from double, so there is nothing to + define here. */ #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/mathcalls.h b/lib/libc/include/generic-glibc/bits/mathcalls.h index 7ff83e5acbeebe7f5fd3b1185735822e436aa5dd..740f26aed89b757cbe7f58e6d4f8570e6dfa74a3 100644 --- a/lib/libc/include/generic-glibc/bits/mathcalls.h +++ b/lib/libc/include/generic-glibc/bits/mathcalls.h @@ -197,6 +197,7 @@ __MATHCALL (compoundn,, (_Mdouble_ __x, long long int __y)); __MATHCALL (pown,, (_Mdouble_ __x, long long int __y)); /* Return X to the Y power. */ +__MATHCALL_VEC (powr,, (_Mdouble_ __x, _Mdouble_ __y)); __MATHCALL (powr,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the Yth root of X. */ diff --git a/lib/libc/include/generic-glibc/bits/ppc.h b/lib/libc/include/generic-glibc/bits/ppc.h deleted file mode 100644 index 5e98f066e0a95606f78a7129795ff5f06cbe55ad..0000000000000000000000000000000000000000 --- a/lib/libc/include/generic-glibc/bits/ppc.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Facilities specific to the PowerPC architecture on Linux - Copyright (C) 2012-2026 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_PPC_H -#define _BITS_PPC_H - -#ifndef _SYS_PLATFORM_PPC_H -# error "Never include this file directly; use instead." -#endif - -__BEGIN_DECLS - -/* Read the time base frequency. */ -extern uint64_t __ppc_get_timebase_freq (void); - -__END_DECLS - -#endif \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/sched.h b/lib/libc/include/generic-glibc/bits/sched.h index aa49876c1c353c46701b02b6f7f19b2f565e06e5..a66bfd53a14ce66651062a7ea51673c6e867e863 100644 --- a/lib/libc/include/generic-glibc/bits/sched.h +++ b/lib/libc/include/generic-glibc/bits/sched.h @@ -54,6 +54,9 @@ #define SCHED_FLAG_UTIL_CLAMP \ (SCHED_FLAG_UTIL_CLAMP_MIN | SCHED_FLAG_UTIL_CLAMP_MAX) +/* Flags for the flags argument of sched_getattr. */ +#define SCHED_GETATTR_FLAG_DL_DYNAMIC 0x01 + /* Use "" to work around incorrect macro expansion of the __has_include argument (GCC PR 80005). */ # ifdef __has_include diff --git a/lib/libc/include/generic-glibc/bits/struct_stat.h b/lib/libc/include/generic-glibc/bits/struct_stat.h index 231c875e7ab2c703e50746e2191ddc411c0878a2..0462d37a6849812f485a6830a7c0dca303332636 100644 --- a/lib/libc/include/generic-glibc/bits/struct_stat.h +++ b/lib/libc/include/generic-glibc/bits/struct_stat.h @@ -23,215 +23,105 @@ #ifndef _BITS_STRUCT_STAT_H #define _BITS_STRUCT_STAT_H 1 -#include - -#if _MIPS_SIM == _ABIO32 -/* Structure describing file characteristics. */ -struct stat - { -# ifdef __USE_TIME64_REDIRECTS -# include -# else - unsigned long int st_dev; - long int st_pad1[3]; -# ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; /* File serial number. */ -# else - __ino64_t st_ino; /* File serial number. */ -# endif - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - unsigned long int st_rdev; /* Device number, if device. */ -# ifndef __USE_FILE_OFFSET64 - long int st_pad2[2]; - __off_t st_size; /* Size of file, in bytes. */ - /* SVR4 added this extra long to allow for expansion of off_t. */ - long int st_pad3; -# else - long int st_pad2[3]; - __off64_t st_size; /* Size of file, in bytes. */ -# endif -# ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif - __blksize_t st_blksize; /* Optimal block size for I/O. */ -# ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ -# else - long int st_pad4; - __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ -# endif - long int st_pad5[14]; -# endif /* __USE_TIME64_REDIRECTS */ - }; - -# ifdef __USE_LARGEFILE64 -struct stat64 - { -# ifdef __USE_TIME64_REDIRECTS -# include -# else - unsigned long int st_dev; - long int st_pad1[3]; - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - unsigned long int st_rdev; /* Device number, if device. */ - long int st_pad2[3]; - __off64_t st_size; /* Size of file, in bytes. */ -# ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif - __blksize_t st_blksize; /* Optimal block size for I/O. */ - long int st_pad3; - __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ - long int st_pad4[14]; -# endif /* __USE_TIME64_REDIRECTS */ - }; -# endif /* __USE_LARGEFILE64 */ - -#else /* _MIPS_SIM != _ABIO32 */ - -struct stat - { -# ifdef __USE_TIME64_REDIRECTS -# include -# else - __dev_t st_dev; - int st_pad1[3]; /* Reserved for st_dev expansion */ -# ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; -# else - __ino64_t st_ino; -# endif - __mode_t st_mode; - __nlink_t st_nlink; - __uid_t st_uid; - __gid_t st_gid; - __dev_t st_rdev; -# if !defined __USE_FILE_OFFSET64 - unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */ - __off_t st_size; - int st_pad3; -# else - unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ - __off64_t st_size; -# endif -# ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif - __blksize_t st_blksize; - unsigned int st_pad4; -# ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; -# else - __blkcnt64_t st_blocks; -# endif - int st_pad5[14]; +#include +#include + +#if defined __USE_FILE_OFFSET64 +# define __field64(type, type64, name) type64 name +#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T +# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T +# error "ino_t and off_t must both be the same type" # endif +# define __field64(type, type64, name) type name +#elif __BYTE_ORDER == __LITTLE_ENDIAN +# define __field64(type, type64, name) \ + type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad +#else +# define __field64(type, type64, name) \ + int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name +#endif + +struct stat + { + __dev_t st_dev; /* Device. */ + __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ +#ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif + int __glibc_reserved[2]; }; +#undef __field64 + #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME64_REDIRECTS -# include -# else - __dev_t st_dev; - unsigned int st_pad1[3]; /* Reserved for st_dev expansion */ - __ino64_t st_ino; - __mode_t st_mode; - __nlink_t st_nlink; - __uid_t st_uid; - __gid_t st_gid; - __dev_t st_rdev; - unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ - __off64_t st_size; -# ifdef __USE_XOPEN2K8 + __dev_t st_dev; /* Device. */ + __ino64_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ +#ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the identifier 'timespec' to appear in the header. Therefore we have to handle the use of this header in strictly standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# else + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +#else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif - __blksize_t st_blksize; - unsigned int st_pad3; - __blkcnt64_t st_blocks; - int st_pad4[14]; -# endif /* __USE_TIME64_REDIRECTS */ -}; #endif - + int __glibc_reserved[2]; + }; #endif /* Tell code we have these members. */ #define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC #endif /* _BITS_STRUCT_STAT_H */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/syscall.h b/lib/libc/include/generic-glibc/bits/syscall.h index 43e6645f7d238e0805be9874cadff3bfd5889520..147cc816809c06a7ab8a79cb858b50c9aa869f05 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.17. */ +/* The system call list corresponds to kernel 7.1. */ #ifndef _SYSCALL_H # error "Never use directly; include instead." #endif -#define __GLIBC_LINUX_VERSION_CODE 397568 +#define __GLIBC_LINUX_VERSION_CODE 459008 #ifdef __NR_FAST_atomic_update # define SYS_FAST_atomic_update __NR_FAST_atomic_update @@ -883,6 +883,10 @@ # define SYS_listmount __NR_listmount #endif +#ifdef __NR_listns +# define SYS_listns __NR_listns +#endif + #ifdef __NR_listxattr # define SYS_listxattr __NR_listxattr #endif @@ -1899,6 +1903,10 @@ # define SYS_rseq __NR_rseq #endif +#ifdef __NR_rseq_slice_yield +# define SYS_rseq_slice_yield __NR_rseq_slice_yield +#endif + #ifdef __NR_rt_sigaction # define SYS_rt_sigaction __NR_rt_sigaction #endif @@ -2551,6 +2559,10 @@ # define SYS_unshare __NR_unshare #endif +#ifdef __NR_uprobe +# define SYS_uprobe __NR_uprobe +#endif + #ifdef __NR_uretprobe # define SYS_uretprobe __NR_uretprobe #endif diff --git a/lib/libc/include/generic-glibc/bits/timesize.h b/lib/libc/include/generic-glibc/bits/timesize.h index 114eea77753240de1509241efac873c28a59e9d0..dff2da5ed6bf30ce6f5580aee352e0958d58b623 100644 --- a/lib/libc/include/generic-glibc/bits/timesize.h +++ b/lib/libc/include/generic-glibc/bits/timesize.h @@ -1,5 +1,5 @@ -/* Bit size of the time_t type at glibc build time, Linux/MIPS. - Copyright (C) 2021-2026 Free Software Foundation, Inc. +/* Bit size of the time_t type at glibc build time, general case. + Copyright (C) 2018-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,5 @@ License along with the GNU C Library; if not, see . */ -#include - /* Size in bits of the 'time_t' type of the default ABI. */ -#define __TIMESIZE __WORDSIZE \ No newline at end of file +#define __TIMESIZE 64 \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/bits/uio-ext.h b/lib/libc/include/generic-glibc/bits/uio-ext.h index e65cf77f433fcc0e7b4ce718f10c093fcc1d2097..1289a864c6d7432bada85113026c2a94b66a0251 100644 --- a/lib/libc/include/generic-glibc/bits/uio-ext.h +++ b/lib/libc/include/generic-glibc/bits/uio-ext.h @@ -51,6 +51,7 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec, #define RWF_ATOMIC 0x00000040 /* Write is to be issued with torn-write prevention. */ #define RWF_DONTCACHE 0x00000080 /* Uncached buffered IO. */ +#define RWF_NOSIGNAL 0x00000100 /* Do not generate SIGPIPE on error. */ __END_DECLS diff --git a/lib/libc/include/generic-glibc/dlfcn.h b/lib/libc/include/generic-glibc/dlfcn.h index f12e3d68cd4e31c856a23e1c63bd5a2d6b597146..439f09dd9e3d8a5937343cc741a7778be646439b 100644 --- a/lib/libc/include/generic-glibc/dlfcn.h +++ b/lib/libc/include/generic-glibc/dlfcn.h @@ -167,7 +167,12 @@ enum the number of program headers in the array. */ RTLD_DI_PHDR = 11, - RTLD_DI_MAX = 11 + /* Treat ARG as `const char **' and at that location, store the address + of the directory name used to expand $ORIGIN in this shared object's + dependency file names. */ + RTLD_DI_ORIGIN_PATH = 12, + + RTLD_DI_MAX = 12 }; diff --git a/lib/libc/include/generic-glibc/elf.h b/lib/libc/include/generic-glibc/elf.h index a45dea41210184770afb26e837fb86f03d226b9a..ea2eca5e6dfbd1c0a63f9a90ddca67982061d64d 100644 --- a/lib/libc/include/generic-glibc/elf.h +++ b/lib/libc/include/generic-glibc/elf.h @@ -798,7 +798,8 @@ typedef struct #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ #define NT_X86_SHSTK 0x204 /* x86 SHSTK state */ #define NT_X86_XSAVE_LAYOUT 0x205 /* XSAVE layout description. */ -#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ +#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves. This was + used in now removed s390-32 arch. */ #define NT_S390_TIMER 0x301 /* s390 timer register */ #define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */ #define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ @@ -846,6 +847,7 @@ typedef struct #define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */ #define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged address control */ +#define NT_RISCV_USER_CFI 0x903 /* RISC-V shadow stack state */ #define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers. */ #define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and status registers. */ @@ -3470,7 +3472,9 @@ enum /* Valid values for the e_flags field. */ -#define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed. */ +#define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed. + This was used in now removed s390-32 + arch. */ /* Additional s390 relocs */ diff --git a/lib/libc/include/generic-glibc/features.h b/lib/libc/include/generic-glibc/features.h index 5ef3af3beb712cf7cbb02d380cc68ef6f1b18d4d..a248a324911cb478b02d7f95cc87f8f9d6408327 100644 --- a/lib/libc/include/generic-glibc/features.h +++ b/lib/libc/include/generic-glibc/features.h @@ -162,7 +162,7 @@ #undef __GLIBC_USE_DEPRECATED_SCANF #undef __GLIBC_USE_C23_STRTOL -/* Suppress kernel-name space pollution unless user expressedly asks +/* Suppress kernel-name space pollution unless user explicitly asks for it. */ #ifndef _LOOSE_KERNEL_NAMES # define __KERNEL_STRICT_NAMES @@ -580,4 +580,4 @@ #include -#endif /* features.h */ +#endif /* features.h */ \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/fts.h b/lib/libc/include/generic-glibc/fts.h index 97d0f4a8a299fb9f4e439232fc9e33cd851b605e..d2164aa4ee5b51b2bc8b2f46df54614b941a4dbb 100644 --- a/lib/libc/include/generic-glibc/fts.h +++ b/lib/libc/include/generic-glibc/fts.h @@ -52,7 +52,29 @@ #include #include +#include +#include +#include +enum { __I_RING_SIZE = 4 }; + +/* When ir_empty is true, the ring is empty. + Otherwise, ir_data[B..F] are defined, where B..F is the contiguous + range of indices, modulo I_RING_SIZE, from back to front, inclusive. + Undefined elements of ir_data are always set to ir_default_val. + Popping from an empty ring aborts. + Pushing onto a full ring returns the displaced value. + An empty ring has F==B and ir_empty == true. + A ring with one entry still has F==B, but now ir_empty == false. */ +struct __I_ring +{ + int ir_data[__I_RING_SIZE]; + int ir_default_val; + unsigned int ir_front; + unsigned int ir_back; + bool ir_empty; +}; +typedef struct __I_ring __I_ring; typedef struct { struct _ftsent *fts_cur; /* current node */ @@ -73,11 +95,106 @@ typedef struct { #define FTS_SEEDOT 0x0020 /* return dot and dot-dot */ #define FTS_XDEV 0x0040 /* don't cross devices */ #define FTS_WHITEOUT 0x0080 /* return whiteout information */ -#define FTS_OPTIONMASK 0x00ff /* valid user option mask */ + + /* There are two ways to detect cycles. + The lazy way (which works only with FTS_PHYSICAL), + with which one may process a directory that is a + part of the cycle several times before detecting the cycle. + The "tight" way, whereby fts uses more memory (proportional + to number of "active" directories, aka distance from root + of current tree to current directory -- see active_dir_ht) + to detect any cycle right away. For example, du must use + this option to avoid counting disk space in a cycle multiple + times, but chown -R need not. + The default is to use the constant-memory lazy way, when possible + (see below). + + However, with FTS_LOGICAL (when following symlinks, e.g., chown -L) + using lazy cycle detection is inadequate. For example, traversing + a directory containing a symbolic link to a peer directory, it is + possible to encounter the same directory twice even though there + is no cycle: + dir + ... + slink -> dir + So, when FTS_LOGICAL is selected, we have to use a different + mode of cycle detection: FTS_TIGHT_CYCLE_CHECK. */ +#define FTS_TIGHT_CYCLE_CHECK 0x0400 + + /* Use this flag to enable semantics with which the parent + application may be made both more efficient and more robust. + Whereas the default is to visit each directory in a recursive + traversal (via chdir), using this flag makes it so the initial + working directory is never changed. Instead, these functions + perform the traversal via a virtual working directory, maintained + through the file descriptor member, fts_cwd_fd. */ +# define FTS_CWDFD 0x0800 + + /* Historically, for each directory that fts initially encounters, it would + open it, read all entries, and stat each entry, storing the results, and + then it would process the first entry. But that behavior is bad for + locality of reference, and also causes trouble with inode-simulating + file systems like FAT, CIFS, FUSE-based ones, etc., when entries from + their name/inode cache are flushed too early. + Use this flag to make fts_open and fts_read defer the stat/lstat/fststat + of each entry until it is actually processed. However, note that if you + use this option and also specify a comparison function, that function may + not examine any data via fts_statp. However, when fts_statp->st_mode is + nonzero, the S_IFMT type bits are valid, with mapped dirent.d_type data. + Of course, that happens only on file systems that provide useful + dirent.d_type data. */ +#define FTS_DEFER_STAT 0x1000 + + /* Use this flag to disable stripping of trailing slashes + from input path names during fts_open initialization. */ +#define FTS_VERBATIM 0x2000 + +#define FTS_MOUNT 0x4000 /* skip other devices */ +#define FTS_OPTIONMASK 0x7fff /* valid user option mask */ #define FTS_NAMEONLY 0x0100 /* (private) child names only */ #define FTS_STOP 0x0200 /* (private) unrecoverable error */ + int fts_options; /* fts_open options, global flags */ + + int fts_cwd_fd; /* the file descriptor on which the + virtual cwd is open, or AT_FDCWD */ + + /* Map a directory's device number to a boolean. The boolean is + true if for that file system (type determined by a single fstatfs + call per FS) st_nlink can be used to calculate the number of + sub-directory entries in a directory. + Using this table is an optimization that permits us to look up + file system type on a per-inode basis at the minimal cost of + calling fstatfs only once per traversed device. */ + struct hash_table *fts_leaf_optimization_works_ht; + + union { + /* This data structure is used if FTS_TIGHT_CYCLE_CHECK is + specified. It records the directories between a starting + point and the current directory. I.e., a directory is + recorded here IFF we have visited it once, but we have not + yet completed processing of all its entries. Every time we + visit a new directory, we add that directory to this set. + When we finish with a directory (usually by visiting it a + second time), we remove it from this set. Each entry in + this data structure is a device/inode pair. This data + structure is used to detect directory cycles efficiently and + promptly even when the depth of a hierarchy is in the tens + of thousands. */ + struct hash_table *ht; + + /* FIXME: rename these two members to have the fts_ prefix */ + /* This data structure uses a lazy cycle-detection algorithm, + as done by rm via cycle-check.c. It's the default, + but it's not appropriate for programs like du. */ + struct cycle_check_state *state; + } fts_cycle; + + /* A stack of the file descriptors corresponding to the + most-recently traversed parent directories. + Currently used only in FTS_CWDFD mode. */ + __I_ring fts_fd_ring; } FTS; #ifdef __USE_LARGEFILE64 @@ -92,6 +209,13 @@ typedef struct { int fts_nitems; /* elements in the sort array */ int (*fts_compar) (const void *, const void *); /* compare fn */ int fts_options; /* fts_open options, global flags */ + int fts_cwd_fd; + struct hash_table *fts_leaf_optimization_works_ht; + union { + struct hash_table *ht; + struct cycle_check_state *state; + } fts_cycle; + __I_ring fts_fd_ring; } FTS64; #endif diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-32.h b/lib/libc/include/generic-glibc/gnu/lib-names-32.h index 77fbbc46100d7b2fcad49cb67f4af22df471f3a3..33f2700fb049c9de98b511c395753670af4df99b 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-32.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-32.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-hard.h index 393a0f91f49473362cb28026ea93f876f41da4c9..80f8b2e87ee57205b72076031c8e4711617647e2 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-hard.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h index 2d2d46e4f5c3b76030cf34eb89a95f1debf40f27..09f068b64409436bd6e070b7f4642a596bb5907d 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-n32_hard.h @@ -23,4 +23,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h index 3d545313911cc42780f3f625b29e4b6078dd4c4e..caed888c6bd100ca1c0627bd0bdfba5146140775 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-n64_hard.h @@ -23,4 +23,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h b/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h index ab69cdcb7cfa958560ef796ba6f94a50398448dd..592d60dd33b5df50b16200332cf576666c2adf58 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-o32_hard.h @@ -23,4 +23,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-o32_soft.h b/lib/libc/include/generic-glibc/gnu/lib-names-o32_soft.h index 9be4d1e62012f6c7ce0ce5ed579989a65c795c7f..5ae29e9fb109b3f2bdfe275ae1a829769d66b0fb 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-o32_soft.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-o32_soft.h @@ -23,4 +23,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/lib-names-soft.h b/lib/libc/include/generic-glibc/gnu/lib-names-soft.h index c7a71323508f709975e8cb9f792dd2f928a275a3..fa665583dd54d5e8c17f2423181476fd94412be8 100644 --- a/lib/libc/include/generic-glibc/gnu/lib-names-soft.h +++ b/lib/libc/include/generic-glibc/gnu/lib-names-soft.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/gnu/stubs-64.h b/lib/libc/include/generic-glibc/gnu/stubs-64.h deleted file mode 100644 index 636dc73283f9e3508fca4713d7d911f47d284387..0000000000000000000000000000000000000000 --- a/lib/libc/include/generic-glibc/gnu/stubs-64.h +++ /dev/null @@ -1,16 +0,0 @@ -/* This file is automatically generated. - It defines a symbol `__stub_FUNCTION' for each function - in the C library which is a stub, meaning it will fail - every time called, usually setting errno to ENOSYS. */ - -#ifdef _LIBC - #error Applications may not define the macro _LIBC -#endif - -#define __stub_chflags -#define __stub_fchflags -#define __stub_gtty -#define __stub_revoke -#define __stub_setlogin -#define __stub_sigreturn -#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/generic-glibc/netinet/in.h b/lib/libc/include/generic-glibc/netinet/in.h index 450338576f11be16bcf50d09d016d593f9ab5ca7..68b2016cdec8019a5e061dce477e6b1a69d3443e 100644 --- a/lib/libc/include/generic-glibc/netinet/in.h +++ b/lib/libc/include/generic-glibc/netinet/in.h @@ -91,6 +91,8 @@ enum #define IPPROTO_MPLS IPPROTO_MPLS IPPROTO_ETHERNET = 143, /* Ethernet-within-IPv6 Encapsulation. */ #define IPPROTO_ETHERNET IPPROTO_ETHERNET + IPPROTO_AGGFRAG = 144, /* AGGFRAG in ESP (RFC 9347). */ +#define IPPROTO_AGGFRAG IPPROTO_AGGFRAG IPPROTO_RAW = 255, /* Raw IP packets. */ #define IPPROTO_RAW IPPROTO_RAW IPPROTO_SMC = 256, /* Shared Memory Communications. */ diff --git a/lib/libc/include/generic-glibc/netinet/tcp.h b/lib/libc/include/generic-glibc/netinet/tcp.h index 49764361e72d032438c000c278a16c8f77bbc555..ae66195fa6dc6b8181e6d4ad4092806a14295d33 100644 --- a/lib/libc/include/generic-glibc/netinet/tcp.h +++ b/lib/libc/include/generic-glibc/netinet/tcp.h @@ -80,6 +80,9 @@ as a cmsg on read. */ #define TCP_CM_INQ TCP_INQ #define TCP_TX_DELAY 37 /* Delay outgoing packets by XX usec. */ +#define TCP_RTO_MAX_MS 44 /* Max time to retransmit (msec). */ +#define TCP_RTO_MIN_US 45 /* Min time to retransmit (usec). */ +#define TCP_DELACK_MAX_US 46 /* Max delayed ack time (usec). */ #define TCP_REPAIR_ON 1 #define TCP_REPAIR_OFF 0 @@ -226,6 +229,24 @@ enum tcp_ca_state TCP_CA_Loss = 4 }; +/* Values for tcpi_ecn_mode after negotiation. */ +#define TCPI_ECN_MODE_DISABLED 0x0 +#define TCPI_ECN_MODE_RFC3168 0x1 +#define TCPI_ECN_MODE_ACCECN 0x2 +#define TCPI_ECN_MODE_PENDING 0x3 + +/* Values for tcpi_accecn_opt_seen. */ +#define TCP_ACCECN_OPT_NOT_SEEN 0x0 +#define TCP_ACCECN_OPT_EMPTY_SEEN 0x1 +#define TCP_ACCECN_OPT_COUNTER_SEEN 0x2 +#define TCP_ACCECN_OPT_FAIL_SEEN 0x3 + +/* Values for tcpi_accecn_fail_mode. */ +#define TCP_ACCECN_ACE_FAIL_SEND 0x1 +#define TCP_ACCECN_ACE_FAIL_RECV 0x2 +#define TCP_ACCECN_OPT_FAIL_SEND 0x4 +#define TCP_ACCECN_OPT_FAIL_RECV 0x8 + struct tcp_info { uint8_t tcpi_state; @@ -319,8 +340,10 @@ struct tcp_info uint32_t tcpi_received_e1_bytes; uint32_t tcpi_received_e0_bytes; uint32_t tcpi_received_ce_bytes; - uint16_t tcpi_accecn_fail_mode; - uint16_t tcpi_accecn_opt_seen; + uint32_t tcpi_ecn_mode:2, + tcpi_accecn_opt_seen:2, + tcpi_accecn_fail_mode:4, + tcpi_options2:24; }; /* Netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */ diff --git a/lib/libc/include/generic-glibc/regex.h b/lib/libc/include/generic-glibc/regex.h index 29964af5b251c24a729a3326c173a0ae96455d96..5ff2fb611c92f20565163ee3430e43348665c37c 100644 --- a/lib/libc/include/generic-glibc/regex.h +++ b/lib/libc/include/generic-glibc/regex.h @@ -74,7 +74,7 @@ typedef unsigned long int reg_syntax_t; #ifdef __USE_GNU /* If this bit is not set, then \ inside a bracket expression is literal. If set, then such a \ quotes the following character. */ -# define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1) +# define RE_BACKSLASH_ESCAPE_IN_LISTS 1ul /* If this bit is not set, then + and ? are operators, and \+ and \? are literals. diff --git a/lib/libc/include/generic-glibc/spawn.h b/lib/libc/include/generic-glibc/spawn.h index b8e1eaee8f8c1432cb21fb069d2134573536827e..265a63ca28b30e0822fe9cf86e2214ec9de3cf3e 100644 --- a/lib/libc/include/generic-glibc/spawn.h +++ b/lib/libc/include/generic-glibc/spawn.h @@ -200,6 +200,26 @@ extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t * int __fd, int __newfd) __THROW __nonnull ((1)); +#ifdef __USE_XOPEN2K24XSI + +/* Add an action changing the directory to PATH during spawn. This + affects the subsequent file actions. + Alias of posix_spawn_file_actions_addchdir_np. */ +extern int __REDIRECT_NTH (posix_spawn_file_actions_addchdir, + (posix_spawn_file_actions_t * __restrict __actions, + const char *__restrict __path), + posix_spawn_file_actions_addchdir_np); + +/* Add an action changing the directory to FD during spawn. This + affects the subsequent file actions. FD is not duplicated and must + be open when the file action is executed. + Alias of posix_spawn_file_actions_addfchdir_np. */ +extern int __REDIRECT_NTH (posix_spawn_file_actions_addfchdir, + (posix_spawn_file_actions_t *, int __fd), + posix_spawn_file_actions_addfchdir_np); + +#endif /* __USE_XOPEN2K24XSI */ + #ifdef __USE_MISC /* Add an action changing the directory to PATH during spawn. This affects the subsequent file actions. */ diff --git a/lib/libc/include/generic-glibc/stdlib.h b/lib/libc/include/generic-glibc/stdlib.h index 3ca2bb1f91bc38a0f6244c99113a3fb520f15b20..7d8d57f4cd907c77714fefe6615acf92624080cb 100644 --- a/lib/libc/include/generic-glibc/stdlib.h +++ b/lib/libc/include/generic-glibc/stdlib.h @@ -1225,4 +1225,4 @@ extern size_t memalignment (const void *__p); __END_DECLS -#endif /* stdlib.h */ +#endif /* stdlib.h */ \ 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 bf226f5a738b6369caba0558d98357d3cb06e975..95834f8bf77e7fb2dbcb33fdb69ea81197335d5e 100644 --- a/lib/libc/include/generic-glibc/sys/mount.h +++ b/lib/libc/include/generic-glibc/sys/mount.h @@ -21,7 +21,6 @@ #ifndef _SYS_MOUNT_H #define _SYS_MOUNT_H 1 -#include #include #include #include @@ -190,6 +189,11 @@ enum /* fsmount flags. */ #define FSMOUNT_CLOEXEC 0x00000001 +// zig patch: check target glibc version +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 +#define FSMOUNT_NAMESPACE 0x00000002 /* Create the mount in a new mount + namespace. */ +#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 */ /* mount attributes used on fsmount. */ #define MOUNT_ATTR_RDONLY 0x00000001 /* Mount read-only. */ @@ -267,10 +271,20 @@ enum fsconfig_command #define FSOPEN_CLOEXEC 0x00000001 /* open_tree flags. */ -#define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */ -#define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */ +#ifndef OPEN_TREE_CLONE +# define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */ +#endif +#define OPEN_TREE_NAMESPACE (1 << 1) /* Clone the target tree into a new mount + namespace */ +#ifndef O_CLOEXEC +# include +# define O_CLOEXEC __O_CLOEXEC +#endif +#ifndef OPEN_TREE_CLOEXEC +# define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */ +#endif -#endif +#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2 */ __BEGIN_DECLS diff --git a/lib/libc/include/generic-glibc/sys/pidfd.h b/lib/libc/include/generic-glibc/sys/pidfd.h index 3d9ab9430c72d2b947860d9fa6b9525a6ebc11aa..19ac5235e5868de39a7a0659b8da9d122467bb8f 100644 --- a/lib/libc/include/generic-glibc/sys/pidfd.h +++ b/lib/libc/include/generic-glibc/sys/pidfd.h @@ -64,6 +64,15 @@ #define PIDFD_INFO_EXIT (1UL << 3) /* Only returned if requested. */ #define PIDFD_INFO_COREDUMP (1UL << 4) +// zig patch: check target glibc version +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 +/* Want/got supported mask flags */ +#define PIDFD_INFO_SUPPORTED_MASK (1UL << 5) +/* Always returned if PIDFD_INFO_COREDUMP is requested. */ +#define PIDFD_INFO_COREDUMP_SIGNAL (1UL << 6) +/* Always returned if PIDFD_INFO_COREDUMP is requested. */ +#define PIDFD_INFO_COREDUMP_CODE (1UL << 7) +#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 */ /* Value for coredump_mask in pidfd_info. Only valid if PIDFD_INFO_COREDUMP @@ -95,11 +104,28 @@ struct pidfd_info __uint32_t fsgid; __int32_t exit_code; __uint32_t coredump_mask; +// zig patch: check target glibc version +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 + __uint32_t coredump_signal; + __uint32_t coredump_code; + __uint32_t coredump_pad; + __uint64_t supported_mask; +#else __uint32_t __spare1; +#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 */ }; /* sizeof first published struct */ #define PIDFD_INFO_SIZE_VER0 64 +// zig patch: check target glibc version +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 +/* sizeof second published struct */ +#define PIDFD_INFO_SIZE_VER1 72 +/* sizeof third published struct */ +#define PIDFD_INFO_SIZE_VER2 80 +/* sizeof fourth published struct */ +#define PIDFD_INFO_SIZE_VER3 88 +#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 44) || __GLIBC__ > 2 */ #define PIDFD_GET_INFO _IOWR(PIDFS_IOCTL_MAGIC, 11, struct pidfd_info) diff --git a/lib/libc/include/generic-glibc/sys/platform/ppc.h b/lib/libc/include/generic-glibc/sys/platform/ppc.h deleted file mode 100644 index 6e7df94235d78f7b3ad6c8644301f8d0441a264e..0000000000000000000000000000000000000000 --- a/lib/libc/include/generic-glibc/sys/platform/ppc.h +++ /dev/null @@ -1,146 +0,0 @@ -/* Facilities specific to the PowerPC architecture - Copyright (C) 2012-2026 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 _SYS_PLATFORM_PPC_H -#define _SYS_PLATFORM_PPC_H 1 - -#include -#include -#include - -/* Read the Time Base Register. */ -static __inline__ uint64_t -__ppc_get_timebase (void) -{ -#if __GNUC_PREREQ (4, 8) - return __builtin_ppc_get_timebase (); -#else -# ifdef __powerpc64__ - uint64_t __tb; - /* "volatile" is necessary here, because the user expects this assembly - isn't moved after an optimization. */ - __asm__ volatile ("mfspr %0, 268" : "=r" (__tb)); - return __tb; -# else /* not __powerpc64__ */ - uint32_t __tbu, __tbl, __tmp; \ - __asm__ volatile ("0:\n\t" - "mftbu %0\n\t" - "mftbl %1\n\t" - "mftbu %2\n\t" - "cmpw %0, %2\n\t" - "bne- 0b" - : "=r" (__tbu), "=r" (__tbl), "=r" (__tmp)); - return (((uint64_t) __tbu << 32) | __tbl); -# endif /* not __powerpc64__ */ -#endif -} - -/* The following functions provide hints about the usage of shared processor - resources, as defined in ISA 2.06 and newer. */ - -/* Provides a hint that performance will probably be improved if shared - resources dedicated to the executing processor are released for use by other - processors. */ -static __inline__ void -__ppc_yield (void) -{ - __asm__ volatile ("or 27,27,27"); -} - -/* Provides a hint that performance will probably be improved if shared - resources dedicated to the executing processor are released until - all outstanding storage accesses to caching-inhibited storage have been - completed. */ -static __inline__ void -__ppc_mdoio (void) -{ - __asm__ volatile ("or 29,29,29"); -} - -/* Provides a hint that performance will probably be improved if shared - resources dedicated to the executing processor are released until all - outstanding storage accesses to cacheable storage for which the data is not - in the cache have been completed. */ -static __inline__ void -__ppc_mdoom (void) -{ - __asm__ volatile ("or 30,30,30"); -} - - -/* ISA 2.05 and beyond support the Program Priority Register (PPR) to adjust - thread priorities based on lock acquisition, wait and release. The ISA - defines the use of form 'or Rx,Rx,Rx' as the way to modify the PRI field. - The unprivileged priorities are: - Rx = 1 (low) - Rx = 2 (medium) - Rx = 6 (medium-low/normal) - The 'or' instruction form is a nop in previous hardware, so it is safe to - use unguarded. The default value is 'medium'. - */ - -static __inline__ void -__ppc_set_ppr_med (void) -{ - __asm__ volatile ("or 2,2,2"); -} - -static __inline__ void -__ppc_set_ppr_med_low (void) -{ - __asm__ volatile ("or 6,6,6"); -} - -static __inline__ void -__ppc_set_ppr_low (void) -{ - __asm__ volatile ("or 1,1,1"); -} - -/* Power ISA 2.07 (Book II, Chapter 3) extends the priorities that can be set - to the Program Priority Register (PPR). The form 'or Rx,Rx,Rx' is used to - modify the PRI field of the PPR, the same way as described above. - The new priority levels are: - Rx = 31 (very low) - Rx = 5 (medium high) - Any program can set the priority to very low, low, medium low, and medium, - as these are unprivileged. - The medium high priority, on the other hand, is privileged, and may only be - set during certain time intervals by problem-state programs. If the program - priority is medium high when the time interval expires or if an attempt is - made to set the priority to medium high when it is not allowed, the PRI - field is set to medium. - */ - -#ifdef _ARCH_PWR8 - -static __inline__ void -__ppc_set_ppr_very_low (void) -{ - __asm__ volatile ("or 31,31,31"); -} - -static __inline__ void -__ppc_set_ppr_med_high (void) -{ - __asm__ volatile ("or 5,5,5"); -} - -#endif - -#endif /* sys/platform/ppc.h */ \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/bits/hwcap.h b/lib/libc/include/loongarch-linux-gnu/bits/hwcap.h index d6335ffaa97c3c61cd1452cd3f01b8fc0903aa9d..72f26b63da5cbca1bac2ca0cbce6d3ff5f21c398 100644 --- a/lib/libc/include/loongarch-linux-gnu/bits/hwcap.h +++ b/lib/libc/include/loongarch-linux-gnu/bits/hwcap.h @@ -36,4 +36,6 @@ #define HWCAP_LOONGARCH_LBT_ARM (1 << 11) #define HWCAP_LOONGARCH_LBT_MIPS (1 << 12) #define HWCAP_LOONGARCH_PTW (1 << 13) -#define HWCAP_LOONGARCH_LSPW (1 << 14) \ No newline at end of file +#define HWCAP_LOONGARCH_LSPW (1 << 14) +#define HWCAP_LOONGARCH_SCQ (1 << 15) +#define HWCAP_LOONGARCH_LAM_BH (1 << 16) \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/bits/long-double.h b/lib/libc/include/loongarch-linux-gnu/bits/long-double.h deleted file mode 100644 index af7784dbe6dd85cd9538b5a7b437ab45de22eeb8..0000000000000000000000000000000000000000 --- a/lib/libc/include/loongarch-linux-gnu/bits/long-double.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Properties of long double type. ldbl-128 version. - Copyright (C) 2016-2026 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 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 - . */ - -/* long double is distinct from double, so there is nothing to - define here. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/bits/struct_stat.h b/lib/libc/include/loongarch-linux-gnu/bits/struct_stat.h deleted file mode 100644 index 0462d37a6849812f485a6830a7c0dca303332636..0000000000000000000000000000000000000000 --- a/lib/libc/include/loongarch-linux-gnu/bits/struct_stat.h +++ /dev/null @@ -1,127 +0,0 @@ -/* Definition for struct stat. - Copyright (C) 2020-2026 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 - . */ - -#if !defined _SYS_STAT_H && !defined _FCNTL_H -# error "Never include directly; use instead." -#endif - -#ifndef _BITS_STRUCT_STAT_H -#define _BITS_STRUCT_STAT_H 1 - -#include -#include - -#if defined __USE_FILE_OFFSET64 -# define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T -# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T -# error "ino_t and off_t must both be the same type" -# endif -# define __field64(type, type64, name) type name -#elif __BYTE_ORDER == __LITTLE_ENDIAN -# define __field64(type, type64, name) \ - type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad -#else -# define __field64(type, type64, name) \ - int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name -#endif - -struct stat - { - __dev_t st_dev; /* Device. */ - __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __dev_t __pad1; - __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - int __pad2; - __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - int __glibc_reserved[2]; - }; - -#undef __field64 - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - __dev_t st_dev; /* Device. */ - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __dev_t __pad1; - __off64_t st_size; /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - int __pad2; - __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - int __glibc_reserved[2]; - }; -#endif - -/* Tell code we have these members. */ -#define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV -/* Nanosecond resolution time values are supported. */ -#define _STATBUF_ST_NSEC - -#endif /* _BITS_STRUCT_STAT_H */ \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/bits/timesize.h b/lib/libc/include/loongarch-linux-gnu/bits/timesize.h deleted file mode 100644 index dff2da5ed6bf30ce6f5580aee352e0958d58b623..0000000000000000000000000000000000000000 --- a/lib/libc/include/loongarch-linux-gnu/bits/timesize.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Bit size of the time_t type at glibc build time, general case. - Copyright (C) 2018-2026 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 - . */ - -/* Size in bits of the 'time_t' type of the default ABI. */ -#define __TIMESIZE 64 \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/bits/wordsize.h b/lib/libc/include/loongarch-linux-gnu/bits/wordsize.h index 5038df494751b3446f652bcb4d1c5d3e721a61ec..d4d561400b42e6e7004737b99bd8d82f6dc2a4f7 100644 --- a/lib/libc/include/loongarch-linux-gnu/bits/wordsize.h +++ b/lib/libc/include/loongarch-linux-gnu/bits/wordsize.h @@ -15,5 +15,16 @@ License along with the GNU C Library; if not, see . */ -#define __WORDSIZE 64 -#define __WORDSIZE_TIME64_COMPAT32 0 \ No newline at end of file +// zig patch: handle 32-bit and 64-bit in the same header +#if __loongarch_grlen == (__SIZEOF_POINTER__ * 8) +# define __WORDSIZE __loongarch_grlen +#else +# error unsupported ABI +#endif + +#define __WORDSIZE_TIME64_COMPAT32 0 + +#if __WORDSIZE == 32 +# define __WORDSIZE32_SIZE_ULONG 0 +# define __WORDSIZE32_PTRDIFF_LONG 0 +#endif diff --git a/lib/libc/include/loongarch-linux-gnu/fpu_control.h b/lib/libc/include/loongarch-linux-gnu/fpu_control.h index 69cd4213c79b5db9e6c6ec60dc454c8177c8ba6d..2a2354d760dcfaa389df58e0a942d4a679994387 100644 --- a/lib/libc/include/loongarch-linux-gnu/fpu_control.h +++ b/lib/libc/include/loongarch-linux-gnu/fpu_control.h @@ -94,6 +94,15 @@ extern void __loongarch_fpu_setcw (fpu_control_t) __THROW; #define _FPU_GETCW(cw) __asm__ volatile ("movfcsr2gr %0,$fcsr0" : "=r"(cw)) #define _FPU_SETCW(cw) __asm__ volatile ("movgr2fcsr $fcsr0,%0" : : "r"(cw)) +#define _FPU_GET_ENABLES(cw) __asm__ volatile ("movfcsr2gr %0,$fcsr1" : "=r"(cw)) +#define _FPU_SET_ENABLES(cw) __asm__ volatile ("movgr2fcsr $fcsr1,%0" : : "r"(cw)) + +#define _FPU_GET_FLAGS_CAUSE(cw) __asm__ volatile ("movfcsr2gr %0,$fcsr2" : "=r"(cw)) +#define _FPU_SET_FLAGS_CAUSE(cw) __asm__ volatile ("movgr2fcsr $fcsr2,%0" : : "r"(cw)) + +#define _FPU_GET_RM(cw) __asm__ volatile ("movfcsr2gr %0,$fcsr3" : "=r"(cw)) +#define _FPU_SET_RM(cw) __asm__ volatile ("movgr2fcsr $fcsr3,%0" : : "r"(cw)) + /* Default control word set at startup. */ extern fpu_control_t __fpu_control; diff --git a/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-ilp32d.h b/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-ilp32d.h new file mode 100644 index 0000000000000000000000000000000000000000..f0780d70ef3f21f2e1cefa6f15f2bbc34c5ec651 --- /dev/null +++ b/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-ilp32d.h @@ -0,0 +1,28 @@ +/* This file is automatically generated. */ +#ifndef __GNU_LIB_NAMES_H +# error "Never use directly; include instead." +#endif + +#define LD_LINUX_LOONGARCH_ILP32D_SO "ld-linux-loongarch-ilp32d.so.1" +#define LD_SO "ld-linux-loongarch-ilp32d.so.1" +#define LIBANL_SO "libanl.so.1" +#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" +#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" +#define LIBC_SO "libc.so.6" +#define LIBDL_SO "libdl.so.2" +#define LIBGCC_S_SO "libgcc_s.so.1" +#define LIBMVEC_SO "libmvec.so.1" +#define LIBM_SO "libm.so.6" +#define LIBNSL_SO "libnsl.so.1" +#define LIBNSS_COMPAT_SO "libnss_compat.so.2" +#define LIBNSS_DB_SO "libnss_db.so.2" +#define LIBNSS_DNS_SO "libnss_dns.so.2" +#define LIBNSS_FILES_SO "libnss_files.so.2" +#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" +#define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBPTHREAD_SO "libpthread.so.0" +#define LIBRESOLV_SO "libresolv.so.2" +#define LIBRT_SO "librt.so.1" +#define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" +#define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-ilp32s.h b/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-ilp32s.h new file mode 100644 index 0000000000000000000000000000000000000000..012654c98f178fc1163e564175ccf9aee4521874 --- /dev/null +++ b/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-ilp32s.h @@ -0,0 +1,28 @@ +/* This file is automatically generated. */ +#ifndef __GNU_LIB_NAMES_H +# error "Never use directly; include instead." +#endif + +#define LD_LINUX_LOONGARCH_ILP32S_SO "ld-linux-loongarch-ilp32s.so.1" +#define LD_SO "ld-linux-loongarch-ilp32s.so.1" +#define LIBANL_SO "libanl.so.1" +#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" +#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" +#define LIBC_SO "libc.so.6" +#define LIBDL_SO "libdl.so.2" +#define LIBGCC_S_SO "libgcc_s.so.1" +#define LIBMVEC_SO "libmvec.so.1" +#define LIBM_SO "libm.so.6" +#define LIBNSL_SO "libnsl.so.1" +#define LIBNSS_COMPAT_SO "libnss_compat.so.2" +#define LIBNSS_DB_SO "libnss_db.so.2" +#define LIBNSS_DNS_SO "libnss_dns.so.2" +#define LIBNSS_FILES_SO "libnss_files.so.2" +#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" +#define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBPTHREAD_SO "libpthread.so.0" +#define LIBRESOLV_SO "libresolv.so.2" +#define LIBRT_SO "librt.so.1" +#define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" +#define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-lp64d.h b/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-lp64d.h index 8f030679c89545ea0ac048e744799051778f0b2c..000df5a7ec275335f903b9ce6a53861189deeca6 100644 --- a/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-lp64d.h +++ b/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-lp64d.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-lp64s.h b/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-lp64s.h index 7c8b796194b2f179d2dfddbd0a7040a76ba37aeb..0a812d367cac3923d148b019ece28f5698001930 100644 --- a/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-lp64s.h +++ b/lib/libc/include/loongarch-linux-gnu/gnu/lib-names-lp64s.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/gnu/lib-names.h b/lib/libc/include/loongarch-linux-gnu/gnu/lib-names.h index c3eba41e095a1705b8478909b27017a74c8a7ff5..d7367183c2d250b519e7fc3018c51b7751930f2e 100644 --- a/lib/libc/include/loongarch-linux-gnu/gnu/lib-names.h +++ b/lib/libc/include/loongarch-linux-gnu/gnu/lib-names.h @@ -6,6 +6,12 @@ #include +#if __WORDSIZE == 32 && defined __loongarch_soft_float +# include +#endif +#if __WORDSIZE == 32 && defined __loongarch_double_float +# include +#endif #if __WORDSIZE == 64 && defined __loongarch_soft_float # include #endif diff --git a/lib/libc/include/loongarch-linux-gnu/gnu/stubs-ilp32d.h b/lib/libc/include/loongarch-linux-gnu/gnu/stubs-ilp32d.h new file mode 100644 index 0000000000000000000000000000000000000000..4c2911dd6d66a591544d5c76448086f5de7b36d5 --- /dev/null +++ b/lib/libc/include/loongarch-linux-gnu/gnu/stubs-ilp32d.h @@ -0,0 +1,21 @@ +/* This file is automatically generated. + It defines a symbol `__stub_FUNCTION' for each function + in the C library which is a stub, meaning it will fail + every time called, usually setting errno to ENOSYS. */ + +#ifdef _LIBC + #error Applications may not define the macro _LIBC +#endif + +#define __stub___compat_bdflush +#define __stub___compat_create_module +#define __stub___compat_get_kernel_syms +#define __stub___compat_query_module +#define __stub___compat_uselib +#define __stub_chflags +#define __stub_fchflags +#define __stub_gtty +#define __stub_revoke +#define __stub_setlogin +#define __stub_sigreturn +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/gnu/stubs-ilp32s.h b/lib/libc/include/loongarch-linux-gnu/gnu/stubs-ilp32s.h new file mode 100644 index 0000000000000000000000000000000000000000..6ce02418e69609f4642a522910708769e96d6ee9 --- /dev/null +++ b/lib/libc/include/loongarch-linux-gnu/gnu/stubs-ilp32s.h @@ -0,0 +1,38 @@ +/* This file is automatically generated. + It defines a symbol `__stub_FUNCTION' for each function + in the C library which is a stub, meaning it will fail + every time called, usually setting errno to ENOSYS. */ + +#ifdef _LIBC + #error Applications may not define the macro _LIBC +#endif + +#define __stub___compat_bdflush +#define __stub___compat_create_module +#define __stub___compat_get_kernel_syms +#define __stub___compat_query_module +#define __stub___compat_uselib +#define __stub_chflags +#define __stub_fchflags +#define __stub_feclearexcept +#define __stub_fedisableexcept +#define __stub_feenableexcept +#define __stub_fegetenv +#define __stub_fegetexcept +#define __stub_fegetexceptflag +#define __stub_fegetmode +#define __stub_fegetround +#define __stub_feholdexcept +#define __stub_feraiseexcept +#define __stub_fesetenv +#define __stub_fesetexcept +#define __stub_fesetexceptflag +#define __stub_fesetmode +#define __stub_fesetround +#define __stub_fetestexcept +#define __stub_feupdateenv +#define __stub_gtty +#define __stub_revoke +#define __stub_setlogin +#define __stub_sigreturn +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/loongarch-linux-gnu/gnu/stubs.h b/lib/libc/include/loongarch-linux-gnu/gnu/stubs.h index ea3f10c4213c01ccc0c0dd0fd9aef9b114ddf0cd..694ca60a5bfeabaa4e0ea8b594839408d21be11d 100644 --- a/lib/libc/include/loongarch-linux-gnu/gnu/stubs.h +++ b/lib/libc/include/loongarch-linux-gnu/gnu/stubs.h @@ -4,6 +4,12 @@ #include +#if __WORDSIZE == 32 && defined __loongarch_soft_float +# include +#endif +#if __WORDSIZE == 32 && defined __loongarch_double_float +# include +#endif #if __WORDSIZE == 64 && defined __loongarch_soft_float # include #endif diff --git a/lib/libc/include/loongarch-linux-gnu/sys/asm.h b/lib/libc/include/loongarch-linux-gnu/sys/asm.h index 973feb6effa26ea10d6b1af85ce2784a32ec8135..17465154a3ebe02d36cdf4b013c23acad75a58d4 100644 --- a/lib/libc/include/loongarch-linux-gnu/sys/asm.h +++ b/lib/libc/include/loongarch-linux-gnu/sys/asm.h @@ -23,10 +23,8 @@ #include /* Macros to handle different pointer/register sizes for 32/64-bit code. */ +#if __loongarch_grlen == 64 #define SZREG 8 -#define SZFREG 8 -#define SZVREG 16 -#define SZXREG 32 #define REG_L ld.d #define REG_S st.d #define SRLI srli.d @@ -34,10 +32,38 @@ #define ADDI addi.d #define ADD add.d #define SUB sub.d -#define BSTRINS bstrins.d #define LI li.d -#define FREG_L fld.d -#define FREG_S fst.d +#define BSTRINS bstrins.d + +#elif __loongarch_grlen == 32 + +#define SZREG 4 +#define REG_L ld.w +#define REG_S st.w +#define SRLI srli.w +#define SLLI slli.w +#define ADDI addi.w +#define ADD add.w +#define SUB sub.w +#define LI li.w +#define BSTRINS bstrins.w + +#else +#error __loongarch_grlen must equal 32 or 64 +#endif + +#if __loongarch_frlen == 64 + #define SZFREG 8 + #define FREG_L fld.d + #define FREG_S fst.d +#elif __loongarch_frlen == 32 + #define SZFREG 4 + #define FREG_L fld.s + #define FREG_S fst.s +#endif + +#define SZVREG 16 +#define SZXREG 32 /* Declare leaf routine. The usage of macro LEAF/ENTRY is as follows: diff --git a/lib/libc/include/m68k-linux-gnu/gnu/lib-names.h b/lib/libc/include/m68k-linux-gnu/gnu/lib-names.h index f72e37a69b31d263771248ddb6141300af975b2e..82aba9b01dc90b844da3f9efb076aa950cc5e348 100644 --- a/lib/libc/include/m68k-linux-gnu/gnu/lib-names.h +++ b/lib/libc/include/m68k-linux-gnu/gnu/lib-names.h @@ -24,6 +24,7 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" #endif /* gnu/lib-names.h */ \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/long-double.h b/lib/libc/include/mips-linux-gnu/bits/long-double.h new file mode 100644 index 0000000000000000000000000000000000000000..ebf6ac878fbf42241d0b2bcaf8c6049d08d827c5 --- /dev/null +++ b/lib/libc/include/mips-linux-gnu/bits/long-double.h @@ -0,0 +1,24 @@ +/* Properties of long double type. MIPS version. + Copyright (C) 2016-2026 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 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 + . */ + +#include + +#if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32 +# define __NO_LONG_DOUBLE_MATH 1 +#endif +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/struct_stat.h b/lib/libc/include/mips-linux-gnu/bits/struct_stat.h new file mode 100644 index 0000000000000000000000000000000000000000..231c875e7ab2c703e50746e2191ddc411c0878a2 --- /dev/null +++ b/lib/libc/include/mips-linux-gnu/bits/struct_stat.h @@ -0,0 +1,237 @@ +/* Definition for struct stat. + Copyright (C) 2020-2026 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 + . */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_STRUCT_STAT_H +#define _BITS_STRUCT_STAT_H 1 + +#include + +#if _MIPS_SIM == _ABIO32 +/* Structure describing file characteristics. */ +struct stat + { +# ifdef __USE_TIME64_REDIRECTS +# include +# else + unsigned long int st_dev; + long int st_pad1[3]; +# ifndef __USE_FILE_OFFSET64 + __ino_t st_ino; /* File serial number. */ +# else + __ino64_t st_ino; /* File serial number. */ +# endif + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + unsigned long int st_rdev; /* Device number, if device. */ +# ifndef __USE_FILE_OFFSET64 + long int st_pad2[2]; + __off_t st_size; /* Size of file, in bytes. */ + /* SVR4 added this extra long to allow for expansion of off_t. */ + long int st_pad3; +# else + long int st_pad2[3]; + __off64_t st_size; /* Size of file, in bytes. */ +# endif +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ +# ifndef __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ +# else + long int st_pad4; + __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ +# endif + long int st_pad5[14]; +# endif /* __USE_TIME64_REDIRECTS */ + }; + +# ifdef __USE_LARGEFILE64 +struct stat64 + { +# ifdef __USE_TIME64_REDIRECTS +# include +# else + unsigned long int st_dev; + long int st_pad1[3]; + __ino64_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + unsigned long int st_rdev; /* Device number, if device. */ + long int st_pad2[3]; + __off64_t st_size; /* Size of file, in bytes. */ +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ + long int st_pad3; + __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ + long int st_pad4[14]; +# endif /* __USE_TIME64_REDIRECTS */ + }; +# endif /* __USE_LARGEFILE64 */ + +#else /* _MIPS_SIM != _ABIO32 */ + +struct stat + { +# ifdef __USE_TIME64_REDIRECTS +# include +# else + __dev_t st_dev; + int st_pad1[3]; /* Reserved for st_dev expansion */ +# ifndef __USE_FILE_OFFSET64 + __ino_t st_ino; +# else + __ino64_t st_ino; +# endif + __mode_t st_mode; + __nlink_t st_nlink; + __uid_t st_uid; + __gid_t st_gid; + __dev_t st_rdev; +# if !defined __USE_FILE_OFFSET64 + unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */ + __off_t st_size; + int st_pad3; +# else + unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ + __off64_t st_size; +# endif +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __blksize_t st_blksize; + unsigned int st_pad4; +# ifndef __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; +# else + __blkcnt64_t st_blocks; +# endif + int st_pad5[14]; +# endif + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { +# ifdef __USE_TIME64_REDIRECTS +# include +# else + __dev_t st_dev; + unsigned int st_pad1[3]; /* Reserved for st_dev expansion */ + __ino64_t st_ino; + __mode_t st_mode; + __nlink_t st_nlink; + __uid_t st_uid; + __gid_t st_gid; + __dev_t st_rdev; + unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ + __off64_t st_size; +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __blksize_t st_blksize; + unsigned int st_pad3; + __blkcnt64_t st_blocks; + int st_pad4[14]; +# endif /* __USE_TIME64_REDIRECTS */ +}; +#endif + +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV + +#endif /* _BITS_STRUCT_STAT_H */ \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/timesize.h b/lib/libc/include/mips-linux-gnu/bits/timesize.h new file mode 100644 index 0000000000000000000000000000000000000000..114eea77753240de1509241efac873c28a59e9d0 --- /dev/null +++ b/lib/libc/include/mips-linux-gnu/bits/timesize.h @@ -0,0 +1,22 @@ +/* Bit size of the time_t type at glibc build time, Linux/MIPS. + Copyright (C) 2021-2026 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 + . */ + +#include + +/* Size in bits of the 'time_t' type of the default ABI. */ +#define __TIMESIZE __WORDSIZE \ No newline at end of file diff --git a/lib/libc/include/mips-linux-gnu/bits/waitstatus.h b/lib/libc/include/mips-linux-gnu/bits/waitstatus.h new file mode 100644 index 0000000000000000000000000000000000000000..1b7a5a3195a98951a56088ee2e3d7b48874dd835 --- /dev/null +++ b/lib/libc/include/mips-linux-gnu/bits/waitstatus.h @@ -0,0 +1,68 @@ +/* Definitions of status bits for `wait' et al. + MIPS version, based on the generic version (bits/waitstatus.h). + + Copyright (C) 1992-2026 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 + . */ + +#if !defined _SYS_WAIT_H && !defined _STDLIB_H +# error "Never include directly; use instead." +#endif + + +/* On MIPS SIGRTMAX is 127, so we need to handle the status code 127 + which is impossible on other ports. */ + +/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ +#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8) + +/* If WIFSIGNALED(STATUS), the terminating signal. */ +#define __WTERMSIG(status) ((status) & 0x7f) + +/* If WIFSTOPPED(STATUS), the signal that stopped the child. */ +#define __WSTOPSIG(status) __WEXITSTATUS(status) + +/* Nonzero if STATUS indicates normal termination. */ +#define __WIFEXITED(status) (__WTERMSIG(status) == 0) + +/* Nonzero if STATUS indicates termination by a signal. */ +static __inline int +__WIFSIGNALED (int __status) +{ + return ((signed char) ((__status & 0x7f) + 1) >> 1) > 0 || __status == 0x7f; +} + +/* Nonzero if STATUS indicates the child is stopped. */ +static __inline int +__WIFSTOPPED (int __status) +{ + return (__status & 0xff) == 0x7f && __status != 0x7f; +} + +/* Nonzero if STATUS indicates the child continued after a stop. We only + define this if provides the WCONTINUED flag bit. */ +#ifdef WCONTINUED +# define __WIFCONTINUED(status) ((status) == __W_CONTINUED) +#endif + +/* Nonzero if STATUS indicates the child dumped core. */ +#define __WCOREDUMP(status) ((status) & __WCOREFLAG) + +/* Macros for constructing status values. */ +#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) +#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f) +#define __W_CONTINUED 0xffff +#define __WCOREFLAG 0x80 \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/long-double.h b/lib/libc/include/powerpc-linux-gnu/bits/long-double.h index 6c9cf2949f916b13700552fd7c1fe852fa507460..e20cbda37abca98ee6597594ff6264ae7ed8f3a7 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/long-double.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/long-double.h @@ -1,5 +1,5 @@ /* Properties of long double type. ldbl-opt version. - Copyright (C) 2016-2026 Free Software Foundation, Inc. + Copyright (C) 2019-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/libc/include/powerpc-linux-gnu/bits/ppc.h b/lib/libc/include/powerpc-linux-gnu/bits/ppc.h new file mode 100644 index 0000000000000000000000000000000000000000..5e98f066e0a95606f78a7129795ff5f06cbe55ad --- /dev/null +++ b/lib/libc/include/powerpc-linux-gnu/bits/ppc.h @@ -0,0 +1,33 @@ +/* Facilities specific to the PowerPC architecture on Linux + Copyright (C) 2012-2026 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_PPC_H +#define _BITS_PPC_H + +#ifndef _SYS_PLATFORM_PPC_H +# error "Never include this file directly; use instead." +#endif + +__BEGIN_DECLS + +/* Read the time base frequency. */ +extern uint64_t __ppc_get_timebase_freq (void); + +__END_DECLS + +#endif \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/bits/struct_mutex.h b/lib/libc/include/powerpc-linux-gnu/bits/struct_mutex.h index ebf2d50922ee0114298519286785f965771985d9..95fc7f4cc7e18960cc0aa678b866c18b3a03e9be 100644 --- a/lib/libc/include/powerpc-linux-gnu/bits/struct_mutex.h +++ b/lib/libc/include/powerpc-linux-gnu/bits/struct_mutex.h @@ -59,4 +59,4 @@ struct __pthread_mutex_s 0, 0, 0, __kind, 0, { { 0, 0 } } #endif -#endif +#endif \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h b/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h deleted file mode 100644 index af615a3d9f90d11fa61205c10ed15dbb63cb8985..0000000000000000000000000000000000000000 --- a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-32.h +++ /dev/null @@ -1,26 +0,0 @@ -/* This file is automatically generated. */ -#ifndef __GNU_LIB_NAMES_H -# error "Never use directly; include instead." -#endif - -#define LD_SO "ld.so.1" -#define LIBANL_SO "libanl.so.1" -#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" -#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" -#define LIBC_SO "libc.so.6" -#define LIBDL_SO "libdl.so.2" -#define LIBGCC_S_SO "libgcc_s.so.1" -#define LIBMVEC_SO "libmvec.so.1" -#define LIBM_SO "libm.so.6" -#define LIBNSL_SO "libnsl.so.1" -#define LIBNSS_COMPAT_SO "libnss_compat.so.2" -#define LIBNSS_DB_SO "libnss_db.so.2" -#define LIBNSS_DNS_SO "libnss_dns.so.2" -#define LIBNSS_FILES_SO "libnss_files.so.2" -#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" -#define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBPTHREAD_SO "libpthread.so.0" -#define LIBRESOLV_SO "libresolv.so.2" -#define LIBRT_SO "librt.so.1" -#define LIBTHREAD_DB_SO "libthread_db.so.1" -#define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-64-v1.h b/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-64-v1.h deleted file mode 100644 index 4b2c00bbd6ba2e0be21db7253984abfc9e0b8e35..0000000000000000000000000000000000000000 --- a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-64-v1.h +++ /dev/null @@ -1,27 +0,0 @@ -/* This file is automatically generated. */ -#ifndef __GNU_LIB_NAMES_H -# error "Never use directly; include instead." -#endif - -#define LD64_SO "ld64.so.1" -#define LD_SO "ld64.so.1" -#define LIBANL_SO "libanl.so.1" -#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" -#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" -#define LIBC_SO "libc.so.6" -#define LIBDL_SO "libdl.so.2" -#define LIBGCC_S_SO "libgcc_s.so.1" -#define LIBMVEC_SO "libmvec.so.1" -#define LIBM_SO "libm.so.6" -#define LIBNSL_SO "libnsl.so.1" -#define LIBNSS_COMPAT_SO "libnss_compat.so.2" -#define LIBNSS_DB_SO "libnss_db.so.2" -#define LIBNSS_DNS_SO "libnss_dns.so.2" -#define LIBNSS_FILES_SO "libnss_files.so.2" -#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" -#define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBPTHREAD_SO "libpthread.so.0" -#define LIBRESOLV_SO "libresolv.so.2" -#define LIBRT_SO "librt.so.1" -#define LIBTHREAD_DB_SO "libthread_db.so.1" -#define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-64-v2.h b/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-64-v2.h index 36329b69d756c708f60be53d92609a7175acef8a..0041d62398223239ae58d9bc47f4b552610cedeb 100644 --- a/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-64-v2.h +++ b/lib/libc/include/powerpc-linux-gnu/gnu/lib-names-64-v2.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/gnu/stubs-64-v1.h b/lib/libc/include/powerpc-linux-gnu/gnu/stubs-64-v1.h deleted file mode 100644 index 636dc73283f9e3508fca4713d7d911f47d284387..0000000000000000000000000000000000000000 --- a/lib/libc/include/powerpc-linux-gnu/gnu/stubs-64-v1.h +++ /dev/null @@ -1,16 +0,0 @@ -/* This file is automatically generated. - It defines a symbol `__stub_FUNCTION' for each function - in the C library which is a stub, meaning it will fail - every time called, usually setting errno to ENOSYS. */ - -#ifdef _LIBC - #error Applications may not define the macro _LIBC -#endif - -#define __stub_chflags -#define __stub_fchflags -#define __stub_gtty -#define __stub_revoke -#define __stub_setlogin -#define __stub_sigreturn -#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/powerpc-linux-gnu/sys/platform/ppc.h b/lib/libc/include/powerpc-linux-gnu/sys/platform/ppc.h new file mode 100644 index 0000000000000000000000000000000000000000..6e7df94235d78f7b3ad6c8644301f8d0441a264e --- /dev/null +++ b/lib/libc/include/powerpc-linux-gnu/sys/platform/ppc.h @@ -0,0 +1,146 @@ +/* Facilities specific to the PowerPC architecture + Copyright (C) 2012-2026 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 _SYS_PLATFORM_PPC_H +#define _SYS_PLATFORM_PPC_H 1 + +#include +#include +#include + +/* Read the Time Base Register. */ +static __inline__ uint64_t +__ppc_get_timebase (void) +{ +#if __GNUC_PREREQ (4, 8) + return __builtin_ppc_get_timebase (); +#else +# ifdef __powerpc64__ + uint64_t __tb; + /* "volatile" is necessary here, because the user expects this assembly + isn't moved after an optimization. */ + __asm__ volatile ("mfspr %0, 268" : "=r" (__tb)); + return __tb; +# else /* not __powerpc64__ */ + uint32_t __tbu, __tbl, __tmp; \ + __asm__ volatile ("0:\n\t" + "mftbu %0\n\t" + "mftbl %1\n\t" + "mftbu %2\n\t" + "cmpw %0, %2\n\t" + "bne- 0b" + : "=r" (__tbu), "=r" (__tbl), "=r" (__tmp)); + return (((uint64_t) __tbu << 32) | __tbl); +# endif /* not __powerpc64__ */ +#endif +} + +/* The following functions provide hints about the usage of shared processor + resources, as defined in ISA 2.06 and newer. */ + +/* Provides a hint that performance will probably be improved if shared + resources dedicated to the executing processor are released for use by other + processors. */ +static __inline__ void +__ppc_yield (void) +{ + __asm__ volatile ("or 27,27,27"); +} + +/* Provides a hint that performance will probably be improved if shared + resources dedicated to the executing processor are released until + all outstanding storage accesses to caching-inhibited storage have been + completed. */ +static __inline__ void +__ppc_mdoio (void) +{ + __asm__ volatile ("or 29,29,29"); +} + +/* Provides a hint that performance will probably be improved if shared + resources dedicated to the executing processor are released until all + outstanding storage accesses to cacheable storage for which the data is not + in the cache have been completed. */ +static __inline__ void +__ppc_mdoom (void) +{ + __asm__ volatile ("or 30,30,30"); +} + + +/* ISA 2.05 and beyond support the Program Priority Register (PPR) to adjust + thread priorities based on lock acquisition, wait and release. The ISA + defines the use of form 'or Rx,Rx,Rx' as the way to modify the PRI field. + The unprivileged priorities are: + Rx = 1 (low) + Rx = 2 (medium) + Rx = 6 (medium-low/normal) + The 'or' instruction form is a nop in previous hardware, so it is safe to + use unguarded. The default value is 'medium'. + */ + +static __inline__ void +__ppc_set_ppr_med (void) +{ + __asm__ volatile ("or 2,2,2"); +} + +static __inline__ void +__ppc_set_ppr_med_low (void) +{ + __asm__ volatile ("or 6,6,6"); +} + +static __inline__ void +__ppc_set_ppr_low (void) +{ + __asm__ volatile ("or 1,1,1"); +} + +/* Power ISA 2.07 (Book II, Chapter 3) extends the priorities that can be set + to the Program Priority Register (PPR). The form 'or Rx,Rx,Rx' is used to + modify the PRI field of the PPR, the same way as described above. + The new priority levels are: + Rx = 31 (very low) + Rx = 5 (medium high) + Any program can set the priority to very low, low, medium low, and medium, + as these are unprivileged. + The medium high priority, on the other hand, is privileged, and may only be + set during certain time intervals by problem-state programs. If the program + priority is medium high when the time interval expires or if an attempt is + made to set the priority to medium high when it is not allowed, the PRI + field is set to medium. + */ + +#ifdef _ARCH_PWR8 + +static __inline__ void +__ppc_set_ppr_very_low (void) +{ + __asm__ volatile ("or 31,31,31"); +} + +static __inline__ void +__ppc_set_ppr_med_high (void) +{ + __asm__ volatile ("or 5,5,5"); +} + +#endif + +#endif /* sys/platform/ppc.h */ \ No newline at end of file diff --git a/lib/libc/include/riscv-linux-gnu/bits/long-double.h b/lib/libc/include/riscv-linux-gnu/bits/long-double.h deleted file mode 100644 index af7784dbe6dd85cd9538b5a7b437ab45de22eeb8..0000000000000000000000000000000000000000 --- a/lib/libc/include/riscv-linux-gnu/bits/long-double.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Properties of long double type. ldbl-128 version. - Copyright (C) 2016-2026 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 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 - . */ - -/* long double is distinct from double, so there is nothing to - define here. */ -#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 \ No newline at end of file diff --git a/lib/libc/include/riscv-linux-gnu/bits/struct_stat.h b/lib/libc/include/riscv-linux-gnu/bits/struct_stat.h deleted file mode 100644 index 0462d37a6849812f485a6830a7c0dca303332636..0000000000000000000000000000000000000000 --- a/lib/libc/include/riscv-linux-gnu/bits/struct_stat.h +++ /dev/null @@ -1,127 +0,0 @@ -/* Definition for struct stat. - Copyright (C) 2020-2026 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 - . */ - -#if !defined _SYS_STAT_H && !defined _FCNTL_H -# error "Never include directly; use instead." -#endif - -#ifndef _BITS_STRUCT_STAT_H -#define _BITS_STRUCT_STAT_H 1 - -#include -#include - -#if defined __USE_FILE_OFFSET64 -# define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T -# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T -# error "ino_t and off_t must both be the same type" -# endif -# define __field64(type, type64, name) type name -#elif __BYTE_ORDER == __LITTLE_ENDIAN -# define __field64(type, type64, name) \ - type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad -#else -# define __field64(type, type64, name) \ - int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name -#endif - -struct stat - { - __dev_t st_dev; /* Device. */ - __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __dev_t __pad1; - __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - int __pad2; - __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - int __glibc_reserved[2]; - }; - -#undef __field64 - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - __dev_t st_dev; /* Device. */ - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __dev_t __pad1; - __off64_t st_size; /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - int __pad2; - __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - int __glibc_reserved[2]; - }; -#endif - -/* Tell code we have these members. */ -#define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV -/* Nanosecond resolution time values are supported. */ -#define _STATBUF_ST_NSEC - -#endif /* _BITS_STRUCT_STAT_H */ \ No newline at end of file diff --git a/lib/libc/include/riscv-linux-gnu/bits/timesize.h b/lib/libc/include/riscv-linux-gnu/bits/timesize.h deleted file mode 100644 index dff2da5ed6bf30ce6f5580aee352e0958d58b623..0000000000000000000000000000000000000000 --- a/lib/libc/include/riscv-linux-gnu/bits/timesize.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Bit size of the time_t type at glibc build time, general case. - Copyright (C) 2018-2026 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 - . */ - -/* Size in bits of the 'time_t' type of the default ABI. */ -#define __TIMESIZE 64 \ No newline at end of file diff --git a/lib/libc/include/riscv-linux-gnu/gnu/lib-names-ilp32d.h b/lib/libc/include/riscv-linux-gnu/gnu/lib-names-ilp32d.h index 33fd7061de58a4aeca1c876789202fc51a5be641..37e0c85dd4ea29bcca29f0b710981b74e5e8e3bc 100644 --- a/lib/libc/include/riscv-linux-gnu/gnu/lib-names-ilp32d.h +++ b/lib/libc/include/riscv-linux-gnu/gnu/lib-names-ilp32d.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/riscv-linux-gnu/gnu/lib-names-lp64d.h b/lib/libc/include/riscv-linux-gnu/gnu/lib-names-lp64d.h index 0b66bda6d611e45af8ebfbaa34b5569ae01e0c87..8117af98ffff4eec5296b1d16e390402785df0d8 100644 --- a/lib/libc/include/riscv-linux-gnu/gnu/lib-names-lp64d.h +++ b/lib/libc/include/riscv-linux-gnu/gnu/lib-names-lp64d.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/elfclass.h b/lib/libc/include/s390x-linux-gnu/bits/elfclass.h index 325ca0fe4b41d0af0242fb38611aca0b39d4b525..1082cffe057afa53e293fe6aec0c117aab32723d 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/elfclass.h +++ b/lib/libc/include/s390x-linux-gnu/bits/elfclass.h @@ -27,11 +27,6 @@ #define __ELF_NATIVE_CLASS __WORDSIZE -#if __WORDSIZE == 64 /* 64 bit Linux for S/390 is exceptional as it has .hash section with 64 bit entries. */ -typedef uint64_t Elf_Symndx; -#else -/* 32 bit Linux for S/390 has normal .hash section entries with 32 bits. */ -typedef uint32_t Elf_Symndx; -#endif \ No newline at end of file +typedef uint64_t Elf_Symndx; \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/environments.h b/lib/libc/include/s390x-linux-gnu/bits/environments.h deleted file mode 100644 index 6a5d3e997c9e6592b4c5077da6e5f1d9e40d9b40..0000000000000000000000000000000000000000 --- a/lib/libc/include/s390x-linux-gnu/bits/environments.h +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (C) 1999-2026 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 _UNISTD_H -# error "Never include this file directly. Use instead" -#endif - -#include - -/* This header should define the following symbols under the described - situations. A value `1' means that the model is always supported, - `-1' means it is never supported. Undefined means it cannot be - statically decided. - - _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type - _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type - - _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type - _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type - - The macros _POSIX_V6_ILP32_OFF32, _POSIX_V6_ILP32_OFFBIG, - _POSIX_V6_LP64_OFF32, _POSIX_V6_LPBIG_OFFBIG, _XBS5_ILP32_OFF32, - _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and _XBS5_LPBIG_OFFBIG were - used in previous versions of the Unix standard and are available - only for compatibility. -*/ - -#if __WORDSIZE == 64 - -/* Environments with 32-bit wide pointers are optionally provided. - Therefore following macros aren't defined: - # undef _POSIX_V7_ILP32_OFF32 - # undef _POSIX_V7_ILP32_OFFBIG - # undef _POSIX_V6_ILP32_OFF32 - # undef _POSIX_V6_ILP32_OFFBIG - # undef _XBS5_ILP32_OFF32 - # undef _XBS5_ILP32_OFFBIG - and users need to check at runtime. */ - -/* We also have no use (for now) for an environment with bigger pointers - and offsets. */ -# define _POSIX_V7_LPBIG_OFFBIG -1 -# define _POSIX_V6_LPBIG_OFFBIG -1 -# define _XBS5_LPBIG_OFFBIG -1 - -/* By default we have 64-bit wide `long int', pointers and `off_t'. */ -# define _POSIX_V7_LP64_OFF64 1 -# define _POSIX_V6_LP64_OFF64 1 -# define _XBS5_LP64_OFF64 1 - -#else /* __WORDSIZE == 32 */ - -/* By default we have 32-bit wide `int', `long int', pointers and `off_t' - and all platforms support LFS. */ -# define _POSIX_V7_ILP32_OFF32 1 -# define _POSIX_V7_ILP32_OFFBIG 1 -# define _POSIX_V6_ILP32_OFF32 1 -# define _POSIX_V6_ILP32_OFFBIG 1 -# define _XBS5_ILP32_OFF32 1 -# define _XBS5_ILP32_OFFBIG 1 - -/* We optionally provide an environment with the above size but an 64-bit - side `off_t'. Therefore we don't define _POSIX_V7_ILP32_OFFBIG. */ - -/* Environments with 64-bit wide pointers can be provided, - so these macros aren't defined: - # undef _POSIX_V7_LP64_OFF64 - # undef _POSIX_V7_LPBIG_OFFBIG - # undef _POSIX_V6_LP64_OFF64 - # undef _POSIX_V6_LPBIG_OFFBIG - # undef _XBS5_LP64_OFF64 - # undef _XBS5_LPBIG_OFFBIG - and sysconf tests for it at runtime. */ - -#endif /* __WORDSIZE == 32 */ - -#define __ILP32_OFF32_CFLAGS "-m31" -#define __ILP32_OFFBIG_CFLAGS "-m31 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" -#define __ILP32_OFF32_LDFLAGS "-m31" -#define __ILP32_OFFBIG_LDFLAGS "-m31" -#define __LP64_OFF64_CFLAGS "-m64" -#define __LP64_OFF64_LDFLAGS "-m64" \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/fcntl.h b/lib/libc/include/s390x-linux-gnu/bits/fcntl.h index 1d209c616c834cb7d1e8c4220a68852418694265..65df93eaf1e48e53690ec83f9cf4c1f17b3c6026 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/fcntl.h +++ b/lib/libc/include/s390x-linux-gnu/bits/fcntl.h @@ -22,29 +22,20 @@ #include -#if __WORDSIZE == 64 /* Not necessary, files are always with 64bit off_t. */ -# define __O_LARGEFILE 0 -#endif +#define __O_LARGEFILE 0 -#if __WORDSIZE == 64 /* Not necessary, we always have 64-bit offsets. */ -# define F_GETLK64 5 /* Get record locking info. */ -# define F_SETLK64 6 /* Set record locking info (non-blocking). */ -# define F_SETLKW64 7 /* Set record locking info (blocking). */ -#endif +#define F_GETLK64 5 /* Get record locking info. */ +#define F_SETLK64 6 /* Set record locking info (non-blocking). */ +#define F_SETLKW64 7 /* Set record locking info (blocking). */ struct flock { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ -#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64 __off_t l_start; /* Offset where the lock begins. */ __off_t l_len; /* Size of the locked area; zero means until EOF. */ -#else - __off64_t l_start; /* Offset where the lock begins. */ - __off64_t l_len; /* Size of the locked area; zero means until EOF. */ -#endif __pid_t l_pid; /* Process holding the lock. */ }; @@ -59,13 +50,8 @@ struct flock64 }; #endif -#if __WORDSIZE == 64 -# define __POSIX_FADV_DONTNEED 6 /* Don't need these pages. */ -# define __POSIX_FADV_NOREUSE 7 /* Data will be accessed once. */ -#else -# define __POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ -# define __POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ -#endif +#define __POSIX_FADV_DONTNEED 6 /* Don't need these pages. */ +#define __POSIX_FADV_NOREUSE 7 /* Data will be accessed once. */ /* Include generic Linux declarations. */ #include \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/fenv.h b/lib/libc/include/s390x-linux-gnu/bits/fenv.h index 6fb9372043231b6e4303457c2b102b56fc39e728..e53e9e1d9ab8b9b5ff63b5f3c6f959ad2253b6ed 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/fenv.h +++ b/lib/libc/include/s390x-linux-gnu/bits/fenv.h @@ -77,9 +77,9 @@ typedef struct { fexcept_t __fpc; void *__glibc_reserved; - /* The field __unused (formerly __ieee_instruction_pointer) is a relict from - commit "Remove PTRACE_PEEKUSER" (87b9b50f0d4b92248905e95a06a13c513dc45e59) - and isn't used anymore. */ + /* The field __glibc_reserved (formerly __ieee_instruction_pointer) is a + relict from commit "Remove PTRACE_PEEKUSER" + (87b9b50f0d4b92248905e95a06a13c513dc45e59) and isn't used anymore. */ } fenv_t; /* If the default argument is used we use this value. */ @@ -96,4 +96,4 @@ typedef unsigned int femode_t; /* Default floating-point control modes. */ # define FE_DFL_MODE ((const femode_t *) -1L) -#endif +#endif \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/link.h b/lib/libc/include/s390x-linux-gnu/bits/link.h index 96694b37a417838cb4452446e0217fd7e3d4ebed..9eeb39b381bc9292c9b5c3842c296aa9db0b74b7 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/link.h +++ b/lib/libc/include/s390x-linux-gnu/bits/link.h @@ -23,64 +23,6 @@ typedef char La_s390_vr[16]; #endif -#if __ELF_NATIVE_CLASS == 32 - -/* Registers for entry into PLT on s390-32. */ -typedef struct La_s390_32_regs -{ - uint32_t lr_r2; - uint32_t lr_r3; - uint32_t lr_r4; - uint32_t lr_r5; - uint32_t lr_r6; - double lr_fp0; - double lr_fp2; -# if defined HAVE_S390_VX_ASM_SUPPORT - La_s390_vr lr_v24; - La_s390_vr lr_v25; - La_s390_vr lr_v26; - La_s390_vr lr_v27; - La_s390_vr lr_v28; - La_s390_vr lr_v29; - La_s390_vr lr_v30; - La_s390_vr lr_v31; -# endif -} La_s390_32_regs; - -/* Return values for calls from PLT on s390-32. */ -typedef struct La_s390_32_retval -{ - uint32_t lrv_r2; - uint32_t lrv_r3; - double lrv_fp0; -# if defined HAVE_S390_VX_ASM_SUPPORT - La_s390_vr lrv_v24; -# endif -} La_s390_32_retval; - - -__BEGIN_DECLS - -extern Elf32_Addr la_s390_32_gnu_pltenter (Elf32_Sym *__sym, - unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - La_s390_32_regs *__regs, - unsigned int *__flags, - const char *__symname, - long int *__framesizep); -extern unsigned int la_s390_32_gnu_pltexit (Elf32_Sym *__sym, - unsigned int __ndx, - uintptr_t *__refcook, - uintptr_t *__defcook, - const La_s390_32_regs *__inregs, - La_s390_32_retval *__outregs, - const char *symname); - -__END_DECLS - -#else - /* Registers for entry into PLT on s390-64. */ typedef struct La_s390_64_regs { @@ -134,6 +76,4 @@ extern unsigned int la_s390_64_gnu_pltexit (Elf64_Sym *__sym, La_s390_64_retval *__outregs, const char *__symname); -__END_DECLS - -#endif \ No newline at end of file +__END_DECLS \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/procfs-extra.h b/lib/libc/include/s390x-linux-gnu/bits/procfs-extra.h deleted file mode 100644 index 7fb00d4146dae8fca24958e976e831c961090952..0000000000000000000000000000000000000000 --- a/lib/libc/include/s390x-linux-gnu/bits/procfs-extra.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Extra sys/procfs.h definitions. S/390 version. - Copyright (C) 2000-2026 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 _SYS_PROCFS_H -# error "Never include directly; use instead." -#endif - -#if __WORDSIZE == 64 - -/* Provide 32-bit variants so that BFD can read 32-bit - core files. */ -#define ELF_NGREG32 36 -typedef unsigned int elf_greg_t32; -typedef elf_greg_t32 - elf_gregset_t32[ELF_NGREG32] __attribute__ ((__aligned__ (8))); -typedef elf_fpregset_t elf_fpregset_t32; - -struct elf_prstatus32 - { - struct elf_siginfo pr_info; /* Info associated with signal. */ - short int pr_cursig; /* Current signal. */ - unsigned int pr_sigpend; /* Set of pending signals. */ - unsigned int pr_sighold; /* Set of held signals. */ - __pid_t pr_pid; - __pid_t pr_ppid; - __pid_t pr_pgrp; - __pid_t pr_sid; - struct - { - int tv_sec, tv_usec; - } pr_utime, /* User time. */ - pr_stime, /* System time. */ - pr_cutime, /* Cumulative user time. */ - pr_cstime; /* Cumulative system time. */ - elf_gregset_t32 pr_reg; /* GP registers. */ - int pr_fpvalid; /* True if math copro being used. */ - }; - -struct elf_prpsinfo32 - { - char pr_state; /* Numeric process state. */ - char pr_sname; /* Char for pr_state. */ - char pr_zomb; /* Zombie. */ - char pr_nice; /* Nice val. */ - unsigned int pr_flag; /* Flags. */ - unsigned short int pr_uid; - unsigned short int pr_gid; - int pr_pid, pr_ppid, pr_pgrp, pr_sid; - /* Lots missing */ - char pr_fname[16]; /* Filename of executable. */ - char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ - }; - -typedef elf_gregset_t32 prgregset32_t; -typedef elf_fpregset_t32 prfpregset32_t; - -typedef struct elf_prstatus32 prstatus32_t; -typedef struct elf_prpsinfo32 prpsinfo32_t; - -#endif \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/procfs-id.h b/lib/libc/include/s390x-linux-gnu/bits/procfs-id.h deleted file mode 100644 index 9e8570cfe612efd5d35867d0a70a20593fde16f9..0000000000000000000000000000000000000000 --- a/lib/libc/include/s390x-linux-gnu/bits/procfs-id.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Types of pr_uid and pr_gid in struct elf_prpsinfo. S/390 version. - Copyright (C) 2018-2026 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 _SYS_PROCFS_H -# error "Never include directly; use instead." -#endif - -#if __WORDSIZE == 64 -typedef unsigned int __pr_uid_t; -typedef unsigned int __pr_gid_t; -#else -typedef unsigned short int __pr_uid_t; -typedef unsigned short int __pr_gid_t; -#endif \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/setjmp.h b/lib/libc/include/s390x-linux-gnu/bits/setjmp.h index 7d660921ab0295c49a77d9fb12cf4b021546d8c3..451857ec455a20350777d9bd21ed38353e7c4763 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/setjmp.h +++ b/lib/libc/include/s390x-linux-gnu/bits/setjmp.h @@ -33,13 +33,7 @@ typedef struct __s390_jmp_buf /* We save registers 6-15. */ long int __gregs[10]; -# if __WORDSIZE == 64 - /* We save fpu registers f8 - f15. */ long __fpregs[8]; -# else - /* We save fpu registers 4 and 6. */ - long __fpregs[4]; -# endif } __jmp_buf[1]; #endif diff --git a/lib/libc/include/s390x-linux-gnu/bits/sigaction.h b/lib/libc/include/s390x-linux-gnu/bits/sigaction.h index 44883efbe768731d6953e626f57588887505c712..7012eab006a3e4b42515fb7fc8c7d0c026c1dc98 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/sigaction.h +++ b/lib/libc/include/s390x-linux-gnu/bits/sigaction.h @@ -1,4 +1,4 @@ -/* Definitions for 31 & 64 bit S/390 sigaction. +/* Definitions for 64 bit S/390 sigaction. Copyright (C) 2001-2026 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -23,9 +23,6 @@ # error "Never include directly; use instead." #endif -#include - -#if __WORDSIZE == 64 /* Structure describing the action to be taken when a signal arrives. */ struct sigaction { @@ -55,36 +52,6 @@ struct sigaction /* Additional set of signals to be blocked. */ __sigset_t sa_mask; }; -#else -/* Structure describing the action to be taken when a signal arrives. */ -struct sigaction - { - /* Signal handler. */ -#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED - union - { - /* Used if SA_SIGINFO is not set. */ - __sighandler_t sa_handler; - /* Used if SA_SIGINFO is set. */ - void (*sa_sigaction) (int, siginfo_t *, void *); - } - __sigaction_handler; -# define sa_handler __sigaction_handler.sa_handler -# define sa_sigaction __sigaction_handler.sa_sigaction -#else - __sighandler_t sa_handler; -#endif - - /* Additional set of signals to be blocked. */ - __sigset_t sa_mask; - - /* Special flags. */ - int sa_flags; - - /* Restore handler. */ - void (*sa_restorer) (void); - }; -#endif /* Bits in `sa_flags'. */ #define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */ diff --git a/lib/libc/include/s390x-linux-gnu/bits/struct_mutex.h b/lib/libc/include/s390x-linux-gnu/bits/struct_mutex.h index 571265267c2edbc388e00aed800c03b3d2c05b2d..d7b3a380e8f2f32e96a7d8f9b3fe71c52d2bf7a4 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/struct_mutex.h +++ b/lib/libc/include/s390x-linux-gnu/bits/struct_mutex.h @@ -24,39 +24,17 @@ struct __pthread_mutex_s int __lock; unsigned int __count; int __owner; -#if __WORDSIZE == 64 unsigned int __nusers; -#endif /* KIND must stay at this position in the structure to maintain binary compatibility with static initializers. */ int __kind; -#if __WORDSIZE == 64 short __spins; short __glibc_reserved; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 -#else - unsigned int __nusers; - __extension__ union - { - struct - { - short __data_spins; - short __data_unused; - } __data; -# define __spins __data.__data_spins - __pthread_slist_t __list; - }; -# define __PTHREAD_MUTEX_HAVE_PREV 0 -#endif }; -#if __WORDSIZE == 64 -# define __PTHREAD_MUTEX_INITIALIZER(__kind) \ +#define __PTHREAD_MUTEX_INITIALIZER(__kind) \ 0, 0, 0, 0, __kind, 0, 0, { 0, 0 } -#else -# define __PTHREAD_MUTEX_INITIALIZER(__kind) \ - 0, 0, 0, __kind, 0, { { 0, 0 } } -#endif -#endif +#endif \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/struct_rwlock.h b/lib/libc/include/s390x-linux-gnu/bits/struct_rwlock.h index e532dcddf63eef3facc4ec0021639de7ca1b49bc..7d453256eee76416816427df60aca51e65a76466 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/struct_rwlock.h +++ b/lib/libc/include/s390x-linux-gnu/bits/struct_rwlock.h @@ -28,7 +28,6 @@ struct __pthread_rwlock_arch_t unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; -#if __WORDSIZE == 64 int __cur_writer; int __shared; unsigned long int __pad1; @@ -36,23 +35,9 @@ struct __pthread_rwlock_arch_t /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; -# else - unsigned char __pad1; - unsigned char __pad2; - unsigned char __shared; - /* FLAGS must stay at this position in the structure to maintain - binary compatibility. */ - unsigned char __flags; - int __cur_writer; -#endif }; -#if __WORDSIZE == 64 -# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ +#define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags -#else -# define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags, 0 -#endif #endif \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/struct_stat.h b/lib/libc/include/s390x-linux-gnu/bits/struct_stat.h index 3d77809e22d16b08b9329cb01c33a48e61177218..47141080639b92a6607dabed7ef00d3f53143736 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/struct_stat.h +++ b/lib/libc/include/s390x-linux-gnu/bits/struct_stat.h @@ -25,7 +25,6 @@ #include -#if __WORDSIZE == 64 struct stat { __dev_t st_dev; /* Device. */ @@ -62,70 +61,8 @@ struct stat __blkcnt_t st_blocks; /* Nr. 512-byte blocks allocated. */ long int __glibc_reserved[3]; }; -#else -struct stat - { -# ifdef __USE_TIME64_REDIRECTS -# include -# else - __dev_t st_dev; /* Device. */ - unsigned int __pad1; -# ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; /* File serial number. */ -# else - __ino_t __st_ino; /* 32bit file serial number. */ -# endif - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - unsigned int __pad2; -# ifndef __USE_FILE_OFFSET64 - __off_t st_size; /* Size of file, in bytes. */ -# else - __off64_t st_size; /* Size of file, in bytes. */ -# endif - __blksize_t st_blksize; /* Optimal block size for I/O. */ - -# ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -# else - __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# endif -# ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif -# ifndef __USE_FILE_OFFSET64 - unsigned long int __glibc_reserved4; - unsigned long int __glibc_reserved5; -# else - __ino64_t st_ino; /* File serial number. */ -# endif -# endif - }; -# endif #ifdef __USE_LARGEFILE64 -# if __WORDSIZE == 64 /* Note stat64 is the same shape as stat. */ struct stat64 { @@ -138,7 +75,7 @@ struct stat64 int __glibc_reserved0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -148,66 +85,21 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ long int __glibc_reserved[3]; }; -# else -struct stat64 - { -# ifdef __USE_TIME64_REDIRECTS -# include -# else - __dev_t st_dev; /* Device. */ - unsigned int __pad1; - - __ino_t __st_ino; /* 32bit file serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - unsigned int __pad2; - __off64_t st_size; /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - - __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif - __ino64_t st_ino; /* File serial number. */ -# endif - }; -# endif #endif /* Tell code we have these members. */ diff --git a/lib/libc/include/s390x-linux-gnu/bits/timesize.h b/lib/libc/include/s390x-linux-gnu/bits/timesize.h deleted file mode 100644 index 5c231fe380193665c3e791dc1c16ef284787d758..0000000000000000000000000000000000000000 --- a/lib/libc/include/s390x-linux-gnu/bits/timesize.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Bit size of the time_t type at glibc build time, Linux/s390. - Copyright (C) 2021-2026 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 - . */ - -#include - -/* Size in bits of the 'time_t' type of the default ABI. */ -#define __TIMESIZE __WORDSIZE \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/typesizes.h b/lib/libc/include/s390x-linux-gnu/bits/typesizes.h index 5302d79b87a3bcdf2e8f9052fc3404030f9a3b35..101d3a7a9867d31f59c32464807cd473ced919fd 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/typesizes.h +++ b/lib/libc/include/s390x-linux-gnu/bits/typesizes.h @@ -57,42 +57,34 @@ #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE #define __FSID_T_TYPE struct { int __val[2]; } -#if defined __GNUC__ && __GNUC__ <= 2 -/* Compatibility with g++ 2.95.x. */ -#define __SSIZE_T_TYPE __SWORD_TYPE -#else -/* size_t is unsigned long int on s390 -m31. */ -#define __SSIZE_T_TYPE __SLONGWORD_TYPE -#endif + +/* With s390-32, __SSIZE_T_TYPE was __SWORD_TYPE for compatibility with + g++ 2.95.x. Afterwards __SLONGWORD_TYPE was needed as size_t was + unsigned long int on s390-32. + Now as only s390-64 exists, __SWORD_TYPE can be used as also used in the + generic version as both types result in long int. */ +#define __SSIZE_T_TYPE __SWORD_TYPE + #define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE -#define __CPU_MASK_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE -#ifdef __s390x__ /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ -# define __OFF_T_MATCHES_OFF64_T 1 +#define __OFF_T_MATCHES_OFF64_T 1 /* Same for ino_t and ino64_t. */ -# define __INO_T_MATCHES_INO64_T 1 +#define __INO_T_MATCHES_INO64_T 1 /* And for __rlim_t and __rlim64_t. */ -# define __RLIM_T_MATCHES_RLIM64_T 1 +#define __RLIM_T_MATCHES_RLIM64_T 1 /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ -# define __STATFS_MATCHES_STATFS64 1 +#define __STATFS_MATCHES_STATFS64 1 /* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 -#else -# define __RLIM_T_MATCHES_RLIM64_T 0 - -# define __STATFS_MATCHES_STATFS64 0 - -/* And for getitimer, setitimer and rusage */ -# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 -#endif +#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 diff --git a/lib/libc/include/s390x-linux-gnu/bits/utmp.h b/lib/libc/include/s390x-linux-gnu/bits/utmp.h deleted file mode 100644 index 87db119de9415b8be0386c7bca655c4046fb2e36..0000000000000000000000000000000000000000 --- a/lib/libc/include/s390x-linux-gnu/bits/utmp.h +++ /dev/null @@ -1,127 +0,0 @@ -/* The `struct utmp' type, describing entries in the utmp file. GNU version. - Copyright (C) 1993-2026 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 _UTMP_H -# error "Never include directly; use instead." -#endif - -#include -#include -#include -#include - - -#define UT_LINESIZE 32 -#define UT_NAMESIZE 32 -#define UT_HOSTSIZE 256 - - -/* The structure describing an entry in the database of - previous logins. */ -struct lastlog - { -#if __WORDSIZE == 32 - int64_t ll_time; -#else - __time_t ll_time; -#endif - char ll_line[UT_LINESIZE]; - char ll_host[UT_HOSTSIZE]; - }; - - -/* The structure describing the status of a terminated process. This - type is used in `struct utmp' below. */ -struct exit_status - { - short int e_termination; /* Process termination status. */ - short int e_exit; /* Process exit status. */ - }; - - -/* The structure describing an entry in the user accounting database. */ -struct utmp -{ - short int ut_type; /* Type of login. */ - pid_t ut_pid; /* Process ID of login process. */ - char ut_line[UT_LINESIZE] - __attribute_nonstring__; /* Devicename. */ - char ut_id[4] - __attribute_nonstring__; /* Inittab ID. */ - char ut_user[UT_NAMESIZE] - __attribute_nonstring__; /* Username. */ - char ut_host[UT_HOSTSIZE] - __attribute_nonstring__; /* Hostname for remote login. */ - struct exit_status ut_exit; /* Exit status of a process marked - as DEAD_PROCESS. */ -/* The ut_session and ut_tv fields must be the same size when compiled - 32- and 64-bit. This allows data files and shared memory to be - shared between 32- and 64-bit applications. */ -#if __WORDSIZE == 32 - int64_t ut_session; /* Session ID, used for windowing. */ - struct - { - int64_t tv_sec; /* Seconds. */ - int64_t tv_usec; /* Microseconds. */ - } ut_tv; /* Time entry was made. */ -#else - long int ut_session; /* Session ID, used for windowing. */ - struct timeval ut_tv; /* Time entry was made. */ -#endif - - int32_t ut_addr_v6[4]; /* Internet address of remote host. */ - char __glibc_reserved[20]; /* Reserved for future use. */ -}; - -/* Backwards compatibility hacks. */ -#define ut_name ut_user -#ifndef _NO_UT_TIME -/* We have a problem here: `ut_time' is also used otherwise. Define - _NO_UT_TIME if the compiler complains. */ -# define ut_time ut_tv.tv_sec -#endif -#define ut_xtime ut_tv.tv_sec -#define ut_addr ut_addr_v6[0] - - -/* Values for the `ut_type' field of a `struct utmp'. */ -#define EMPTY 0 /* No valid user accounting information. */ - -#define RUN_LVL 1 /* The system's runlevel. */ -#define BOOT_TIME 2 /* Time of system boot. */ -#define NEW_TIME 3 /* Time after system clock changed. */ -#define OLD_TIME 4 /* Time when system clock changed. */ - -#define INIT_PROCESS 5 /* Process spawned by the init process. */ -#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ -#define USER_PROCESS 7 /* Normal process. */ -#define DEAD_PROCESS 8 /* Terminated process. */ - -#define ACCOUNTING 9 - -/* Old Linux name for the EMPTY type. */ -#define UT_UNKNOWN EMPTY - - -/* Tell the user that we have a modern system with UT_HOST, UT_PID, - UT_TYPE, UT_ID and UT_TV fields. */ -#define _HAVE_UT_TYPE 1 -#define _HAVE_UT_PID 1 -#define _HAVE_UT_ID 1 -#define _HAVE_UT_TV 1 -#define _HAVE_UT_HOST 1 \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/utmpx.h b/lib/libc/include/s390x-linux-gnu/bits/utmpx.h deleted file mode 100644 index 00ed2f21a1c4853e7f45dafe7d8ca46a0b4b44a7..0000000000000000000000000000000000000000 --- a/lib/libc/include/s390x-linux-gnu/bits/utmpx.h +++ /dev/null @@ -1,106 +0,0 @@ -/* Structures and definitions for the user accounting database. GNU version. - Copyright (C) 1997-2026 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 _UTMPX_H -# error "Never include directly; use instead." -#endif - -#include -#include -#include - - -#ifdef __USE_GNU -# include -# define _PATH_UTMPX _PATH_UTMP -# define _PATH_WTMPX _PATH_WTMP -#endif - - -#define __UT_LINESIZE 32 -#define __UT_NAMESIZE 32 -#define __UT_HOSTSIZE 256 - - -/* The structure describing the status of a terminated process. This - type is used in `struct utmpx' below. */ -struct __exit_status - { -#ifdef __USE_GNU - short int e_termination; /* Process termination status. */ - short int e_exit; /* Process exit status. */ -#else - short int __e_termination; /* Process termination status. */ - short int __e_exit; /* Process exit status. */ -#endif - }; - - -/* The structure describing an entry in the user accounting database. */ -struct utmpx -{ - short int ut_type; /* Type of login. */ - __pid_t ut_pid; /* Process ID of login process. */ - char ut_line[__UT_LINESIZE] - __attribute_nonstring__; /* Devicename. */ - char ut_id[4] - __attribute_nonstring__; /* Inittab ID. */ - char ut_user[__UT_NAMESIZE] - __attribute_nonstring__; /* Username. */ - char ut_host[__UT_HOSTSIZE] - __attribute_nonstring__; /* Hostname for remote login. */ - struct __exit_status ut_exit; /* Exit status of a process marked - as DEAD_PROCESS. */ - -/* The fields ut_session and ut_tv must be the same size when compiled - 32- and 64-bit. This allows files and shared memory to be shared - between 32- and 64-bit applications. */ -#if __WORDSIZE == 32 - __int64_t ut_session; /* Session ID, used for windowing. */ - struct - { - __int64_t tv_sec; /* Seconds. */ - __int64_t tv_usec; /* Microseconds. */ - } ut_tv; /* Time entry was made. */ -#else - long int ut_session; /* Session ID, used for windowing. */ - struct timeval ut_tv; /* Time entry was made. */ -#endif - __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ - char __glibc_reserved[20]; /* Reserved for future use. */ -}; - - -/* Values for the `ut_type' field of a `struct utmpx'. */ -#define EMPTY 0 /* No valid user accounting information. */ - -#ifdef __USE_GNU -# define RUN_LVL 1 /* The system's runlevel. */ -#endif -#define BOOT_TIME 2 /* Time of system boot. */ -#define NEW_TIME 3 /* Time after system clock changed. */ -#define OLD_TIME 4 /* Time when system clock changed. */ - -#define INIT_PROCESS 5 /* Process spawned by the init process. */ -#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ -#define USER_PROCESS 7 /* Normal process. */ -#define DEAD_PROCESS 8 /* Terminated process. */ - -#ifdef __USE_GNU -# define ACCOUNTING 9 /* System accounting. */ -#endif \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/bits/wordsize.h b/lib/libc/include/s390x-linux-gnu/bits/wordsize.h index 8f3304644bdb1e10ae25ea828e95df45e3d4c124..5038df494751b3446f652bcb4d1c5d3e721a61ec 100644 --- a/lib/libc/include/s390x-linux-gnu/bits/wordsize.h +++ b/lib/libc/include/s390x-linux-gnu/bits/wordsize.h @@ -1,11 +1,19 @@ -/* Determine the wordsize from the preprocessor defines. */ +/* Copyright (C) 1999-2026 Free Software Foundation, Inc. + This file is part of the GNU C Library. -#if defined __s390x__ -# define __WORDSIZE 64 -#else -# define __WORDSIZE 32 -# define __WORDSIZE32_SIZE_ULONG 1 -# define __WORDSIZE32_PTRDIFF_LONG 0 -#endif + 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. -#define __WORDSIZE_TIME64_COMPAT32 0 \ No newline at end of file + 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 + . */ + +#define __WORDSIZE 64 +#define __WORDSIZE_TIME64_COMPAT32 0 \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h deleted file mode 100644 index 0df63282ccce3e8edc6f72dc3ac75bf7a29e2b5e..0000000000000000000000000000000000000000 --- a/lib/libc/include/s390x-linux-gnu/gnu/lib-names-64.h +++ /dev/null @@ -1,27 +0,0 @@ -/* This file is automatically generated. */ -#ifndef __GNU_LIB_NAMES_H -# error "Never use directly; include instead." -#endif - -#define LD64_SO "ld64.so.1" -#define LD_SO "ld64.so.1" -#define LIBANL_SO "libanl.so.1" -#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" -#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" -#define LIBC_SO "libc.so.6" -#define LIBDL_SO "libdl.so.2" -#define LIBGCC_S_SO "libgcc_s.so.1" -#define LIBMVEC_SO "libmvec.so.1" -#define LIBM_SO "libm.so.6" -#define LIBNSL_SO "libnsl.so.1" -#define LIBNSS_COMPAT_SO "libnss_compat.so.2" -#define LIBNSS_DB_SO "libnss_db.so.2" -#define LIBNSS_DNS_SO "libnss_dns.so.2" -#define LIBNSS_FILES_SO "libnss_files.so.2" -#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" -#define LIBNSS_LDAP_SO "libnss_ldap.so.2" -#define LIBPTHREAD_SO "libpthread.so.0" -#define LIBRESOLV_SO "libresolv.so.2" -#define LIBRT_SO "librt.so.1" -#define LIBTHREAD_DB_SO "libthread_db.so.1" -#define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/gnu/lib-names.h b/lib/libc/include/s390x-linux-gnu/gnu/lib-names.h index ad6471507a48c834a5c8cbc13cd851c2e20b74b9..b76efce6d28b32d6d22ad38b1239a620cf950a8a 100644 --- a/lib/libc/include/s390x-linux-gnu/gnu/lib-names.h +++ b/lib/libc/include/s390x-linux-gnu/gnu/lib-names.h @@ -4,13 +4,28 @@ #ifndef __GNU_LIB_NAMES_H #define __GNU_LIB_NAMES_H 1 -#include - -#if __WORDSIZE == 32 -# include -#endif -#if __WORDSIZE == 64 -# include -#endif +#define LD64_SO "ld64.so.1" +#define LD_SO "ld64.so.1" +#define LIBANL_SO "libanl.so.1" +#define LIBBROKENLOCALE_SO "libBrokenLocale.so.1" +#define LIBC_MALLOC_DEBUG_SO "libc_malloc_debug.so.0" +#define LIBC_SO "libc.so.6" +#define LIBDL_SO "libdl.so.2" +#define LIBGCC_S_SO "libgcc_s.so.1" +#define LIBMVEC_SO "libmvec.so.1" +#define LIBM_SO "libm.so.6" +#define LIBNSL_SO "libnsl.so.1" +#define LIBNSS_COMPAT_SO "libnss_compat.so.2" +#define LIBNSS_DB_SO "libnss_db.so.2" +#define LIBNSS_DNS_SO "libnss_dns.so.2" +#define LIBNSS_FILES_SO "libnss_files.so.2" +#define LIBNSS_HESIOD_SO "libnss_hesiod.so.2" +#define LIBNSS_LDAP_SO "libnss_ldap.so.2" +#define LIBPTHREAD_SO "libpthread.so.0" +#define LIBRESOLV_SO "libresolv.so.2" +#define LIBRT_SO "librt.so.1" +#define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" +#define LIBUTIL_SO "libutil.so.1" #endif /* gnu/lib-names.h */ \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/gnu/stubs.h b/lib/libc/include/s390x-linux-gnu/gnu/stubs.h index 120171a87ae7a525497cffc5786ed0383b47ca33..636dc73283f9e3508fca4713d7d911f47d284387 100644 --- a/lib/libc/include/s390x-linux-gnu/gnu/stubs.h +++ b/lib/libc/include/s390x-linux-gnu/gnu/stubs.h @@ -1,12 +1,16 @@ /* This file is automatically generated. - This file selects the right generated file of `__stub_FUNCTION' macros - based on the architecture being compiled for. */ + It defines a symbol `__stub_FUNCTION' for each function + in the C library which is a stub, meaning it will fail + every time called, usually setting errno to ENOSYS. */ -#include - -#if __WORDSIZE == 32 -# include +#ifdef _LIBC + #error Applications may not define the macro _LIBC #endif -#if __WORDSIZE == 64 -# include -#endif \ No newline at end of file + +#define __stub_chflags +#define __stub_fchflags +#define __stub_gtty +#define __stub_revoke +#define __stub_setlogin +#define __stub_sigreturn +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/s390x-linux-gnu/sys/ucontext.h b/lib/libc/include/s390x-linux-gnu/sys/ucontext.h index a766145563a3c44816cf2985502cfc5f11507948..950d26f9b433db86e9b9df218a23aff1cc3e37e8 100644 --- a/lib/libc/include/s390x-linux-gnu/sys/ucontext.h +++ b/lib/libc/include/s390x-linux-gnu/sys/ucontext.h @@ -45,11 +45,7 @@ typedef unsigned long greg_t; the register set is an array, we make gregset_t a simple array that has the same size as s390_regs. This is needed for the elf_prstatus structure. */ -#if __WORDSIZE == 64 -# define __NGREG 27 -#else -# define __NGREG 36 -#endif +#define __NGREG 27 #ifdef __USE_MISC # define NGREG __NGREG #endif diff --git a/lib/libc/include/sparc-linux-gnu/bits/cloexec.h b/lib/libc/include/sparc-linux-gnu/bits/cloexec.h new file mode 100644 index 0000000000000000000000000000000000000000..153b5491cd5cfc283387276a0c6b4b2ae6fb45d8 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/bits/cloexec.h @@ -0,0 +1 @@ +#define __O_CLOEXEC 0x400000 \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h index 7e53ae0eb3f6bb5ea6f99a2c1e5de7cca1491685..ca08483aab3e398663087d84f914fd0903d98232 100644 --- a/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/sparc-linux-gnu/gnu/lib-names-64.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/sparc-linux-gnu/gnu/stubs-64.h b/lib/libc/include/sparc-linux-gnu/gnu/stubs-64.h new file mode 100644 index 0000000000000000000000000000000000000000..636dc73283f9e3508fca4713d7d911f47d284387 --- /dev/null +++ b/lib/libc/include/sparc-linux-gnu/gnu/stubs-64.h @@ -0,0 +1,16 @@ +/* This file is automatically generated. + It defines a symbol `__stub_FUNCTION' for each function + in the C library which is a stub, meaning it will fail + every time called, usually setting errno to ENOSYS. */ + +#ifdef _LIBC + #error Applications may not define the macro _LIBC +#endif + +#define __stub_chflags +#define __stub_fchflags +#define __stub_gtty +#define __stub_revoke +#define __stub_setlogin +#define __stub_sigreturn +#define __stub_stty \ No newline at end of file diff --git a/lib/libc/include/x86-linux-gnu/bits/struct_mutex.h b/lib/libc/include/x86-linux-gnu/bits/struct_mutex.h index 13c9894ad4b3156677a2475ede4c0bc47d1df68a..70b516b1e5d32ca6c8b99c393ad62b7f086723ab 100644 --- a/lib/libc/include/x86-linux-gnu/bits/struct_mutex.h +++ b/lib/libc/include/x86-linux-gnu/bits/struct_mutex.h @@ -59,4 +59,4 @@ struct __pthread_mutex_s 0, 0, 0, __kind, 0, { { 0, 0 } } #endif -#endif +#endif \ No newline at end of file diff --git a/lib/libc/include/x86-linux-gnu/gnu/lib-names-64.h b/lib/libc/include/x86-linux-gnu/gnu/lib-names-64.h index 26bcb6482efed72a960e0f0d5f79aee819f683b4..e570e8dc72828087c96f32b08a0150a17f709224 100644 --- a/lib/libc/include/x86-linux-gnu/gnu/lib-names-64.h +++ b/lib/libc/include/x86-linux-gnu/gnu/lib-names-64.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/lib/libc/include/x86-linux-gnu/gnu/lib-names-x32.h b/lib/libc/include/x86-linux-gnu/gnu/lib-names-x32.h index 735e8e2d3907906c879428d5433b19c9f8065b24..0ac184ea85c124f89fa21819b5c36c7e16e031ad 100644 --- a/lib/libc/include/x86-linux-gnu/gnu/lib-names-x32.h +++ b/lib/libc/include/x86-linux-gnu/gnu/lib-names-x32.h @@ -24,4 +24,5 @@ #define LIBRESOLV_SO "libresolv.so.2" #define LIBRT_SO "librt.so.1" #define LIBTHREAD_DB_SO "libthread_db.so.1" +#define LIBUNWIND_SO "libunwind.so.1" #define LIBUTIL_SO "libutil.so.1" \ No newline at end of file diff --git a/tools/process_headers.zig b/tools/process_headers.zig index 3e912c742e79c4c89d242d72a3e8c7126741c3f7..976f17b18207bd12bd915a64b4318d9543e63399 100644 --- a/tools/process_headers.zig +++ b/tools/process_headers.zig @@ -36,6 +36,8 @@ const glibc_targets = [_]LibCTarget{ .{ .arch = .aarch64_be, .abi = .gnu, .dest = "aarch64-linux-gnu" }, .{ .arch = .csky, .abi = .gnueabi, .dest = "csky-linux-gnu" }, .{ .arch = .csky, .abi = .gnueabihf, .dest = "csky-linux-gnu" }, + .{ .arch = .loongarch32, .abi = .gnu, .dest = "loongarch-linux-gnu" }, + .{ .arch = .loongarch32, .abi = .gnusf, .dest = "loongarch-linux-gnu" }, .{ .arch = .loongarch64, .abi = .gnu, .dest = "loongarch-linux-gnu" }, .{ .arch = .loongarch64, .abi = .gnusf, .dest = "loongarch-linux-gnu" }, .{ .arch = .m68k, .abi = .gnu },