Merge in a port for mips32-linux, by Petar Jovanovic and Dejan Jevtic,
mips-valgrind@rt-rk.com, Bug 270777.

Valgrind: changes to existing files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12616 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/Makefile.tool.am b/Makefile.tool.am
index 7924b1b..6f5a6ea 100644
--- a/Makefile.tool.am
+++ b/Makefile.tool.am
@@ -59,6 +59,11 @@
 TOOL_LDFLAGS_AMD64_DARWIN = \
 	$(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64
 
+# MIPS Linux default start symbol is __start, not _start like on x86 or amd
+TOOL_LDFLAGS_MIPS32_LINUX = \
+	-static -nodefaultlibs -nostartfiles -u __start @FLAG_NO_BUILD_ID@ \
+	@FLAG_M32@
+
 # On Android we must ask for non-executable stack, not sure why.
 if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
 if VGCONF_PLATVARIANT_IS_ANDROID
@@ -103,6 +108,8 @@
 LIBREPLACEMALLOC_S390X_LINUX = \
 	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-s390x-linux.a
 
+LIBREPLACEMALLOC_MIPS32_LINUX = \
+	$(top_builddir)/coregrind/libreplacemalloc_toolpreload-mips32-linux.a
 
 LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \
 	-Wl,--whole-archive \
@@ -140,6 +147,11 @@
 	$(LIBREPLACEMALLOC_S390X_LINUX) \
 	-Wl,--no-whole-archive
 
+LIBREPLACEMALLOC_LDFLAGS_MIPS32_LINUX = \
+	-Wl,--whole-archive \
+	$(LIBREPLACEMALLOC_MIPS32_LINUX) \
+	-Wl,--no-whole-archive
+
 #----------------------------------------------------------------------------
 # General stuff
 #----------------------------------------------------------------------------