1include $(top_srcdir)/Makefile.tool.am 2 3EXTRA_DIST = docs/mc-manual.xml docs/mc-tech-docs.xml 4 5#---------------------------------------------------------------------------- 6# Headers 7#---------------------------------------------------------------------------- 8 9pkginclude_HEADERS = \ 10 memcheck.h 11 12noinst_HEADERS = \ 13 mc_include.h 14 15#---------------------------------------------------------------------------- 16# memcheck-<platform> 17#---------------------------------------------------------------------------- 18 19noinst_PROGRAMS = memcheck-@VGCONF_ARCH_PRI@-@VGCONF_OS@ 20if VGCONF_HAVE_PLATFORM_SEC 21noinst_PROGRAMS += memcheck-@VGCONF_ARCH_SEC@-@VGCONF_OS@ 22endif 23 24MEMCHECK_SOURCES_COMMON = \ 25 mc_leakcheck.c \ 26 mc_malloc_wrappers.c \ 27 mc_main.c \ 28 mc_translate.c \ 29 mc_machine.c \ 30 mc_errors.c 31 32memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = \ 33 $(MEMCHECK_SOURCES_COMMON) 34memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ 35 $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) 36memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ 37 $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -O2 38memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ 39 $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) 40memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \ 41 $(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) 42memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \ 43 $(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) 44memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LINK = \ 45 $(top_builddir)/coregrind/link_tool_exe_@VGCONF_OS@ \ 46 @VALT_LOAD_ADDRESS_PRI@ \ 47 $(LINK) \ 48 $(memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS) \ 49 $(memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS) 50 51if VGCONF_HAVE_PLATFORM_SEC 52memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = \ 53 $(MEMCHECK_SOURCES_COMMON) 54memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ 55 $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) 56memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ 57 $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -O2 58memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ 59 $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) 60memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \ 61 $(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@) 62memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \ 63 $(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) 64memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LINK = \ 65 $(top_builddir)/coregrind/link_tool_exe_@VGCONF_OS@ \ 66 @VALT_LOAD_ADDRESS_SEC@ \ 67 $(LINK) \ 68 $(memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS) \ 69 $(memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS) 70endif 71 72# mc_main.c contains the helper function for memcheck that get called 73# all the time. To maximise performance compile with -fomit-frame-pointer 74# Primary beneficiary is x86. 75mc_main.o: CFLAGS += -fomit-frame-pointer 76 77#---------------------------------------------------------------------------- 78# vgpreload_memcheck-<platform>.so 79#---------------------------------------------------------------------------- 80 81noinst_PROGRAMS += vgpreload_memcheck-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so 82if VGCONF_HAVE_PLATFORM_SEC 83noinst_PROGRAMS += vgpreload_memcheck-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so 84endif 85 86if VGCONF_OS_IS_DARWIN 87noinst_DSYMS = $(noinst_PROGRAMS) 88endif 89 90VGPRELOAD_MEMCHECK_SOURCES_COMMON = mc_replace_strmem.c 91 92vgpreload_memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = \ 93 $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) 94vgpreload_memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \ 95 $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) 96vgpreload_memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \ 97 $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(AM_CFLAGS_PIC) -O2 98vgpreload_memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_DEPENDENCIES = \ 99 $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_PRI_CAPS@) 100vgpreload_memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \ 101 $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) \ 102 $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) 103 104if VGCONF_HAVE_PLATFORM_SEC 105vgpreload_memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = \ 106 $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) 107vgpreload_memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \ 108 $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) 109vgpreload_memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \ 110 $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(AM_CFLAGS_PIC) -O2 111vgpreload_memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_DEPENDENCIES = \ 112 $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_SEC_CAPS@) 113vgpreload_memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \ 114 $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) \ 115 $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) 116endif 117 118# mc_replace_strmem.c runs on the simulated CPU, and it often appears 119# in stack traces shown to the user. It is built with 120# -fno-omit-frame-pointer so as to guarantee robust backtraces on x86, 121# on which CFI based unwinding is not the "normal" case and so is 122# sometimes fragile. 123mc_replace_strmem.o: CFLAGS += -fno-omit-frame-pointer 124 125