diff --git a/packages/valgrind/Makefile.all.am.patch b/packages/valgrind/Makefile.all.am.patch new file mode 100644 index 000000000..811c084ba --- /dev/null +++ b/packages/valgrind/Makefile.all.am.patch @@ -0,0 +1,20 @@ +--- a/Makefile.all.am ++++ b/Makefile.all.am +@@ -335,13 +335,13 @@ + PRELOAD_LDFLAGS_COMMON_LINUX += -nostdlib + endif + +-PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ +-PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ ++PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ $(shell $(CC) @FLAG_M32@ -print-libgcc-file-name) ++PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ $(shell $(CC) @FLAG_M64@ -print-libgcc-file-name) + PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ + PRELOAD_LDFLAGS_PPC64BE_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ + PRELOAD_LDFLAGS_PPC64LE_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ +-PRELOAD_LDFLAGS_ARM_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ +-PRELOAD_LDFLAGS_ARM64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ ++PRELOAD_LDFLAGS_ARM_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ $(shell $(CC) @FLAG_M32@ -print-libgcc-file-name) ++PRELOAD_LDFLAGS_ARM64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ $(shell $(CC) @FLAG_M64@ -print-libgcc-file-name) + PRELOAD_LDFLAGS_X86_FREEBSD = $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M32@ + PRELOAD_LDFLAGS_AMD64_FREEBSD= $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@ + PRELOAD_LDFLAGS_X86_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch i386 diff --git a/packages/valgrind/Makefile.tool.am.patch b/packages/valgrind/Makefile.tool.am.patch new file mode 100644 index 000000000..c89205a03 --- /dev/null +++ b/packages/valgrind/Makefile.tool.am.patch @@ -0,0 +1,31 @@ +--- a/Makefile.tool.am ++++ b/Makefile.tool.am +@@ -44,13 +44,13 @@ + -nodefaultlibs -nostartfiles -Wl,-u,_start @FLAG_NO_BUILD_ID@ + + TOOL_LDFLAGS_X86_LINUX = \ +- $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ ++ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ $(shell $(CC) @FLAG_M32@ -print-libgcc-file-name) + + TOOL_LDFLAGS_X86_FREEBSD = \ + $(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M32@ + + TOOL_LDFLAGS_AMD64_LINUX = \ +- $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ ++ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ $(shell $(CC) @FLAG_M64@ -print-libgcc-file-name) + + TOOL_LDFLAGS_AMD64_FREEBSD = \ + $(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@ +@@ -65,10 +65,10 @@ + $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ + + TOOL_LDFLAGS_ARM_LINUX = \ +- $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ ++ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ $(shell $(CC) @FLAG_M32@ -print-libgcc-file-name) + + TOOL_LDFLAGS_ARM64_LINUX = \ +- $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ ++ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ $(shell $(CC) @FLAG_M64@ -print-libgcc-file-name) + + TOOL_LDFLAGS_S390X_LINUX = \ + $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ diff --git a/packages/valgrind/build.sh b/packages/valgrind/build.sh index 1e86630cc..95d63b058 100644 --- a/packages/valgrind/build.sh +++ b/packages/valgrind/build.sh @@ -11,11 +11,11 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-tmpdir=$TERMUX_PREFIX/tmp" termux_step_pre_configure() { CFLAGS=${CFLAGS/-fstack-protector-strong/} - LDFLAGS+=" $($CC -print-libgcc-file-name)" if [ "$TERMUX_ARCH" == "aarch64" ]; then cp $TERMUX_PKG_BUILDER_DIR/aarch64-setjmp.S $TERMUX_PKG_SRCDIR - autoreconf -if + patch --silent -p1 < $TERMUX_PKG_BUILDER_DIR/coregrindmake.am.diff + patch --silent -p1 < $TERMUX_PKG_BUILDER_DIR/memcheckmake.am.diff TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-only64bit" elif [ "$TERMUX_ARCH" == "arm" ]; then # valgrind doesn't like arm; armv7 works, though. @@ -24,4 +24,6 @@ termux_step_pre_configure() { # "valgrind uses inline assembly that is not Thumb compatible": CFLAGS=${CFLAGS/-mthumb/} fi + + autoreconf -fi } diff --git a/packages/valgrind/coregrindmake.am.patch b/packages/valgrind/coregrindmake.am.diff similarity index 100% rename from packages/valgrind/coregrindmake.am.patch rename to packages/valgrind/coregrindmake.am.diff diff --git a/packages/valgrind/memcheckmake.am.patch b/packages/valgrind/memcheckmake.am.diff similarity index 100% rename from packages/valgrind/memcheckmake.am.patch rename to packages/valgrind/memcheckmake.am.diff