Build vg_replace_malloc.c into a library, because it makes the Makefiles a bit
neater. Also remove some dodgy CFLAGS+= lines.
I had to change the expected output of pth_once.c, because the change has
altered the order of the (non-deterministic) output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2825 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/Makefile.am b/memcheck/Makefile.am
index 86b6d7d..36d2b20 100644
--- a/memcheck/Makefile.am
+++ b/memcheck/Makefile.am
@@ -7,9 +7,11 @@
vgpreload_memcheck_so_SOURCES = \
mac_replace_strmem.c
-vgpreload_memcheck_so_LDADD = $(top_builddir)/coregrind/vg_replace_malloc.o
-vgpreload_memcheck_so_DEPENDENCIES = $(top_builddir)/coregrind/vg_replace_malloc.o
-vgpreload_memcheck_so_LDFLAGS = -shared -Wl,-z,interpose,-z,initfirst
+vgpreload_memcheck_so_DEPENDENCIES = $(top_builddir)/coregrind/lib_replace_malloc.a
+vgpreload_memcheck_so_LDFLAGS = -shared -Wl,-z,interpose,-z,initfirst \
+ -Wl,--whole-archive \
+ $(top_builddir)/coregrind/lib_replace_malloc.a \
+ -Wl,--no-whole-archive
vgskin_memcheck_so_SOURCES = \
mac_leakcheck.c \