From e0a92849688f557d3e7153ecf6505ee1eedd7248 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Thu, 29 Feb 2024 19:35:53 +0300 Subject: Add time64 support for sparc. By some reason sparc ld.so cannot work properly with statx() system call, so fallback to regular stat() family in ld.so. Signed-off-by: Dmitry Chestnykh --- libc/sysdeps/linux/sparc/bits/kernel_stat.h | 16 ++++++++++++++++ libc/sysdeps/linux/sparc/bits/sem.h | 18 ++++++++++++++++-- libc/sysdeps/linux/sparc/bits/typesizes.h | 12 ++++++++++++ libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h | 3 --- 4 files changed, 44 insertions(+), 5 deletions(-) (limited to 'libc') diff --git a/libc/sysdeps/linux/sparc/bits/kernel_stat.h b/libc/sysdeps/linux/sparc/bits/kernel_stat.h index e960857fe..5e214c72f 100644 --- a/libc/sysdeps/linux/sparc/bits/kernel_stat.h +++ b/libc/sysdeps/linux/sparc/bits/kernel_stat.h @@ -5,6 +5,10 @@ * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ +#if defined(__UCLIBC_USE_TIME64__) +#include "internal/time64_helpers.h" +#endif + struct kernel_stat { unsigned short st_dev; unsigned long st_ino; @@ -14,9 +18,15 @@ struct kernel_stat { unsigned short st_gid; unsigned short st_rdev; long st_size; +#if defined(__UCLIBC_USE_TIME64__) + struct __ts32_struct __st_atim32; + struct __ts32_struct __st_mtim32; + struct __ts32_struct __st_ctim32; +#else struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; +#endif long st_blksize; long st_blocks; unsigned long __unused4[2]; @@ -35,9 +45,15 @@ struct kernel_stat64 { unsigned int st_blksize; unsigned char __pad4[8]; unsigned int st_blocks; +#if defined(__UCLIBC_USE_TIME64__) + struct __ts32_struct __st_atim32; + struct __ts32_struct __st_mtim32; + struct __ts32_struct __st_ctim32; +#else struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; +#endif unsigned int __unused4; unsigned int __unused5; }; diff --git a/libc/sysdeps/linux/sparc/bits/sem.h b/libc/sysdeps/linux/sparc/bits/sem.h index 04c579fc6..23fd7c2eb 100644 --- a/libc/sysdeps/linux/sparc/bits/sem.h +++ b/libc/sysdeps/linux/sparc/bits/sem.h @@ -38,10 +38,24 @@ struct semid_ds { struct ipc_perm sem_perm; /* operation permission struct */ unsigned int __pad1; - __time_t sem_otime; /* last semop() time */ +#if defined(__UCLIBC_USE_TIME64__) + unsigned long int __sem_otime_internal_1; /* last semop() time */ + unsigned long int __sem_otime_internal_2; +#else + __time_t sem_otime; /* last semop() time */ +#endif unsigned int __pad2; - __time_t sem_ctime; /* last time changed by semctl() */ +#if defined(__UCLIBC_USE_TIME64__) + unsigned long int __sem_ctime_internal_1; /* last time changed by semctl() */ + unsigned long int __sem_ctime_internal_2; +#else + __time_t sem_ctime; /* last time changed by semctl() */ +#endif unsigned long int sem_nsems; /* number of semaphores in set */ +#if defined(__UCLIBC_USE_TIME64__) + __time_t sem_otime; + __time_t sem_ctime; +#endif unsigned long int __uclibc_unused1; unsigned long int __uclibc_unused2; }; diff --git a/libc/sysdeps/linux/sparc/bits/typesizes.h b/libc/sysdeps/linux/sparc/bits/typesizes.h index 37b7656aa..c7b7f5576 100644 --- a/libc/sysdeps/linux/sparc/bits/typesizes.h +++ b/libc/sysdeps/linux/sparc/bits/typesizes.h @@ -46,9 +46,21 @@ #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE + +#ifdef __UCLIBC_USE_TIME64__ +#define __TIME_T_TYPE __S64_TYPE +#else #define __TIME_T_TYPE __SLONGWORD_TYPE +#endif + #define __USECONDS_T_TYPE __U32_TYPE + +#ifdef __UCLIBC_USE_TIME64__ +#define __SUSECONDS_T_TYPE __S64_TYPE +#else #define __SUSECONDS_T_TYPE __S32_TYPE +#endif + #define __DADDR_T_TYPE __S32_TYPE #define __SWBLK_T_TYPE __SLONGWORD_TYPE #define __KEY_T_TYPE __S32_TYPE diff --git a/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h b/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h index 76f5084ff..283a250bb 100644 --- a/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h +++ b/libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h @@ -11,9 +11,6 @@ /* can your target use syscall6() for mmap ? */ #define __UCLIBC_MMAP_HAS_6_ARGS__ -/* does your target use statx */ -#undef __UCLIBC_HAVE_STATX__ - /* does your target align 64bit values in register pairs ? (32bit arches only) */ #undef __UCLIBC_SYSCALL_ALIGN_64BIT__ -- cgit v1.2.3