From 00f974879df3416954431a3da4e5f157771263b7 Mon Sep 17 00:00:00 2001 From: Christian Melki Date: Fri, 23 Sep 2022 16:21:10 +0200 Subject: host-fakeroot: Version bump. 1.28 -> 1.29. Minor bugfix. Hardly noteworthy. * Forward patches. Signed-off-by: Christian Melki Message-Id: <20220923142110.1904332-1-christian.melki@t2data.com> Signed-off-by: Michael Olbrich --- .../0001-Also-wrap-the-stat-library-call.patch | 71 ---------------------- .../0002-Fix-prototype-generation-for-openat.patch | 70 --------------------- .../0003-make-fakeroot-relocatable.patch | 33 ---------- patches/fakeroot-1.28/autogen.sh | 1 - patches/fakeroot-1.28/series | 6 -- .../0001-Also-wrap-the-stat-library-call.patch | 71 ++++++++++++++++++++++ .../0002-Fix-prototype-generation-for-openat.patch | 70 +++++++++++++++++++++ .../0003-make-fakeroot-relocatable.patch | 33 ++++++++++ patches/fakeroot-1.29/autogen.sh | 1 + patches/fakeroot-1.29/series | 6 ++ rules/host-fakeroot.make | 6 +- 11 files changed, 184 insertions(+), 184 deletions(-) delete mode 100644 patches/fakeroot-1.28/0001-Also-wrap-the-stat-library-call.patch delete mode 100644 patches/fakeroot-1.28/0002-Fix-prototype-generation-for-openat.patch delete mode 100644 patches/fakeroot-1.28/0003-make-fakeroot-relocatable.patch delete mode 120000 patches/fakeroot-1.28/autogen.sh delete mode 100644 patches/fakeroot-1.28/series create mode 100644 patches/fakeroot-1.29/0001-Also-wrap-the-stat-library-call.patch create mode 100644 patches/fakeroot-1.29/0002-Fix-prototype-generation-for-openat.patch create mode 100644 patches/fakeroot-1.29/0003-make-fakeroot-relocatable.patch create mode 120000 patches/fakeroot-1.29/autogen.sh create mode 100644 patches/fakeroot-1.29/series 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 deleted file mode 100644 index daff7f347..000000000 --- a/patches/fakeroot-1.28/0001-Also-wrap-the-stat-library-call.patch +++ /dev/null @@ -1,71 +0,0 @@ -From: Christian Melki -Date: Wed, 11 May 2022 10:23:40 +0200 -Subject: [PATCH] Also wrap the "stat" library call - -Patch by: Christoph Biedl -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 ---- - 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 deleted file mode 100644 index 3e091379d..000000000 --- a/patches/fakeroot-1.28/0002-Fix-prototype-generation-for-openat.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Christian Melki -Date: Wed, 11 May 2022 10:25:59 +0200 -Subject: [PATCH] Fix prototype generation for openat - -Patch by: Christoph Biedl -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 ---- - 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.28/0003-make-fakeroot-relocatable.patch b/patches/fakeroot-1.28/0003-make-fakeroot-relocatable.patch deleted file mode 100644 index 8d7a6994c..000000000 --- a/patches/fakeroot-1.28/0003-make-fakeroot-relocatable.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Michael Olbrich -Date: Sun, 30 Oct 2011 22:16:53 +0100 -Subject: [PATCH] make fakeroot relocatable - -Calculate the libdir relative to the fakeroot binary. - -Not for upstream. - -Signed-off-by: Michael Olbrich ---- - scripts/fakeroot.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/scripts/fakeroot.in b/scripts/fakeroot.in -index 0d6f435af1ed..08d8b27863a8 100755 ---- a/scripts/fakeroot.in -+++ b/scripts/fakeroot.in -@@ -30,12 +30,12 @@ fatal () - } - - # strip /bin/fakeroot to find install prefix --FAKEROOT_PREFIX=@prefix@ --FAKEROOT_BINDIR=@bindir@ -+FAKEROOT_BINDIR="`dirname "$0"`" -+FAKEROOT_PREFIX="`dirname "$FAKEROOT_BINDIR"`" - - USEABSLIBPATH=@LDPRELOADABS@ - FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@ --PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot -+PATHS="${FAKEROOT_PREFIX}@libdir@":${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot - FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ - - FAKED_MODE="unknown-is-root" diff --git a/patches/fakeroot-1.28/autogen.sh b/patches/fakeroot-1.28/autogen.sh deleted file mode 120000 index 9f8a4cb7d..000000000 --- a/patches/fakeroot-1.28/autogen.sh +++ /dev/null @@ -1 +0,0 @@ -../autogen.sh \ No newline at end of file diff --git a/patches/fakeroot-1.28/series b/patches/fakeroot-1.28/series deleted file mode 100644 index 7cc751cd4..000000000 --- a/patches/fakeroot-1.28/series +++ /dev/null @@ -1,6 +0,0 @@ -# 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/patches/fakeroot-1.29/0001-Also-wrap-the-stat-library-call.patch b/patches/fakeroot-1.29/0001-Also-wrap-the-stat-library-call.patch new file mode 100644 index 000000000..daff7f347 --- /dev/null +++ b/patches/fakeroot-1.29/0001-Also-wrap-the-stat-library-call.patch @@ -0,0 +1,71 @@ +From: Christian Melki +Date: Wed, 11 May 2022 10:23:40 +0200 +Subject: [PATCH] Also wrap the "stat" library call + +Patch by: Christoph Biedl +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 +--- + 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.29/0002-Fix-prototype-generation-for-openat.patch b/patches/fakeroot-1.29/0002-Fix-prototype-generation-for-openat.patch new file mode 100644 index 000000000..3e091379d --- /dev/null +++ b/patches/fakeroot-1.29/0002-Fix-prototype-generation-for-openat.patch @@ -0,0 +1,70 @@ +From: Christian Melki +Date: Wed, 11 May 2022 10:25:59 +0200 +Subject: [PATCH] Fix prototype generation for openat + +Patch by: Christoph Biedl +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 +--- + 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.29/0003-make-fakeroot-relocatable.patch b/patches/fakeroot-1.29/0003-make-fakeroot-relocatable.patch new file mode 100644 index 000000000..8d7a6994c --- /dev/null +++ b/patches/fakeroot-1.29/0003-make-fakeroot-relocatable.patch @@ -0,0 +1,33 @@ +From: Michael Olbrich +Date: Sun, 30 Oct 2011 22:16:53 +0100 +Subject: [PATCH] make fakeroot relocatable + +Calculate the libdir relative to the fakeroot binary. + +Not for upstream. + +Signed-off-by: Michael Olbrich +--- + scripts/fakeroot.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/scripts/fakeroot.in b/scripts/fakeroot.in +index 0d6f435af1ed..08d8b27863a8 100755 +--- a/scripts/fakeroot.in ++++ b/scripts/fakeroot.in +@@ -30,12 +30,12 @@ fatal () + } + + # strip /bin/fakeroot to find install prefix +-FAKEROOT_PREFIX=@prefix@ +-FAKEROOT_BINDIR=@bindir@ ++FAKEROOT_BINDIR="`dirname "$0"`" ++FAKEROOT_PREFIX="`dirname "$FAKEROOT_BINDIR"`" + + USEABSLIBPATH=@LDPRELOADABS@ + FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@ +-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot ++PATHS="${FAKEROOT_PREFIX}@libdir@":${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot + FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ + + FAKED_MODE="unknown-is-root" diff --git a/patches/fakeroot-1.29/autogen.sh b/patches/fakeroot-1.29/autogen.sh new file mode 120000 index 000000000..9f8a4cb7d --- /dev/null +++ b/patches/fakeroot-1.29/autogen.sh @@ -0,0 +1 @@ +../autogen.sh \ No newline at end of file diff --git a/patches/fakeroot-1.29/series b/patches/fakeroot-1.29/series new file mode 100644 index 000000000..7cc751cd4 --- /dev/null +++ b/patches/fakeroot-1.29/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 80d9d7fbf..2436f99d0 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.28 -HOST_FAKEROOT_MD5 := 75663fa4d0d1eedab0b951bb977bc12f +HOST_FAKEROOT_VERSION := 1.29 +HOST_FAKEROOT_MD5 := cab9604a7dc1d58346e0d15bb285bd0f 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/20220304T204941Z/pool/main/f/fakeroot/$(HOST_FAKEROOT_TARBALL) +HOST_FAKEROOT_URL := https://snapshot.debian.org/archive/debian/20220522T213641Z/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 -- cgit v1.2.3