From 33b7171dd6aa97b33a75e363004d8e50c3c8ae54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bednarski?= Date: Sat, 7 May 2016 21:48:14 +0200 Subject: [PATCH] ltrace: Step towards working version - Use version from git, current release has problems with ARM - Replace rindex with strrchr using C preprocessor - Don't exit on ltelf_destroy on library that failed to load --- disabled-packages/ltrace/build.sh | 26 ++++++++++++++++++--- disabled-packages/ltrace/ltrace-elf.c.patch | 13 +++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 disabled-packages/ltrace/ltrace-elf.c.patch diff --git a/disabled-packages/ltrace/build.sh b/disabled-packages/ltrace/build.sh index a91233d56..75f798374 100644 --- a/disabled-packages/ltrace/build.sh +++ b/disabled-packages/ltrace/build.sh @@ -1,5 +1,25 @@ TERMUX_PKG_HOMEPAGE=http://www.ltrace.org/ TERMUX_PKG_DESCRIPTION="Tracks runtime library calls in dynamically linked programs" -TERMUX_PKG_VERSION=0.7.3 -TERMUX_PKG_SRCURL=http://www.ltrace.org/ltrace_${TERMUX_PKG_VERSION}.orig.tar.bz2 -TERMUX_PKG_FOLDERNAME=ltrace-${TERMUX_PKG_VERSION} +TERMUX_PKG_VERSION=0.7.3.20160411 +TERMUX_PKG_DEPENDS="elfutils" + +# TERMUX_PKG_SRCURL=http://www.ltrace.org/ltrace_${TERMUX_PKG_VERSION}.orig.tar.bz2 +# TERMUX_PKG_FOLDERNAME=ltrace-${TERMUX_PKG_VERSION} + +_COMMIT=2def9f1217374cc8371105993003b2c663aefda7 +TERMUX_PKG_SRCURL=https://github.com/dkogan/ltrace/archive/${_COMMIT}.zip +TERMUX_PKG_FOLDERNAME=ltrace-${_COMMIT} + +termux_step_pre_configure () { + autoreconf -i ../src +} + + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_host=$TERMUX_ARCH-generic-linux-gnu" + +CFLAGS+=" -Wno-error=maybe-uninitialized" + +# rindex is obsolete name of strrchr which is not available in Android +# function signature stays same, so I'm replacing it with C preprocessor +# instead of patch +CFLAGS+=" -Drindex=strrchr" diff --git a/disabled-packages/ltrace/ltrace-elf.c.patch b/disabled-packages/ltrace/ltrace-elf.c.patch new file mode 100644 index 000000000..eaa181256 --- /dev/null +++ b/disabled-packages/ltrace/ltrace-elf.c.patch @@ -0,0 +1,13 @@ +--- ltrace-2def9f1217374cc8371105993003b2c663aefda7/ltrace-elf.c 2016-04-11 21:30:04.000000000 +0200 ++++ src/ltrace-elf.c 2016-05-07 21:23:17.999754862 +0200 +@@ -423,7 +423,9 @@ + debug(DEBUG_FUNCTION, "close_elf()"); + elf_end(lte->elf); + close(lte->fd); +- VECT_DESTROY(<e->plt_relocs, GElf_Rela, NULL, NULL); ++ if (lte->plt_relocs.elt_size) { ++ VECT_DESTROY(<e->plt_relocs, GElf_Rela, NULL, NULL); ++ } + } + + static void