From 99d10ab61776cdab45e8a0ef8385835470c6270c Mon Sep 17 00:00:00 2001 From: Maxython Date: Wed, 24 Jan 2024 23:44:12 +0300 Subject: [PATCH] experiment with statx --- gpkg/glibc/fix-syscall-statx.patch | 55 ++++++++++++++++++++++++++++++ gpkg/glibc/fstatat64.c.patch | 52 ---------------------------- gpkg/glibc/fxstat64.c.patch | 17 --------- gpkg/glibc/fxstatat64.c.patch | 20 ----------- gpkg/glibc/lxstat64.c.patch | 21 ------------ gpkg/glibc/xstat64.c.patch | 20 ----------- 6 files changed, 55 insertions(+), 130 deletions(-) create mode 100644 gpkg/glibc/fix-syscall-statx.patch delete mode 100644 gpkg/glibc/fstatat64.c.patch delete mode 100644 gpkg/glibc/fxstat64.c.patch delete mode 100644 gpkg/glibc/fxstatat64.c.patch delete mode 100644 gpkg/glibc/lxstat64.c.patch delete mode 100644 gpkg/glibc/xstat64.c.patch diff --git a/gpkg/glibc/fix-syscall-statx.patch b/gpkg/glibc/fix-syscall-statx.patch new file mode 100644 index 000000000..98c5b9062 --- /dev/null +++ b/gpkg/glibc/fix-syscall-statx.patch @@ -0,0 +1,55 @@ +--- glibc-2.38/sysdeps/unix/sysv/linux/fstatat64.c 2023-07-31 20:54:16.000000000 +0300 ++++ glibc-2.38/sysdeps/unix/sysv/linux/fstatat64.c.patch 2024-01-24 23:33:04.238225159 +0300 +@@ -53,7 +53,7 @@ + /* 32-bit kABI with default 64-bit time_t, e.g. arc, riscv32. Also + 64-bit time_t support is done through statx syscall. */ + struct statx tmp; +- int r = INTERNAL_SYSCALL_CALL (statx, fd, file, AT_NO_AUTOMOUNT | flag, ++ int r = statx (fd, file, AT_NO_AUTOMOUNT | flag, + STATX_BASIC_STATS, &tmp); + if (r != 0) + return r; +--- glibc-2.38/sysdeps/unix/sysv/linux/fxstat64.c 2023-07-31 20:54:16.000000000 +0300 ++++ glibc-2.38/sysdeps/unix/sysv/linux/fxstat64.c.patch 2024-01-24 23:35:17.668225108 +0300 +@@ -53,7 +53,7 @@ + # else + /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32. */ + struct statx tmp; +- int r = INLINE_SYSCALL_CALL (statx, fd, "", AT_EMPTY_PATH, ++ int r = statx (fd, "", AT_EMPTY_PATH, + STATX_BASIC_STATS, &tmp); + if (r == 0) + __cp_stat64_statx (buf, &tmp); +--- glibc-2.38/sysdeps/unix/sysv/linux/fxstatat64.c 2023-07-31 20:54:16.000000000 +0300 ++++ glibc-2.38/sysdeps/unix/sysv/linux/fxstatat64.c.patch 2024-01-24 23:36:21.868225084 +0300 +@@ -49,7 +49,7 @@ + if (vers == _STAT_VER_KERNEL) + { + struct statx tmp; +- int r = INLINE_SYSCALL_CALL (statx, fd, file, AT_NO_AUTOMOUNT | flag, ++ int r = statx (fd, file, AT_NO_AUTOMOUNT | flag, + STATX_BASIC_STATS, &tmp); + if (r == 0) + __cp_stat64_statx (st, &tmp); +--- glibc-2.38/sysdeps/unix/sysv/linux/lxstat64.c 2023-07-31 20:54:16.000000000 +0300 ++++ glibc-2.38/sysdeps/unix/sysv/linux/lxstat64.c.patch 2024-01-24 23:40:04.098224999 +0300 +@@ -58,7 +58,7 @@ + if (vers == _STAT_VER_KERNEL) + { + struct statx tmp; +- int r = INLINE_SYSCALL_CALL (statx, AT_FDCWD, name, ++ int r = statx (AT_FDCWD, name, + AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW, + STATX_BASIC_STATS, &tmp); + if (r == 0) +--- glibc-2.38/sysdeps/unix/sysv/linux/xstat64.c 2023-07-31 20:54:16.000000000 +0300 ++++ glibc-2.38/sysdeps/unix/sysv/linux/xstat64.c.patch 2024-01-24 23:38:58.168225024 +0300 +@@ -57,7 +57,7 @@ + if (vers == _STAT_VER_KERNEL) + { + struct statx tmp; +- int r = INLINE_SYSCALL_CALL (statx, AT_FDCWD, name, AT_NO_AUTOMOUNT, ++ int r = statx (AT_FDCWD, name, AT_NO_AUTOMOUNT, + STATX_BASIC_STATS, &tmp); + if (r == 0) + __cp_stat64_statx (buf, &tmp); diff --git a/gpkg/glibc/fstatat64.c.patch b/gpkg/glibc/fstatat64.c.patch deleted file mode 100644 index 5a394d33a..000000000 --- a/gpkg/glibc/fstatat64.c.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- glibc-2.38/sysdeps/unix/sysv/linux/fstatat64.c 2022-07-30 01:03:09.000000000 +0300 -+++ glibc-2.38/sysdeps/unix/sysv/linux/fstatat64.c.patch 2022-10-07 22:37:40.624262457 +0300 -@@ -40,48 +40,7 @@ - "__blkcnt_t and __blkcnt64_t must match"); - #endif - --#if (__WORDSIZE == 32 \ -- && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \ -- || defined STAT_HAS_TIME32 \ -- || (!defined __NR_newfstatat && !defined __NR_fstatat64) --# define FSTATAT_USE_STATX 1 -- --static inline int --fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf, -- int flag) --{ -- /* 32-bit kABI with default 64-bit time_t, e.g. arc, riscv32. Also -- 64-bit time_t support is done through statx syscall. */ -- struct statx tmp; -- int r = INTERNAL_SYSCALL_CALL (statx, fd, file, AT_NO_AUTOMOUNT | flag, -- STATX_BASIC_STATS, &tmp); -- if (r != 0) -- return r; -- -- *buf = (struct __stat64_t64) { -- .st_dev = __gnu_dev_makedev (tmp.stx_dev_major, tmp.stx_dev_minor), -- .st_rdev = __gnu_dev_makedev (tmp.stx_rdev_major, tmp.stx_rdev_minor), -- .st_ino = tmp.stx_ino, -- .st_mode = tmp.stx_mode, -- .st_nlink = tmp.stx_nlink, -- .st_uid = tmp.stx_uid, -- .st_gid = tmp.stx_gid, -- .st_atime = tmp.stx_atime.tv_sec, -- .st_atim.tv_nsec = tmp.stx_atime.tv_nsec, -- .st_mtime = tmp.stx_mtime.tv_sec, -- .st_mtim.tv_nsec = tmp.stx_mtime.tv_nsec, -- .st_ctime = tmp.stx_ctime.tv_sec, -- .st_ctim.tv_nsec = tmp.stx_ctime.tv_nsec, -- .st_size = tmp.stx_size, -- .st_blocks = tmp.stx_blocks, -- .st_blksize = tmp.stx_blksize, -- }; -- -- return r; --} --#else --# define FSTATAT_USE_STATX 0 --#endif -+#define FSTATAT_USE_STATX 0 - - /* Only statx supports 64-bit timestamps for 32-bit architectures with - __ASSUME_STATX, so there is no point in building the fallback. */ diff --git a/gpkg/glibc/fxstat64.c.patch b/gpkg/glibc/fxstat64.c.patch deleted file mode 100644 index 15e7b83cd..000000000 --- a/gpkg/glibc/fxstat64.c.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- glibc-2.38/sysdeps/unix/sysv/linux/fxstat64.c 2022-07-30 01:03:09.000000000 +0300 -+++ glibc-2.38/sysdeps/unix/sysv/linux/fxstat64.c.patch 2022-10-07 22:35:03.954262517 +0300 -@@ -50,14 +50,6 @@ - if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX) - return INLINE_SYSCALL_CALL (fstat, fd, buf); - return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); --# else -- /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32. */ -- struct statx tmp; -- int r = INLINE_SYSCALL_CALL (statx, fd, "", AT_EMPTY_PATH, -- STATX_BASIC_STATS, &tmp); -- if (r == 0) -- __cp_stat64_statx (buf, &tmp); -- return r; - # endif - #else - /* All kABIs with non-LFS support, e.g. arm, csky, i386, hppa, m68k, diff --git a/gpkg/glibc/fxstatat64.c.patch b/gpkg/glibc/fxstatat64.c.patch deleted file mode 100644 index 11f9d50cf..000000000 --- a/gpkg/glibc/fxstatat64.c.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- glibc-2.38/sysdeps/unix/sysv/linux/fxstatat64.c 2022-07-30 01:03:09.000000000 +0300 -+++ glibc-2.38/sysdeps/unix/sysv/linux/fxstatat64.c.patch 2022-10-07 22:31:59.294262587 +0300 -@@ -44,17 +44,6 @@ - struct stat64 st64; - int r = INLINE_SYSCALL_CALL (fstatat64, fd, file, &st64, flag); - return r ?: __xstat32_conv (vers, &st64, (struct stat *) st); --# else -- /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32. */ -- if (vers == _STAT_VER_KERNEL) -- { -- struct statx tmp; -- int r = INLINE_SYSCALL_CALL (statx, fd, file, AT_NO_AUTOMOUNT | flag, -- STATX_BASIC_STATS, &tmp); -- if (r == 0) -- __cp_stat64_statx (st, &tmp); -- return r; -- } - # endif - #else - /* All kABIs with non-LFS support, e.g. arm, csky, i386, hppa, m68k, diff --git a/gpkg/glibc/lxstat64.c.patch b/gpkg/glibc/lxstat64.c.patch deleted file mode 100644 index 6468eb842..000000000 --- a/gpkg/glibc/lxstat64.c.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- glibc-2.38/sysdeps/unix/sysv/linux/lxstat64.c 2022-07-30 01:03:09.000000000 +0300 -+++ glibc-2.38/sysdeps/unix/sysv/linux/lxstat64.c.patch 2022-10-07 22:27:46.944262684 +0300 -@@ -53,18 +53,6 @@ - if (vers == _STAT_VER_KERNEL) - return INLINE_SYSCALL_CALL (newfstatat, AT_FDCWD, name, buf, - AT_SYMLINK_NOFOLLOW); --# else -- /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32. */ -- if (vers == _STAT_VER_KERNEL) -- { -- struct statx tmp; -- int r = INLINE_SYSCALL_CALL (statx, AT_FDCWD, name, -- AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW, -- STATX_BASIC_STATS, &tmp); -- if (r == 0) -- __cp_stat64_statx (buf, &tmp); -- return r; -- } - # endif - #else - # if STAT_IS_KERNEL_STAT diff --git a/gpkg/glibc/xstat64.c.patch b/gpkg/glibc/xstat64.c.patch deleted file mode 100644 index 5b1dd6564..000000000 --- a/gpkg/glibc/xstat64.c.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- glibc-2.38/sysdeps/unix/sysv/linux/xstat64.c 2022-07-30 01:03:09.000000000 +0300 -+++ glibc-2.38/sysdeps/unix/sysv/linux/xstat64.c.patch 2022-10-07 22:26:06.884262722 +0300 -@@ -52,17 +52,6 @@ - /* New kABIs which uses generic 64-bit Linux ABI, e.g. aarch64, riscv64. */ - if (vers == _STAT_VER_KERNEL) - return INLINE_SYSCALL_CALL (newfstatat, AT_FDCWD, name, buf, 0); --# else -- /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32. */ -- if (vers == _STAT_VER_KERNEL) -- { -- struct statx tmp; -- int r = INLINE_SYSCALL_CALL (statx, AT_FDCWD, name, AT_NO_AUTOMOUNT, -- STATX_BASIC_STATS, &tmp); -- if (r == 0) -- __cp_stat64_statx (buf, &tmp); -- return r; -- } - # endif - #else - # if STAT_IS_KERNEL_STAT