Control: tags 995393 + pending Control: tags 1001961 + pending Dear maintainer,
to fix the two pressing problems for this package, I've prepared an NMU
for fakeroot (versioned as 1.26-1.1), upload it to DELAYED/3 will follow
shortly. Please feel free to tell me if I should delay it longer.
Regards.
Christoph
diff -Nru fakeroot-1.26/debian/changelog fakeroot-1.26/debian/changelog
--- fakeroot-1.26/debian/changelog 2021-09-07 03:41:37.000000000 +0200
+++ fakeroot-1.26/debian/changelog 2021-12-23 08:19:30.000000000 +0100
@@ -1,3 +1,11 @@
+fakeroot (1.26-1.1) unstable; urgency=high
+
+ * Non-maintainer upload
+ * Also wrap the "stat" library call. Closes: #1001961
+ * Work around segfault on ppc64el. Closes: #995393
+
+ -- Christoph Biedl <[email protected]> Thu, 23 Dec 2021
08:19:30 +0100
+
fakeroot (1.26-1) unstable; urgency=medium
[ Helmut Grohne ]
diff -Nru fakeroot-1.26/debian/patches/also-wrap-stat-library-call.patch
fakeroot-1.26/debian/patches/also-wrap-stat-library-call.patch
--- fakeroot-1.26/debian/patches/also-wrap-stat-library-call.patch
1970-01-01 01:00:00.000000000 +0100
+++ fakeroot-1.26/debian/patches/also-wrap-stat-library-call.patch
2021-12-23 08:17:43.000000000 +0100
@@ -0,0 +1,63 @@
+Subject: Also wrap the "stat" library call
+Author: Christoph Biedl <[email protected]>
+Date: 2021-12-20
+Bug-Debian: https://bugs.debian.org/1001961
+Forwarded: Yes
+
+ 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.
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -353,9 +353,13 @@
+
+ :>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)
+@@ -366,8 +370,8 @@
+ 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)
+@@ -509,6 +513,12 @@
+ #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 -Nru fakeroot-1.26/debian/patches/ppc64el-workaround.patch
fakeroot-1.26/debian/patches/ppc64el-workaround.patch
--- fakeroot-1.26/debian/patches/ppc64el-workaround.patch 1970-01-01
01:00:00.000000000 +0100
+++ fakeroot-1.26/debian/patches/ppc64el-workaround.patch 2021-12-23
08:18:30.000000000 +0100
@@ -0,0 +1,31 @@
+Subject: Work around segfault on ppc64el
+Author: Christoph Biedl <[email protected]>
+Date: 2021-12-20
+Bug-Debian: https://bugs.debian.org/995393
+Forwarded: Yes
+
+ For whatever reason the generated code segfaults on ppc64el when
+ built with the usual optimizations. The root cause is not clear,
+ might be a compiler bug or the result of improperly generated
+ function prototypes.
+
+ As a workaround, disable optimizations for the affected function.
+
+ This should be re-visted upon any major compiler release whether
+ it's still needed.
+
+--- a/libfakeroot.c
++++ b/libfakeroot.c
+@@ -2596,7 +2596,11 @@
+ #endif
+
+ #ifdef HAVE_OPENAT
+-int openat(int dir_fd, const char *pathname, int flags, ...)
++int
++#if HAVE_OPENAT && defined(__powerpc__) && defined(__powerpc64__) &&
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
++__attribute__((optimize("O0")))
++#endif
++openat(int dir_fd, const char *pathname, int flags, ...)
+ {
+ mode_t mode;
+
diff -Nru fakeroot-1.26/debian/patches/series
fakeroot-1.26/debian/patches/series
--- fakeroot-1.26/debian/patches/series 2021-09-07 03:41:37.000000000 +0200
+++ fakeroot-1.26/debian/patches/series 2021-12-23 08:18:30.000000000 +0100
@@ -1 +1,3 @@
fix-shell-in-fakeroot
+also-wrap-stat-library-call.patch
+ppc64el-workaround.patch
signature.asc
Description: PGP signature

