fakeroot has a bunch of fixes, esp. for newer glibc. * Change URL. Now stored in another snapshot. * Remove old patches, but forward the make-fakeroot-relocateable. * Add the debian patch series for 1.28. Signed-off-by: Christian Melki <christian.melki@t2data.com> --- ...fine-_STAT_VER-if-not-already-define.patch | 33 ---- ...d-wrappers-for-new-glibc-2.33-symbol.patch | 68 -------- ...fix-compile-error-with-DEBUG-enabled.patch | 22 --- ....ac-fix-__xmknod-at-pointer-argument.patch | 56 ------ ...root.c-fix-fts_read-and-fts_children.patch | 44 ----- ...ER-defines-for-ppc64le-riscv64-s390x.patch | 26 --- .../0007-OS-X-portability.patch | 161 ------------------ patches/fakeroot-1.25.3/series | 13 -- ...0001-Also-wrap-the-stat-library-call.patch | 71 ++++++++ ...-Fix-prototype-generation-for-openat.patch | 70 ++++++++ .../0003-make-fakeroot-relocatable.patch} | 0 .../autogen.sh | 0 patches/fakeroot-1.28/series | 6 + rules/host-fakeroot.make | 6 +- 14 files changed, 150 insertions(+), 426 deletions(-) delete mode 100644 patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch delete mode 100644 patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch delete mode 100644 patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch delete mode 100644 patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch delete mode 100644 patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch delete mode 100644 patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch delete mode 100644 patches/fakeroot-1.25.3/0007-OS-X-portability.patch delete mode 100644 patches/fakeroot-1.25.3/series create mode 100644 patches/fakeroot-1.28/0001-Also-wrap-the-stat-library-call.patch create mode 100644 patches/fakeroot-1.28/0002-Fix-prototype-generation-for-openat.patch rename patches/{fakeroot-1.25.3/0008-make-fakeroot-relocatable.patch => fakeroot-1.28/0003-make-fakeroot-relocatable.patch} (100%) rename patches/{fakeroot-1.25.3 => fakeroot-1.28}/autogen.sh (100%) create mode 100644 patches/fakeroot-1.28/series diff --git a/patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch b/patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch deleted file mode 100644 index 92584801d..000000000 --- a/patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> -Date: Thu, 11 Feb 2021 20:59:25 -0800 -Subject: [PATCH] libfakeroot.c: define _STAT_VER if not already defined - -Based on patch from Jan Pazdziora: -https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/SMQ3RYXEYTVZH6PLQMKNB3NM4XLPMNZO/ - -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> ---- - libfakeroot.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/libfakeroot.c b/libfakeroot.c -index 3e80e38b16db..14cdbc4dca12 100644 ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -90,6 +90,16 @@ - #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) - #endif - -+#ifndef _STAT_VER -+ #if defined (__aarch64__) -+ #define _STAT_VER 0 -+ #elif defined (__x86_64__) -+ #define _STAT_VER 1 -+ #else -+ #define _STAT_VER 3 -+ #endif -+#endif -+ - /* - These INT_* (which stands for internal) macros should always be used when - the fakeroot library owns the storage of the stat variable. diff --git a/patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch b/patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch deleted file mode 100644 index 59bc951d3..000000000 --- a/patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch +++ /dev/null @@ -1,68 +0,0 @@ -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> -Date: Thu, 11 Feb 2021 21:00:04 -0800 -Subject: [PATCH] libfakeroot.c: add wrappers for new glibc 2.33+ symbols - -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> ---- - libfakeroot.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 48 insertions(+) - -diff --git a/libfakeroot.c b/libfakeroot.c -index 14cdbc4dca12..d75c51fa990a 100644 ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -1352,6 +1352,54 @@ int renameat(int olddir_fd, const char *oldpath, - #endif /* HAVE_FSTATAT */ - - -+#if defined(__GLIBC__) && __GLIBC_PREREQ(2,33) -+/* Glibc 2.33 exports symbols for these functions in the shared lib */ -+ int lstat(const char *file_name, struct stat *statbuf) { -+ return WRAP_LSTAT LSTAT_ARG(_STAT_VER, file_name, statbuf); -+ } -+ int stat(const char *file_name, struct stat *st) { -+ return WRAP_STAT STAT_ARG(_STAT_VER, file_name, st); -+ } -+ int fstat(int fd, struct stat *st) { -+ return WRAP_FSTAT FSTAT_ARG(_STAT_VER, fd, st); -+ } -+ -+ #ifdef HAVE_FSTATAT -+ int fstatat(int dir_fd, const char *path, struct stat *st, int flags) { -+ return WRAP_FSTATAT FSTATAT_ARG(_STAT_VER, dir_fd, path, st, flags); -+ } -+ #endif -+ -+ #ifdef STAT64_SUPPORT -+ int lstat64(const char *file_name, struct stat64 *st) { -+ return WRAP_LSTAT64 LSTAT64_ARG(_STAT_VER, file_name, st); -+ } -+ int stat64(const char *file_name, struct stat64 *st) { -+ return WRAP_STAT64 STAT64_ARG(_STAT_VER, file_name, st); -+ } -+ int fstat64(int fd, struct stat64 *st) { -+ return WRAP_FSTAT64 FSTAT64_ARG(_STAT_VER, fd, st); -+ } -+ -+ #ifdef HAVE_FSTATAT -+ int fstatat64(int dir_fd, const char *path, struct stat64 *st, int flags) { -+ return WRAP_FSTATAT64 FSTATAT64_ARG(_STAT_VER, dir_fd, path, st, flags); -+ } -+ #endif -+ #endif -+ -+ int mknod(const char *pathname, mode_t mode, dev_t dev) { -+ return WRAP_MKNOD MKNOD_ARG(_STAT_VER, pathname, mode, &dev); -+ } -+ -+ #if defined(HAVE_FSTATAT) && defined(HAVE_MKNODAT) -+ int mknodat(int dir_fd, const char *pathname, mode_t mode, dev_t dev) { -+ return WRAP_MKNODAT MKNODAT_ARG(_STAT_VER, dir_fd, pathname, mode, &dev); -+ } -+ #endif -+#endif /* GLIBC_PREREQ */ -+ -+ - #ifdef FAKEROOT_FAKENET - pid_t fork(void) - { diff --git a/patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch b/patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch deleted file mode 100644 index 8007d7334..000000000 --- a/patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> -Date: Thu, 11 Feb 2021 21:00:20 -0800 -Subject: [PATCH] libfakeroot.c: fix compile error with DEBUG enabled - -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> ---- - libfakeroot.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libfakeroot.c b/libfakeroot.c -index d75c51fa990a..31480f8323ba 100644 ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -2525,7 +2525,7 @@ int statx (int dirfd, const char *path, int flags, unsigned int mask, struct sta - - #ifdef LIBFAKEROOT_DEBUGGING - if (fakeroot_debug) { -- fprintf(stderr, "statx fd %d\n", fd); -+ fprintf(stderr, "statx fd %d\n", dirfd); - } - #endif /* LIBFAKEROOT_DEBUGGING */ - r=INT_NEXT_FSTATAT(dirfd, path, &st, flags); diff --git a/patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch b/patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch deleted file mode 100644 index 5291625ee..000000000 --- a/patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch +++ /dev/null @@ -1,56 +0,0 @@ -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> -Date: Sat, 13 Feb 2021 19:32:08 -0800 -Subject: [PATCH] configure.ac: fix __xmknod{,at} pointer argument - -Switch default to assume * and not the absence of *. - -On glibc 2.33+, there is no definition for these functions in header -files, so the compile test doesn't work. But, we can default to using -the pointer (as is the case with newer glibc), and use the header file -on older platforms to fail the test and use no pointer. - -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> ---- - configure.ac | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 73415d2a91a6..d85566f089b4 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -183,13 +183,13 @@ AC_MSG_CHECKING([for type of arg of __xmknod]) - ]], [[ - int __xmknod ( int ver, - const char *pathname , -- mode_t mode , dev_t dev); -+ mode_t mode , dev_t *dev); - ]])],[ -- AC_DEFINE(XMKNOD_FRTH_ARG,) -- AC_MSG_RESULT([no extra *]) -- ],[ - AC_DEFINE(XMKNOD_FRTH_ARG,[*]) - AC_MSG_RESULT([needs *]) -+ ],[ -+ AC_DEFINE(XMKNOD_FRTH_ARG,) -+ AC_MSG_RESULT([no extra *]) - - ]) - -@@ -210,13 +210,13 @@ AC_MSG_CHECKING([for type of arg of __xmknodat]) - int __xmknodat ( int ver, - int dirfd, - const char *pathname , -- mode_t mode , dev_t dev); -+ mode_t mode , dev_t *dev); - ]])],[ -- AC_DEFINE(XMKNODAT_FIFTH_ARG,) -- AC_MSG_RESULT([no extra *]) -- ],[ - AC_DEFINE(XMKNODAT_FIFTH_ARG,[*]) - AC_MSG_RESULT([needs *]) -+ ],[ -+ AC_DEFINE(XMKNODAT_FIFTH_ARG,) -+ AC_MSG_RESULT([no extra *]) - - ]) - diff --git a/patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch b/patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch deleted file mode 100644 index 620afc2ea..000000000 --- a/patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch +++ /dev/null @@ -1,44 +0,0 @@ -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> -Date: Sat, 13 Feb 2021 19:35:31 -0800 -Subject: [PATCH] libfakeroot.c: fix fts_read and fts_children - -Apply Debian patch from [0], since glibc is usually built without LFS. -__USE_LARGEFILE64 and FTSENT64 should be used anyway for proper support -of this, if needed. See [1] for more details. - -[0]: https://sources.debian.org/patches/fakeroot/1.25.3-1.1/eglibc-fts-without-LFS/ -[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676428 - -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> ---- - libfakeroot.c | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/libfakeroot.c b/libfakeroot.c -index 31480f8323ba..169f4da4de21 100644 ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -2066,11 +2066,7 @@ FTSENT *fts_read(FTS *ftsp) { - || r->fts_info == FTS_NS || r->fts_info == FTS_NSOK)) - r->fts_statp = NULL; /* Otherwise fts_statp may be a random pointer */ - if(r && r->fts_statp) { /* Should we bother checking fts_info here? */ --# if defined(STAT64_SUPPORT) && !defined(__APPLE__) -- SEND_GET_STAT64(r->fts_statp, _STAT_VER); --# else - SEND_GET_STAT(r->fts_statp, _STAT_VER); --# endif - } - - return r; -@@ -2089,11 +2085,7 @@ FTSENT *fts_children(FTS *ftsp, int options) { - first=next_fts_children(ftsp, options); - for(r = first; r; r = r->fts_link) { - if(r && r->fts_statp) { /* Should we bother checking fts_info here? */ --# if defined(STAT64_SUPPORT) && !defined(__APPLE__) -- SEND_GET_STAT64(r->fts_statp, _STAT_VER); --# else - SEND_GET_STAT(r->fts_statp, _STAT_VER); --# endif - } - } - diff --git a/patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch b/patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch deleted file mode 100644 index 5db58dcd3..000000000 --- a/patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Dimitri John Ledkov <xnox@ubuntu.com> -Date: Wed, 17 Feb 2021 14:41:43 +0000 -Subject: [PATCH] Add _STAT_VER defines for ppc64le, riscv64, s390x. - -Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com> ---- - libfakeroot.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/libfakeroot.c b/libfakeroot.c -index 169f4da4de21..74f52ab1df79 100644 ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -93,6 +93,12 @@ - #ifndef _STAT_VER - #if defined (__aarch64__) - #define _STAT_VER 0 -+ #elif defined (__powerpc__) && __WORDSIZE == 64 -+ #define _STAT_VER 1 -+ #elif defined (__riscv) && __riscv_xlen==64 -+ #define _STAT_VER 0 -+ #elif defined (__s390x__) -+ #define _STAT_VER 1 - #elif defined (__x86_64__) - #define _STAT_VER 1 - #else diff --git a/patches/fakeroot-1.25.3/0007-OS-X-portability.patch b/patches/fakeroot-1.25.3/0007-OS-X-portability.patch deleted file mode 100644 index 768696a25..000000000 --- a/patches/fakeroot-1.25.3/0007-OS-X-portability.patch +++ /dev/null @@ -1,161 +0,0 @@ -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> -Date: Sat, 13 Feb 2021 20:05:17 -0800 -Subject: [PATCH] OS X portability - -OS X portability work from OpenWrt. - -Cc: Felix Fietkau <nbd@nbd.name> -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com> ---- - configure.ac | 1 + - libfakeroot.c | 36 ++++++++++++++++++++++++++++++++++-- - wrapawk_macosx | 10 +++++++--- - wrapfunc.inp | 4 ++-- - 4 files changed, 44 insertions(+), 7 deletions(-) - -diff --git a/configure.ac b/configure.ac -index d85566f089b4..35f9ecf28993 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -146,6 +146,7 @@ for first in size_t int; do - #include <sys/types.h> - #endif - #include <unistd.h> -+#include <stdio.h> - #ifdef HAVE_GRP_H - #include <grp.h> - #endif -diff --git a/libfakeroot.c b/libfakeroot.c -index 74f52ab1df79..f9ca1820e4b7 100644 ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -128,8 +128,16 @@ - #define INT_SEND_STAT(a,b) SEND_STAT(a,b,_STAT_VER) - #define INT_SEND_GET_XATTR(a,b) SEND_GET_XATTR(a,b,_STAT_VER) - #define INT_SEND_GET_STAT(a,b) SEND_GET_STAT(a,b) -+ -+/* 10.10 uses id_t in getpriority/setpriority calls, so pretend -+ id_t is used everywhere, just happens to be int on some OSes */ -+#ifndef _ID_T -+#define _ID_T -+typedef int id_t; -+#endif - #endif - -+#include <sys/types.h> - #include <stdlib.h> - #include <sys/ipc.h> - #include <sys/msg.h> -@@ -141,7 +149,6 @@ - #include <unistd.h> - #include <dirent.h> - #include <errno.h> --#include <sys/types.h> - #ifdef HAVE_SYS_ACL_H - #include <sys/acl.h> - #endif /* HAVE_SYS_ACL_H */ -@@ -204,6 +211,15 @@ extern int unsetenv (const char *name); - #undef __lxstat64 - #undef _FILE_OFFSET_BITS - -+ -+#ifndef AT_EMPTY_PATH -+#define AT_EMPTY_PATH 0 -+#endif -+ -+#ifndef AT_NO_AUTOMOUNT -+#define AT_NO_AUTOMOUNT 0 -+#endif -+ - /* - // next_wrap_st: - // this structure is used in next_wrap, which is defined in -@@ -1975,7 +1991,7 @@ ssize_t fremovexattr(int fd, const char *name) - } - #endif /* HAVE_FREMOVEXATTR */ - --int setpriority(int which, int who, int prio){ -+int setpriority(int which, id_t who, int prio){ - if (fakeroot_disabled) - return next_setpriority(which, who, prio); - next_setpriority(which, who, prio); -@@ -2576,3 +2592,19 @@ int sysinfo(int command, char *buf, long count) - } - } - #endif -+ -+#ifdef HAVE_OPENAT -+int openat(int dir_fd, const char *pathname, int flags, ...) -+{ -+ mode_t mode; -+ -+ if (flags & O_CREAT) { -+ va_list args; -+ va_start(args, flags); -+ mode = va_arg(args, int); -+ va_end(args); -+ } -+ -+ return next_openat(dir_fd, pathname, flags, mode); -+} -+#endif -diff --git a/wrapawk_macosx b/wrapawk_macosx -index 088a7f48de49..f783219758ac 100644 ---- a/wrapawk_macosx -+++ b/wrapawk_macosx -@@ -46,26 +46,30 @@ BEGIN{ - argtype=$3; - argname=$4; - MACRO=$5; -+ argtype_def=$6 -+ if(!argtype_def) { -+ argtype_def = argtype -+ } - if(MACRO){ - print "extern " ret " MY_DEF(" name ")" argtype " __attribute__((visibility(\"hidden\")));" > headerfile; - print "INTERPOSE(MY_DEF(" name "_RAW)," name "_RAW);" > structfile; - print "#undef " name > deffile - print "#define " name " MY_DEF(" name "_RAW)" > deffile - -- print "extern " ret, name, argtype ";" > tmpffile; -+ print "extern " ret, name, argtype_def ";" > tmpffile; - print "static __inline__ " ret " NEXT_" MACRO "_NOARG " argtype " __attribute__((always_inline));" > tmpffile; - print "static __inline__ " ret " NEXT_" MACRO "_NOARG " argtype " {" > tmpffile; - print " return " name, argname ";" > tmpffile; - print "}" > tmpffile; - print "" > tmpffile; - } else { -- print "extern " ret " my_" name, argtype " __attribute__((visibility(\"hidden\")));" > headerfile; -+ print "extern " ret " my_" name, argtype_def " __attribute__((visibility(\"hidden\")));" > headerfile; - print "#undef " name > structfile; - print "INTERPOSE(my_" name "," name ");" > structfile; - print "#define " name " my_" name > structfile - print "#define " name " my_" name > deffile - -- print "extern " ret, name, argtype ";" > tmpffile; -+ print "extern " ret, name, argtype_def ";" > tmpffile; - if(argname){ - print "static __inline__ " ret " next_" name, argtype " __attribute__((always_inline));" > tmpffile; - print "static __inline__ " ret " next_" name, argtype " {" > tmpffile; -diff --git a/wrapfunc.inp b/wrapfunc.inp -index f7ad1867891a..556af34579b0 100644 ---- a/wrapfunc.inp -+++ b/wrapfunc.inp -@@ -146,7 +146,7 @@ setfsgid;gid_t;(gid_t fsgid);(fsgid) - initgroups;int;(const char *user, INITGROUPS_SECOND_ARG group);(user, group) - getgroups;int;(int size, gid_t list[]);(size, list) - setgroups;int;(SETGROUPS_SIZE_TYPE size, const gid_t *list);(size, list) --setpriority;int;(int which, int who, int prio);(which, who, prio) -+setpriority;int;(int which, id_t who, int prio);(which, who, prio) - #ifdef HAVE_CAPSET - capset;int;(cap_user_header_t hdrp, const cap_user_data_t datap);(hdrp, datap) - #endif /* HAVE_CAPSET */ -@@ -198,7 +198,7 @@ fchownat;int;(int dir_fd, const char *path, uid_t owner, gid_t group, int flags) - mkdirat;int;(int dir_fd, const char *pathname, mode_t mode);(dir_fd, pathname, mode) - #endif /* HAVE_MKDIRAT */ - #ifdef HAVE_OPENAT --openat;int;(int dir_fd, const char *pathname, int flags);(dir_fd, pathname, flags) -+openat;int;(int dir_fd, const char *pathname, int flags, mode_t mode);(dir_fd, pathname, flags, mode);;(int dir_fd, const char *pathname, int flags, ...) - #endif /* HAVE_OPENAT */ - #ifdef HAVE_RENAMEAT - renameat;int;(int olddir_fd, const char *oldpath, int newdir_fd, const char *newpath);(olddir_fd, oldpath, newdir_fd, newpath) diff --git a/patches/fakeroot-1.25.3/series b/patches/fakeroot-1.25.3/series deleted file mode 100644 index fa0010583..000000000 --- a/patches/fakeroot-1.25.3/series +++ /dev/null @@ -1,13 +0,0 @@ -# generated by git-ptx-patches -#tag:base --start-number 1 -#tag:upstream --start-number 1 -0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch -0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch -0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch -0004-configure.ac-fix-__xmknod-at-pointer-argument.patch -0005-libfakeroot.c-fix-fts_read-and-fts_children.patch -0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch -0007-OS-X-portability.patch -#tag:ptxdist --start-number 100 -0008-make-fakeroot-relocatable.patch -# d07e91409b4dcfb1e6e2abd76ddc7481 - git-ptx-patches magic diff --git a/patches/fakeroot-1.28/0001-Also-wrap-the-stat-library-call.patch b/patches/fakeroot-1.28/0001-Also-wrap-the-stat-library-call.patch new file mode 100644 index 000000000..daff7f347 --- /dev/null +++ b/patches/fakeroot-1.28/0001-Also-wrap-the-stat-library-call.patch @@ -0,0 +1,71 @@ +From: Christian Melki <christian.melki@t2data.com> +Date: Wed, 11 May 2022 10:23:40 +0200 +Subject: [PATCH] Also wrap the "stat" library call + +Patch by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de> +Bug-Debian: https://bugs.debian.org/1001961 + +Seems changes in glibc 2.33 caused the stat() function to be mapped +into a stat() library call instead of __xstat() as it used to be. + +However, fakeroot does not wrap this, causing files to be reported +with the real owner, not 0 as expected. + +The fix for this got a bit ugly as the abstraction in configure.ac +would not allow wrapping both "stat" and "__xstat". So enhance the +search list capabilities with an optional symbol how the wrapped +function is named internally. Also hack the parser so "stat" gets +actually probed and not mistaken for __xstat. + +Using "realstat" as a symbol is not the best choice as it might be +confusing, but "statstat" seemed even worse. + +Signed-off-by: Christian Melki <christian.melki@t2data.com> +--- + configure.ac | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index e7c1c7c484f3..3fa4756557af 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -362,9 +362,13 @@ dnl Digital Unix: stat + + :>fakerootconfig.h.tmp + +-for SEARCH in %stat f%stat l%stat f%statat %stat64 f%stat64 l%stat64 f%statat64 %mknod %mknodat; do +- FUNC=`echo $SEARCH|sed -e 's/.*%//'` ++for SEARCH in %stat s%tat@realstat f%stat l%stat f%statat %stat64 f%stat64 l%stat64 f%statat64 %mknod %mknodat; do ++ FUNC=`echo $SEARCH|sed -e 's/.*%// ; s/@.*//'` + PRE=`echo $SEARCH|sed -e 's/%.*//'` ++ SYMBOL=`echo $SEARCH|sed -e 's/.*@//'` ++ if test "$SYMBOL" = "$SEARCH" ; then ++ SYMBOL="${PRE}${FUNC}" ++ fi + FOUND= + for WRAPPED in __${PRE}x${FUNC} _${PRE}x${FUNC} __${PRE}${FUNC}13 ${PRE}${FUNC}; do + AC_CHECK_FUNCS($WRAPPED,FOUND=$WRAPPED) +@@ -375,8 +379,8 @@ dnl + dnl for WRAPPED in _${PRE}${FUNC}; do + dnl FOUND=$WRAPPED + if test -n "$FOUND"; then +- PF=[`echo ${PRE}${FUNC}| tr '[a-z]' '[A-Z]'`] +- DEFINE_WRAP=[`echo wrap_${PRE}${FUNC}| tr '[a-z]' '[A-Z]'`] ++ PF=[`echo $SYMBOL | tr '[a-z]' '[A-Z]'`] ++ DEFINE_WRAP=[`echo wrap_${SYMBOL}| tr '[a-z]' '[A-Z]'`] + DEFINE_NEXT=[`echo wrap_${FOUND}| tr '[a-z]' '[A-Z]'`] + DEFINE_ARG=[`echo wrap_${FOUND}| tr '[a-z]' '[A-Z]'`] + AC_DEFINE_UNQUOTED(WRAP_${PF}, $FOUND) +@@ -518,6 +522,12 @@ AH_VERBATIM([WRAP_STAT], + #define TMP_STAT __astat + #define NEXT_STAT_NOARG next___astat + ++#define WRAP_REALSTAT __astat ++#define WRAP_REALSTAT_QUOTE __astat ++#define WRAP_REALSTAT_RAW __astat ++#define TMP_REALSTAT __astat ++#define NEXT_REALSTAT_NOARG next___astat ++ + #define WRAP_LSTAT_QUOTE __astat + #define WRAP_LSTAT __astat + #define WRAP_LSTAT_RAW __astat diff --git a/patches/fakeroot-1.28/0002-Fix-prototype-generation-for-openat.patch b/patches/fakeroot-1.28/0002-Fix-prototype-generation-for-openat.patch new file mode 100644 index 000000000..3e091379d --- /dev/null +++ b/patches/fakeroot-1.28/0002-Fix-prototype-generation-for-openat.patch @@ -0,0 +1,70 @@ +From: Christian Melki <christian.melki@t2data.com> +Date: Wed, 11 May 2022 10:25:59 +0200 +Subject: [PATCH] Fix prototype generation for openat + +Patch by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de> +Bug-Debian: https://bugs.debian.org/995393 + +As jrtc27 pointed out in IRC, ppc64el is more strict than other +architectures when it comes to va_arg handling: + + it's that ppc64le uses the elfv2 abi, and for variadic calls you + must reserve space for a parameter save area + +So enhance wrapawk to create a proper prototype and argument +handling although it's specific to the openat call. Also add the +missing documentation for the sixth column to wrapfunc.inp. + +Signed-off-by: Christian Melki <christian.melki@t2data.com> +--- + wrapawk | 20 +++++++++++++++++++- + wrapfunc.inp | 4 +++- + 2 files changed, 22 insertions(+), 2 deletions(-) + +diff --git a/wrapawk b/wrapawk +index a2fd220a6fcb..9b2c285c257b 100644 +--- a/wrapawk ++++ b/wrapawk +@@ -37,7 +37,25 @@ BEGIN{ + argtype=$3; + argname=$4; + MACRO=$5; +- if(MACRO){ ++ openat_extra=$6; ++ if(openat_extra){ ++ print " {(void(*))&next_" name ", \"" name "\"}," > structfile; ++ print "extern " ret " (*next_" name ")" openat_extra ";" > headerfile; ++ print ret " (*next_" name ")" openat_extra "=tmp_" name ";"> deffile; ++ ++ print ret " tmp_" name, openat_extra "{" > tmpffile; ++ print " mode_t mode = 0;" > tmpffile; ++ print " if (flags & O_CREAT) {" > tmpffile; ++ print " va_list args;" > tmpffile; ++ print " va_start(args, flags);" > tmpffile; ++ print " mode = va_arg(args, int);" > tmpffile; ++ print " va_end(args);" > tmpffile; ++ print " }" > tmpffile; ++ print " load_library_symbols();" > tmpffile; ++ print " return next_" name, argname ";" > tmpffile; ++ print "}" > tmpffile; ++ print "" > tmpffile; ++ } else if(MACRO){ + print " {(void(*))&NEXT_" MACRO "_NOARG, " name "_QUOTE}," > structfile; + print "extern " ret " (*NEXT_" MACRO "_NOARG)" argtype ";" > headerfile; + print ret " (*NEXT_" MACRO "_NOARG)" argtype "=TMP_" MACRO ";"> deffile; +diff --git a/wrapfunc.inp b/wrapfunc.inp +index 556af34579b0..f5bd4063152c 100644 +--- a/wrapfunc.inp ++++ b/wrapfunc.inp +@@ -9,8 +9,10 @@ + /**/ */ + /* each line of this file lists 4 fields, seperated by a ";". */ + /* The first field is the name of the wrapped function, then it's return */ +-/* value. After that come the function arguments with types, and the last */ ++/* value. After that come the function arguments with types, and the fifth */ + /* field contains the function arguments without types. */ ++/* A sixth field is a special needed when wrapping the openat syscall. */ ++/* Otherwise it's like the third (function arguments with types). */ + /**/ + + /* __*xstat are used on glibc systems instead of just *xstat. */ diff --git a/patches/fakeroot-1.25.3/0008-make-fakeroot-relocatable.patch b/patches/fakeroot-1.28/0003-make-fakeroot-relocatable.patch similarity index 100% rename from patches/fakeroot-1.25.3/0008-make-fakeroot-relocatable.patch rename to patches/fakeroot-1.28/0003-make-fakeroot-relocatable.patch diff --git a/patches/fakeroot-1.25.3/autogen.sh b/patches/fakeroot-1.28/autogen.sh similarity index 100% rename from patches/fakeroot-1.25.3/autogen.sh rename to patches/fakeroot-1.28/autogen.sh diff --git a/patches/fakeroot-1.28/series b/patches/fakeroot-1.28/series new file mode 100644 index 000000000..7cc751cd4 --- /dev/null +++ b/patches/fakeroot-1.28/series @@ -0,0 +1,6 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-Also-wrap-the-stat-library-call.patch +0002-Fix-prototype-generation-for-openat.patch +0003-make-fakeroot-relocatable.patch +# a15acfb9f130741fa53186998a6f6ee3 - git-ptx-patches magic diff --git a/rules/host-fakeroot.make b/rules/host-fakeroot.make index 3a09e4ce8..80d9d7fbf 100644 --- a/rules/host-fakeroot.make +++ b/rules/host-fakeroot.make @@ -15,12 +15,12 @@ HOST_PACKAGES-$(PTXCONF_HOST_FAKEROOT) += host-fakeroot # # Paths and names # -HOST_FAKEROOT_VERSION := 1.25.3 -HOST_FAKEROOT_MD5 := f6104ef6960c962377ef062bf222a1d2 +HOST_FAKEROOT_VERSION := 1.28 +HOST_FAKEROOT_MD5 := 75663fa4d0d1eedab0b951bb977bc12f HOST_FAKEROOT_SUFFIX := tar.gz HOST_FAKEROOT := fakeroot-$(HOST_FAKEROOT_VERSION) HOST_FAKEROOT_TARBALL := fakeroot_$(HOST_FAKEROOT_VERSION).orig.$(HOST_FAKEROOT_SUFFIX) -HOST_FAKEROOT_URL := https://snapshot.debian.org/archive/debian/20210123T025406Z/pool/main/f/fakeroot/$(HOST_FAKEROOT_TARBALL) +HOST_FAKEROOT_URL := https://snapshot.debian.org/archive/debian/20220304T204941Z/pool/main/f/fakeroot/$(HOST_FAKEROOT_TARBALL) HOST_FAKEROOT_SOURCE := $(SRCDIR)/$(HOST_FAKEROOT_TARBALL) HOST_FAKEROOT_DIR := $(HOST_BUILDDIR)/$(HOST_FAKEROOT) HOST_FAKEROOT_LICENSE := GPL-3.0-or-later -- 2.34.1
Thanks, applied as f72ba21b194c981caf1dd227abfdceb601a4b16f.
Michael
[sent from post-receive hook]
On Wed, 25 May 2022 11:45:20 +0200, Christian Melki <christian.melki@t2data.com> wrote:
> fakeroot has a bunch of fixes, esp. for newer glibc.
>
> * Change URL. Now stored in another snapshot.
> * Remove old patches, but forward the make-fakeroot-relocateable.
> * Add the debian patch series for 1.28.
>
> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> Message-Id: <20220513130446.1311792-1-christian.melki@t2data.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
>
> diff --git a/patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch b/patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch
> deleted file mode 100644
> index 92584801dc10..000000000000
> --- a/patches/fakeroot-1.25.3/0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> -Date: Thu, 11 Feb 2021 20:59:25 -0800
> -Subject: [PATCH] libfakeroot.c: define _STAT_VER if not already defined
> -
> -Based on patch from Jan Pazdziora:
> -https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/SMQ3RYXEYTVZH6PLQMKNB3NM4XLPMNZO/
> -
> -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> ----
> - libfakeroot.c | 10 ++++++++++
> - 1 file changed, 10 insertions(+)
> -
> -diff --git a/libfakeroot.c b/libfakeroot.c
> -index 3e80e38b16db..14cdbc4dca12 100644
> ---- a/libfakeroot.c
> -+++ b/libfakeroot.c
> -@@ -90,6 +90,16 @@
> - #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b)
> - #endif
> -
> -+#ifndef _STAT_VER
> -+ #if defined (__aarch64__)
> -+ #define _STAT_VER 0
> -+ #elif defined (__x86_64__)
> -+ #define _STAT_VER 1
> -+ #else
> -+ #define _STAT_VER 3
> -+ #endif
> -+#endif
> -+
> - /*
> - These INT_* (which stands for internal) macros should always be used when
> - the fakeroot library owns the storage of the stat variable.
> diff --git a/patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch b/patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch
> deleted file mode 100644
> index 59bc951d3c55..000000000000
> --- a/patches/fakeroot-1.25.3/0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch
> +++ /dev/null
> @@ -1,68 +0,0 @@
> -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> -Date: Thu, 11 Feb 2021 21:00:04 -0800
> -Subject: [PATCH] libfakeroot.c: add wrappers for new glibc 2.33+ symbols
> -
> -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> ----
> - libfakeroot.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
> - 1 file changed, 48 insertions(+)
> -
> -diff --git a/libfakeroot.c b/libfakeroot.c
> -index 14cdbc4dca12..d75c51fa990a 100644
> ---- a/libfakeroot.c
> -+++ b/libfakeroot.c
> -@@ -1352,6 +1352,54 @@ int renameat(int olddir_fd, const char *oldpath,
> - #endif /* HAVE_FSTATAT */
> -
> -
> -+#if defined(__GLIBC__) && __GLIBC_PREREQ(2,33)
> -+/* Glibc 2.33 exports symbols for these functions in the shared lib */
> -+ int lstat(const char *file_name, struct stat *statbuf) {
> -+ return WRAP_LSTAT LSTAT_ARG(_STAT_VER, file_name, statbuf);
> -+ }
> -+ int stat(const char *file_name, struct stat *st) {
> -+ return WRAP_STAT STAT_ARG(_STAT_VER, file_name, st);
> -+ }
> -+ int fstat(int fd, struct stat *st) {
> -+ return WRAP_FSTAT FSTAT_ARG(_STAT_VER, fd, st);
> -+ }
> -+
> -+ #ifdef HAVE_FSTATAT
> -+ int fstatat(int dir_fd, const char *path, struct stat *st, int flags) {
> -+ return WRAP_FSTATAT FSTATAT_ARG(_STAT_VER, dir_fd, path, st, flags);
> -+ }
> -+ #endif
> -+
> -+ #ifdef STAT64_SUPPORT
> -+ int lstat64(const char *file_name, struct stat64 *st) {
> -+ return WRAP_LSTAT64 LSTAT64_ARG(_STAT_VER, file_name, st);
> -+ }
> -+ int stat64(const char *file_name, struct stat64 *st) {
> -+ return WRAP_STAT64 STAT64_ARG(_STAT_VER, file_name, st);
> -+ }
> -+ int fstat64(int fd, struct stat64 *st) {
> -+ return WRAP_FSTAT64 FSTAT64_ARG(_STAT_VER, fd, st);
> -+ }
> -+
> -+ #ifdef HAVE_FSTATAT
> -+ int fstatat64(int dir_fd, const char *path, struct stat64 *st, int flags) {
> -+ return WRAP_FSTATAT64 FSTATAT64_ARG(_STAT_VER, dir_fd, path, st, flags);
> -+ }
> -+ #endif
> -+ #endif
> -+
> -+ int mknod(const char *pathname, mode_t mode, dev_t dev) {
> -+ return WRAP_MKNOD MKNOD_ARG(_STAT_VER, pathname, mode, &dev);
> -+ }
> -+
> -+ #if defined(HAVE_FSTATAT) && defined(HAVE_MKNODAT)
> -+ int mknodat(int dir_fd, const char *pathname, mode_t mode, dev_t dev) {
> -+ return WRAP_MKNODAT MKNODAT_ARG(_STAT_VER, dir_fd, pathname, mode, &dev);
> -+ }
> -+ #endif
> -+#endif /* GLIBC_PREREQ */
> -+
> -+
> - #ifdef FAKEROOT_FAKENET
> - pid_t fork(void)
> - {
> diff --git a/patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch b/patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch
> deleted file mode 100644
> index 8007d73343e5..000000000000
> --- a/patches/fakeroot-1.25.3/0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> -Date: Thu, 11 Feb 2021 21:00:20 -0800
> -Subject: [PATCH] libfakeroot.c: fix compile error with DEBUG enabled
> -
> -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> ----
> - libfakeroot.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/libfakeroot.c b/libfakeroot.c
> -index d75c51fa990a..31480f8323ba 100644
> ---- a/libfakeroot.c
> -+++ b/libfakeroot.c
> -@@ -2525,7 +2525,7 @@ int statx (int dirfd, const char *path, int flags, unsigned int mask, struct sta
> -
> - #ifdef LIBFAKEROOT_DEBUGGING
> - if (fakeroot_debug) {
> -- fprintf(stderr, "statx fd %d\n", fd);
> -+ fprintf(stderr, "statx fd %d\n", dirfd);
> - }
> - #endif /* LIBFAKEROOT_DEBUGGING */
> - r=INT_NEXT_FSTATAT(dirfd, path, &st, flags);
> diff --git a/patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch b/patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch
> deleted file mode 100644
> index 5291625eea1f..000000000000
> --- a/patches/fakeroot-1.25.3/0004-configure.ac-fix-__xmknod-at-pointer-argument.patch
> +++ /dev/null
> @@ -1,56 +0,0 @@
> -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> -Date: Sat, 13 Feb 2021 19:32:08 -0800
> -Subject: [PATCH] configure.ac: fix __xmknod{,at} pointer argument
> -
> -Switch default to assume * and not the absence of *.
> -
> -On glibc 2.33+, there is no definition for these functions in header
> -files, so the compile test doesn't work. But, we can default to using
> -the pointer (as is the case with newer glibc), and use the header file
> -on older platforms to fail the test and use no pointer.
> -
> -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> ----
> - configure.ac | 16 ++++++++--------
> - 1 file changed, 8 insertions(+), 8 deletions(-)
> -
> -diff --git a/configure.ac b/configure.ac
> -index 73415d2a91a6..d85566f089b4 100644
> ---- a/configure.ac
> -+++ b/configure.ac
> -@@ -183,13 +183,13 @@ AC_MSG_CHECKING([for type of arg of __xmknod])
> - ]], [[
> - int __xmknod ( int ver,
> - const char *pathname ,
> -- mode_t mode , dev_t dev);
> -+ mode_t mode , dev_t *dev);
> - ]])],[
> -- AC_DEFINE(XMKNOD_FRTH_ARG,)
> -- AC_MSG_RESULT([no extra *])
> -- ],[
> - AC_DEFINE(XMKNOD_FRTH_ARG,[*])
> - AC_MSG_RESULT([needs *])
> -+ ],[
> -+ AC_DEFINE(XMKNOD_FRTH_ARG,)
> -+ AC_MSG_RESULT([no extra *])
> -
> - ])
> -
> -@@ -210,13 +210,13 @@ AC_MSG_CHECKING([for type of arg of __xmknodat])
> - int __xmknodat ( int ver,
> - int dirfd,
> - const char *pathname ,
> -- mode_t mode , dev_t dev);
> -+ mode_t mode , dev_t *dev);
> - ]])],[
> -- AC_DEFINE(XMKNODAT_FIFTH_ARG,)
> -- AC_MSG_RESULT([no extra *])
> -- ],[
> - AC_DEFINE(XMKNODAT_FIFTH_ARG,[*])
> - AC_MSG_RESULT([needs *])
> -+ ],[
> -+ AC_DEFINE(XMKNODAT_FIFTH_ARG,)
> -+ AC_MSG_RESULT([no extra *])
> -
> - ])
> -
> diff --git a/patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch b/patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch
> deleted file mode 100644
> index 620afc2ea476..000000000000
> --- a/patches/fakeroot-1.25.3/0005-libfakeroot.c-fix-fts_read-and-fts_children.patch
> +++ /dev/null
> @@ -1,44 +0,0 @@
> -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> -Date: Sat, 13 Feb 2021 19:35:31 -0800
> -Subject: [PATCH] libfakeroot.c: fix fts_read and fts_children
> -
> -Apply Debian patch from [0], since glibc is usually built without LFS.
> -__USE_LARGEFILE64 and FTSENT64 should be used anyway for proper support
> -of this, if needed. See [1] for more details.
> -
> -[0]: https://sources.debian.org/patches/fakeroot/1.25.3-1.1/eglibc-fts-without-LFS/
> -[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676428
> -
> -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> ----
> - libfakeroot.c | 8 --------
> - 1 file changed, 8 deletions(-)
> -
> -diff --git a/libfakeroot.c b/libfakeroot.c
> -index 31480f8323ba..169f4da4de21 100644
> ---- a/libfakeroot.c
> -+++ b/libfakeroot.c
> -@@ -2066,11 +2066,7 @@ FTSENT *fts_read(FTS *ftsp) {
> - || r->fts_info == FTS_NS || r->fts_info == FTS_NSOK))
> - r->fts_statp = NULL; /* Otherwise fts_statp may be a random pointer */
> - if(r && r->fts_statp) { /* Should we bother checking fts_info here? */
> --# if defined(STAT64_SUPPORT) && !defined(__APPLE__)
> -- SEND_GET_STAT64(r->fts_statp, _STAT_VER);
> --# else
> - SEND_GET_STAT(r->fts_statp, _STAT_VER);
> --# endif
> - }
> -
> - return r;
> -@@ -2089,11 +2085,7 @@ FTSENT *fts_children(FTS *ftsp, int options) {
> - first=next_fts_children(ftsp, options);
> - for(r = first; r; r = r->fts_link) {
> - if(r && r->fts_statp) { /* Should we bother checking fts_info here? */
> --# if defined(STAT64_SUPPORT) && !defined(__APPLE__)
> -- SEND_GET_STAT64(r->fts_statp, _STAT_VER);
> --# else
> - SEND_GET_STAT(r->fts_statp, _STAT_VER);
> --# endif
> - }
> - }
> -
> diff --git a/patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch b/patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch
> deleted file mode 100644
> index 5db58dcd3ede..000000000000
> --- a/patches/fakeroot-1.25.3/0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -From: Dimitri John Ledkov <xnox@ubuntu.com>
> -Date: Wed, 17 Feb 2021 14:41:43 +0000
> -Subject: [PATCH] Add _STAT_VER defines for ppc64le, riscv64, s390x.
> -
> -Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
> ----
> - libfakeroot.c | 6 ++++++
> - 1 file changed, 6 insertions(+)
> -
> -diff --git a/libfakeroot.c b/libfakeroot.c
> -index 169f4da4de21..74f52ab1df79 100644
> ---- a/libfakeroot.c
> -+++ b/libfakeroot.c
> -@@ -93,6 +93,12 @@
> - #ifndef _STAT_VER
> - #if defined (__aarch64__)
> - #define _STAT_VER 0
> -+ #elif defined (__powerpc__) && __WORDSIZE == 64
> -+ #define _STAT_VER 1
> -+ #elif defined (__riscv) && __riscv_xlen==64
> -+ #define _STAT_VER 0
> -+ #elif defined (__s390x__)
> -+ #define _STAT_VER 1
> - #elif defined (__x86_64__)
> - #define _STAT_VER 1
> - #else
> diff --git a/patches/fakeroot-1.25.3/0007-OS-X-portability.patch b/patches/fakeroot-1.25.3/0007-OS-X-portability.patch
> deleted file mode 100644
> index 768696a25953..000000000000
> --- a/patches/fakeroot-1.25.3/0007-OS-X-portability.patch
> +++ /dev/null
> @@ -1,161 +0,0 @@
> -From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> -Date: Sat, 13 Feb 2021 20:05:17 -0800
> -Subject: [PATCH] OS X portability
> -
> -OS X portability work from OpenWrt.
> -
> -Cc: Felix Fietkau <nbd@nbd.name>
> -Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> ----
> - configure.ac | 1 +
> - libfakeroot.c | 36 ++++++++++++++++++++++++++++++++++--
> - wrapawk_macosx | 10 +++++++---
> - wrapfunc.inp | 4 ++--
> - 4 files changed, 44 insertions(+), 7 deletions(-)
> -
> -diff --git a/configure.ac b/configure.ac
> -index d85566f089b4..35f9ecf28993 100644
> ---- a/configure.ac
> -+++ b/configure.ac
> -@@ -146,6 +146,7 @@ for first in size_t int; do
> - #include <sys/types.h>
> - #endif
> - #include <unistd.h>
> -+#include <stdio.h>
> - #ifdef HAVE_GRP_H
> - #include <grp.h>
> - #endif
> -diff --git a/libfakeroot.c b/libfakeroot.c
> -index 74f52ab1df79..f9ca1820e4b7 100644
> ---- a/libfakeroot.c
> -+++ b/libfakeroot.c
> -@@ -128,8 +128,16 @@
> - #define INT_SEND_STAT(a,b) SEND_STAT(a,b,_STAT_VER)
> - #define INT_SEND_GET_XATTR(a,b) SEND_GET_XATTR(a,b,_STAT_VER)
> - #define INT_SEND_GET_STAT(a,b) SEND_GET_STAT(a,b)
> -+
> -+/* 10.10 uses id_t in getpriority/setpriority calls, so pretend
> -+ id_t is used everywhere, just happens to be int on some OSes */
> -+#ifndef _ID_T
> -+#define _ID_T
> -+typedef int id_t;
> -+#endif
> - #endif
> -
> -+#include <sys/types.h>
> - #include <stdlib.h>
> - #include <sys/ipc.h>
> - #include <sys/msg.h>
> -@@ -141,7 +149,6 @@
> - #include <unistd.h>
> - #include <dirent.h>
> - #include <errno.h>
> --#include <sys/types.h>
> - #ifdef HAVE_SYS_ACL_H
> - #include <sys/acl.h>
> - #endif /* HAVE_SYS_ACL_H */
> -@@ -204,6 +211,15 @@ extern int unsetenv (const char *name);
> - #undef __lxstat64
> - #undef _FILE_OFFSET_BITS
> -
> -+
> -+#ifndef AT_EMPTY_PATH
> -+#define AT_EMPTY_PATH 0
> -+#endif
> -+
> -+#ifndef AT_NO_AUTOMOUNT
> -+#define AT_NO_AUTOMOUNT 0
> -+#endif
> -+
> - /*
> - // next_wrap_st:
> - // this structure is used in next_wrap, which is defined in
> -@@ -1975,7 +1991,7 @@ ssize_t fremovexattr(int fd, const char *name)
> - }
> - #endif /* HAVE_FREMOVEXATTR */
> -
> --int setpriority(int which, int who, int prio){
> -+int setpriority(int which, id_t who, int prio){
> - if (fakeroot_disabled)
> - return next_setpriority(which, who, prio);
> - next_setpriority(which, who, prio);
> -@@ -2576,3 +2592,19 @@ int sysinfo(int command, char *buf, long count)
> - }
> - }
> - #endif
> -+
> -+#ifdef HAVE_OPENAT
> -+int openat(int dir_fd, const char *pathname, int flags, ...)
> -+{
> -+ mode_t mode;
> -+
> -+ if (flags & O_CREAT) {
> -+ va_list args;
> -+ va_start(args, flags);
> -+ mode = va_arg(args, int);
> -+ va_end(args);
> -+ }
> -+
> -+ return next_openat(dir_fd, pathname, flags, mode);
> -+}
> -+#endif
> -diff --git a/wrapawk_macosx b/wrapawk_macosx
> -index 088a7f48de49..f783219758ac 100644
> ---- a/wrapawk_macosx
> -+++ b/wrapawk_macosx
> -@@ -46,26 +46,30 @@ BEGIN{
> - argtype=$3;
> - argname=$4;
> - MACRO=$5;
> -+ argtype_def=$6
> -+ if(!argtype_def) {
> -+ argtype_def = argtype
> -+ }
> - if(MACRO){
> - print "extern " ret " MY_DEF(" name ")" argtype " __attribute__((visibility(\"hidden\")));" > headerfile;
> - print "INTERPOSE(MY_DEF(" name "_RAW)," name "_RAW);" > structfile;
> - print "#undef " name > deffile
> - print "#define " name " MY_DEF(" name "_RAW)" > deffile
> -
> -- print "extern " ret, name, argtype ";" > tmpffile;
> -+ print "extern " ret, name, argtype_def ";" > tmpffile;
> - print "static __inline__ " ret " NEXT_" MACRO "_NOARG " argtype " __attribute__((always_inline));" > tmpffile;
> - print "static __inline__ " ret " NEXT_" MACRO "_NOARG " argtype " {" > tmpffile;
> - print " return " name, argname ";" > tmpffile;
> - print "}" > tmpffile;
> - print "" > tmpffile;
> - } else {
> -- print "extern " ret " my_" name, argtype " __attribute__((visibility(\"hidden\")));" > headerfile;
> -+ print "extern " ret " my_" name, argtype_def " __attribute__((visibility(\"hidden\")));" > headerfile;
> - print "#undef " name > structfile;
> - print "INTERPOSE(my_" name "," name ");" > structfile;
> - print "#define " name " my_" name > structfile
> - print "#define " name " my_" name > deffile
> -
> -- print "extern " ret, name, argtype ";" > tmpffile;
> -+ print "extern " ret, name, argtype_def ";" > tmpffile;
> - if(argname){
> - print "static __inline__ " ret " next_" name, argtype " __attribute__((always_inline));" > tmpffile;
> - print "static __inline__ " ret " next_" name, argtype " {" > tmpffile;
> -diff --git a/wrapfunc.inp b/wrapfunc.inp
> -index f7ad1867891a..556af34579b0 100644
> ---- a/wrapfunc.inp
> -+++ b/wrapfunc.inp
> -@@ -146,7 +146,7 @@ setfsgid;gid_t;(gid_t fsgid);(fsgid)
> - initgroups;int;(const char *user, INITGROUPS_SECOND_ARG group);(user, group)
> - getgroups;int;(int size, gid_t list[]);(size, list)
> - setgroups;int;(SETGROUPS_SIZE_TYPE size, const gid_t *list);(size, list)
> --setpriority;int;(int which, int who, int prio);(which, who, prio)
> -+setpriority;int;(int which, id_t who, int prio);(which, who, prio)
> - #ifdef HAVE_CAPSET
> - capset;int;(cap_user_header_t hdrp, const cap_user_data_t datap);(hdrp, datap)
> - #endif /* HAVE_CAPSET */
> -@@ -198,7 +198,7 @@ fchownat;int;(int dir_fd, const char *path, uid_t owner, gid_t group, int flags)
> - mkdirat;int;(int dir_fd, const char *pathname, mode_t mode);(dir_fd, pathname, mode)
> - #endif /* HAVE_MKDIRAT */
> - #ifdef HAVE_OPENAT
> --openat;int;(int dir_fd, const char *pathname, int flags);(dir_fd, pathname, flags)
> -+openat;int;(int dir_fd, const char *pathname, int flags, mode_t mode);(dir_fd, pathname, flags, mode);;(int dir_fd, const char *pathname, int flags, ...)
> - #endif /* HAVE_OPENAT */
> - #ifdef HAVE_RENAMEAT
> - renameat;int;(int olddir_fd, const char *oldpath, int newdir_fd, const char *newpath);(olddir_fd, oldpath, newdir_fd, newpath)
> diff --git a/patches/fakeroot-1.25.3/series b/patches/fakeroot-1.25.3/series
> deleted file mode 100644
> index fa00105832e5..000000000000
> --- a/patches/fakeroot-1.25.3/series
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -# generated by git-ptx-patches
> -#tag:base --start-number 1
> -#tag:upstream --start-number 1
> -0001-libfakeroot.c-define-_STAT_VER-if-not-already-define.patch
> -0002-libfakeroot.c-add-wrappers-for-new-glibc-2.33-symbol.patch
> -0003-libfakeroot.c-fix-compile-error-with-DEBUG-enabled.patch
> -0004-configure.ac-fix-__xmknod-at-pointer-argument.patch
> -0005-libfakeroot.c-fix-fts_read-and-fts_children.patch
> -0006-Add-_STAT_VER-defines-for-ppc64le-riscv64-s390x.patch
> -0007-OS-X-portability.patch
> -#tag:ptxdist --start-number 100
> -0008-make-fakeroot-relocatable.patch
> -# d07e91409b4dcfb1e6e2abd76ddc7481 - git-ptx-patches magic
> diff --git a/patches/fakeroot-1.28/0001-Also-wrap-the-stat-library-call.patch b/patches/fakeroot-1.28/0001-Also-wrap-the-stat-library-call.patch
> new file mode 100644
> index 000000000000..daff7f347744
> --- /dev/null
> +++ b/patches/fakeroot-1.28/0001-Also-wrap-the-stat-library-call.patch
> @@ -0,0 +1,71 @@
> +From: Christian Melki <christian.melki@t2data.com>
> +Date: Wed, 11 May 2022 10:23:40 +0200
> +Subject: [PATCH] Also wrap the "stat" library call
> +
> +Patch by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
> +Bug-Debian: https://bugs.debian.org/1001961
> +
> +Seems changes in glibc 2.33 caused the stat() function to be mapped
> +into a stat() library call instead of __xstat() as it used to be.
> +
> +However, fakeroot does not wrap this, causing files to be reported
> +with the real owner, not 0 as expected.
> +
> +The fix for this got a bit ugly as the abstraction in configure.ac
> +would not allow wrapping both "stat" and "__xstat". So enhance the
> +search list capabilities with an optional symbol how the wrapped
> +function is named internally. Also hack the parser so "stat" gets
> +actually probed and not mistaken for __xstat.
> +
> +Using "realstat" as a symbol is not the best choice as it might be
> +confusing, but "statstat" seemed even worse.
> +
> +Signed-off-by: Christian Melki <christian.melki@t2data.com>
> +---
> + configure.ac | 18 ++++++++++++++----
> + 1 file changed, 14 insertions(+), 4 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index e7c1c7c484f3..3fa4756557af 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -362,9 +362,13 @@ dnl Digital Unix: stat
> +
> + :>fakerootconfig.h.tmp
> +
> +-for SEARCH in %stat f%stat l%stat f%statat %stat64 f%stat64 l%stat64 f%statat64 %mknod %mknodat; do
> +- FUNC=`echo $SEARCH|sed -e 's/.*%//'`
> ++for SEARCH in %stat s%tat@realstat f%stat l%stat f%statat %stat64 f%stat64 l%stat64 f%statat64 %mknod %mknodat; do
> ++ FUNC=`echo $SEARCH|sed -e 's/.*%// ; s/@.*//'`
> + PRE=`echo $SEARCH|sed -e 's/%.*//'`
> ++ SYMBOL=`echo $SEARCH|sed -e 's/.*@//'`
> ++ if test "$SYMBOL" = "$SEARCH" ; then
> ++ SYMBOL="${PRE}${FUNC}"
> ++ fi
> + FOUND=
> + for WRAPPED in __${PRE}x${FUNC} _${PRE}x${FUNC} __${PRE}${FUNC}13 ${PRE}${FUNC}; do
> + AC_CHECK_FUNCS($WRAPPED,FOUND=$WRAPPED)
> +@@ -375,8 +379,8 @@ dnl
> + dnl for WRAPPED in _${PRE}${FUNC}; do
> + dnl FOUND=$WRAPPED
> + if test -n "$FOUND"; then
> +- PF=[`echo ${PRE}${FUNC}| tr '[a-z]' '[A-Z]'`]
> +- DEFINE_WRAP=[`echo wrap_${PRE}${FUNC}| tr '[a-z]' '[A-Z]'`]
> ++ PF=[`echo $SYMBOL | tr '[a-z]' '[A-Z]'`]
> ++ DEFINE_WRAP=[`echo wrap_${SYMBOL}| tr '[a-z]' '[A-Z]'`]
> + DEFINE_NEXT=[`echo wrap_${FOUND}| tr '[a-z]' '[A-Z]'`]
> + DEFINE_ARG=[`echo wrap_${FOUND}| tr '[a-z]' '[A-Z]'`]
> + AC_DEFINE_UNQUOTED(WRAP_${PF}, $FOUND)
> +@@ -518,6 +522,12 @@ AH_VERBATIM([WRAP_STAT],
> + #define TMP_STAT __astat
> + #define NEXT_STAT_NOARG next___astat
> +
> ++#define WRAP_REALSTAT __astat
> ++#define WRAP_REALSTAT_QUOTE __astat
> ++#define WRAP_REALSTAT_RAW __astat
> ++#define TMP_REALSTAT __astat
> ++#define NEXT_REALSTAT_NOARG next___astat
> ++
> + #define WRAP_LSTAT_QUOTE __astat
> + #define WRAP_LSTAT __astat
> + #define WRAP_LSTAT_RAW __astat
> diff --git a/patches/fakeroot-1.28/0002-Fix-prototype-generation-for-openat.patch b/patches/fakeroot-1.28/0002-Fix-prototype-generation-for-openat.patch
> new file mode 100644
> index 000000000000..3e091379da0e
> --- /dev/null
> +++ b/patches/fakeroot-1.28/0002-Fix-prototype-generation-for-openat.patch
> @@ -0,0 +1,70 @@
> +From: Christian Melki <christian.melki@t2data.com>
> +Date: Wed, 11 May 2022 10:25:59 +0200
> +Subject: [PATCH] Fix prototype generation for openat
> +
> +Patch by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
> +Bug-Debian: https://bugs.debian.org/995393
> +
> +As jrtc27 pointed out in IRC, ppc64el is more strict than other
> +architectures when it comes to va_arg handling:
> +
> + it's that ppc64le uses the elfv2 abi, and for variadic calls you
> + must reserve space for a parameter save area
> +
> +So enhance wrapawk to create a proper prototype and argument
> +handling although it's specific to the openat call. Also add the
> +missing documentation for the sixth column to wrapfunc.inp.
> +
> +Signed-off-by: Christian Melki <christian.melki@t2data.com>
> +---
> + wrapawk | 20 +++++++++++++++++++-
> + wrapfunc.inp | 4 +++-
> + 2 files changed, 22 insertions(+), 2 deletions(-)
> +
> +diff --git a/wrapawk b/wrapawk
> +index a2fd220a6fcb..9b2c285c257b 100644
> +--- a/wrapawk
> ++++ b/wrapawk
> +@@ -37,7 +37,25 @@ BEGIN{
> + argtype=$3;
> + argname=$4;
> + MACRO=$5;
> +- if(MACRO){
> ++ openat_extra=$6;
> ++ if(openat_extra){
> ++ print " {(void(*))&next_" name ", \"" name "\"}," > structfile;
> ++ print "extern " ret " (*next_" name ")" openat_extra ";" > headerfile;
> ++ print ret " (*next_" name ")" openat_extra "=tmp_" name ";"> deffile;
> ++
> ++ print ret " tmp_" name, openat_extra "{" > tmpffile;
> ++ print " mode_t mode = 0;" > tmpffile;
> ++ print " if (flags & O_CREAT) {" > tmpffile;
> ++ print " va_list args;" > tmpffile;
> ++ print " va_start(args, flags);" > tmpffile;
> ++ print " mode = va_arg(args, int);" > tmpffile;
> ++ print " va_end(args);" > tmpffile;
> ++ print " }" > tmpffile;
> ++ print " load_library_symbols();" > tmpffile;
> ++ print " return next_" name, argname ";" > tmpffile;
> ++ print "}" > tmpffile;
> ++ print "" > tmpffile;
> ++ } else if(MACRO){
> + print " {(void(*))&NEXT_" MACRO "_NOARG, " name "_QUOTE}," > structfile;
> + print "extern " ret " (*NEXT_" MACRO "_NOARG)" argtype ";" > headerfile;
> + print ret " (*NEXT_" MACRO "_NOARG)" argtype "=TMP_" MACRO ";"> deffile;
> +diff --git a/wrapfunc.inp b/wrapfunc.inp
> +index 556af34579b0..f5bd4063152c 100644
> +--- a/wrapfunc.inp
> ++++ b/wrapfunc.inp
> +@@ -9,8 +9,10 @@
> + /**/ */
> + /* each line of this file lists 4 fields, seperated by a ";". */
> + /* The first field is the name of the wrapped function, then it's return */
> +-/* value. After that come the function arguments with types, and the last */
> ++/* value. After that come the function arguments with types, and the fifth */
> + /* field contains the function arguments without types. */
> ++/* A sixth field is a special needed when wrapping the openat syscall. */
> ++/* Otherwise it's like the third (function arguments with types). */
> + /**/
> +
> + /* __*xstat are used on glibc systems instead of just *xstat. */
> diff --git a/patches/fakeroot-1.25.3/0008-make-fakeroot-relocatable.patch b/patches/fakeroot-1.28/0003-make-fakeroot-relocatable.patch
> similarity index 100%
> rename from patches/fakeroot-1.25.3/0008-make-fakeroot-relocatable.patch
> rename to patches/fakeroot-1.28/0003-make-fakeroot-relocatable.patch
> diff --git a/patches/fakeroot-1.25.3/autogen.sh b/patches/fakeroot-1.28/autogen.sh
> similarity index 100%
> rename from patches/fakeroot-1.25.3/autogen.sh
> rename to patches/fakeroot-1.28/autogen.sh
> diff --git a/patches/fakeroot-1.28/series b/patches/fakeroot-1.28/series
> new file mode 100644
> index 000000000000..7cc751cd490a
> --- /dev/null
> +++ b/patches/fakeroot-1.28/series
> @@ -0,0 +1,6 @@
> +# generated by git-ptx-patches
> +#tag:base --start-number 1
> +0001-Also-wrap-the-stat-library-call.patch
> +0002-Fix-prototype-generation-for-openat.patch
> +0003-make-fakeroot-relocatable.patch
> +# a15acfb9f130741fa53186998a6f6ee3 - git-ptx-patches magic
> diff --git a/rules/host-fakeroot.make b/rules/host-fakeroot.make
> index 3a09e4ce84a2..80d9d7fbf3b8 100644
> --- a/rules/host-fakeroot.make
> +++ b/rules/host-fakeroot.make
> @@ -15,12 +15,12 @@ HOST_PACKAGES-$(PTXCONF_HOST_FAKEROOT) += host-fakeroot
> #
> # Paths and names
> #
> -HOST_FAKEROOT_VERSION := 1.25.3
> -HOST_FAKEROOT_MD5 := f6104ef6960c962377ef062bf222a1d2
> +HOST_FAKEROOT_VERSION := 1.28
> +HOST_FAKEROOT_MD5 := 75663fa4d0d1eedab0b951bb977bc12f
> HOST_FAKEROOT_SUFFIX := tar.gz
> HOST_FAKEROOT := fakeroot-$(HOST_FAKEROOT_VERSION)
> HOST_FAKEROOT_TARBALL := fakeroot_$(HOST_FAKEROOT_VERSION).orig.$(HOST_FAKEROOT_SUFFIX)
> -HOST_FAKEROOT_URL := https://snapshot.debian.org/archive/debian/20210123T025406Z/pool/main/f/fakeroot/$(HOST_FAKEROOT_TARBALL)
> +HOST_FAKEROOT_URL := https://snapshot.debian.org/archive/debian/20220304T204941Z/pool/main/f/fakeroot/$(HOST_FAKEROOT_TARBALL)
> HOST_FAKEROOT_SOURCE := $(SRCDIR)/$(HOST_FAKEROOT_TARBALL)
> HOST_FAKEROOT_DIR := $(HOST_BUILDDIR)/$(HOST_FAKEROOT)
> HOST_FAKEROOT_LICENSE := GPL-3.0-or-later