From e27d2b97e434602e260cae6f8f7c0a1dfa4d1939 Mon Sep 17 00:00:00 2001 From: Faheem Pervez Date: Sun, 16 Jan 2022 03:23:51 +0000 Subject: [PATCH] strace: enable mpers for aarch64 --- packages/strace/build.sh | 10 ++++++---- packages/strace/configure-find-armv7-cc.patch | 18 ++++++++++++++++++ ...mpers-use-host-readelf-for-debug-dump.patch | 13 +++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 packages/strace/configure-find-armv7-cc.patch create mode 100644 packages/strace/mpers-use-host-readelf-for-debug-dump.patch diff --git a/packages/strace/build.sh b/packages/strace/build.sh index eff16595e..66483a022 100644 --- a/packages/strace/build.sh +++ b/packages/strace/build.sh @@ -8,10 +8,7 @@ TERMUX_PKG_SHA256=dc7db230ff3e57c249830ba94acab2b862da1fcaac55417e9b85041a833ca2 TERMUX_PKG_AUTO_UPDATE=true TERMUX_PKG_DEPENDS="libdw" -# Without st_cv_m32_mpers=no the build fails if gawk is installed. TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -st_cv_m32_mpers=no ---enable-mpers=no --with-libdw " @@ -19,6 +16,11 @@ st_cv_m32_mpers=no TERMUX_PKG_RM_AFTER_INSTALL="bin/strace-graph" termux_step_pre_configure() { - autoreconf # for configure.ac in 5.11fix.patch + if [ "$TERMUX_ARCH" = "arm" ] || [ "$TERMUX_ARCH" = "i686" ] || [ "$TERMUX_ARCH" = "x86_64" ]; then + # Without st_cv_m32_mpers=no the build fails if gawk is installed. + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" st_cv_m32_mpers=no" + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-mpers=no" + fi + autoreconf # for configure.ac in configure-find-armv7-cc.patch CPPFLAGS+=" -Dfputs_unlocked=fputs" } diff --git a/packages/strace/configure-find-armv7-cc.patch b/packages/strace/configure-find-armv7-cc.patch new file mode 100644 index 000000000..79a7b14bb --- /dev/null +++ b/packages/strace/configure-find-armv7-cc.patch @@ -0,0 +1,18 @@ +diff --git a/configure.ac b/configure.ac +index d17ba04a7..9b677a77f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -753,10 +753,10 @@ AS_IF([test x$arch = xaarch64], + # Red Hat: arm-redhat-linux-gnu-gcc + # Fedora: arm-linux-gnu-gcc + # ALT: armh-alt-linux-gnueabi-gcc +- m4_foreach([triplet1], [arm, arm7, arm7hl, armh], dnl ++ m4_foreach([triplet1], [arm, arm7, armv7a, arm7hl, armh], dnl + [m4_foreach([triplet2], [, $host_vendor-], dnl +- [m4_foreach([triplet3], [gnu, gnueabi, gnueabihf], dnl +- [m4_foreach([triplet_cc], [gcc, cc], dnl ++ [m4_foreach([triplet3], [gnu, gnueabi, gnueabihf, androideabi], dnl ++ [m4_foreach([triplet_cc], [gcc, cc, clang], dnl + [m4_append([arm_compat_compilers], dnl + triplet1[-]triplet2[linux-]triplet3[-]triplet_cc)])])])]) + AC_CHECK_PROGS(CC_FOR_M32, arm_compat_compilers) diff --git a/packages/strace/mpers-use-host-readelf-for-debug-dump.patch b/packages/strace/mpers-use-host-readelf-for-debug-dump.patch new file mode 100644 index 000000000..1aad4d947 --- /dev/null +++ b/packages/strace/mpers-use-host-readelf-for-debug-dump.patch @@ -0,0 +1,13 @@ +diff --git a/src/mpers.sh b/src/mpers.sh +index bb5685465..ae309caed 100755 +--- a/src/mpers.sh ++++ b/src/mpers.sh +@@ -15,7 +15,7 @@ ARCH_FLAG=$1 + CC_ARCH_FLAG=$2 + PARSER_FILE=$3 + +-READELF="${READELF:-readelf}" ++READELF="readelf" + CC="${CC-gcc}" + CFLAGS="$CFLAGS -gdwarf-2 -c" + CPP="${CPP-$CC -E}"