From c871e251467ad11f094d96b3b2a605ea1f32d5dd Mon Sep 17 00:00:00 2001 From: edanaher Date: Tue, 26 Jul 2016 17:54:55 -0400 Subject: [PATCH] Add valgrind package. (#310) --- packages/valgrind/build.sh | 12 ++++++++++ .../valgrind/dont-redefine-elf32_nhdr.patch | 23 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 packages/valgrind/build.sh create mode 100644 packages/valgrind/dont-redefine-elf32_nhdr.patch diff --git a/packages/valgrind/build.sh b/packages/valgrind/build.sh new file mode 100644 index 000000000..664941f26 --- /dev/null +++ b/packages/valgrind/build.sh @@ -0,0 +1,12 @@ +TERMUX_PKG_HOMEPAGE=http://valgrind.org/ +TERMUX_PKG_DESCRIPTION="Valgrind is an instrumentation framework for building dynamic analysis tools." +TERMUX_PKG_VERSION=3.11.0 +TERMUX_PKG_SRCURL=http://valgrind.org/downloads/valgrind-${TERMUX_PKG_VERSION}.tar.bz2 +TERMUX_PKG_DEPENDS="" + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-tmpdir=/data/data/com.termux/files/usr/tmp" +if [ "$TERMUX_ARCH" == "arm" ]; then + # valgrind doesn't like arm; armv7 works, though. + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --host=armv7-linux-androideabi" +fi + diff --git a/packages/valgrind/dont-redefine-elf32_nhdr.patch b/packages/valgrind/dont-redefine-elf32_nhdr.patch new file mode 100644 index 000000000..dd1f7c9c3 --- /dev/null +++ b/packages/valgrind/dont-redefine-elf32_nhdr.patch @@ -0,0 +1,23 @@ +Binary files src/coregrind/m_coredump/.coredump-elf.c.swp and src2/coregrind/m_coredump/.coredump-elf.c.swp differ +diff -purN src/coregrind/m_coredump/coredump-elf.c src2/coregrind/m_coredump/coredump-elf.c +--- src/coregrind/m_coredump/coredump-elf.c 2016-06-09 19:42:06.566486519 +0000 ++++ src2/coregrind/m_coredump/coredump-elf.c 2015-09-08 13:23:27.000000000 +0000 +@@ -135,18 +135,6 @@ static void fill_phdr(ESZ(Phdr) *phdr, c + phdr->p_align = VKI_PAGE_SIZE; + } + +-#if defined(VGPV_arm_linux_android) || defined(VGPV_x86_linux_android) \ +- || defined(VGPV_mips32_linux_android) +-/* Android's libc doesn't provide a definition for this. Hence: */ +-typedef +- struct { +- Elf32_Word n_namesz; +- Elf32_Word n_descsz; +- Elf32_Word n_type; +- } +- Elf32_Nhdr; +-#endif +- + struct note { + struct note *next; + ESZ(Nhdr) note;