From: Nicholas Nethercote Date: Wed, 24 Jun 2009 00:37:09 +0000 (+0000) Subject: This commit merges the BUILD_TWEAKS branch onto the trunk. It has the X-Git-Tag: svn/VALGRIND_3_5_0~481 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b05a2a18d7b918ffab0157ba0b2b55b84e3ad02e;p=thirdparty%2Fvalgrind.git This commit merges the BUILD_TWEAKS branch onto the trunk. It has the following improvements: - Arch/OS/platform-specific files are now included/excluded via the preprocessor, rather than via the build system. This is more consistent (we use the pre-processor for small arch/OS/platform-specific chunks within files) and makes the build system much simpler, as the sources for all programs are the same on all platforms. - Vast amounts of cut+paste Makefile.am code has been factored out. If a new platform is implemented, you need to add 11 extra Makefile.am lines. Previously it was over 100 lines. - Vex has been autotoolised. Dependency checking now works in Vex (no more incomplete builds). Parallel builds now also work. --with-vex no longer works; it's little use and a pain to support. VEX/Makefile is still in the Vex repository and gets overwritten at configure-time; it should probably be renamed Makefile-gcc to avoid possible problems, such as accidentally committing a generated Makefile. There's a bunch of hacky copying to deal with the fact that autotools don't handle same-named files in different directories. Julian plans to rename the files to avoid this problem. - Various small Makefile.am things have been made more standard automake style, eg. the use of pkginclude/pkglib prefixes instead of rolling our own. - The existing five top-level Makefile.am include files have been consolidated into three. - Most Makefile.am files now are structured more clearly, with comment headers separating sections, declarations relating to the same things next to each other, better spacing and layout, etc. - Removed the unused exp-ptrcheck/tests/x86 directory. - Renamed some XML files. - Factored out some duplicated dSYM handling code. - Split auxprogs/ into auxprogs/ and mpi/, which allowed the resulting Makefile.am files to be much more standard. - Cleaned up m_coredump by merging a bunch of files that had been overzealously separated. The net result is 630 fewer lines of Makefile.am code, or 897 if you exclude the added Makefile.vex.am, or 997 once the hacky file copying for Vex is removed. And the build system is much simpler. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10364 --- diff --git a/Makefile.all.am b/Makefile.all.am index 390e109598..b7c633d346 100644 --- a/Makefile.all.am +++ b/Makefile.all.am @@ -1,13 +1,212 @@ -## This file should be included by *every* Makefile.am, except those for docs/ -## and tests/ subdirectories. +# This file should be included (directly or indirectly) by every +# Makefile.am that builds programs. And also the top-level Makefile.am. + +#---------------------------------------------------------------------------- +# Global stuff +#---------------------------------------------------------------------------- -valdir = $(libdir)/valgrind inplacedir = $(top_builddir)/.in_place +# This used to be required when Vex had a handwritten Makefile. It +# shouldn't be needed any more, though. +##.NOTPARALLEL: + +#---------------------------------------------------------------------------- +# noinst_PROGRAMS and noinst_DSYMS targets +#---------------------------------------------------------------------------- + +# On Darwin, for a program 'p', the DWARF debug info is stored in the +# directory 'p.dSYM'. This must be generated after the executable is +# created, with 'dsymutil p'. We could redefine LINK with a script that +# executes 'dsymutil' after linking, but that's a pain. Instead we use this +# hook so that every time "make check" is run, we subsequently invoke +# 'dsymutil' on all the executables that lack a .dSYM directory, or that are +# newer than their corresponding .dSYM directory. +build-noinst_DSYMS: $(noinst_DSYMS) + for f in $(noinst_DSYMS); do \ + if [ ! -e $$f.dSYM -o $$f -nt $$f.dSYM ] ; then \ + echo "dsymutil $$f"; \ + dsymutil $$f; \ + fi; \ + done + +# This is used by coregrind/Makefile.am and Makefile.tool.am for doing +# "in-place" installs. It copies $(noinst_PROGRAMS) into $inplacedir. +# It needs to be depended on by an 'all-local' rule. +inplace-noinst_PROGRAMS: $(noinst_PROGRAMS) + if [ -n "$(noinst_PROGRAMS)" ] ; then \ + mkdir -p $(inplacedir); \ + for f in $(noinst_PROGRAMS) ; do \ + rm -f $(inplacedir)/$$f; \ + ln -f -s ../$(subdir)/$$f $(inplacedir); \ + done ; \ + fi + +# Similar to inplace-noinst_PROGRAMS +inplace-noinst_DSYMS: build-noinst_DSYMS + if [ -n "$(noinst_DSYMS)" ] ; then \ + mkdir -p $(inplacedir); \ + for f in $(noinst_DSYMS); do \ + rm -f $(inplacedir)/$$f.dSYM; \ + ln -f -s ../$(subdir)/$$f.dSYM $(inplacedir); \ + done ; \ + fi + +# This is used by coregrind/Makefile.am and by /Makefile.am for doing +# "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/. +# It needs to be depended on by an 'install-exec-local' rule. +install-noinst_PROGRAMS: $(noinst_PROGRAMS) + if [ -n "$(noinst_PROGRAMS)" ] ; then \ + $(mkinstalldirs) $(DESTDIR)$(pkglibdir); \ + for f in $(noinst_PROGRAMS); do \ + $(INSTALL_PROGRAM) $$f $(DESTDIR)$(pkglibdir); \ + done ; \ + fi + +# Similar to install-noinst_PROGRAMS. +# Nb: we don't use $(INSTALL_PROGRAM) here because it doesn't work with +# directories. XXX: not sure whether the resulting permissions will be +# correct when using 'cp -R'... +install-noinst_DSYMS: build-noinst_DSYMS + if [ -n "$(noinst_DSYMS)" ] ; then \ + $(mkinstalldirs) $(DESTDIR)$(pkglibdir); \ + for f in $(noinst_DSYMS); do \ + cp -R $$f.dSYM $(DESTDIR)$(pkglibdir); \ + done ; \ + fi + +# This needs to be depended on by a 'clean-local' rule. +clean-noinst_DSYMS: + for f in $(noinst_DSYMS); do \ + rm -rf $$f.dSYM; \ + done + +#---------------------------------------------------------------------------- +# Flags +#---------------------------------------------------------------------------- + +# Baseline flags for all compilations. Aim here is to maximise +# performance and get whatever useful warnings we can out of gcc. +AM_CFLAGS_BASE = \ + -O2 -g \ + -Wall \ + -Wmissing-prototypes \ + -Wshadow \ + -Wpointer-arith \ + -Wstrict-prototypes \ + -Wmissing-declarations \ + @FLAG_W_NO_FORMAT_ZERO_LENGTH@ \ + -fno-strict-aliasing + +# These flags are used for building the preload shared objects. +# The aim is to give reasonable performance but also to have good +# stack traces, since users often see stack traces extending +# into (and through) the preloads. +if VGCONF_OS_IS_DARWIN +AM_CFLAGS_PIC = -dynamic -O -g -fno-omit-frame-pointer -fno-strict-aliasing -mno-dynamic-no-pic +else +AM_CFLAGS_PIC = -fpic -O -g -fno-omit-frame-pointer -fno-strict-aliasing +endif + + +# Flags for specific targets. +# +# Nb: the AM_CPPFLAGS_* values are suitable for building tools and auxprogs. +# For building the core, coregrind/Makefile.am files add some extra things. +# +# Also: in newer versions of automake (1.10 onwards?) asm files ending with +# '.S' are considered "pre-processed" (as opposed to those ending in '.s') +# and so the CPPFLAGS are passed to the assembler. But this is not true for +# older automakes (e.g. 1.8.5, 1.9.6), sigh. So we include +# AM_CPPFLAGS_ in each AM_CCASFLAGS_ variable. This +# means some of the flags are duplicated on systems with newer versions of +# automake, but this does not really matter and seems hard to avoid. + +AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@ = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/VEX/pub \ + -DVGA_@VGCONF_ARCH_PRI@=1 \ + -DVGO_@VGCONF_OS@=1 \ + -DVGP_@VGCONF_ARCH_PRI@_@VGCONF_OS@=1 +if VGCONF_HAVE_PLATFORM_SEC +AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@ = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/VEX/pub \ + -DVGA_@VGCONF_ARCH_SEC@=1 \ + -DVGO_@VGCONF_OS@=1 \ + -DVGP_@VGCONF_ARCH_SEC@_@VGCONF_OS@=1 +endif + +AM_FLAG_M3264_X86_LINUX = @FLAG_M32@ +AM_CFLAGS_X86_LINUX = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ \ + $(AM_CFLAGS_BASE) +AM_CCASFLAGS_X86_LINUX = $(AM_CPPFLAGS_X86_LINUX) @FLAG_M32@ -g + +AM_FLAG_M3264_AMD64_LINUX = @FLAG_M64@ +AM_CFLAGS_AMD64_LINUX = @FLAG_M64@ -fomit-frame-pointer \ + @PREFERRED_STACK_BOUNDARY@ $(AM_CFLAGS_BASE) +AM_CCASFLAGS_AMD64_LINUX = $(AM_CPPFLAGS_AMD64_LINUX) @FLAG_M64@ -g + +AM_FLAG_M3264_PPC32_LINUX = @FLAG_M32@ +AM_CFLAGS_PPC32_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) +AM_CCASFLAGS_PPC32_LINUX = $(AM_CPPFLAGS_PPC32_LINUX) @FLAG_M32@ -g + +AM_FLAG_M3264_PPC64_LINUX = @FLAG_M64@ +AM_CFLAGS_PPC64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) +AM_CCASFLAGS_PPC64_LINUX = $(AM_CPPFLAGS_PPC64_LINUX) @FLAG_M64@ -g + +AM_FLAG_M3264_PPC32_AIX5 = @FLAG_MAIX32@ +AM_CFLAGS_PPC32_AIX5 = @FLAG_MAIX32@ -mcpu=powerpc $(AM_CFLAGS_BASE) +AM_CCASFLAGS_PPC32_AIX5 = $(AM_CPPFLAGS_PPC32_AIX5) \ + @FLAG_MAIX32@ -mcpu=powerpc -g + +AM_FLAG_M3264_PPC64_AIX5 = @FLAG_MAIX64@ +AM_CFLAGS_PPC64_AIX5 = @FLAG_MAIX64@ -mcpu=powerpc64 $(AM_CFLAGS_BASE) +AM_CCASFLAGS_PPC64_AIX5 = $(AM_CPPFLAGS_PPC64_AIX5) \ + @FLAG_MAIX64@ -mcpu=powerpc64 -g + +AM_FLAG_M3264_X86_DARWIN = -arch i386 +AM_CFLAGS_X86_DARWIN = $(WERROR) -arch i386 $(AM_CFLAGS_BASE) \ + -mmacosx-version-min=10.5 -fno-stack-protector \ + -mdynamic-no-pic +AM_CCASFLAGS_X86_DARWIN = $(AM_CPPFLAGS_X86_DARWIN) -arch i386 -g + +AM_FLAG_M3264_AMD64_DARWIN = -arch x86_64 +AM_CFLAGS_AMD64_DARWIN = $(WERROR) -arch x86_64 $(AM_CFLAGS_BASE) \ + -mmacosx-version-min=10.5 -fno-stack-protector +AM_CCASFLAGS_AMD64_DARWIN = $(AM_CPPFLAGS_AMD64_DARWIN) -arch x86_64 -g + +# Flags for the primary target. These must be used to build the +# regtests and performance tests. In fact, these must be used to +# build anything which is built only once on a dual-arch build. +# +AM_FLAG_M3264_PRI = $(AM_FLAG_M3264_@VGCONF_PLATFORM_PRI_CAPS@) +AM_CPPFLAGS_PRI = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +AM_CFLAGS_PRI = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +AM_CCASFLAGS_PRI = $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) + +if VGCONF_HAVE_PLATFORM_SEC + AM_FLAG_M3264_SEC = $(AM_FLAG_M3264_@VGCONF_PLATFORM_SEC_CAPS@) +else + AM_FLAG_M3264_SEC = +endif + + +# Baseline link flags for making vgpreload shared objects. +# +PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst +PRELOAD_LDFLAGS_COMMON_AIX5 = -nodefaultlibs -shared -Wl,-G -Wl,-bnogc +PRELOAD_LDFLAGS_COMMON_DARWIN = -dynamic -dynamiclib -all_load -# The kludge that passes for vex's build system can't handle parallel -# builds. So, for the time being, serialise all Valgrind building. -# (this is equivalent to enforcing "make -j 1". -.NOTPARALLEL: +PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ +PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ +PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ +PRELOAD_LDFLAGS_PPC64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ +PRELOAD_LDFLAGS_PPC32_AIX5 = $(PRELOAD_LDFLAGS_COMMON_AIX5) @FLAG_MAIX32@ +PRELOAD_LDFLAGS_PPC64_AIX5 = $(PRELOAD_LDFLAGS_COMMON_AIX5) @FLAG_MAIX64@ +PRELOAD_LDFLAGS_X86_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch i386 +PRELOAD_LDFLAGS_AMD64_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch x86_64 diff --git a/Makefile.am b/Makefile.am index 8478d246ff..3d180d1199 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,7 +32,18 @@ endif # Put docs last because building the HTML is slow and we want to get # everything else working before we try it. -SUBDIRS = include coregrind . tests perf auxprogs $(TOOLS) $(EXP_TOOLS) docs +SUBDIRS = \ + include \ + VEX \ + coregrind \ + . \ + $(TOOLS) \ + $(EXP_TOOLS) \ + tests \ + perf \ + auxprogs \ + mpi \ + docs DIST_SUBDIRS = $(SUBDIRS) SUPP_FILES = \ @@ -48,56 +59,16 @@ DEFAULT_SUPP_FILES = @DEFAULT_SUPP@ # We include all the base .supp files in the distribution, but not # default.supp, as it is built from the base .supp files at compile-time. -# The "val" in "val_DATA" ties in with $(valdir), defined in -# Makefile.all.am. From the automake info pages: -# -# Sometimes the standard directories--even as augmented by Automake--are -# not enough. In particular it is sometimes useful, for clarity, to -# install objects in a subdirectory of some predefined directory. To this -# end, Automake allows you to extend the list of possible installation -# directories. A given prefix (e.g., `zar') is valid if a variable of the -# same name with `dir' appended is defined (e.g., `zardir'). -# dist_noinst_DATA = $(SUPP_FILES) -val_DATA = default.supp + +pkglib_DATA = default.supp pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = valgrind.pc -incincdir = $(includedir)/valgrind -nodist_incinc_HEADERS = $(VEX_PUBLIC_HDRS) - BUILT_SOURCES = default.supp valgrind.pc CLEANFILES = default.supp -if VGCONF_PLATFORMS_INCLUDE_X86_LINUX -BUILT_SOURCES += valt_load_address_x86_linux.lds -CLEANFILES += valt_load_address_x86_linux.lds -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX -BUILT_SOURCES += valt_load_address_amd64_linux.lds -CLEANFILES += valt_load_address_amd64_linux.lds -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX -BUILT_SOURCES += valt_load_address_ppc32_linux.lds -CLEANFILES += valt_load_address_ppc32_linux.lds -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX -BUILT_SOURCES += valt_load_address_ppc64_linux.lds -CLEANFILES += valt_load_address_ppc64_linux.lds -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 -# No need to generate valt_load_address*.lds; the final executables -# can be linked to be at any address. They will be relocated by -# AIX kernel when they are loaded. -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 -# Ditto -endif -if VGCONF_OS_IS_DARWIN -# GrP untested, possibly hopeless -endif - default.supp: $(DEFAULT_SUPP_FILES) echo "# This is a generated file, composed of the following suppression rules:" > default.supp echo "# " $(DEFAULT_SUPP_FILES) >> default.supp @@ -116,17 +87,18 @@ perf: check @PERL@ perf/vg_perf perf # Nb: no need to include any Makefile.am files here, or files included from -# them, as automake includes them automatically. +# them, as automake includes them automatically. Also not COPYING, README +# or NEWS. EXTRA_DIST = \ + COPYING.DOCS \ README_DEVELOPERS \ README_PACKAGERS \ README_MISSING_SYSCALL_OR_IOCTL \ - valgrind.spec.in valgrind.pc.in \ - $(vex_primary_sources) \ - vg-in-place + valgrind.pc.in \ + valgrind.spec.in -install-exec-hook: - $(mkinstalldirs) $(DESTDIR)$(valdir) +dist_noinst_SCRIPTS = \ + vg-in-place all-local: default.supp mkdir -p $(inplacedir) @@ -136,132 +108,4 @@ all-local: default.supp clean-local: rm -rf $(inplacedir) -# These list the bits of vex we need to install - -VEX_PUBLIC_HDRS = \ - @VEX_DIR@/pub/libvex_guest_amd64.h \ - @VEX_DIR@/pub/libvex_ir.h \ - @VEX_DIR@/pub/libvex_guest_ppc32.h \ - @VEX_DIR@/pub/libvex_guest_ppc64.h \ - @VEX_DIR@/pub/libvex_basictypes.h \ - @VEX_DIR@/pub/libvex_guest_offsets.h \ - @VEX_DIR@/pub/libvex_emwarn.h \ - @VEX_DIR@/pub/libvex.h \ - @VEX_DIR@/pub/libvex_trc_values.h \ - @VEX_DIR@/pub/libvex_guest_arm.h \ - @VEX_DIR@/pub/libvex_guest_x86.h - -# These list the bits of vex we need to copy into the tarball - -vex_primary_sources = \ - VEX/quote.txt \ - VEX/newline.txt \ - VEX/HACKING.README \ - VEX/LICENSE.README \ - VEX/LICENSE.GPL \ - VEX/Makefile \ - VEX/auxprogs/genoffsets.c \ - VEX/pub/libvex_guest_amd64.h \ - VEX/pub/libvex_ir.h \ - VEX/pub/libvex_guest_ppc32.h \ - VEX/pub/libvex_guest_ppc64.h \ - VEX/pub/libvex_basictypes.h \ - VEX/pub/libvex_guest_offsets.h \ - VEX/pub/libvex_emwarn.h \ - VEX/pub/libvex.h \ - VEX/pub/libvex_trc_values.h \ - VEX/pub/libvex_guest_arm.h \ - VEX/pub/libvex_guest_x86.h \ - VEX/priv/ir/irmatch.c \ - VEX/priv/ir/irmatch.h \ - VEX/priv/ir/irdefs.c \ - VEX/priv/ir/iropt.c \ - VEX/priv/ir/iropt.h \ - VEX/priv/host-ppc/isel.c \ - VEX/priv/host-ppc/hdefs.c \ - VEX/priv/host-ppc/hdefs.h \ - VEX/priv/main/vex_svnversion.h \ - VEX/priv/main/vex_globals.c \ - VEX/priv/main/vex_globals.h \ - VEX/priv/main/vex_main.c \ - VEX/priv/main/vex_util.c \ - VEX/priv/main/vex_util.h \ - VEX/priv/guest-arm/ghelpers.c \ - VEX/priv/guest-arm/gdefs.h \ - VEX/priv/guest-arm/toIR.c \ - VEX/priv/guest-x86/ghelpers.c \ - VEX/priv/guest-x86/gdefs.h \ - VEX/priv/guest-x86/toIR.c \ - VEX/priv/guest-generic/g_generic_x87.c \ - VEX/priv/guest-generic/g_generic_x87.h \ - VEX/priv/guest-generic/bb_to_IR.c \ - VEX/priv/guest-generic/bb_to_IR.h \ - VEX/priv/host-arm/isel.c \ - VEX/priv/host-arm/hdefs.c \ - VEX/priv/host-arm/hdefs.h \ - VEX/priv/host-x86/isel.c \ - VEX/priv/host-x86/hdefs.c \ - VEX/priv/host-x86/hdefs.h \ - VEX/priv/guest-amd64/ghelpers.c \ - VEX/priv/guest-amd64/gdefs.h \ - VEX/priv/guest-amd64/toIR.c \ - VEX/priv/guest-ppc/ghelpers.c \ - VEX/priv/guest-ppc/gdefs.h \ - VEX/priv/guest-ppc/toIR.c \ - VEX/priv/host-generic/reg_alloc2.c \ - VEX/priv/host-generic/h_generic_regs.c \ - VEX/priv/host-generic/h_generic_regs.h \ - VEX/priv/host-generic/h_generic_simd64.c \ - VEX/priv/host-generic/h_generic_simd64.h \ - VEX/priv/host-amd64/isel.c \ - VEX/priv/host-amd64/hdefs.c \ - VEX/priv/host-amd64/hdefs.h - - -# Generate a linker script for linking the binaries. This is the -# standard gcc linker script, except hacked so that an alternative -# load address can be specified by (1) asking gcc to use this script -# (-Wl,-T,valt_load_address.lds) and (2) setting the symbol -# valt_load_address to the required value -# (-Wl,-defsym,valt_load_address=0x70000000). -# -# Extract ld's default linker script and hack it to our needs. -# First we cut everything above and below the "=====..." lines at the top -# and bottom. -# Then we have to replace the load address with "valt_load_address". -# The line to replace in has one of the following two forms: -# -# . = 0x08048000 + SIZEOF_HEADERS; -# -# or -# PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS; -# -# So we search for the line with a hex value "+ SIZEOF_HEADERS", and replace -# all the hex values in that line with "valt_load_address". -valt_load_address_x86_linux.lds: Makefile - $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ - -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ - -valt_load_address_amd64_linux.lds: Makefile - $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ - -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ - -valt_load_address_ppc32_linux.lds: Makefile - $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ - -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ -valt_load_address_ppc64_linux.lds: Makefile - $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \ - -e '1,/^=====\+$$/d' \ - -e '/^=====\+$$/,/.\*/d' \ - -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ - || rm -f $@ diff --git a/Makefile.core-tool.am b/Makefile.core-tool.am deleted file mode 100644 index b4fc2751c1..0000000000 --- a/Makefile.core-tool.am +++ /dev/null @@ -1,65 +0,0 @@ -# This file contains things shared by coregrind/Makefile.am and tool -# Makefile.am files. Also auxprogs/Makefile.am. - -# See Makefile.tool-tests.am for an explanation of dSYMs. -build-noinst_DSYMS: - for f in $(noinst_DSYMS); do \ - if [ ! -e $$f.dSYM -o $$f -nt $$f.dSYM ] ; then \ - echo "dsymutil $$f"; \ - dsymutil $$f; \ - fi; \ - done - -# This is used by coregrind/Makefile.am and Makefile.tool.am for doing -# "in-place" installs. It copies $(noinst_PROGRAMS) into $inplacedir. -# It needs to be depended on by an 'all-local' rule. -inplace-noinst_PROGRAMS: - if [ -n "$(noinst_PROGRAMS)" ] ; then \ - mkdir -p $(inplacedir); \ - for f in $(noinst_PROGRAMS) ; do \ - rm -f $(inplacedir)/$$f; \ - ln -f -s ../$(subdir)/$$f $(inplacedir); \ - done ; \ - fi - -# Similar to inplace-noinst_PROGRAMS -inplace-noinst_DSYMS: build-noinst_DSYMS - if [ -n "$(noinst_DSYMS)" ] ; then \ - mkdir -p $(inplacedir); \ - for f in $(noinst_DSYMS); do \ - rm -f $(inplacedir)/$$f.dSYM; \ - ln -f -s ../$(subdir)/$$f.dSYM $(inplacedir); \ - done ; \ - fi - -# This is used by coregrind/Makefile.am and by /Makefile.am for doing -# "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/. -# It needs to be depended on by an 'install-exec-local' rule. -install-noinst_PROGRAMS: - if [ -n "$(noinst_PROGRAMS)" ] ; then \ - $(mkinstalldirs) $(DESTDIR)$(valdir); \ - for f in $(noinst_PROGRAMS); do \ - $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir); \ - done ; \ - fi - -# Similar to install-noinst_PROGRAMS. -# Nb: we don't use $(INSTALL_PROGRAM) here because it doesn't work with -# directories. XXX: not sure whether the resulting permissions will be -# correct when using 'cp -R'... -install-noinst_DSYMS: build-noinst_DSYMS - if [ -n "$(noinst_DSYMS)" ] ; then \ - $(mkinstalldirs) $(DESTDIR)$(valdir); \ - for f in $(noinst_DSYMS); do \ - cp -R $$f.dSYM $(DESTDIR)$(valdir); \ - done ; \ - fi - -# This needs to be depended on by a 'clean-local' rule. -clean-noinst_DSYMS: - for f in $(noinst_DSYMS); do \ - rm -rf $$f.dSYM; \ - done - - - diff --git a/Makefile.flags.am b/Makefile.flags.am deleted file mode 100644 index f0352b6e03..0000000000 --- a/Makefile.flags.am +++ /dev/null @@ -1,137 +0,0 @@ - -# Baseline flags for all compilations. Aim here is to maximise -# performance and get whatever useful warnings we can out of gcc. -AM_CFLAGS_BASE = -O2 -g -Wmissing-prototypes -Wall -Wshadow \ - -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations \ - @FLAG_W_NO_FORMAT_ZERO_LENGTH@ \ - -fno-strict-aliasing - -# These flags are used for building the preload shared objects. -# The aim is to give reasonable performance but also to have good -# stack traces, since users often see stack traces extending -# into (and through) the preloads. -if VGCONF_OS_IS_DARWIN -AM_CFLAGS_PIC = -dynamic -O -g -fno-omit-frame-pointer -fno-strict-aliasing -mno-dynamic-no-pic -else -AM_CFLAGS_PIC = -fpic -O -g -fno-omit-frame-pointer -fno-strict-aliasing -endif - - -# Flags for specific targets. -# -# Nb: the AM_CPPFLAGS_* values are suitable for building tools and auxprogs. -# For building the core, coregrind/Makefile.am files add some extra things. -# -# Also: in newer versions of automake (1.10 onwards?) asm files ending with -# '.S' are considered "pre-processed" (as opposed to those ending in '.s') -# and so the CPPFLAGS are passed to the assembler. But this is not true for -# older automakes (e.g. 1.8.5, 1.9.6), sigh. So we include -# AM_CPPFLAGS_ in each AM_CCASFLAGS_ variable. This -# means some of the flags are duplicated on systems with newer versions of -# automake, but this does not really matter and seems hard to avoid. - -AM_CPPFLAGS_COMMON = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/include \ - -I@VEX_DIR@/pub - -AM_FLAG_M3264_X86_LINUX = @FLAG_M32@ -AM_CPPFLAGS_X86_LINUX = $(AM_CPPFLAGS_COMMON) \ - -DVGA_x86=1 \ - -DVGO_linux=1 \ - -DVGP_x86_linux=1 -AM_CFLAGS_X86_LINUX = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ \ - $(AM_CFLAGS_BASE) -AM_CCASFLAGS_X86_LINUX = $(AM_CPPFLAGS_X86_LINUX) @FLAG_M32@ -g - -AM_FLAG_M3264_AMD64_LINUX = @FLAG_M64@ -AM_CPPFLAGS_AMD64_LINUX = $(AM_CPPFLAGS_COMMON) \ - -DVGA_amd64=1 \ - -DVGO_linux=1 \ - -DVGP_amd64_linux=1 -AM_CFLAGS_AMD64_LINUX = @FLAG_M64@ -fomit-frame-pointer \ - @PREFERRED_STACK_BOUNDARY@ $(AM_CFLAGS_BASE) -AM_CCASFLAGS_AMD64_LINUX = $(AM_CPPFLAGS_AMD64_LINUX) @FLAG_M64@ -g - -AM_FLAG_M3264_PPC32_LINUX = @FLAG_M32@ -AM_CPPFLAGS_PPC32_LINUX = $(AM_CPPFLAGS_COMMON) \ - -DVGA_ppc32=1 \ - -DVGO_linux=1 \ - -DVGP_ppc32_linux=1 -AM_CFLAGS_PPC32_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) -AM_CCASFLAGS_PPC32_LINUX = $(AM_CPPFLAGS_PPC32_LINUX) @FLAG_M32@ -g - -AM_FLAG_M3264_PPC64_LINUX = @FLAG_M64@ -AM_CPPFLAGS_PPC64_LINUX = $(AM_CPPFLAGS_COMMON) \ - -DVGA_ppc64=1 \ - -DVGO_linux=1 \ - -DVGP_ppc64_linux=1 -AM_CFLAGS_PPC64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) -AM_CCASFLAGS_PPC64_LINUX = $(AM_CPPFLAGS_PPC64_LINUX) @FLAG_M64@ -g - -AM_FLAG_M3264_PPC32_AIX5 = @FLAG_MAIX32@ -AM_CPPFLAGS_PPC32_AIX5 = $(AM_CPPFLAGS_COMMON) \ - -DVGA_ppc32=1 \ - -DVGO_aix5=1 \ - -DVGP_ppc32_aix5=1 -AM_CFLAGS_PPC32_AIX5 = @FLAG_MAIX32@ -mcpu=powerpc $(AM_CFLAGS_BASE) -AM_CCASFLAGS_PPC32_AIX5 = $(AM_CPPFLAGS_PPC32_AIX5) \ - @FLAG_MAIX32@ -mcpu=powerpc -g - -AM_FLAG_M3264_PPC64_AIX5 = @FLAG_MAIX64@ -AM_CPPFLAGS_PPC64_AIX5 = $(AM_CPPFLAGS_COMMON) \ - -DVGA_ppc64=1 \ - -DVGO_aix5=1 \ - -DVGP_ppc64_aix5=1 -AM_CFLAGS_PPC64_AIX5 = @FLAG_MAIX64@ -mcpu=powerpc64 $(AM_CFLAGS_BASE) -AM_CCASFLAGS_PPC64_AIX5 = $(AM_CPPFLAGS_PPC64_AIX5) \ - @FLAG_MAIX64@ -mcpu=powerpc64 -g - -AM_FLAG_M3264_X86_DARWIN = -arch i386 -AM_CPPFLAGS_X86_DARWIN = $(AM_CPPFLAGS_COMMON) \ - -DVGA_x86=1 \ - -DVGO_darwin=1 \ - -DVGP_x86_darwin=1 -AM_CFLAGS_X86_DARWIN = $(WERROR) -arch i386 $(AM_CFLAGS_BASE) \ - -mmacosx-version-min=10.5 -fno-stack-protector \ - -mdynamic-no-pic -AM_CCASFLAGS_X86_DARWIN = $(AM_CPPFLAGS_X86_DARWIN) -arch i386 -g - -AM_FLAG_M3264_AMD64_DARWIN = -arch x86_64 -AM_CPPFLAGS_AMD64_DARWIN = $(AM_CPPFLAGS_COMMON) \ - -DVGA_amd64=1 \ - -DVGO_darwin=1 \ - -DVGP_amd64_darwin=1 -AM_CFLAGS_AMD64_DARWIN = $(WERROR) -arch x86_64 $(AM_CFLAGS_BASE) \ - -mmacosx-version-min=10.5 -fno-stack-protector -AM_CCASFLAGS_AMD64_DARWIN = $(AM_CPPFLAGS_AMD64_DARWIN) -arch x86_64 -g - -# Flags for the primary target. These must be used to build the -# regtests and performance tests. In fact, these must be used to -# build anything which is built only once on a dual-arch build. -# -AM_FLAG_M3264_PRI = $(AM_FLAG_M3264_@VGCONF_PLATFORM_PRI_CAPS@) -AM_CPPFLAGS_PRI = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -AM_CFLAGS_PRI = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -AM_CCASFLAGS_PRI = $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) - -if VGCONF_HAVE_PLATFORM_SEC - AM_FLAG_M3264_SEC = $(AM_FLAG_M3264_@VGCONF_PLATFORM_SEC_CAPS@) -else - AM_FLAG_M3264_SEC = -endif - - -# Baseline link flags for making dynamic shared objects. -# -PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst -PRELOAD_LDFLAGS_COMMON_AIX5 = -nodefaultlibs -shared -Wl,-G -Wl,-bnogc -PRELOAD_LDFLAGS_COMMON_DARWIN = -dynamic -dynamiclib -all_load -PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ -PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ -PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ -PRELOAD_LDFLAGS_PPC64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ -PRELOAD_LDFLAGS_PPC32_AIX5 = $(PRELOAD_LDFLAGS_COMMON_AIX5) @FLAG_MAIX32@ -PRELOAD_LDFLAGS_PPC64_AIX5 = $(PRELOAD_LDFLAGS_COMMON_AIX5) @FLAG_MAIX64@ -PRELOAD_LDFLAGS_X86_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch i386 -PRELOAD_LDFLAGS_AMD64_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch x86_64 diff --git a/Makefile.tool-tests.am b/Makefile.tool-tests.am index 9694f064a4..a9d3b91001 100644 --- a/Makefile.tool-tests.am +++ b/Makefile.tool-tests.am @@ -1,10 +1,10 @@ # This file is used for tool tests, and also in perf/Makefile.am. -include $(top_srcdir)/Makefile.flags.am # For AM_FLAG_M3264_PRI +include $(top_srcdir)/Makefile.all.am AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include \ -I$(top_srcdir)/coregrind -I$(top_builddir)/include \ - -I@VEX_DIR@/pub \ + -I$(top_srcdir)/VEX/pub \ -DVGA_$(VGCONF_ARCH_PRI)=1 \ -DVGO_$(VGCONF_OS)=1 \ -DVGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS)=1 @@ -13,28 +13,13 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include \ AM_CFLAGS = -Winline -Wall -Wshadow -g AM_CXXFLAGS = -Winline -Wall -Wshadow -g # Include AM_CPPFLAGS in AM_CCASFLAGS to allow for older versions of -# automake; see comments in Makefile.flags.am for more detail. +# automake; see comments in Makefile.all.am for more detail. AM_CCASFLAGS = $(AM_CPPFLAGS) - -# On Darwin, for a program 'p', the DWARF debug info is stored in the -# directory 'p.dSYM'. This must be generated after the executable is -# created, with 'dsymutil p'. We could redefine LINK with a script that -# executes 'dsymutil' after linking, but that's a pain. Instead we use this -# hook so that every time "make check" is run, we subsequently invoke -# 'dsymutil' on all the executables that lack a .dSYM directory, or that are -# newer than their corresponding .dSYM directory. if VGCONF_OS_IS_DARWIN -check-local: - for f in $(check_PROGRAMS) ; do \ - if [ ! -e $$f.dSYM -o $$f -nt $$f.dSYM ] ; then \ - echo "dsymutil $$f"; \ - dsymutil $$f; \ - fi \ - done +noinst_DSYMS = $(check_PROGRAMS) +endif + +check-local: build-noinst_DSYMS -clean-local: - for f in $(check_PROGRAMS) ; do \ - rm -rf $$f.dSYM; \ - done -endif +clean-local: clean-noinst_DSYMS diff --git a/Makefile.tool.am b/Makefile.tool.am index 21925fca42..fbc43fdfd6 100644 --- a/Makefile.tool.am +++ b/Makefile.tool.am @@ -2,123 +2,30 @@ SUBDIRS = . tests docs include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.flags.am -include $(top_srcdir)/Makefile.core-tool.am +#---------------------------------------------------------------------------- +# - stuff +#---------------------------------------------------------------------------- -LIBREPLACEMALLOC_X86_LINUX = \ - $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a - -LIBREPLACEMALLOC_AMD64_LINUX = \ - $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a - -LIBREPLACEMALLOC_PPC32_LINUX = \ - $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a - -LIBREPLACEMALLOC_PPC64_LINUX = \ - $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-linux.a - -LIBREPLACEMALLOC_PPC32_AIX5 = \ - $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-aix5.a - -LIBREPLACEMALLOC_PPC64_AIX5 = \ - $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-aix5.a - -LIBREPLACEMALLOC_X86_DARWIN = \ - $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a - -LIBREPLACEMALLOC_AMD64_DARWIN = \ - $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a - - -COREGRIND_LIBS_X86_LINUX = \ - $(top_builddir)/coregrind/libcoregrind-x86-linux.a \ - @VEX_DIR@/libvex-x86-linux.a - -COREGRIND_LIBS_AMD64_LINUX = \ - $(top_builddir)/coregrind/libcoregrind-amd64-linux.a \ - @VEX_DIR@/libvex-amd64-linux.a - -COREGRIND_LIBS_PPC32_LINUX = \ - $(top_builddir)/coregrind/libcoregrind-ppc32-linux.a \ - @VEX_DIR@/libvex-ppc32-linux.a - -COREGRIND_LIBS_PPC64_LINUX = \ - $(top_builddir)/coregrind/libcoregrind-ppc64-linux.a \ - @VEX_DIR@/libvex-ppc64-linux.a - -COREGRIND_LIBS_PPC32_AIX5 = \ - $(top_builddir)/coregrind/libcoregrind-ppc32-aix5.a \ - @VEX_DIR@/libvex-ppc32-aix5.a - -COREGRIND_LIBS_PPC64_AIX5 = \ - $(top_builddir)/coregrind/libcoregrind-ppc64-aix5.a \ - @VEX_DIR@/libvex-ppc64-aix5.a - -COREGRIND_LIBS_X86_DARWIN = \ - $(top_builddir)/coregrind/libcoregrind-x86-darwin.a \ - @VEX_DIR@/libvex-x86-darwin.a - -COREGRIND_LIBS_AMD64_DARWIN = \ - $(top_builddir)/coregrind/libcoregrind-amd64-darwin.a \ - @VEX_DIR@/libvex-amd64-darwin.a - - -##.PHONY: @VEX_DIR@/libvex.a - -@VEX_DIR@/libvex-x86-linux.a: @VEX_DIR@/priv/main/vex_svnversion.h - $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" \ - libvex-x86-linux.a \ - EXTRA_CFLAGS="$(AM_CFLAGS_X86_LINUX) @FLAG_WDECL_AFTER_STMT@ \ - @FLAG_FNO_STACK_PROTECTOR@" +TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@ = \ + $(top_builddir)/coregrind/libcoregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a \ + $(top_builddir)/VEX/libvex-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a +if VGCONF_HAVE_PLATFORM_SEC +TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@ = \ + $(top_builddir)/coregrind/libcoregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a \ + $(top_builddir)/VEX/libvex-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a +endif -@VEX_DIR@/libvex-amd64-linux.a: @VEX_DIR@/priv/main/vex_svnversion.h - $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" \ - libvex-amd64-linux.a \ - EXTRA_CFLAGS="$(AM_CFLAGS_AMD64_LINUX) @FLAG_WDECL_AFTER_STMT@ \ - @FLAG_FNO_STACK_PROTECTOR@" -@VEX_DIR@/libvex-ppc32-linux.a: @VEX_DIR@/priv/main/vex_svnversion.h - $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" \ - libvex-ppc32-linux.a \ - EXTRA_CFLAGS="$(AM_CFLAGS_PPC32_LINUX) @FLAG_WDECL_AFTER_STMT@ \ - @FLAG_FNO_STACK_PROTECTOR@" - -@VEX_DIR@/libvex-ppc64-linux.a: @VEX_DIR@/priv/main/vex_svnversion.h - $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" \ - libvex-ppc64-linux.a \ - EXTRA_CFLAGS="$(AM_CFLAGS_PPC64_LINUX) @FLAG_WDECL_AFTER_STMT@ \ - @FLAG_FNO_STACK_PROTECTOR@" - -@VEX_DIR@/libvex-ppc32-aix5.a: @VEX_DIR@/priv/main/vex_svnversion.h - $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR) -X32" \ - libvex-ppc32-aix5.a \ - EXTRA_CFLAGS="$(AM_CFLAGS_PPC32_AIX5) @FLAG_WDECL_AFTER_STMT@ \ - @FLAG_FNO_STACK_PROTECTOR@" - -@VEX_DIR@/libvex-ppc64-aix5.a: @VEX_DIR@/priv/main/vex_svnversion.h - $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR) -X64" \ - libvex-ppc64-aix5.a \ - EXTRA_CFLAGS="$(AM_CFLAGS_PPC64_AIX5) @FLAG_WDECL_AFTER_STMT@ \ - @FLAG_FNO_STACK_PROTECTOR@" - -@VEX_DIR@/libvex-x86-darwin.a: @VEX_DIR@/priv/main/vex_svnversion.h - $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" \ - libvex-x86-darwin.a \ - EXTRA_CFLAGS="$(AM_CFLAGS_X86_DARWIN) @FLAG_WDECL_AFTER_STMT@ \ - @FLAG_FNO_STACK_PROTECTOR@" - -@VEX_DIR@/libvex-amd64-darwin.a: @VEX_DIR@/priv/main/vex_svnversion.h - $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" \ - libvex-amd64-darwin.a \ - EXTRA_CFLAGS="$(AM_CFLAGS_AMD64_DARWIN) @FLAG_WDECL_AFTER_STMT@ \ - @FLAG_FNO_STACK_PROTECTOR@" - -@VEX_DIR@/priv/main/vex_svnversion.h: - $(MAKE) -C @VEX_DIR@ CC="$(CC)" version +TOOL_LDADD_COMMON = -lgcc +TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) $(TOOL_LDADD_COMMON) +if VGCONF_HAVE_PLATFORM_SEC +TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) $(TOOL_LDADD_COMMON) +endif -TOOL_LDADD_COMMON = -lgcc TOOL_LDFLAGS_COMMON_LINUX = -static \ -Wl,-defsym,valt_load_address=@VALT_LOAD_ADDRESS@ \ -nodefaultlibs -nostartfiles -u _start @@ -126,35 +33,28 @@ TOOL_LDFLAGS_COMMON_AIX5 = -static -Wl,-e_start_valgrind TOOL_LDFLAGS_COMMON_DARWIN = -nodefaultlibs -nostartfiles \ -Wl,-u,__start -Wl,-e,__start -Wl,-bind_at_load /usr/lib/dyld -TOOL_LDADD_X86_LINUX = $(COREGRIND_LIBS_X86_LINUX) $(TOOL_LDADD_COMMON) TOOL_LDFLAGS_X86_LINUX = \ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ \ -Wl,-T,$(top_builddir)/valt_load_address_x86_linux.lds -TOOL_LDADD_AMD64_LINUX = $(COREGRIND_LIBS_AMD64_LINUX) $(TOOL_LDADD_COMMON) TOOL_LDFLAGS_AMD64_LINUX = \ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ \ -Wl,-T,$(top_builddir)/valt_load_address_amd64_linux.lds -TOOL_LDADD_PPC32_LINUX = $(COREGRIND_LIBS_PPC32_LINUX) $(TOOL_LDADD_COMMON) TOOL_LDFLAGS_PPC32_LINUX = \ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ \ -Wl,-T,$(top_builddir)/valt_load_address_ppc32_linux.lds -TOOL_LDADD_PPC64_LINUX = $(COREGRIND_LIBS_PPC64_LINUX) $(TOOL_LDADD_COMMON) TOOL_LDFLAGS_PPC64_LINUX = \ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ \ -Wl,-T,$(top_builddir)/valt_load_address_ppc64_linux.lds -TOOL_LDADD_PPC32_AIX5 = $(COREGRIND_LIBS_PPC32_AIX5) $(TOOL_LDADD_COMMON) TOOL_LDFLAGS_PPC32_AIX5 = \ $(TOOL_LDFLAGS_COMMON_AIX5) @FLAG_MAIX32@ -TOOL_LDADD_PPC64_AIX5 = $(COREGRIND_LIBS_PPC64_AIX5) $(TOOL_LDADD_COMMON) TOOL_LDFLAGS_PPC64_AIX5 = \ $(TOOL_LDFLAGS_COMMON_AIX5) @FLAG_MAIX64@ -Wl,-bbigtoc -TOOL_LDADD_X86_DARWIN = $(COREGRIND_LIBS_X86_DARWIN) $(TOOL_LDADD_COMMON) TOOL_LDFLAGS_X86_DARWIN = \ $(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386 \ -Wl,-seg1addr,0xf0080000 \ @@ -163,7 +63,6 @@ TOOL_LDFLAGS_X86_DARWIN = \ # pagezero can't be unmapped and remapped. Use stack instead. # GrP fixme no stack guard -TOOL_LDADD_AMD64_DARWIN = $(COREGRIND_LIBS_AMD64_DARWIN) $(TOOL_LDADD_COMMON) TOOL_LDFLAGS_AMD64_DARWIN = \ $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64 \ -Wl,-seg1addr,0x7fff55000000 \ @@ -171,6 +70,114 @@ TOOL_LDFLAGS_AMD64_DARWIN = \ -Wl,-pagezero_size,0x100000000 +BUILT_SOURCES = +CLEANFILES = +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX +BUILT_SOURCES += $(top_builddir)/valt_load_address_x86_linux.lds +CLEANFILES += $(top_builddir)/valt_load_address_x86_linux.lds +endif +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX +BUILT_SOURCES += $(top_builddir)/valt_load_address_amd64_linux.lds +CLEANFILES += $(top_builddir)/valt_load_address_amd64_linux.lds +endif +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX +BUILT_SOURCES += $(top_builddir)/valt_load_address_ppc32_linux.lds +CLEANFILES += $(top_builddir)/valt_load_address_ppc32_linux.lds +endif +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX +BUILT_SOURCES += $(top_builddir)/valt_load_address_ppc64_linux.lds +CLEANFILES += $(top_builddir)/valt_load_address_ppc64_linux.lds +endif +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 +# No need to generate $(top_builddir)/valt_load_address*.lds; the final +# executables can be linked to be at any address. They will be relocated by +# AIX kernel when they are loaded. +endif +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 +# Ditto +endif +if VGCONF_OS_IS_DARWIN +# GrP untested, possibly hopeless +endif + + +# Generate a linker script for linking the binaries. This is the +# standard gcc linker script, except hacked so that an alternative +# load address can be specified by (1) asking gcc to use this script +# (-Wl,-T,valt_load_address.lds) and (2) setting the symbol +# valt_load_address to the required value +# (-Wl,-defsym,valt_load_address=0x70000000). +# +# Extract ld's default linker script and hack it to our needs. +# First we cut everything above and below the "=====..." lines at the top +# and bottom. +# Then we have to replace the load address with "valt_load_address". +# The line to replace in has one of the following two forms: +# +# . = 0x08048000 + SIZEOF_HEADERS; +# +# or +# PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS; +# +# So we search for the line with a hex value "+ SIZEOF_HEADERS", and replace +# all the hex values in that line with "valt_load_address". +$(top_builddir)/valt_load_address_x86_linux.lds: Makefile + $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ + -e '1,/^=====\+$$/d' \ + -e '/^=====\+$$/,/.\*/d' \ + -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ + || rm -f $@ + +$(top_builddir)/valt_load_address_amd64_linux.lds: Makefile + $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \ + -e '1,/^=====\+$$/d' \ + -e '/^=====\+$$/,/.\*/d' \ + -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ + || rm -f $@ + +$(top_builddir)/valt_load_address_ppc32_linux.lds: Makefile + $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ + -e '1,/^=====\+$$/d' \ + -e '/^=====\+$$/,/.\*/d' \ + -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ + || rm -f $@ + +$(top_builddir)/valt_load_address_ppc64_linux.lds: Makefile + $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \ + -e '1,/^=====\+$$/d' \ + -e '/^=====\+$$/,/.\*/d' \ + -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ + || rm -f $@ + +#---------------------------------------------------------------------------- +# vgpreload_-.a stuff +#---------------------------------------------------------------------------- + +LIBREPLACEMALLOC_X86_LINUX = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-linux.a + +LIBREPLACEMALLOC_AMD64_LINUX = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-linux.a + +LIBREPLACEMALLOC_PPC32_LINUX = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a + +LIBREPLACEMALLOC_PPC64_LINUX = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-linux.a + +LIBREPLACEMALLOC_PPC32_AIX5 = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-aix5.a + +LIBREPLACEMALLOC_PPC64_AIX5 = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-aix5.a + +LIBREPLACEMALLOC_X86_DARWIN = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-darwin.a + +LIBREPLACEMALLOC_AMD64_DARWIN = \ + $(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-darwin.a + + LIBREPLACEMALLOC_LDFLAGS_X86_LINUX = \ -Wl,--whole-archive \ $(LIBREPLACEMALLOC_X86_LINUX) \ @@ -203,7 +210,9 @@ LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN = \ LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN = \ $(LIBREPLACEMALLOC_AMD64_DARWIN) - +#---------------------------------------------------------------------------- +# General stuff +#---------------------------------------------------------------------------- all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS diff --git a/Makefile.vex.am b/Makefile.vex.am new file mode 100644 index 0000000000..862bee8080 --- /dev/null +++ b/Makefile.vex.am @@ -0,0 +1,270 @@ +# VEX/Makefile is generated from this file at configure-time. + +include $(top_srcdir)/Makefile.all.am + +#---------------------------------------------------------------------------- +# Headers, etc +#---------------------------------------------------------------------------- + +EXTRA_DIST = \ + HACKING.README \ + LICENSE.README \ + LICENSE.GPL \ + quote.txt \ + newline.txt \ + auxprogs/genoffsets.c + +pkginclude_HEADERS = \ + pub/libvex.h \ + pub/libvex_basictypes.h \ + pub/libvex_emwarn.h \ + pub/libvex_guest_offsets.h \ + pub/libvex_guest_x86.h \ + pub/libvex_guest_amd64.h \ + pub/libvex_guest_ppc32.h \ + pub/libvex_guest_ppc64.h \ + pub/libvex_guest_arm.h \ + pub/libvex_ir.h \ + pub/libvex_trc_values.h + +noinst_HEADERS = \ + priv/main/vex_globals.h \ + priv/main/vex_util.h \ + priv/ir/irmatch.h \ + priv/ir/iropt.h \ + priv/guest-generic/bb_to_IR.h \ + priv/guest-generic/g_generic_x87.h \ + priv/guest-x86/gdefs.h \ + priv/guest-amd64/gdefs.h \ + priv/guest-ppc/gdefs.h \ + priv/guest-arm/gdefs.h \ + priv/host-generic/h_generic_regs.h \ + priv/host-generic/h_generic_simd64.h \ + priv/host-x86/hdefs.h \ + priv/host-amd64/hdefs.h \ + priv/host-ppc/hdefs.h \ + priv/host-arm/hdefs.h + +BUILT_SOURCES = pub/libvex_guest_offsets.h +CLEANFILES = pub/libvex_guest_offsets.h + +# This is very uggerly. Need to sed out both "xyzzyN" and +# "xyzzy$N" since gcc on different targets emits the constants +# differently -- with a leading $ on x86/amd64 but none on ppc32/64. +pub/libvex_guest_offsets.h: + rm -f auxprogs/genoffsets.s + $(CC) $(LIBVEX_CFLAGS) -O -S -o auxprogs/genoffsets.s \ + auxprogs/genoffsets.c + grep xyzzy auxprogs/genoffsets.s | grep define \ + | sed "s/xyzzy\\$$//g" | sed "s/xyzzy//g" \ + > pub/libvex_guest_offsets.h + rm -f auxprogs/genoffsets.s + +#---------------------------------------------------------------------------- +# vex_svnversion.h +#---------------------------------------------------------------------------- + +# The contents of vex_svnversion.h depends on the Vex revision number. The +# ideal way to deal with it would be if SVN had post-update hooks: we'd +# generate/regenerate it every time we did "svn co"/"svn up", and otherwise +# never delete it or regenerate it. +# +# But SVN lacks post-update hooks. So instead we generate it when building +# (it's in BUILT_SOURCES) if it's not present (we test for that in the +# generation rule), or if 'make version' is run. (Thus it can get +# out-of-date when developing; the 'make version' target lets that be +# remedied manually.) Otherwise, we never delete it or regenerate it (in +# particular, it is not present in CLEANFILES). Furthermore, at 'make dist' +# time, we regenerate it, and copy it into the dist tarball, thus ensuring +# the distributed version is up-to-date. Note that if a user manually +# deletes it and rebuilds, or does 'make dist' from a distributed version, +# it will be regenerated incorrectly, containing the string "exported" +# instead of the SVN revision number. + +BUILT_SOURCES += priv/main/vex_svnversion.h + +# Generate it at build time if not present. Nb: generating a file and +# putting it in $(srcdir) rather than $(builddir) seems like bad form. But +# because this file won't be regenerated post-distribution, then it's more +# like a non-generated file and so is reasonable to put in $(srcdir). +priv/main/vex_svnversion.h: version + if [ ! -f priv/main/vex_svnversion.h ] ; then \ + mv $(top_srcdir)/vex_svnversion.h $(srcdir)/priv/main/; \ + else \ + rm -f $(top_srcdir)/vex_svnversion.h; \ + fi + +# Regenerate it and copy it into the dist tarball at 'make dist' time. +dist-hook: version + mv $(top_srcdir)/vex_svnversion.h $(distdir)/priv/main/ + +# Generate it. +version: + cat quote.txt > $(top_srcdir)/vex_svnversion.h + svnversion -n . >> $(top_srcdir)/vex_svnversion.h + cat quote.txt >> $(top_srcdir)/vex_svnversion.h + cat newline.txt >> $(top_srcdir)/vex_svnversion.h + +#---------------------------------------------------------------------------- +# libvex-.a +#---------------------------------------------------------------------------- + +pkglib_LIBRARIES = libvex-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a +if VGCONF_HAVE_PLATFORM_SEC +pkglib_LIBRARIES += libvex-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a +endif + +# XXX: automake cannot handle having multiple files of the same name in +# different directories. The plan is to change the Vex filenames to avoid +# this. In the meantime, we use some hacky rules to copy the like-named +# files to differently-named files. + +LIBVEX_SOURCES_COMMON = \ + priv/main/vex_globals.c \ + priv/main/vex_main.c \ + priv/main/vex_util.c \ + priv/ir/irdefs.c \ + priv/ir/irmatch.c \ + priv/ir/iropt.c \ + priv/guest-generic/bb_to_IR.c \ + priv/guest-generic/g_generic_x87.c \ + priv/guest-x86/ghelpers-x86.c \ + priv/guest-x86/toIR-x86.c \ + priv/guest-amd64/ghelpers-amd64.c \ + priv/guest-amd64/toIR-amd64.c \ + priv/guest-ppc/ghelpers-ppc.c \ + priv/guest-ppc/toIR-ppc.c \ + priv/guest-arm/ghelpers-arm.c \ + priv/guest-arm/toIR-arm.c \ + priv/host-generic/h_generic_regs.c \ + priv/host-generic/h_generic_simd64.c \ + priv/host-generic/reg_alloc2.c \ + priv/host-x86/hdefs-x86.c \ + priv/host-x86/isel-x86.c \ + priv/host-amd64/hdefs-amd64.c \ + priv/host-amd64/isel-amd64.c \ + priv/host-ppc/hdefs-ppc.c \ + priv/host-ppc/isel-ppc.c \ + priv/host-arm/hdefs-arm.c \ + priv/host-arm/isel-arm.c + +# XXX: temporary +TMP_FILES = \ + priv/guest-x86/ghelpers-x86.c \ + priv/guest-amd64/ghelpers-amd64.c \ + priv/guest-ppc/ghelpers-ppc.c \ + priv/guest-arm/ghelpers-arm.c \ + \ + priv/guest-x86/toIR-x86.c \ + priv/guest-amd64/toIR-amd64.c \ + priv/guest-ppc/toIR-ppc.c \ + priv/guest-arm/toIR-arm.c \ + \ + priv/host-x86/hdefs-x86.c \ + priv/host-amd64/hdefs-amd64.c \ + priv/host-ppc/hdefs-ppc.c \ + priv/host-arm/hdefs-arm.c \ + \ + priv/host-x86/isel-x86.c \ + priv/host-amd64/isel-amd64.c \ + priv/host-ppc/isel-ppc.c \ + priv/host-arm/isel-arm.c + +BUILT_SOURCES += $(TMP_FILES) +CLEANFILES += $(TMP_FILES) + +# XXX: temporary +EXTRA_DIST += \ + priv/guest-x86/ghelpers.c \ + priv/guest-amd64/ghelpers.c \ + priv/guest-ppc/ghelpers.c \ + priv/guest-arm/ghelpers.c \ + \ + priv/guest-x86/toIR.c \ + priv/guest-amd64/toIR.c \ + priv/guest-ppc/toIR.c \ + priv/guest-arm/toIR.c \ + \ + priv/host-x86/hdefs.c \ + priv/host-amd64/hdefs.c \ + priv/host-ppc/hdefs.c \ + priv/host-arm/hdefs.c \ + \ + priv/host-x86/isel.c \ + priv/host-amd64/isel.c \ + priv/host-ppc/isel.c \ + priv/host-arm/isel.c + + +# XXX: ghelpers +priv/guest-x86/ghelpers-x86.c: priv/guest-x86/ghelpers.c + cp priv/guest-x86/ghelpers.c priv/guest-x86/ghelpers-x86.c + +priv/guest-amd64/ghelpers-amd64.c: priv/guest-amd64/ghelpers.c + cp priv/guest-amd64/ghelpers.c priv/guest-amd64/ghelpers-amd64.c + +priv/guest-ppc/ghelpers-ppc.c: priv/guest-ppc/ghelpers.c + cp priv/guest-ppc/ghelpers.c priv/guest-ppc/ghelpers-ppc.c + +priv/guest-arm/ghelpers-arm.c: priv/guest-arm/ghelpers.c + cp priv/guest-arm/ghelpers.c priv/guest-arm/ghelpers-arm.c + +# XXX: toIR +priv/guest-x86/toIR-x86.c: priv/guest-x86/toIR.c + cp priv/guest-x86/toIR.c priv/guest-x86/toIR-x86.c + +priv/guest-amd64/toIR-amd64.c: priv/guest-amd64/toIR.c + cp priv/guest-amd64/toIR.c priv/guest-amd64/toIR-amd64.c + +priv/guest-ppc/toIR-ppc.c: priv/guest-ppc/toIR.c + cp priv/guest-ppc/toIR.c priv/guest-ppc/toIR-ppc.c + +priv/guest-arm/toIR-arm.c: priv/guest-arm/toIR.c + cp priv/guest-arm/toIR.c priv/guest-arm/toIR-arm.c + +# XXX: hdefs +priv/host-x86/hdefs-x86.c: priv/host-x86/hdefs.c + cp priv/host-x86/hdefs.c priv/host-x86/hdefs-x86.c + +priv/host-amd64/hdefs-amd64.c: priv/host-amd64/hdefs.c + cp priv/host-amd64/hdefs.c priv/host-amd64/hdefs-amd64.c + +priv/host-ppc/hdefs-ppc.c: priv/host-ppc/hdefs.c + cp priv/host-ppc/hdefs.c priv/host-ppc/hdefs-ppc.c + +priv/host-arm/hdefs-arm.c: priv/host-arm/hdefs.c + cp priv/host-arm/hdefs.c priv/host-arm/hdefs-arm.c + +# XXX: isel +priv/host-x86/isel-x86.c: priv/host-x86/isel.c + cp priv/host-x86/isel.c priv/host-x86/isel-x86.c + +priv/host-amd64/isel-amd64.c: priv/host-amd64/isel.c + cp priv/host-amd64/isel.c priv/host-amd64/isel-amd64.c + +priv/host-ppc/isel-ppc.c: priv/host-ppc/isel.c + cp priv/host-ppc/isel.c priv/host-ppc/isel-ppc.c + +priv/host-arm/isel-arm.c: priv/host-arm/isel.c + cp priv/host-arm/isel.c priv/host-arm/isel-arm.c + + +LIBVEX_CFLAGS = \ + -Wbad-function-cast \ + -Wcast-qual \ + -Wcast-align \ + -fstrict-aliasing + +libvex_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = $(LIBVEX_SOURCES_COMMON) +libvex_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -Ipriv +libvex_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(LIBVEX_CFLAGS) +if VGCONF_HAVE_PLATFORM_SEC +libvex_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = $(LIBVEX_SOURCES_COMMON) +libvex_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -Ipriv +libvex_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(LIBVEX_CFLAGS) +endif + diff --git a/NEWS b/NEWS index 3784a53df0..00a5d5ccee 100644 --- a/NEWS +++ b/NEWS @@ -81,20 +81,34 @@ Release 3.5.0 (???) from the distribution. For anyone interested, the removal occurred in SVN revision r10247. -* The location of some install files has changed. This should not affect - most users. Those who might be affected: - - For people who use Valgrind with MPI programs, the installed - libmpiwrap.so library has moved from $(INSTALL)//libmpiwrap.so - to $(INSTALL)/libmpiwrap-.so. - - For people who distribute standalone Valgrind tools, the installed - libraries such as $(INSTALL)//libcoregrind.a have moved to - $(INSTALL)/libcoregrind-.a. - - These changes were made to simplify the build system. - -* Previously, all the distributed suppression (*.supp) files were installed. - Now, only default.supp is installed. This should not affect users as the - other installed suppression files were not read. +* Some changes have been made to the build system. + + - VEX/ is now integrated properly into the build system. This means that + dependency tracking within VEX/ now works properly, "make install" will + work without requiring "make" before it, and parallel builds + (ie. 'make -j') now work (previously a .NOTPARALLEL directive was used + to serialize builds, ie. 'make -j' was effectively ignored). + + - The --with-vex configure option has been removed. It was of little use + and removing it simplified the build system. + + - The location of some install files has changed. This should not affect + most users. Those who might be affected: + + * For people who use Valgrind with MPI programs, the installed + libmpiwrap.so library has moved from $(INSTALL)//libmpiwrap.so + to $(INSTALL)/libmpiwrap-.so. + + * For people who distribute standalone Valgrind tools, the installed + libraries such as $(INSTALL)//libcoregrind.a have moved to + $(INSTALL)/libcoregrind-.a. + + These changes simplified the build system. + + - Previously, all the distributed suppression (*.supp) files were installed. + Now, only default.supp is installed. This should not affect users as the + other installed suppression files were not read; the fact that they + were installed was a mistake. n-i-bz DRD - race conditions between pthread_barrier_wait() and pthread_barrier_destroy() calls are now reported. diff --git a/README b/README index a32a88e5df..25652d3535 100644 --- a/README +++ b/README @@ -72,9 +72,9 @@ To install from a tar.bz2 distribution: options are documented in the INSTALL file. The only interesting one is the usual --prefix=/where/you/want/it/installed. - 5. Do "make". (Nb: this cannot be combined with the next step.) + 5. Run "make". - 6. Do "make install", possibly as root if the destination permissions + 6. Run "make install", possibly as root if the destination permissions require that. 7. See if it works. Try "valgrind ls -l". Either this works, or it diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am index 7226824a0f..38a643e926 100644 --- a/auxprogs/Makefile.am +++ b/auxprogs/Makefile.am @@ -1,128 +1,32 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.flags.am -include $(top_srcdir)/Makefile.core-tool.am -bin_PROGRAMS = valgrind-listener - -noinst_SCRIPTS = gen-mdg DotToScc.hs Merge3Way.hs primes.c \ - gsl16test gsl16-badfree.patch gsl16-wavelet.patch \ - gsl19test \ - ppcfround.c ppc64shifts.c libmpiwrap.c mpiwrap_type_test.c \ - aix5_VKI_info.c libmpiwrap_aix5.exp \ - aix5_proc_self_sysent.c \ - posixtestsuite-1.5.1-diff-results \ - posixtestsuite-1.5.1-diff.txt - -EXTRA_DIST = $(noinst_SCRIPTS) +dist_noinst_SCRIPTS = \ + gen-mdg \ + gsl16test \ + gsl19test \ + posixtestsuite-1.5.1-diff-results + +EXTRA_DIST = \ + DotToScc.hs \ + Merge3Way.hs \ + aix5_VKI_info.c \ + aix5_proc_self_sysent.c \ + gsl16-badfree.patch \ + gsl16-wavelet.patch \ + posixtestsuite-1.5.1-diff.txt \ + ppcfround.c \ + ppc64shifts.c \ + primes.c + +#---------------------------------------------------------------------------- +# valgrind_listener (built for the primary target only) +#---------------------------------------------------------------------------- +bin_PROGRAMS = valgrind-listener -#------------------------- listener ----------------------- -# Build valgrind_listener for the primary target only. -# valgrind_listener_SOURCES = valgrind-listener.c - valgrind_listener_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI) valgrind_listener_CCASFLAGS = $(AM_CCASFLAGS_PRI) valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI) -# -#---------------------------------------------------------- - -#------------------------- mpi wrappers ----------------------- -# Build libmpiwrap.so for the primary target, and for the secondary -# target if relevant. -# -# This is really horrible. -# -# automake isn't good at supporting non-$(CC) compilers. -# But we need to use $(MPI_CC) here. Hence the nasty hack of -# directly saying how to build libmpiwrap-*.so, instead of -# using automake's standard gunk. -# -# XXX: if we put the MPI stuff in its own directory and manually added -# "CC = $(MPI_CC)" then I think the usual automake approach would work. -# --njn -# -if VGCONF_OS_IS_AIX5 - HACKY_FLAGS_PRI = -g -O -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \ - -qflag=w:w -qlanglvl=extended \ - `echo $(AM_FLAG_M3264_PRI) | sed s/maix/q/g` - HACKY_FLAGS_SEC = -g -O -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \ - -qflag=w:w -qlanglvl=extended \ - `echo $(AM_FLAG_M3264_SEC) | sed s/maix/q/g` -else -if VGCONF_OS_IS_DARWIN - HACKY_FLAGS_PRI = -g -O -fno-omit-frame-pointer -Wall -dynamic \ - -dynamiclib -all_load $(AM_FLAG_M3264_PRI) - HACKY_FLAGS_SEC = -g -O -fno-omit-frame-pointer -Wall -dynamic \ - -dynamiclib -all_load $(AM_FLAG_M3264_SEC) -else - HACKY_FLAGS_PRI = -g -O -fno-omit-frame-pointer -Wall -fpic -shared \ - $(AM_FLAG_M3264_PRI) - HACKY_FLAGS_SEC = -g -O -fno-omit-frame-pointer -Wall -fpic -shared \ - $(AM_FLAG_M3264_SEC) -endif -endif - - -## First, we have to say how to build the .so's .. -## -noinst_PROGRAMS = -noinst_DSYMS = -if BUILD_MPIWRAP_PRI -noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so -if VGCONF_OS_IS_DARWIN -noinst_DSYMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so -endif -libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so: libmpiwrap.c - $(MPI_CC) $(HACKY_FLAGS_PRI) \ - -I../include \ - -o libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so libmpiwrap.c -endif -if BUILD_MPIWRAP_SEC -noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so -if VGCONF_OS_IS_DARWIN -noinst_DSYMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so -endif -libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so: libmpiwrap.c - $(MPI_CC) $(HACKY_FLAGS_SEC) \ - -I../include \ - -o libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so libmpiwrap.c -endif - - -## And here we say how to install them. -## -# The following install hack is serialised by "libmpiwrap.so". -# Hence force -j 1. -.NOTPARALLEL: - -clean-local: clean-noinst_DSYMS - -install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS - - -## And some hacks to keep 'make dist' happy. -## It would seem that using nodist_SOURCES is the right fix, but -## I can't figure out how to do it. -## -#nodist_SOURCES = libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c -#nodist_SOURCES = libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c - -libmpiwrap-.c: - rm -f libmpiwrap-.c - touch libmpiwrap-.c - -libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c: - rm -f libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c - touch libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c - -if VGCONF_HAVE_PLATFORM_SEC -libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c: - rm -f libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c - touch libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c -endif - -# -#---------------------------------------------------------- diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am index f165e8dc85..04c798ec07 100644 --- a/cachegrind/Makefile.am +++ b/cachegrind/Makefile.am @@ -1,102 +1,68 @@ include $(top_srcdir)/Makefile.tool.am +#---------------------------------------------------------------------------- +# Headers, etc +#---------------------------------------------------------------------------- + bin_SCRIPTS = cg_annotate -noinst_HEADERS = cg_arch.h cg_sim.c cg_branchpred.c +noinst_HEADERS = \ + cg_arch.h \ + cg_branchpred.c \ + cg_sim.c -noinst_PROGRAMS = -if VGCONF_PLATFORMS_INCLUDE_X86_LINUX -noinst_PROGRAMS += cachegrind-x86-linux -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX -noinst_PROGRAMS += cachegrind-amd64-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX -noinst_PROGRAMS += cachegrind-ppc32-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX -noinst_PROGRAMS += cachegrind-ppc64-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 -noinst_PROGRAMS += cachegrind-ppc32-aix5 -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 -noinst_PROGRAMS += cachegrind-ppc64-aix5 -endif -if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN -noinst_PROGRAMS += cachegrind-x86-darwin -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN -noinst_PROGRAMS += cachegrind-amd64-darwin -endif +#---------------------------------------------------------------------------- +# cg_merge (built for the primary target only) +#---------------------------------------------------------------------------- -# Build cg_merge for the primary target only. bin_PROGRAMS = cg_merge + cg_merge_SOURCES = cg_merge.c cg_merge_CPPFLAGS = $(AM_CPPFLAGS_PRI) cg_merge_CFLAGS = $(AM_CFLAGS_PRI) cg_merge_CCASFLAGS = $(AM_CCASFLAGS_PRI) cg_merge_LDFLAGS = $(AM_CFLAGS_PRI) +#---------------------------------------------------------------------------- +# cachegrind- +#---------------------------------------------------------------------------- -CACHEGRIND_SOURCES_COMMON = cg_main.c -CACHEGRIND_SOURCES_X86 = cg-x86.c -CACHEGRIND_SOURCES_AMD64 = cg-amd64.c -CACHEGRIND_SOURCES_PPC32 = cg-ppc32.c -CACHEGRIND_SOURCES_PPC64 = cg-ppc64.c - -cachegrind_x86_linux_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_X86) -cachegrind_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -cachegrind_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) -cachegrind_x86_linux_DEPENDENCIES = $(COREGRIND_LIBS_X86_LINUX) -cachegrind_x86_linux_LDADD = $(TOOL_LDADD_X86_LINUX) -cachegrind_x86_linux_LDFLAGS = $(TOOL_LDFLAGS_X86_LINUX) - -cachegrind_amd64_linux_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_AMD64) -cachegrind_amd64_linux_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -cachegrind_amd64_linux_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) -cachegrind_amd64_linux_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_LINUX) -cachegrind_amd64_linux_LDADD = $(TOOL_LDADD_AMD64_LINUX) -cachegrind_amd64_linux_LDFLAGS = $(TOOL_LDFLAGS_AMD64_LINUX) - -cachegrind_ppc32_linux_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_PPC32) -cachegrind_ppc32_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -cachegrind_ppc32_linux_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) -cachegrind_ppc32_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_LINUX) -cachegrind_ppc32_linux_LDADD = $(TOOL_LDADD_PPC32_LINUX) -cachegrind_ppc32_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC32_LINUX) - -cachegrind_ppc64_linux_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_PPC64) -cachegrind_ppc64_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -cachegrind_ppc64_linux_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) -cachegrind_ppc64_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_LINUX) -cachegrind_ppc64_linux_LDADD = $(TOOL_LDADD_PPC64_LINUX) -cachegrind_ppc64_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC64_LINUX) +noinst_PROGRAMS = cachegrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@ +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += cachegrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@ +endif -cachegrind_ppc32_aix5_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_PPC32) -cachegrind_ppc32_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -cachegrind_ppc32_aix5_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) -cachegrind_ppc32_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_AIX5) -cachegrind_ppc32_aix5_LDADD = $(TOOL_LDADD_PPC32_AIX5) -cachegrind_ppc32_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC32_AIX5) +CACHEGRIND_SOURCES_COMMON = \ + cg_main.c \ + cg-x86-amd64.c \ + cg-ppc32.c \ + cg-ppc64.c -cachegrind_ppc64_aix5_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_PPC64) -cachegrind_ppc64_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -cachegrind_ppc64_aix5_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) -cachegrind_ppc64_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_AIX5) -cachegrind_ppc64_aix5_LDADD = $(TOOL_LDADD_PPC64_AIX5) -cachegrind_ppc64_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC64_AIX5) +cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = \ + $(CACHEGRIND_SOURCES_COMMON) +cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) +cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) +cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = \ + $(CACHEGRIND_SOURCES_COMMON) +cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) +cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@) +cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -cachegrind_x86_darwin_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_X86) -cachegrind_x86_darwin_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -cachegrind_x86_darwin_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -cachegrind_x86_darwin_DEPENDENCIES = $(COREGRIND_LIBS_X86_DARWIN) -cachegrind_x86_darwin_LDADD = $(TOOL_LDADD_X86_DARWIN) -cachegrind_x86_darwin_LDFLAGS = $(TOOL_LDFLAGS_X86_DARWIN) -cachegrind_amd64_darwin_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_AMD64) -cachegrind_amd64_darwin_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -cachegrind_amd64_darwin_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) -cachegrind_amd64_darwin_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_DARWIN) -cachegrind_amd64_darwin_LDADD = $(TOOL_LDADD_AMD64_DARWIN) -cachegrind_amd64_darwin_LDFLAGS = $(TOOL_LDFLAGS_AMD64_DARWIN) diff --git a/cachegrind/cg-amd64.c b/cachegrind/cg-amd64.c deleted file mode 100644 index 9b0c65399a..0000000000 --- a/cachegrind/cg-amd64.c +++ /dev/null @@ -1,35 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- AMD64-specific definitions. cg-amd64.c ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Cachegrind, a Valgrind tool for cache - profiling programs. - - Copyright (C) 2002-2009 Nicholas Nethercote - njn@valgrind.org - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. -*/ - -#include "cg-x86.c" - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ diff --git a/cachegrind/cg-ppc32.c b/cachegrind/cg-ppc32.c index 570e208503..bfd5d5ee3f 100644 --- a/cachegrind/cg-ppc32.c +++ b/cachegrind/cg-ppc32.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGA_ppc32) + #include "pub_tool_basics.h" #include "pub_tool_libcbase.h" #include "pub_tool_libcassert.h" @@ -59,6 +61,8 @@ void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c, } } +#endif // defined(VGA_ppc32) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/cachegrind/cg-ppc64.c b/cachegrind/cg-ppc64.c index beb1f34c10..5b6e99f063 100644 --- a/cachegrind/cg-ppc64.c +++ b/cachegrind/cg-ppc64.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGA_ppc64) + #include "pub_tool_basics.h" #include "pub_tool_libcbase.h" #include "pub_tool_libcassert.h" @@ -59,6 +61,8 @@ void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c, } } +#endif + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/cachegrind/cg-x86.c b/cachegrind/cg-x86-amd64.c similarity index 98% rename from cachegrind/cg-x86.c rename to cachegrind/cg-x86-amd64.c index be5eb82ecd..821a8c7746 100644 --- a/cachegrind/cg-x86.c +++ b/cachegrind/cg-x86-amd64.c @@ -1,6 +1,6 @@ /*--------------------------------------------------------------------*/ -/*--- x86-specific (and AMD64-specific) definitions. cg-x86.c ---*/ +/*--- x86- and AMD64-specific definitions. cg-x86-amd64.c ---*/ /*--------------------------------------------------------------------*/ /* @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGA_x86) || defined(VGA_amd64) + #include "pub_tool_basics.h" #include "pub_tool_cpuid.h" #include "pub_tool_libcbase.h" @@ -347,6 +349,8 @@ void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c, } } +#endif // defined(VGA_x86) || defined(VGA_amd64) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/cachegrind/tests/Makefile.am b/cachegrind/tests/Makefile.am index f7f12a71c0..e21d52d5c3 100644 --- a/cachegrind/tests/Makefile.am +++ b/cachegrind/tests/Makefile.am @@ -8,9 +8,9 @@ endif DIST_SUBDIRS = x86 . -noinst_SCRIPTS = filter_stderr filter_cachesim_discards +dist_noinst_SCRIPTS = filter_stderr filter_cachesim_discards -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ chdir.vgtest chdir.stderr.exp \ clreq.vgtest clreq.stderr.exp \ dlclose.vgtest dlclose.stderr.exp dlclose.stdout.exp \ diff --git a/cachegrind/tests/x86/Makefile.am b/cachegrind/tests/x86/Makefile.am index 12d96e9b46..1d141efc4a 100644 --- a/cachegrind/tests/x86/Makefile.am +++ b/cachegrind/tests/x86/Makefile.am @@ -1,9 +1,9 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr +dist_noinst_SCRIPTS = filter_stderr -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ fpu-28-108.vgtest fpu-28-108.stderr.exp check_PROGRAMS = \ diff --git a/callgrind/Makefile.am b/callgrind/Makefile.am index bc983b6edd..893cc9c937 100644 --- a/callgrind/Makefile.am +++ b/callgrind/Makefile.am @@ -1,103 +1,75 @@ include $(top_srcdir)/Makefile.tool.am -bin_SCRIPTS = callgrind_annotate callgrind_control +#---------------------------------------------------------------------------- +# Headers, etc +#---------------------------------------------------------------------------- -noinst_HEADERS = global.h costs.h events.h +pkginclude_HEADERS = callgrind.h -noinst_PROGRAMS = -if VGCONF_PLATFORMS_INCLUDE_X86_LINUX -noinst_PROGRAMS += callgrind-x86-linux -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX -noinst_PROGRAMS += callgrind-amd64-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX -noinst_PROGRAMS += callgrind-ppc32-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX -noinst_PROGRAMS += callgrind-ppc64-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 -noinst_PROGRAMS += callgrind-ppc32-aix5 -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 -noinst_PROGRAMS += callgrind-ppc64-aix5 -endif -if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN -noinst_PROGRAMS += callgrind-x86-darwin -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN -noinst_PROGRAMS += callgrind-amd64-darwin -endif - -CALLGRIND_SOURCES_COMMON = main.c events.c bb.c clo.c \ - costs.c bbcc.c command.c debug.c fn.c \ - sim.c callstack.c context.c dump.c jumps.c \ - threads.c +bin_SCRIPTS = \ + callgrind_annotate \ + callgrind_control -CALLGRIND_SOURCES_X86 = ../cachegrind/cg-x86.c -CALLGRIND_SOURCES_AMD64 = ../cachegrind/cg-amd64.c -CALLGRIND_SOURCES_PPC32 = ../cachegrind/cg-ppc32.c -CALLGRIND_SOURCES_PPC64 = ../cachegrind/cg-ppc64.c +noinst_HEADERS = \ + costs.h \ + events.h \ + global.h -CALLGRIND_CFLAGS_COMMON = -I$(top_srcdir)/cachegrind - -clincludedir = $(includedir)/valgrind -clinclude_HEADERS = \ - callgrind.h - -callgrind_x86_linux_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_X86) -callgrind_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -callgrind_x86_linux_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_X86_LINUX) -callgrind_x86_linux_DEPENDENCIES = $(COREGRIND_LIBS_X86_LINUX) -callgrind_x86_linux_LDADD = $(TOOL_LDADD_X86_LINUX) -callgrind_x86_linux_LDFLAGS = $(TOOL_LDFLAGS_X86_LINUX) - -callgrind_amd64_linux_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_AMD64) -callgrind_amd64_linux_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -callgrind_amd64_linux_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_AMD64_LINUX) -callgrind_amd64_linux_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_LINUX) -callgrind_amd64_linux_LDADD = $(TOOL_LDADD_AMD64_LINUX) -callgrind_amd64_linux_LDFLAGS = $(TOOL_LDFLAGS_AMD64_LINUX) - -callgrind_ppc32_linux_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_PPC32) -callgrind_ppc32_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -callgrind_ppc32_linux_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_PPC32_LINUX) -callgrind_ppc32_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_LINUX) -callgrind_ppc32_linux_LDADD = $(TOOL_LDADD_PPC32_LINUX) -callgrind_ppc32_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC32_LINUX) +#---------------------------------------------------------------------------- +# callgrind- +#---------------------------------------------------------------------------- -callgrind_ppc64_linux_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_PPC64) -callgrind_ppc64_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -callgrind_ppc64_linux_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_PPC64_LINUX) -callgrind_ppc64_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_LINUX) -callgrind_ppc64_linux_LDADD = $(TOOL_LDADD_PPC64_LINUX) -callgrind_ppc64_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC64_LINUX) - -callgrind_ppc32_aix5_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_PPC32) -callgrind_ppc32_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -callgrind_ppc32_aix5_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_PPC32_AIX5) -callgrind_ppc32_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_AIX5) -callgrind_ppc32_aix5_LDADD = $(TOOL_LDADD_PPC32_AIX5) -callgrind_ppc32_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC32_AIX5) +noinst_PROGRAMS = callgrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@ +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += callgrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@ +endif -callgrind_ppc64_aix5_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_PPC64) -callgrind_ppc64_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -callgrind_ppc64_aix5_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_PPC64_AIX5) -callgrind_ppc64_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_AIX5) -callgrind_ppc64_aix5_LDADD = $(TOOL_LDADD_PPC64_AIX5) -callgrind_ppc64_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC64_AIX5) +CALLGRIND_SOURCES_COMMON = \ + bb.c \ + bbcc.c \ + callstack.c \ + clo.c \ + command.c \ + context.c \ + costs.c \ + debug.c \ + dump.c \ + events.c \ + fn.c \ + jumps.c \ + main.c \ + sim.c \ + threads.c \ + ../cachegrind/cg-x86-amd64.c \ + ../cachegrind/cg-ppc32.c \ + ../cachegrind/cg-ppc64.c + +CALLGRIND_CFLAGS_COMMON = -I$(top_srcdir)/cachegrind -callgrind_x86_darwin_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_X86) -callgrind_x86_darwin_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -callgrind_x86_darwin_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_X86_DARWIN) -callgrind_x86_darwin_DEPENDENCIES = $(COREGRIND_LIBS_X86_DARWIN) -callgrind_x86_darwin_LDADD = $(TOOL_LDADD_X86_DARWIN) -callgrind_x86_darwin_LDFLAGS = $(TOOL_LDFLAGS_X86_DARWIN) +callgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = \ + $(CALLGRIND_SOURCES_COMMON) +callgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +callgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(CALLGRIND_CFLAGS_COMMON) +callgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) +callgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) +callgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +callgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = \ + $(CALLGRIND_SOURCES_COMMON) +callgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +callgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(CALLGRIND_CFLAGS_COMMON) +callgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) +callgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@) +callgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -callgrind_amd64_darwin_SOURCES = $(CALLGRIND_SOURCES_COMMON) $(CALLGRIND_SOURCES_AMD64) -callgrind_amd64_darwin_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -callgrind_amd64_darwin_CFLAGS = $(CALLGRIND_CFLAGS_COMMON) $(AM_CFLAGS_AMD64_DARWIN) -callgrind_amd64_darwin_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_DARWIN) -callgrind_amd64_darwin_LDADD = $(TOOL_LDADD_AMD64_DARWIN) -callgrind_amd64_darwin_LDFLAGS = $(TOOL_LDFLAGS_AMD64_DARWIN) diff --git a/callgrind/tests/Makefile.am b/callgrind/tests/Makefile.am index c2d5f0e8e3..03e0f9f764 100644 --- a/callgrind/tests/Makefile.am +++ b/callgrind/tests/Makefile.am @@ -4,18 +4,18 @@ include $(top_srcdir)/Makefile.tool-tests.am SUBDIRS = . DIST_SUBDIRS = . -noinst_SCRIPTS = filter_stderr +dist_noinst_SCRIPTS = filter_stderr -EXTRA_DIST = $(noinst_SCRIPTS) \ - clreq.vgtest clreq.stderr.exp \ - simwork1.vgtest simwork1.stdout.exp simwork1.stderr.exp \ - simwork2.vgtest simwork2.stdout.exp simwork2.stderr.exp \ - simwork3.vgtest simwork3.stdout.exp simwork3.stderr.exp \ - notpower2.vgtest notpower2.stderr.exp \ - notpower2-wb.vgtest notpower2-wb.stderr.exp \ - notpower2-hwpref.vgtest notpower2-hwpref.stderr.exp \ - notpower2-use.vgtest notpower2-use.stderr.exp \ - threads.vgtest threads.stderr.exp +EXTRA_DIST = \ + clreq.vgtest clreq.stderr.exp \ + simwork1.vgtest simwork1.stdout.exp simwork1.stderr.exp \ + simwork2.vgtest simwork2.stdout.exp simwork2.stderr.exp \ + simwork3.vgtest simwork3.stdout.exp simwork3.stderr.exp \ + notpower2.vgtest notpower2.stderr.exp \ + notpower2-wb.vgtest notpower2-wb.stderr.exp \ + notpower2-hwpref.vgtest notpower2-hwpref.stderr.exp \ + notpower2-use.vgtest notpower2-use.stderr.exp \ + threads.vgtest threads.stderr.exp check_PROGRAMS = clreq simwork threads diff --git a/configure.in b/configure.in index 563bd1439d..b584f19377 100644 --- a/configure.in +++ b/configure.in @@ -15,43 +15,6 @@ AM_INIT_AUTOMAKE([foreign]) AM_MAINTAINER_MODE -#---------------------------------------------------------------------------- -# Where is VEX ? -#---------------------------------------------------------------------------- -# Nb: For the 2nd arg, the help string, AS_HELP_STRING is the proper way, but -# older autoconfs don't support it... here's what it would say: -# -# AS_HELP_STRING([--with-vex], [Vex directory]), -# -AC_ARG_WITH(vex, - [ --with-vex=/path/to/vex/dir Vex directory], -[ - AC_CHECK_FILE($withval/pub/libvex.h, - [VEX_DIR=$withval], - [AC_MSG_ERROR([Directory '$withval' does not exist, or does not contain Vex])]) -], -[ - VEX_DIR='$(top_srcdir)/VEX' -]) -AC_SUBST(VEX_DIR) - -# "make distcheck" first builds a tarball, then extracts it. -# Then it creates a build directory different from the extracted sources -# (called _build), and issues -# -# ../configure $(DISTCHECK_CONFIGURE_FLAGS) -# -# and then builds, runs "make check", installs using DESTDIR, runs make -# installcheck, uninstalls, checks whether the installed base is empty -# again, then does yet another "make dist" and compares the resulting -# tarball with the one it started off with for identical content. Then it -# tests "make distclean" for no leftover files. -# -# So this line means: when doing "make dist", use the same --with-vex value -# that you used when running configure to configure this tree in the first -# place. -AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], [--with-vex=$VEX_DIR]) - #---------------------------------------------------------------------------- # Checks for various programs. #---------------------------------------------------------------------------- @@ -1835,8 +1798,10 @@ AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC], [test x$ac_have_builtin_atomic = xyes]) # Ok. We're done checking. #---------------------------------------------------------------------------- -AC_OUTPUT( +# Nb: VEX/Makefile is generated from Makefile.vex.in. +AC_CONFIG_FILES([ Makefile + VEX/Makefile:Makefile.vex.in valgrind.spec valgrind.pc glibc-2.X.supp @@ -1850,8 +1815,8 @@ AC_OUTPUT( perf/Makefile perf/vg_perf include/Makefile - include/vki/Makefile auxprogs/Makefile + mpi/Makefile coregrind/Makefile memcheck/Makefile memcheck/tests/Makefile @@ -1900,7 +1865,8 @@ AC_OUTPUT( drd/docs/Makefile drd/scripts/download-and-build-splash2 drd/tests/Makefile -) +]) +AC_OUTPUT cat<.a +#---------------------------------------------------------------------------- + +BUILT_SOURCES = $(mach_user_srcs) +CLEANFILES = $(mach_user_srcs) $(mach_server_srcs) $(mach_hdrs) +pkglib_LIBRARIES = libcoregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a +if VGCONF_HAVE_PLATFORM_SEC +pkglib_LIBRARIES += libcoregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a +endif COREGRIND_SOURCES_COMMON = \ m_commandline.c \ @@ -300,286 +255,175 @@ COREGRIND_SOURCES_COMMON = \ m_xarray.c \ m_aspacehl.c \ m_aspacemgr/aspacemgr-common.c \ + m_aspacemgr/aspacemgr-linux.c \ + m_aspacemgr/aspacemgr-aix5.c \ + m_coredump/coredump-elf.c \ + m_coredump/coredump-macho.c \ + m_coredump/coredump-xcoff.c \ m_debuginfo/misc.c \ m_debuginfo/d3basics.c \ - m_debuginfo/storage.c \ m_debuginfo/debuginfo.c \ + m_debuginfo/readdwarf.c \ + m_debuginfo/readdwarf3.c \ + m_debuginfo/readelf.c \ + m_debuginfo/readmacho.c \ + m_debuginfo/readpdb.c \ + m_debuginfo/readstabs.c \ + m_debuginfo/readxcoff.c \ + m_debuginfo/storage.c \ m_debuginfo/tytypes.c \ m_demangle/cp-demangle.c \ m_demangle/cplus-dem.c \ m_demangle/demangle.c \ m_demangle/dyn-string.c \ m_demangle/safe-ctype.c \ - m_replacemalloc/replacemalloc_core.c \ - m_scheduler/scheduler.c \ - m_scheduler/sema.c \ - m_syswrap/syswrap-main.c \ - m_ume/elf.c \ - m_ume/macho.c \ - m_ume/main.c \ - m_ume/script.c - -COREGRIND_LINUX_SOURCE = \ - m_aspacemgr/aspacemgr-linux.c \ - m_coredump/coredump-elf.c \ - m_debuginfo/readelf.c \ - m_debuginfo/readdwarf.c \ - m_debuginfo/readdwarf3.c \ - m_debuginfo/readstabs.c \ - m_debuginfo/readpdb.c \ + m_dispatch/dispatch-x86-linux.S \ + m_dispatch/dispatch-amd64-linux.S \ + m_dispatch/dispatch-ppc32-linux.S \ + m_dispatch/dispatch-ppc64-linux.S \ + m_dispatch/dispatch-ppc32-aix5.S \ + m_dispatch/dispatch-ppc64-aix5.S \ + m_dispatch/dispatch-x86-darwin.S \ + m_dispatch/dispatch-amd64-darwin.S \ m_initimg/initimg-linux.c \ - m_initimg/initimg-pathscan.c \ - m_syswrap/syswrap-linux.c \ - m_syswrap/syswrap-linux-variants.c \ - m_syswrap/syswrap-generic.c - -COREGRIND_AIX5_SOURCE = \ - m_aspacemgr/aspacemgr-aix5.c \ - m_debuginfo/readxcoff.c \ m_initimg/initimg-aix5.c \ - m_syswrap/syswrap-aix5.c - - # Note that the *User.c files are generated using 'mig' from $mach_defs - # above. -COREGRIND_DARWIN_SOURCE = \ - m_aspacemgr/aspacemgr-linux.c \ - m_debuginfo/readdwarf.c \ - m_debuginfo/readdwarf3.c \ - m_debuginfo/readstabs.c \ - m_debuginfo/readmacho.c \ - m_debuginfo/readpdb.c \ - m_mach/mach_basics.c \ - m_mach/mach_msg.c \ m_initimg/initimg-darwin.c \ m_initimg/initimg-pathscan.c \ - m_syswrap/syswrap-darwin.c \ - m_syswrap/syswrap-generic.c - -COREGRIND_DARWIN_BUILT_SOURCES = \ - m_mach/mach_vmUser.c \ - m_mach/taskUser.c \ - m_mach/thread_actUser.c \ - m_mach/vm_mapUser.c - -libcoregrind_x86_linux_a_SOURCES = \ - $(COREGRIND_SOURCES_COMMON) \ - $(COREGRIND_LINUX_SOURCE) \ - m_coredump/coredump-x86-linux.c \ - m_dispatch/dispatch-x86-linux.S \ + m_mach/mach_basics.c \ + m_mach/mach_msg.c \ + m_mach/mach_traps-x86-darwin.S \ + m_mach/mach_traps-amd64-darwin.S \ + m_replacemalloc/replacemalloc_core.c \ + m_scheduler/scheduler.c \ + m_scheduler/sema.c \ m_sigframe/sigframe-x86-linux.c \ - m_syswrap/syscall-x86-linux.S \ - m_syswrap/syswrap-x86-linux.c -libcoregrind_x86_linux_a_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -libcoregrind_x86_linux_a_CFLAGS = $(AM_CFLAGS_X86_LINUX) -libcoregrind_x86_linux_a_CCASFLAGS = $(AM_CCASFLAGS_X86_LINUX) - -libcoregrind_amd64_linux_a_SOURCES = \ - $(COREGRIND_SOURCES_COMMON) \ - $(COREGRIND_LINUX_SOURCE) \ - m_coredump/coredump-amd64-linux.c \ - m_dispatch/dispatch-amd64-linux.S \ m_sigframe/sigframe-amd64-linux.c \ - m_syswrap/syscall-amd64-linux.S \ - m_syswrap/syswrap-amd64-linux.c -libcoregrind_amd64_linux_a_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -libcoregrind_amd64_linux_a_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) -libcoregrind_amd64_linux_a_CCASFLAGS = $(AM_CCASFLAGS_AMD64_LINUX) - -libcoregrind_ppc32_linux_a_SOURCES = \ - $(COREGRIND_SOURCES_COMMON) \ - $(COREGRIND_LINUX_SOURCE) \ - m_coredump/coredump-ppc32-linux.c \ - m_dispatch/dispatch-ppc32-linux.S \ m_sigframe/sigframe-ppc32-linux.c \ - m_syswrap/syscall-ppc32-linux.S \ - m_syswrap/syswrap-ppc32-linux.c -libcoregrind_ppc32_linux_a_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -libcoregrind_ppc32_linux_a_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) -libcoregrind_ppc32_linux_a_CCASFLAGS = $(AM_CCASFLAGS_PPC32_LINUX) - -libcoregrind_ppc64_linux_a_SOURCES = \ - $(COREGRIND_SOURCES_COMMON) \ - $(COREGRIND_LINUX_SOURCE) \ - m_coredump/coredump-ppc64-linux.c \ - m_dispatch/dispatch-ppc64-linux.S \ m_sigframe/sigframe-ppc64-linux.c \ - m_syswrap/syscall-ppc64-linux.S \ - m_syswrap/syswrap-ppc64-linux.c -libcoregrind_ppc64_linux_a_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -libcoregrind_ppc64_linux_a_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) -libcoregrind_ppc64_linux_a_CCASFLAGS = $(AM_CCASFLAGS_PPC64_LINUX) - -libcoregrind_ppc32_aix5_a_SOURCES = \ - $(COREGRIND_SOURCES_COMMON) \ - $(COREGRIND_AIX5_SOURCE) \ - m_coredump/coredump-ppc32-aix5.c \ - m_dispatch/dispatch-ppc32-aix5.S \ m_sigframe/sigframe-ppc32-aix5.c \ - m_syswrap/syscall-ppc32-aix5.S \ - m_syswrap/syswrap-ppc32-aix5.c -libcoregrind_ppc32_aix5_a_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -libcoregrind_ppc32_aix5_a_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) -libcoregrind_ppc32_aix5_a_CCASFLAGS = $(AM_CCASFLAGS_PPC32_AIX5) -libcoregrind_ppc32_aix5_a_AR = $(AR) -X32 cru - -libcoregrind_ppc64_aix5_a_SOURCES = \ - $(COREGRIND_SOURCES_COMMON) \ - $(COREGRIND_AIX5_SOURCE) \ - m_coredump/coredump-ppc64-aix5.c \ - m_dispatch/dispatch-ppc64-aix5.S \ m_sigframe/sigframe-ppc64-aix5.c \ - m_syswrap/syscall-ppc64-aix5.S \ - m_syswrap/syswrap-ppc64-aix5.c -libcoregrind_ppc64_aix5_a_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -libcoregrind_ppc64_aix5_a_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) -libcoregrind_ppc64_aix5_a_CCASFLAGS = $(AM_CCASFLAGS_PPC64_AIX5) -libcoregrind_ppc64_aix5_a_AR = $(AR) -X64 cru - -libcoregrind_x86_darwin_a_SOURCES = \ - $(COREGRIND_SOURCES_COMMON) \ - $(COREGRIND_DARWIN_SOURCE) \ - m_coredump/coredump-x86-darwin.c \ - m_dispatch/dispatch-x86-darwin.S \ - m_mach/mach_traps-x86-darwin.S \ m_sigframe/sigframe-x86-darwin.c \ - m_start-x86-darwin.S \ - m_syswrap/syscall-x86-darwin.S \ - m_syswrap/syswrap-x86-darwin.c -nodist_libcoregrind_x86_darwin_a_SOURCES = $(COREGRIND_DARWIN_BUILT_SOURCES) -libcoregrind_x86_darwin_a_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -libcoregrind_x86_darwin_a_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -libcoregrind_x86_darwin_a_CCASFLAGS = $(AM_CCASFLAGS_X86_DARWIN) - - -libcoregrind_amd64_darwin_a_SOURCES = \ - $(COREGRIND_SOURCES_COMMON) \ - $(COREGRIND_DARWIN_SOURCE) \ - m_coredump/coredump-amd64-darwin.c \ - m_dispatch/dispatch-amd64-darwin.S \ - m_mach/mach_traps-amd64-darwin.S \ m_sigframe/sigframe-amd64-darwin.c \ + m_start-x86-darwin.S \ m_start-amd64-darwin.S \ + m_syswrap/syscall-x86-linux.S \ + m_syswrap/syscall-amd64-linux.S \ + m_syswrap/syscall-ppc32-linux.S \ + m_syswrap/syscall-ppc64-linux.S \ + m_syswrap/syscall-ppc32-aix5.S \ + m_syswrap/syscall-ppc64-aix5.S \ + m_syswrap/syscall-x86-darwin.S \ m_syswrap/syscall-amd64-darwin.S \ - m_syswrap/syswrap-amd64-darwin.c -nodist_libcoregrind_amd64_darwin_a_SOURCES = $(COREGRIND_DARWIN_BUILT_SOURCES) -libcoregrind_amd64_darwin_a_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -libcoregrind_amd64_darwin_a_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) -libcoregrind_amd64_darwin_a_CCASFLAGS = $(AM_CCASFLAGS_AMD64_DARWIN) + m_syswrap/syswrap-main.c \ + m_syswrap/syswrap-generic.c \ + m_syswrap/syswrap-linux.c \ + m_syswrap/syswrap-linux-variants.c \ + m_syswrap/syswrap-aix5.c \ + m_syswrap/syswrap-darwin.c \ + m_syswrap/syswrap-x86-linux.c \ + m_syswrap/syswrap-amd64-linux.c \ + m_syswrap/syswrap-ppc32-linux.c \ + m_syswrap/syswrap-ppc64-linux.c \ + m_syswrap/syswrap-ppc32-aix5.c \ + m_syswrap/syswrap-ppc64-aix5.c \ + m_syswrap/syswrap-x86-darwin.c \ + m_syswrap/syswrap-amd64-darwin.c \ + m_ume/elf.c \ + m_ume/macho.c \ + m_ume/main.c \ + m_ume/script.c +libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \ + $(COREGRIND_SOURCES_COMMON) +nodist_libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \ + $(BUILT_SOURCES) +libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CCASFLAGS = \ + $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \ + $(COREGRIND_SOURCES_COMMON) +nodist_libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \ + $(BUILT_SOURCES) +libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CCASFLAGS = \ + $(AM_CCASFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -libreplacemalloc_toolpreload_x86_linux_a_SOURCES = m_replacemalloc/vg_replace_malloc.c -libreplacemalloc_toolpreload_x86_linux_a_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -libreplacemalloc_toolpreload_x86_linux_a_CFLAGS = $(AM_CFLAGS_X86_LINUX) $(AM_CFLAGS_PIC) +libcoregrind_ppc32_aix5_a_AR = $(AR) -X32 cru +libcoregrind_ppc64_aix5_a_AR = $(AR) -X64 cru -libreplacemalloc_toolpreload_amd64_linux_a_SOURCES = m_replacemalloc/vg_replace_malloc.c -libreplacemalloc_toolpreload_amd64_linux_a_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -libreplacemalloc_toolpreload_amd64_linux_a_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) $(AM_CFLAGS_PIC) +#---------------------------------------------------------------------------- +# libreplacemalloc_toolpreload-.a +#---------------------------------------------------------------------------- -libreplacemalloc_toolpreload_ppc32_linux_a_SOURCES = m_replacemalloc/vg_replace_malloc.c -libreplacemalloc_toolpreload_ppc32_linux_a_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -libreplacemalloc_toolpreload_ppc32_linux_a_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) $(AM_CFLAGS_PIC) +pkglib_LIBRARIES += libreplacemalloc_toolpreload-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a +if VGCONF_HAVE_PLATFORM_SEC +pkglib_LIBRARIES += libreplacemalloc_toolpreload-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a +endif -libreplacemalloc_toolpreload_ppc64_linux_a_SOURCES = m_replacemalloc/vg_replace_malloc.c -libreplacemalloc_toolpreload_ppc64_linux_a_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -libreplacemalloc_toolpreload_ppc64_linux_a_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) $(AM_CFLAGS_PIC) +libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \ + m_replacemalloc/vg_replace_malloc.c +libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +libreplacemalloc_toolpreload_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(AM_CFLAGS_PIC) +if VGCONF_HAVE_PLATFORM_SEC +libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \ + m_replacemalloc/vg_replace_malloc.c +libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +libreplacemalloc_toolpreload_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(AM_CFLAGS_PIC) +endif -libreplacemalloc_toolpreload_ppc32_aix5_a_SOURCES = m_replacemalloc/vg_replace_malloc.c -libreplacemalloc_toolpreload_ppc32_aix5_a_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -libreplacemalloc_toolpreload_ppc32_aix5_a_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) $(AM_CFLAGS_PIC) +# Special AR for AIX. libreplacemalloc_toolpreload_ppc32_aix5_a_AR = $(AR) -X32 cru - -libreplacemalloc_toolpreload_ppc64_aix5_a_SOURCES = m_replacemalloc/vg_replace_malloc.c -libreplacemalloc_toolpreload_ppc64_aix5_a_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -libreplacemalloc_toolpreload_ppc64_aix5_a_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) $(AM_CFLAGS_PIC) libreplacemalloc_toolpreload_ppc64_aix5_a_AR = $(AR) -X64 cru -libreplacemalloc_toolpreload_x86_darwin_a_SOURCES = m_replacemalloc/vg_replace_malloc.c -libreplacemalloc_toolpreload_x86_darwin_a_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -libreplacemalloc_toolpreload_x86_darwin_a_CFLAGS = $(AM_CFLAGS_X86_DARWIN) $(AM_CFLAGS_PIC) - -libreplacemalloc_toolpreload_amd64_darwin_a_SOURCES = m_replacemalloc/vg_replace_malloc.c -libreplacemalloc_toolpreload_amd64_darwin_a_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -libreplacemalloc_toolpreload_amd64_darwin_a_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) $(AM_CFLAGS_PIC) - -m_dispatch/dispatch-x86-linux.S: libvex_guest_offsets.h -m_dispatch/dispatch-amd64-linux.S: libvex_guest_offsets.h -m_dispatch/dispatch-ppc32-linux.S: libvex_guest_offsets.h -m_dispatch/dispatch-ppc64-linux.S: libvex_guest_offsets.h -m_dispatch/dispatch-ppc32-aix5.S: libvex_guest_offsets.h -m_dispatch/dispatch-ppc64-aix5.S: libvex_guest_offsets.h -m_dispatch/dispatch-x86-darwin.S: libvex_guest_offsets.h -m_dispatch/dispatch-amd64-darwin.S: libvex_guest_offsets.h -m_syswrap/syscall-x86-linux.S: libvex_guest_offsets.h -m_syswrap/syscall-amd64-linux.S: libvex_guest_offsets.h -m_syswrap/syscall-ppc32-linux.S: libvex_guest_offsets.h -m_syswrap/syscall-ppc64-linux.S: libvex_guest_offsets.h -m_syswrap/syscall-ppc32-aix5.S: libvex_guest_offsets.h -m_syswrap/syscall-ppc64-aix5.S: libvex_guest_offsets.h -m_syswrap/syscall-x86-darwin.S: libvex_guest_offsets.h -m_syswrap/syscall-amd64-darwin.S: libvex_guest_offsets.h -m_syswrap/syswrap-main.c: libvex_guest_offsets.h - -libvex_guest_offsets.h: - $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" pub/libvex_guest_offsets.h - -VGPRELOAD_CORE_SOURCES_COMMON = vg_preloaded.c - -vgpreload_core_x86_linux_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) -vgpreload_core_x86_linux_so_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -vgpreload_core_x86_linux_so_CFLAGS = $(AM_CFLAGS_X86_LINUX) $(AM_CFLAGS_PIC) -vgpreload_core_x86_linux_so_LDFLAGS = $(PRELOAD_LDFLAGS_X86_LINUX) - -vgpreload_core_amd64_linux_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) -vgpreload_core_amd64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -vgpreload_core_amd64_linux_so_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) $(AM_CFLAGS_PIC) -vgpreload_core_amd64_linux_so_LDFLAGS = $(PRELOAD_LDFLAGS_AMD64_LINUX) - -vgpreload_core_ppc32_linux_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) -vgpreload_core_ppc32_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -vgpreload_core_ppc32_linux_so_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) $(AM_CFLAGS_PIC) -vgpreload_core_ppc32_linux_so_LDFLAGS = $(PRELOAD_LDFLAGS_PPC32_LINUX) - -vgpreload_core_ppc64_linux_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) -vgpreload_core_ppc64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -vgpreload_core_ppc64_linux_so_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) $(AM_CFLAGS_PIC) -vgpreload_core_ppc64_linux_so_LDFLAGS = $(PRELOAD_LDFLAGS_PPC64_LINUX) - -vgpreload_core_ppc32_aix5_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) -vgpreload_core_ppc32_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -vgpreload_core_ppc32_aix5_so_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) $(AM_CFLAGS_PIC) -vgpreload_core_ppc32_aix5_so_LDFLAGS = $(PRELOAD_LDFLAGS_PPC32_AIX5) - -vgpreload_core_ppc64_aix5_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) -vgpreload_core_ppc64_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -vgpreload_core_ppc64_aix5_so_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) $(AM_CFLAGS_PIC) -vgpreload_core_ppc64_aix5_so_LDFLAGS = $(PRELOAD_LDFLAGS_PPC64_AIX5) - -vgpreload_core_x86_darwin_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) -vgpreload_core_x86_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -vgpreload_core_x86_darwin_so_CFLAGS = $(AM_CFLAGS_X86_DARWIN) $(AM_CFLAGS_PIC) -vgpreload_core_x86_darwin_so_LDFLAGS = $(PRELOAD_LDFLAGS_X86_DARWIN) - -vgpreload_core_amd64_darwin_so_SOURCES = $(VGPRELOAD_CORE_SOURCES_COMMON) -vgpreload_core_amd64_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -vgpreload_core_amd64_darwin_so_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) $(AM_CFLAGS_PIC) -vgpreload_core_amd64_darwin_so_LDFLAGS = $(PRELOAD_LDFLAGS_AMD64_DARWIN) +#---------------------------------------------------------------------------- +# vgpreload_core-.a +#---------------------------------------------------------------------------- + +noinst_PROGRAMS = vgpreload_core-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += vgpreload_core-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so +endif + +if VGCONF_OS_IS_DARWIN +noinst_DSYMS = $(noinst_PROGRAMS) +endif + +vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = vg_preloaded.c +vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(AM_CFLAGS_PIC) +vgpreload_core_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = vg_preloaded.c +vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(AM_CFLAGS_PIC) +vgpreload_core_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif + +#---------------------------------------------------------------------------- +# General stuff +#---------------------------------------------------------------------------- all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS clean-local: clean-noinst_DSYMS - $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" clean - rm -f $(mach_srcs) $(mach_server_srcs) $(mach_hdrs) -# Nb: The loop installs the libvex library for possible use by standalone -# tools. install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS - for v in $(LIBVEX) ; do \ - $(INSTALL_DATA) @VEX_DIR@/$$v $(DESTDIR)$(valdir) ; \ - done - -MANUAL_DEPS = $(noinst_HEADERS) $(include_HEADERS) - -EXTRA_DIST = \ - m_debuginfo/UNUSED_STABS.txt \ - m_debuginfo/README.txt diff --git a/coregrind/m_aspacemgr/aspacemgr-aix5.c b/coregrind/m_aspacemgr/aspacemgr-aix5.c index ce529e581e..d07e04e045 100644 --- a/coregrind/m_aspacemgr/aspacemgr-aix5.c +++ b/coregrind/m_aspacemgr/aspacemgr-aix5.c @@ -36,6 +36,8 @@ without prior written permission. */ +#if defined(VGO_aix5) + /* ************************************************************* DO NOT INCLUDE ANY OTHER FILES HERE. ADD NEW INCLUDES ONLY TO priv_aspacemgr.h @@ -2635,6 +2637,7 @@ static void parse_procselfmap ( /*OUT*/AixSegments* segs ) show_AixSegments(0, "as read from procmap", segs); } +#endif // defined(VGO_aix5) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index c9bf5b365c..dc547e6b5c 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -31,6 +31,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_linux) || defined(VGO_darwin) + /* ************************************************************* DO NOT INCLUDE ANY OTHER FILES HERE. ADD NEW INCLUDES ONLY TO priv_aspacemgr.h @@ -3473,7 +3475,10 @@ void VG_(get_changed_segments)( *css_used = css_used_local; } -#endif +#endif // HAVE_PROC + + +#endif // defined(VGO_linux) || defined(VGO_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_coredump/coredump-amd64-linux.c b/coregrind/m_coredump/coredump-amd64-linux.c deleted file mode 100644 index 2f62f37c2c..0000000000 --- a/coregrind/m_coredump/coredump-amd64-linux.c +++ /dev/null @@ -1,90 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- Dumping core. coredump-amd64-linux.c ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2000-2009 Julian Seward - jseward@acm.org - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. -*/ - -#include "pub_core_basics.h" -#include "pub_core_vki.h" -#include "pub_core_libcbase.h" -#include "pub_core_coredump.h" -#include "pub_core_threadstate.h" - -#include "priv_elf.h" - -void ML_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs, - const ThreadArchState* arch) -{ - regs->eflags = LibVEX_GuestAMD64_get_rflags( &((ThreadArchState*)arch)->vex ); - regs->rsp = arch->vex.guest_RSP; - regs->rip = arch->vex.guest_RIP; - - regs->rbx = arch->vex.guest_RBX; - regs->rcx = arch->vex.guest_RCX; - regs->rdx = arch->vex.guest_RDX; - regs->rsi = arch->vex.guest_RSI; - regs->rdi = arch->vex.guest_RDI; - regs->rbp = arch->vex.guest_RBP; - regs->rax = arch->vex.guest_RAX; - regs->r8 = arch->vex.guest_R8; - regs->r9 = arch->vex.guest_R9; - regs->r10 = arch->vex.guest_R10; - regs->r11 = arch->vex.guest_R11; - regs->r12 = arch->vex.guest_R12; - regs->r13 = arch->vex.guest_R13; - regs->r14 = arch->vex.guest_R14; - regs->r15 = arch->vex.guest_R15; - -//:: regs->cs = arch->vex.guest_cs; -//:: regs->fs = arch->vex.guest_fs; -//:: regs->gs = arch->vex.guest_gs; -} - -void ML_(fill_elffpregs_from_tst)(vki_elf_fpregset_t* fpu, - const ThreadArchState* arch) -{ -//:: fpu->cwd = ?; -//:: fpu->swd = ?; -//:: fpu->twd = ?; -//:: fpu->fop = ?; -//:: fpu->rip = ?; -//:: fpu->rdp = ?; -//:: fpu->mxcsr = ?; -//:: fpu->mxcsr_mask = ?; -//:: fpu->st_space = ?; - -# define DO(n) VG_(memcpy)(fpu->xmm_space + n * 4, &arch->vex.guest_XMM##n, sizeof(arch->vex.guest_XMM##n)) - DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); - DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15); -# undef DO - - VG_(memset)(fpu->padding, 0, sizeof(fpu->padding)); -} - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_coredump/coredump-elf.c b/coregrind/m_coredump/coredump-elf.c index 00699c1714..0d409aa4a4 100644 --- a/coregrind/m_coredump/coredump-elf.c +++ b/coregrind/m_coredump/coredump-elf.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_aspacehl.h" @@ -45,8 +47,6 @@ #include "pub_core_clientstate.h" #include "pub_core_options.h" -#include "priv_elf.h" - /* Dump core @@ -218,6 +218,7 @@ static void fill_prstatus(const ThreadState *tst, const vki_siginfo_t *si) { struct vki_user_regs_struct *regs; + ThreadArchState* arch = (ThreadArchState*)&tst->arch; VG_(memset)(prs, 0, sizeof(*prs)); @@ -236,18 +237,189 @@ static void fill_prstatus(const ThreadState *tst, vg_assert(sizeof(*regs) == sizeof(prs->pr_reg)); - ML_(fill_elfregs_from_tst)(regs, &tst->arch); +#if defined(VGP_x86_linux) + regs->eflags = LibVEX_GuestX86_get_eflags( &arch->vex ); + regs->esp = arch->vex.guest_ESP; + regs->eip = arch->vex.guest_EIP; + + regs->ebx = arch->vex.guest_EBX; + regs->ecx = arch->vex.guest_ECX; + regs->edx = arch->vex.guest_EDX; + regs->esi = arch->vex.guest_ESI; + regs->edi = arch->vex.guest_EDI; + regs->ebp = arch->vex.guest_EBP; + regs->eax = arch->vex.guest_EAX; + + regs->cs = arch->vex.guest_CS; + regs->ds = arch->vex.guest_DS; + regs->ss = arch->vex.guest_SS; + regs->es = arch->vex.guest_ES; + regs->fs = arch->vex.guest_FS; + regs->gs = arch->vex.guest_GS; + +#elif defined(VGP_amd64_linux) + regs->eflags = LibVEX_GuestAMD64_get_rflags( &((ThreadArchState*)arch)->vex ); + regs->rsp = arch->vex.guest_RSP; + regs->rip = arch->vex.guest_RIP; + + regs->rbx = arch->vex.guest_RBX; + regs->rcx = arch->vex.guest_RCX; + regs->rdx = arch->vex.guest_RDX; + regs->rsi = arch->vex.guest_RSI; + regs->rdi = arch->vex.guest_RDI; + regs->rbp = arch->vex.guest_RBP; + regs->rax = arch->vex.guest_RAX; + regs->r8 = arch->vex.guest_R8; + regs->r9 = arch->vex.guest_R9; + regs->r10 = arch->vex.guest_R10; + regs->r11 = arch->vex.guest_R11; + regs->r12 = arch->vex.guest_R12; + regs->r13 = arch->vex.guest_R13; + regs->r14 = arch->vex.guest_R14; + regs->r15 = arch->vex.guest_R15; + +//:: regs->cs = arch->vex.guest_CS; +//:: regs->fs = arch->vex.guest_FS; +//:: regs->gs = arch->vex.guest_GS; + +#elif defined(VGP_ppc32_linux) +# define DO(n) regs->gpr[n] = arch->vex.guest_GPR##n + DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); + DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15); + DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23); + DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31); +# undef DO + + regs->nip = arch->vex.guest_CIA; + regs->msr = 0xf032; /* pretty arbitrary */ + regs->orig_gpr3 = arch->vex.guest_GPR3; + regs->ctr = arch->vex.guest_CTR; + regs->link = arch->vex.guest_LR; + regs->xer = LibVEX_GuestPPC32_get_XER( &((ThreadArchState*)arch)->vex ); + regs->ccr = LibVEX_GuestPPC32_get_CR( &((ThreadArchState*)arch)->vex ); + regs->mq = 0; + regs->trap = 0; + regs->dar = 0; /* should be fault address? */ + regs->dsisr = 0; + regs->result = 0; + +#elif defined(VGP_ppc64_linux) +# define DO(n) regs->gpr[n] = arch->vex.guest_GPR##n + DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); + DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15); + DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23); + DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31); +# undef DO + + regs->nip = arch->vex.guest_CIA; + regs->msr = 0xf032; /* pretty arbitrary */ + regs->orig_gpr3 = arch->vex.guest_GPR3; + regs->ctr = arch->vex.guest_CTR; + regs->link = arch->vex.guest_LR; + regs->xer = LibVEX_GuestPPC64_get_XER( &((ThreadArchState*)arch)->vex ); + regs->ccr = LibVEX_GuestPPC64_get_CR( &((ThreadArchState*)arch)->vex ); + /* regs->mq = 0; */ + regs->trap = 0; + regs->dar = 0; /* should be fault address? */ + regs->dsisr = 0; + regs->result = 0; + +#else +# error Unknown ELF platform +#endif } static void fill_fpu(const ThreadState *tst, vki_elf_fpregset_t *fpu) { - ML_(fill_elffpregs_from_tst)(fpu, &tst->arch); + __attribute__((unused)) + ThreadArchState* arch = (ThreadArchState*)&tst->arch; + +#if defined(VGP_x86_linux) +//:: static void fill_fpu(vki_elf_fpregset_t *fpu, const Char *from) +//:: { +//:: if (VG_(have_ssestate)) { +//:: UShort *to; +//:: Int i; +//:: +//:: /* This is what the kernel does */ +//:: VG_(memcpy)(fpu, from, 7*sizeof(long)); +//:: +//:: to = (UShort *)&fpu->st_space[0]; +//:: from += 18 * sizeof(UShort); +//:: +//:: for (i = 0; i < 8; i++, to += 5, from += 8) +//:: VG_(memcpy)(to, from, 5*sizeof(UShort)); +//:: } else +//:: VG_(memcpy)(fpu, from, sizeof(*fpu)); +//:: } + +//:: fill_fpu(fpu, (const Char *)&arch->m_sse); + +#elif defined(VGP_amd64_linux) +//:: fpu->cwd = ?; +//:: fpu->swd = ?; +//:: fpu->twd = ?; +//:: fpu->fop = ?; +//:: fpu->rip = ?; +//:: fpu->rdp = ?; +//:: fpu->mxcsr = ?; +//:: fpu->mxcsr_mask = ?; +//:: fpu->st_space = ?; + +# define DO(n) VG_(memcpy)(fpu->xmm_space + n * 4, &arch->vex.guest_XMM##n, sizeof(arch->vex.guest_XMM##n)) + DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); + DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15); +# undef DO + + VG_(memset)(fpu->padding, 0, sizeof(fpu->padding)); + +#elif defined(VGP_ppc32_linux) + /* The guest state has the FPR fields declared as ULongs, so need + to fish out the values without converting them. */ +# define DO(n) (*fpu)[n] = *(double*)(&arch->vex.guest_FPR##n) + DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); + DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15); + DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23); + DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31); +# undef DO + +#elif defined(VGP_ppc64_linux) + /* The guest state has the FPR fields declared as ULongs, so need + to fish out the values without converting them. */ +# define DO(n) (*fpu)[n] = *(double*)(&arch->vex.guest_FPR##n) + DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); + DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15); + DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23); + DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31); +# undef DO + +#else +# error Unknown ELF platform +#endif } #if defined(VGP_x86_linux) static void fill_xfpu(const ThreadState *tst, vki_elf_fpxregset_t *xfpu) { - ML_(fill_elffpxregs_from_tst)(xfpu, &tst->arch); + ThreadArchState* arch = (ThreadArchState*)&tst->arch; + +//:: xfpu->cwd = ?; +//:: xfpu->swd = ?; +//:: xfpu->twd = ?; +//:: xfpu->fop = ?; +//:: xfpu->fip = ?; +//:: xfpu->fcs = ?; +//:: xfpu->foo = ?; +//:: xfpu->fos = ?; +//:: xfpu->mxcsr = ?; + xfpu->reserved = 0; +//:: xfpu->st_space = ?; + +# define DO(n) VG_(memcpy)(xfpu->xmm_space + n * 4, &arch->vex.guest_XMM##n, sizeof(arch->vex.guest_XMM##n)) + DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); +# undef DO + + VG_(memset)(xfpu->padding, 0, sizeof(xfpu->padding)); } #endif @@ -331,16 +503,16 @@ void make_elf_coredump(ThreadId tid, const vki_siginfo_t *si, UInt max_size) for(i = 1; i < VG_N_THREADS; i++) { vki_elf_fpregset_t fpu; -#if defined(VGP_x86_linux) - vki_elf_fpxregset_t xfpu; -#endif if (VG_(threads)[i].status == VgTs_Empty) continue; #if defined(VGP_x86_linux) - fill_xfpu(&VG_(threads)[i], &xfpu); - add_note(¬elist, "LINUX", NT_PRXFPREG, &xfpu, sizeof(xfpu)); + { + vki_elf_fpxregset_t xfpu; + fill_xfpu(&VG_(threads)[i], &xfpu); + add_note(¬elist, "LINUX", NT_PRXFPREG, &xfpu, sizeof(xfpu)); + } #endif fill_fpu(&VG_(threads)[i], &fpu); @@ -418,6 +590,8 @@ void VG_(make_coredump)(ThreadId tid, const vki_siginfo_t *si, UInt max_size) make_elf_coredump(tid, si, max_size); } +#endif // defined(VGO_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_coredump/coredump-amd64-darwin.c b/coregrind/m_coredump/coredump-macho.c similarity index 79% rename from coregrind/m_coredump/coredump-amd64-darwin.c rename to coregrind/m_coredump/coredump-macho.c index 6b18f32338..5f74a869b3 100644 --- a/coregrind/m_coredump/coredump-amd64-darwin.c +++ b/coregrind/m_coredump/coredump-macho.c @@ -1,6 +1,6 @@ /*--------------------------------------------------------------------*/ -/*--- Dumping core. coredump-amd64-darwin.c ---*/ +/*--- Dumping core. coredump-macho.c ---*/ /*--------------------------------------------------------------------*/ /* @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_darwin) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_coredump.h" @@ -37,3 +39,9 @@ void VG_(make_coredump)(ThreadId tid, const vki_siginfo_t *si, UInt max_size) { // DDD: #warning GrP fixme coredump } + +#endif // defined(VGO_darwin) + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_coredump/coredump-ppc32-linux.c b/coregrind/m_coredump/coredump-ppc32-linux.c deleted file mode 100644 index faf789b92d..0000000000 --- a/coregrind/m_coredump/coredump-ppc32-linux.c +++ /dev/null @@ -1,77 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- Dumping core. coredump-ppc32-linux.c ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2000-2009 Julian Seward - jseward@acm.org - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. -*/ - -#include "pub_core_basics.h" -#include "pub_core_vki.h" -#include "pub_core_coredump.h" -#include "pub_core_threadstate.h" - -#include "priv_elf.h" - -void ML_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs, - const ThreadArchState* arch) -{ -# define DO(n) regs->gpr[n] = arch->vex.guest_GPR##n - DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); - DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15); - DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23); - DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31); -# undef DO - - regs->nip = arch->vex.guest_CIA; - regs->msr = 0xf032; /* pretty arbitrary */ - regs->orig_gpr3 = arch->vex.guest_GPR3; - regs->ctr = arch->vex.guest_CTR; - regs->link = arch->vex.guest_LR; - regs->xer = LibVEX_GuestPPC32_get_XER( &((ThreadArchState*)arch)->vex ); - regs->ccr = LibVEX_GuestPPC32_get_CR( &((ThreadArchState*)arch)->vex ); - regs->mq = 0; - regs->trap = 0; - regs->dar = 0; /* should be fault address? */ - regs->dsisr = 0; - regs->result = 0; -} - -void ML_(fill_elffpregs_from_tst)(vki_elf_fpregset_t* fpu, - const ThreadArchState* arch) -{ - /* The guest state has the FPR fields declared as ULongs, so need - to fish out the values without converting them. */ -# define DO(n) (*fpu)[n] = *(double*)(&arch->vex.guest_FPR##n) - DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); - DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15); - DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23); - DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31); -# undef DO -} - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_coredump/coredump-ppc64-aix5.c b/coregrind/m_coredump/coredump-ppc64-aix5.c deleted file mode 100644 index 80a7c421ad..0000000000 --- a/coregrind/m_coredump/coredump-ppc64-aix5.c +++ /dev/null @@ -1,48 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- Dumping core. coredump-ppc64-aix5.c ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2006-2009 OpenWorks LLP - info@open-works.co.uk - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. - - Neither the names of the U.S. Department of Energy nor the - University of California nor the names of its contributors may be - used to endorse or promote products derived from this software - without prior written permission. -*/ - -#include "pub_core_basics.h" -#include "pub_core_vki.h" -#include "pub_core_libcassert.h" -#include "pub_core_coredump.h" /* self */ - -void VG_(make_coredump)(ThreadId tid, const vki_siginfo_t *si, UInt max_size) -{ - /* not implemented */ -} - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_coredump/coredump-ppc64-linux.c b/coregrind/m_coredump/coredump-ppc64-linux.c deleted file mode 100644 index 449e9b11d2..0000000000 --- a/coregrind/m_coredump/coredump-ppc64-linux.c +++ /dev/null @@ -1,77 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- Dumping core. coredump-ppc32-linux.c ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2000-2009 Julian Seward - jseward@acm.org - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. -*/ - -#include "pub_core_basics.h" -#include "pub_core_vki.h" -#include "pub_core_coredump.h" -#include "pub_core_threadstate.h" - -#include "priv_elf.h" - -void ML_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs, - const ThreadArchState* arch) -{ -# define DO(n) regs->gpr[n] = arch->vex.guest_GPR##n - DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); - DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15); - DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23); - DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31); -# undef DO - - regs->nip = arch->vex.guest_CIA; - regs->msr = 0xf032; /* pretty arbitrary */ - regs->orig_gpr3 = arch->vex.guest_GPR3; - regs->ctr = arch->vex.guest_CTR; - regs->link = arch->vex.guest_LR; - regs->xer = LibVEX_GuestPPC64_get_XER( &((ThreadArchState*)arch)->vex ); - regs->ccr = LibVEX_GuestPPC64_get_CR( &((ThreadArchState*)arch)->vex ); - /* regs->mq = 0; */ - regs->trap = 0; - regs->dar = 0; /* should be fault address? */ - regs->dsisr = 0; - regs->result = 0; -} - -void ML_(fill_elffpregs_from_tst)(vki_elf_fpregset_t* fpu, - const ThreadArchState* arch) -{ - /* The guest state has the FPR fields declared as ULongs, so need - to fish out the values without converting them. */ -# define DO(n) (*fpu)[n] = *(double*)(&arch->vex.guest_FPR##n) - DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); - DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15); - DO(16); DO(17); DO(18); DO(19); DO(20); DO(21); DO(22); DO(23); - DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31); -# undef DO -} - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_coredump/coredump-x86-darwin.c b/coregrind/m_coredump/coredump-x86-darwin.c deleted file mode 100644 index 3618113cba..0000000000 --- a/coregrind/m_coredump/coredump-x86-darwin.c +++ /dev/null @@ -1,39 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- Dumping core. coredump-x86-darwin.c ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2005 Apple Inc. - Greg Parker gparker@apple.com - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. -*/ - -#include "pub_core_basics.h" -#include "pub_core_vki.h" -#include "pub_core_coredump.h" -#include "pub_core_threadstate.h" - -void VG_(make_coredump)(ThreadId tid, const vki_siginfo_t *si, UInt max_size) -{ - // DDD: #warning GrP fixme coredump -} diff --git a/coregrind/m_coredump/coredump-x86-linux.c b/coregrind/m_coredump/coredump-x86-linux.c deleted file mode 100644 index 9b3a145696..0000000000 --- a/coregrind/m_coredump/coredump-x86-linux.c +++ /dev/null @@ -1,110 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- Dumping core. coredump-x86-linux.c ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2000-2009 Julian Seward - jseward@acm.org - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. -*/ - -#include "pub_core_basics.h" -#include "pub_core_vki.h" -#include "pub_core_libcbase.h" -#include "pub_core_coredump.h" -#include "pub_core_threadstate.h" - -#include "priv_elf.h" - -void ML_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs, - const ThreadArchState* arch) -{ - regs->eflags = LibVEX_GuestX86_get_eflags( &((ThreadArchState*)arch)->vex ); - regs->esp = arch->vex.guest_ESP; - regs->eip = arch->vex.guest_EIP; - - regs->ebx = arch->vex.guest_EBX; - regs->ecx = arch->vex.guest_ECX; - regs->edx = arch->vex.guest_EDX; - regs->esi = arch->vex.guest_ESI; - regs->edi = arch->vex.guest_EDI; - regs->ebp = arch->vex.guest_EBP; - regs->eax = arch->vex.guest_EAX; - - regs->cs = arch->vex.guest_CS; - regs->ds = arch->vex.guest_DS; - regs->ss = arch->vex.guest_SS; - regs->es = arch->vex.guest_ES; - regs->fs = arch->vex.guest_FS; - regs->gs = arch->vex.guest_GS; -} - -//:: static void fill_fpu(vki_elf_fpregset_t *fpu, const Char *from) -//:: { -//:: if (VG_(have_ssestate)) { -//:: UShort *to; -//:: Int i; -//:: -//:: /* This is what the kernel does */ -//:: VG_(memcpy)(fpu, from, 7*sizeof(long)); -//:: -//:: to = (UShort *)&fpu->st_space[0]; -//:: from += 18 * sizeof(UShort); -//:: -//:: for (i = 0; i < 8; i++, to += 5, from += 8) -//:: VG_(memcpy)(to, from, 5*sizeof(UShort)); -//:: } else -//:: VG_(memcpy)(fpu, from, sizeof(*fpu)); -//:: } - -void ML_(fill_elffpregs_from_tst)(vki_elf_fpregset_t* fpu, - const ThreadArchState* arch) -{ -//:: fill_fpu(fpu, (const Char *)&arch->m_sse); -} - -void ML_(fill_elffpxregs_from_tst)(vki_elf_fpxregset_t* xfpu, - const ThreadArchState* arch) -{ -//:: xfpu->cwd = ?; -//:: xfpu->swd = ?; -//:: xfpu->twd = ?; -//:: xfpu->fop = ?; -//:: xfpu->fip = ?; -//:: xfpu->fcs = ?; -//:: xfpu->foo = ?; -//:: xfpu->fos = ?; -//:: xfpu->mxcsr = ?; - xfpu->reserved = 0; -//:: xfpu->st_space = ?; - -# define DO(n) VG_(memcpy)(xfpu->xmm_space + n * 4, &arch->vex.guest_XMM##n, sizeof(arch->vex.guest_XMM##n)) - DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7); -# undef DO - - VG_(memset)(xfpu->padding, 0, sizeof(xfpu->padding)); -} - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_coredump/coredump-ppc32-aix5.c b/coregrind/m_coredump/coredump-xcoff.c similarity index 93% rename from coregrind/m_coredump/coredump-ppc32-aix5.c rename to coregrind/m_coredump/coredump-xcoff.c index 31b7d45b72..34e86a6dbb 100644 --- a/coregrind/m_coredump/coredump-ppc32-aix5.c +++ b/coregrind/m_coredump/coredump-xcoff.c @@ -1,6 +1,6 @@ /*--------------------------------------------------------------------*/ -/*--- Dumping core. coredump-ppc32-aix5.c ---*/ +/*--- Dumping core. coredump-xcoff.c ---*/ /*--------------------------------------------------------------------*/ /* @@ -33,6 +33,8 @@ without prior written permission. */ +#if defined(VGO_aix5) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_libcassert.h" @@ -43,6 +45,8 @@ void VG_(make_coredump)(ThreadId tid, const vki_siginfo_t *si, UInt max_size) /* not implemented */ } +#endif // defined(VGO_aix5) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_coredump/priv_elf.h b/coregrind/m_coredump/priv_elf.h deleted file mode 100644 index 0543b116c5..0000000000 --- a/coregrind/m_coredump/priv_elf.h +++ /dev/null @@ -1,49 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- Header for ELF core dump stuff. priv_elf.h ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2000-2009 Julian Seward - jseward@acm.org - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307, USA. - - The GNU General Public License is contained in the file COPYING. -*/ - -#ifndef __PRIV_ELF_H -#define __PRIV_ELF_H - -void ML_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs, - const ThreadArchState* arch); - -void ML_(fill_elffpregs_from_tst)(vki_elf_fpregset_t* fpu, - const ThreadArchState* arch); - -#if defined(VGP_x86_linux) -void ML_(fill_elffpxregs_from_tst)(vki_elf_fpxregset_t* xfpu, - const ThreadArchState* arch); -#endif - -#endif // __PRIV_ELF_H - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 4ec85c802a..34442f6bc7 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -28,11 +28,6 @@ The GNU General Public License is contained in the file COPYING. */ -/* - Stabs reader greatly improved by Nick Nethercote, Apr 02. - This module was also extensively hacked on by Jeremy Fitzhardinge - and Tom Hughes. -*/ #include "pub_core_basics.h" #include "pub_core_vki.h" @@ -752,15 +747,16 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV ) } vg_assert(nread > 0 && nread <= sizeof(buf1k) ); - /* We're only interested in mappings of ELF object files. */ -#if defined(HAVE_ELF) + /* We're only interested in mappings of object files. */ + // Nb: AIX5 doesn't use this file and so isn't represented here. +#if defined(VGO_linux) if (!ML_(is_elf_object_file)( buf1k, (SizeT)nread )) return 0; -#elif defined(HAVE_MACHO) +#elif defined(VGO_darwin) if (!ML_(is_macho_object_file)( buf1k, (SizeT)nread )) return 0; #else -# error "unknown executable type" +# error "unknown OS" #endif /* See if we have a DebugInfo for this filename. If not, @@ -813,12 +809,13 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV ) discard_DebugInfos_which_overlap_with( di ); /* .. and acquire new info. */ -#if defined(HAVE_ELF) + // Nb: AIX5 doesn't use this file and so isn't represented here. +#if defined(VGO_linux) ok = ML_(read_elf_debug_info)( di ); -#elif defined(HAVE_MACHO) +#elif defined(VGO_darwin) ok = ML_(read_macho_debug_info)( di ); #else -# error "unknown executable type" +# error "unknown OS" #endif if (ok) { @@ -1026,7 +1023,7 @@ void VG_(di_notify_pdb_debuginfo)( Int fd_obj, Addr avma_obj, if (pdbname) ML_(dinfo_free)(pdbname); } -#endif /* defined(VGO_linux) */ +#endif /* defined(VGO_linux) || defined(VGO_darwin) */ /*-------------------------------------------------------------*/ diff --git a/coregrind/m_debuginfo/priv_readpdb.h b/coregrind/m_debuginfo/priv_readpdb.h index eb8801798b..3fb84d7be9 100644 --- a/coregrind/m_debuginfo/priv_readpdb.h +++ b/coregrind/m_debuginfo/priv_readpdb.h @@ -32,6 +32,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_linux) || defined(VGO_darwin) + #ifndef __PRIV_READPDB_H #define __PRIV_READPDB_H @@ -48,6 +50,8 @@ extern Bool ML_(read_pdb_debug_info)( #endif /* ndef __PRIV_READPDB_H */ +#endif // defined(VGO_linux) || defined(VGO_darwin) + /*--------------------------------------------------------------------*/ -/*--- end priv_readpdb.h ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c index 69000e63e8..24bb473384 100644 --- a/coregrind/m_debuginfo/readdwarf.c +++ b/coregrind/m_debuginfo/readdwarf.c @@ -27,11 +27,8 @@ The GNU General Public License is contained in the file COPYING. */ -/* - Stabs reader greatly improved by Nick Nethercote, Apr 02. - This module was also extensively hacked on by Jeremy Fitzhardinge - and Tom Hughes. -*/ + +#if defined(VGO_linux) || defined(VGO_darwin) #include "pub_core_basics.h" #include "pub_core_debuginfo.h" @@ -3884,6 +3881,7 @@ void ML_(read_callframe_info_dwarf3) return; } +#endif // defined(VGO_linux) || defined(VGO_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c index d94b17dea1..db46cc3688 100644 --- a/coregrind/m_debuginfo/readdwarf3.c +++ b/coregrind/m_debuginfo/readdwarf3.c @@ -34,6 +34,8 @@ without prior written permission. */ +#if defined(VGO_linux) || defined(VGO_darwin) + /* REFERENCE (without which this code will not make much sense): DWARF Debugging Information Format, Version 3, @@ -3904,7 +3906,8 @@ ML_(new_dwarf3_reader) ( TRACE_SYMTAB("\n"); #endif +#endif // defined(VGO_linux) || defined(VGO_darwin) /*--------------------------------------------------------------------*/ -/*--- end readdwarf3.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c index f80edd6f44..2da1cf258e 100644 --- a/coregrind/m_debuginfo/readelf.c +++ b/coregrind/m_debuginfo/readelf.c @@ -28,11 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ -/* - Stabs reader greatly improved by Nick Nethercote, Apr 02. - This module was also extensively hacked on by Jeremy Fitzhardinge - and Tom Hughes. -*/ + +#if defined(VGO_linux) #include "pub_core_basics.h" #include "pub_core_vki.h" @@ -2048,6 +2045,7 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di ) } } +#endif // defined(VGO_linux) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_debuginfo/readmacho.c b/coregrind/m_debuginfo/readmacho.c index 21eb08a7e1..53263125cc 100644 --- a/coregrind/m_debuginfo/readmacho.c +++ b/coregrind/m_debuginfo/readmacho.c @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_darwin) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_libcbase.h" @@ -1092,6 +1094,8 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) return False; } +#endif // defined(VGO_darwin) + /*--------------------------------------------------------------------*/ -/*--- end readmacho.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_debuginfo/readpdb.c b/coregrind/m_debuginfo/readpdb.c index 18c479c6c9..b0682c034e 100644 --- a/coregrind/m_debuginfo/readpdb.c +++ b/coregrind/m_debuginfo/readpdb.c @@ -35,6 +35,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_linux) || defined(VGO_darwin) + #include "pub_core_basics.h" #include "pub_core_debuginfo.h" #include "pub_core_vki.h" // VKI_PAGE_SIZE @@ -2261,7 +2263,8 @@ Bool ML_(read_pdb_debug_info)( return True; } +#endif // defined(VGO_linux) || defined(VGO_darwin) /*--------------------------------------------------------------------*/ -/*--- end readpdb.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_debuginfo/readstabs.c b/coregrind/m_debuginfo/readstabs.c index 72de81dd84..1cd72c6193 100644 --- a/coregrind/m_debuginfo/readstabs.c +++ b/coregrind/m_debuginfo/readstabs.c @@ -27,6 +27,9 @@ The GNU General Public License is contained in the file COPYING. */ + +#if defined(VGO_linux) || defined(VGO_darwin) + /* Stabs reader greatly improved by Nick Nethercote, Apr 02. This module was also extensively hacked on by Jeremy Fitzhardinge @@ -386,6 +389,8 @@ void ML_(read_debuginfo_stabs) ( DebugInfo* di, } } +#endif // defined(VGO_linux) || defined(VGO_darwin) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_debuginfo/readxcoff.c b/coregrind/m_debuginfo/readxcoff.c index 4435d7cc6c..1be4e94f7a 100644 --- a/coregrind/m_debuginfo/readxcoff.c +++ b/coregrind/m_debuginfo/readxcoff.c @@ -33,6 +33,8 @@ without prior written permission. */ +#if defined(VGO_aix5) + /* This file reads XCOFF symbol tables and debug info. Known limitations: @@ -2481,6 +2483,8 @@ Bool ML_(read_xcoff_debug_info) ( struct _DebugInfo* di, return ok; } +#endif // defined(VGO_aix5) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_dispatch/dispatch-amd64-darwin.S b/coregrind/m_dispatch/dispatch-amd64-darwin.S index bc095e4be1..badeeeb77f 100644 --- a/coregrind/m_dispatch/dispatch-amd64-darwin.S +++ b/coregrind/m_dispatch/dispatch-amd64-darwin.S @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_amd64_darwin) + #include "pub_core_basics_asm.h" #include "pub_core_dispatch_asm.h" #include "pub_core_transtab_asm.h" @@ -326,6 +328,8 @@ VG_(run_a_noredir_translation__return_point): popq %rbx ret +#endif // defined(VGP_amd64_darwin) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_dispatch/dispatch-amd64-linux.S b/coregrind/m_dispatch/dispatch-amd64-linux.S index 029b71aaba..6f52dbf8cd 100644 --- a/coregrind/m_dispatch/dispatch-amd64-linux.S +++ b/coregrind/m_dispatch/dispatch-amd64-linux.S @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_amd64_linux) + #include "pub_core_basics_asm.h" #include "pub_core_dispatch_asm.h" #include "pub_core_transtab_asm.h" @@ -339,6 +341,8 @@ VG_(run_a_noredir_translation__return_point): /* Let the linker know we don't need an executable stack */ .section .note.GNU-stack,"",@progbits +#endif // defined(VGP_amd64_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_dispatch/dispatch-ppc32-aix5.S b/coregrind/m_dispatch/dispatch-ppc32-aix5.S index b09b76c286..b98ef0d36c 100644 --- a/coregrind/m_dispatch/dispatch-ppc32-aix5.S +++ b/coregrind/m_dispatch/dispatch-ppc32-aix5.S @@ -34,6 +34,8 @@ without prior written permission. */ +#if defined(VGP_ppc32_aix5) + #include "pub_core_basics_asm.h" #include "pub_core_dispatch_asm.h" #include "pub_core_transtab_asm.h" @@ -672,6 +674,7 @@ void VG_(run_a_noredir_translation) ( UWord* argblock ); mr 1,4 blr +#endif // defined(VGP_ppc32_aix5) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_dispatch/dispatch-ppc32-linux.S b/coregrind/m_dispatch/dispatch-ppc32-linux.S index c69c27b637..2eb13ef4ce 100644 --- a/coregrind/m_dispatch/dispatch-ppc32-linux.S +++ b/coregrind/m_dispatch/dispatch-ppc32-linux.S @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_ppc32_linux) + #include "pub_core_basics_asm.h" #include "pub_core_dispatch_asm.h" #include "pub_core_transtab_asm.h" @@ -621,6 +623,8 @@ VG_(run_a_noredir_translation): /* Let the linker know we don't need an executable stack */ .section .note.GNU-stack,"",@progbits +#endif // defined(VGP_ppc32_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_dispatch/dispatch-ppc64-aix5.S b/coregrind/m_dispatch/dispatch-ppc64-aix5.S index 522e1831fc..c829e1ee55 100644 --- a/coregrind/m_dispatch/dispatch-ppc64-aix5.S +++ b/coregrind/m_dispatch/dispatch-ppc64-aix5.S @@ -34,6 +34,8 @@ without prior written permission. */ +#if defined(VGP_ppc64_aix5) + #include "pub_core_basics_asm.h" #include "pub_core_dispatch_asm.h" #include "pub_core_transtab_asm.h" @@ -645,6 +647,8 @@ void VG_(run_a_noredir_translation) ( UWord* argblock ); mr 1,4 blr +#endif // defined(VGP_ppc64_aix5) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_dispatch/dispatch-ppc64-linux.S b/coregrind/m_dispatch/dispatch-ppc64-linux.S index f04e4b5e73..801a1dd96c 100644 --- a/coregrind/m_dispatch/dispatch-ppc64-linux.S +++ b/coregrind/m_dispatch/dispatch-ppc64-linux.S @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_ppc64_linux) + #include "pub_core_basics_asm.h" #include "pub_core_dispatch_asm.h" #include "pub_core_transtab_asm.h" @@ -656,6 +658,8 @@ VG_(run_a_noredir_translation): /* Let the linker know we don't need an executable stack */ .section .note.GNU-stack,"",@progbits +#endif // defined(VGP_ppc64_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_dispatch/dispatch-x86-darwin.S b/coregrind/m_dispatch/dispatch-x86-darwin.S index 11956a80a9..ab90cf8a52 100644 --- a/coregrind/m_dispatch/dispatch-x86-darwin.S +++ b/coregrind/m_dispatch/dispatch-x86-darwin.S @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------*/ /*--- The core dispatch loop, for jumping to a code address. ---*/ -/*--- dispatch-x86.S ---*/ +/*--- dispatch-x86-darwin.S ---*/ /*--------------------------------------------------------------------*/ /* @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_x86_darwin) + #include "pub_core_basics_asm.h" #include "pub_core_dispatch_asm.h" #include "pub_core_transtab_asm.h" @@ -312,6 +314,7 @@ VG_(run_a_noredir_translation__return_point): popl %esi ret +#endif // defined(VGP_x86_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_dispatch/dispatch-x86-linux.S b/coregrind/m_dispatch/dispatch-x86-linux.S index b8833baf25..506fc0fbe5 100644 --- a/coregrind/m_dispatch/dispatch-x86-linux.S +++ b/coregrind/m_dispatch/dispatch-x86-linux.S @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_x86_linux) + #include "pub_core_basics_asm.h" #include "pub_core_dispatch_asm.h" #include "pub_core_transtab_asm.h" @@ -306,6 +308,8 @@ VG_(run_a_noredir_translation__return_point): /* Let the linker know we don't need an executable stack */ .section .note.GNU-stack,"",@progbits +#endif // defined(VGP_x86_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_initimg/initimg-aix5.c b/coregrind/m_initimg/initimg-aix5.c index 24ca1bc910..f4cc2f64a5 100644 --- a/coregrind/m_initimg/initimg-aix5.c +++ b/coregrind/m_initimg/initimg-aix5.c @@ -34,6 +34,8 @@ without prior written permission. */ +#if defined(VGO_aix5) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -540,6 +542,8 @@ static void diagnose_load_failure ( void ) of the symbol was not found. */ +#endif // defined(VGO_aix5) + /*--------------------------------------------------------------------*/ -/*--- initimg-aix5.c ---*/ +/*--- ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_initimg/initimg-darwin.c b/coregrind/m_initimg/initimg-darwin.c index 13da3bc46b..d11ae3a17d 100644 --- a/coregrind/m_initimg/initimg-darwin.c +++ b/coregrind/m_initimg/initimg-darwin.c @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_darwin) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_debuglog.h" @@ -619,3 +621,9 @@ void VG_(ii_finalise_image)( IIFinaliseImageInfo iifii ) VG_TRACK( post_reg_write, Vg_CoreStartup, /*tid*/1, /*offset*/0, sizeof(VexGuestArchState)); } + +#endif // defined(VGO_darwin) + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_initimg/initimg-linux.c b/coregrind/m_initimg/initimg-linux.c index f5b0278b3b..a24799cf39 100644 --- a/coregrind/m_initimg/initimg-linux.c +++ b/coregrind/m_initimg/initimg-linux.c @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_debuglog.h" @@ -986,7 +988,8 @@ void VG_(ii_finalise_image)( IIFinaliseImageInfo iifii ) sizeof(VexGuestArchState)); } +#endif // defined(VGO_linux) /*--------------------------------------------------------------------*/ -/*--- initimg-linux.c ---*/ +/*--- ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_initimg/initimg-pathscan.c b/coregrind/m_initimg/initimg-pathscan.c index 47c7d01a7c..acde9c96b8 100644 --- a/coregrind/m_initimg/initimg-pathscan.c +++ b/coregrind/m_initimg/initimg-pathscan.c @@ -147,3 +147,6 @@ HChar* ML_(find_executable) ( HChar* exec ) return VG_STREQ(executable_name_out, "") ? NULL : executable_name_out; } +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_mach/mach_basics.c b/coregrind/m_mach/mach_basics.c index cd6df6c591..a671b65476 100644 --- a/coregrind/m_mach/mach_basics.c +++ b/coregrind/m_mach/mach_basics.c @@ -28,11 +28,11 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_darwin) + #include "pub_core_basics.h" #include "pub_core_mach.h" -#if defined(VGO_darwin) - #include #include @@ -84,17 +84,7 @@ void VG_(mach_init)(void) vm_page_size = 4096; } - -#else - -// For platforms that don't actually have Mach kernel interfaces - -void VG_(mach_init)(void) -{ - // do nothing -} - -#endif +#endif // defined(VGO_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_mach/mach_msg.c b/coregrind/m_mach/mach_msg.c index 0b9aa968ed..c21425472a 100644 --- a/coregrind/m_mach/mach_msg.c +++ b/coregrind/m_mach/mach_msg.c @@ -1,8 +1,3 @@ -#include "pub_core_basics.h" -#include "pub_core_mach.h" - -#if defined(VGO_darwin) - /* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University @@ -42,6 +37,11 @@ * */ +#if defined(VGO_darwin) + +#include "pub_core_basics.h" +#include "pub_core_mach.h" + #include #include @@ -103,4 +103,8 @@ mach_msg(msg, option, send_size, rcv_size, rcv_name, timeout, notify) return mr; } -#endif +#endif // defined(VGO_darwin) + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_mach/mach_traps-amd64-darwin.S b/coregrind/m_mach/mach_traps-amd64-darwin.S index 7a85e41c52..8eb6036d73 100644 --- a/coregrind/m_mach/mach_traps-amd64-darwin.S +++ b/coregrind/m_mach/mach_traps-amd64-darwin.S @@ -1,5 +1,5 @@ /*--------------------------------------------------------------------*/ -/*--- Basic Mach traps mach_traps.S ---*/ +/*--- Basic Mach traps. mach_traps-amd64-darwin.S ---*/ /*--------------------------------------------------------------------*/ /* @@ -27,6 +27,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_amd64_darwin) + #include "vki/vki-scnums-darwin.h" // mach_port_name_t task_self_trap(void) @@ -130,6 +132,7 @@ _semaphore_wait_signal: syscall ret +#endif // defined(VGP_amd64_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_mach/mach_traps-x86-darwin.S b/coregrind/m_mach/mach_traps-x86-darwin.S index b843834a45..4992cd07d9 100644 --- a/coregrind/m_mach/mach_traps-x86-darwin.S +++ b/coregrind/m_mach/mach_traps-x86-darwin.S @@ -1,5 +1,5 @@ /*--------------------------------------------------------------------*/ -/*--- Basic Mach traps mach_traps.S ---*/ +/*--- Basic Mach traps. mach_traps-x86-darwin.S ---*/ /*--------------------------------------------------------------------*/ /* @@ -27,6 +27,10 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_x86_darwin) + +// DDD: should use __NR_ constants in here instead of the trap numbers +// directly! // mach_port_name_t task_self_trap(void) .text @@ -118,6 +122,7 @@ _semaphore_wait_signal: int $0x81 ret +#endif // defined(VGP_x86_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_sigframe/sigframe-amd64-darwin.c b/coregrind/m_sigframe/sigframe-amd64-darwin.c index 4c8bc926a3..4898255e5b 100644 --- a/coregrind/m_sigframe/sigframe-amd64-darwin.c +++ b/coregrind/m_sigframe/sigframe-amd64-darwin.c @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_amd64_darwin) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -63,6 +65,8 @@ void VG_(sigframe_destroy)( ThreadId tid, Bool isRT ) I_die_here; } +#endif // defined(VGP_amd64_darwin) + /*--------------------------------------------------------------------*/ /*--- end sigframe-amd64-darwin.c ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_sigframe/sigframe-amd64-linux.c b/coregrind/m_sigframe/sigframe-amd64-linux.c index 47a65c26d6..b3b97d1145 100644 --- a/coregrind/m_sigframe/sigframe-amd64-linux.c +++ b/coregrind/m_sigframe/sigframe-amd64-linux.c @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_amd64_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_threadstate.h" @@ -631,6 +633,8 @@ void VG_(sigframe_destroy)( ThreadId tid, Bool isRT ) VG_TRACK( post_deliver_signal, tid, sigNo ); } +#endif // defined(VGP_amd64_linux) + /*--------------------------------------------------------------------*/ -/*--- end sigframe-amd64-linux.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_sigframe/sigframe-ppc32-aix5.c b/coregrind/m_sigframe/sigframe-ppc32-aix5.c index 925e617577..3cecd57ba1 100644 --- a/coregrind/m_sigframe/sigframe-ppc32-aix5.c +++ b/coregrind/m_sigframe/sigframe-ppc32-aix5.c @@ -34,6 +34,8 @@ without prior written permission. */ +#if defined(VGP_ppc32_aix5) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -230,6 +232,8 @@ void VG_(sigframe_destroy)( ThreadId tid, Bool isRT ) VG_TRACK( post_deliver_signal, tid, sigNo ); } +#endif // defined(VGP_ppc32_aix5) + /*--------------------------------------------------------------------*/ -/*--- end sigframe-ppc32-aix5.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_sigframe/sigframe-ppc32-linux.c b/coregrind/m_sigframe/sigframe-ppc32-linux.c index 93f8ee7ff1..d36988c278 100644 --- a/coregrind/m_sigframe/sigframe-ppc32-linux.c +++ b/coregrind/m_sigframe/sigframe-ppc32-linux.c @@ -31,6 +31,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_ppc32_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -973,6 +975,8 @@ void VG_(sigframe_destroy)( ThreadId tid, Bool isRT ) //.. VG_TRACK( post_deliver_signal, tid, sigNo ); } +#endif // defined(VGP_ppc32_linux) + /*--------------------------------------------------------------------*/ -/*--- end sigframe-ppc32-linux.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_sigframe/sigframe-ppc64-aix5.c b/coregrind/m_sigframe/sigframe-ppc64-aix5.c index 914e45961e..083a5a1d8d 100644 --- a/coregrind/m_sigframe/sigframe-ppc64-aix5.c +++ b/coregrind/m_sigframe/sigframe-ppc64-aix5.c @@ -34,6 +34,8 @@ without prior written permission. */ +#if defined(VGP_ppc64_aix5) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -264,6 +266,8 @@ void VG_(sigframe_destroy)( ThreadId tid, Bool isRT ) VG_TRACK( post_deliver_signal, tid, sigNo ); } +#endif // defined(VGP_ppc64_aix5) + /*--------------------------------------------------------------------*/ -/*--- end sigframe-ppc64-aix5.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_sigframe/sigframe-ppc64-linux.c b/coregrind/m_sigframe/sigframe-ppc64-linux.c index 1dc117ce0a..16411d7a24 100644 --- a/coregrind/m_sigframe/sigframe-ppc64-linux.c +++ b/coregrind/m_sigframe/sigframe-ppc64-linux.c @@ -31,6 +31,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_ppc64_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -382,6 +384,8 @@ void VG_(sigframe_destroy)( ThreadId tid, Bool isRT ) VG_TRACK( post_deliver_signal, tid, sigNo ); } +#endif // defined(VGP_ppc64_linux) + /*--------------------------------------------------------------------*/ -/*--- end sigframe-ppc64-linux.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_sigframe/sigframe-x86-darwin.c b/coregrind/m_sigframe/sigframe-x86-darwin.c index 698d940792..3b5a018512 100644 --- a/coregrind/m_sigframe/sigframe-x86-darwin.c +++ b/coregrind/m_sigframe/sigframe-x86-darwin.c @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_x86_darwin) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -227,6 +229,8 @@ void VG_(sigframe_destroy)( ThreadId tid, Bool isRT ) VG_TRACK( post_deliver_signal, tid, sigNo ); } +#endif // defined(VGP_x86_darwin) + /*--------------------------------------------------------------------*/ -/*--- end sigframe-x86-darwin.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_sigframe/sigframe-x86-linux.c b/coregrind/m_sigframe/sigframe-x86-linux.c index 06f780acab..11b779f268 100644 --- a/coregrind/m_sigframe/sigframe-x86-linux.c +++ b/coregrind/m_sigframe/sigframe-x86-linux.c @@ -29,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_x86_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_threadstate.h" @@ -721,6 +723,8 @@ void VG_(sigframe_destroy)( ThreadId tid, Bool isRT ) VG_TRACK( post_deliver_signal, tid, sigNo ); } +#endif // defined(VGP_x86_linux) + /*--------------------------------------------------------------------*/ -/*--- end sigframe-x86-linux.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_start-amd64-darwin.S b/coregrind/m_start-amd64-darwin.S index e414a26aca..edd96130bc 100644 --- a/coregrind/m_start-amd64-darwin.S +++ b/coregrind/m_start-amd64-darwin.S @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_amd64_darwin) + #include "pub_core_basics_asm.h" .text @@ -79,3 +81,8 @@ __start: int $3 int $3 +#endif // defined(VGP_amd64_darwin) + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_start-x86-darwin.S b/coregrind/m_start-x86-darwin.S index 57b49d0a74..10e7e13ae2 100644 --- a/coregrind/m_start-x86-darwin.S +++ b/coregrind/m_start-x86-darwin.S @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_x86_darwin) + #include "pub_core_basics_asm.h" .text @@ -78,3 +80,9 @@ __start: // should not reach here int $3 int $3 + +#endif // defined(VGP_x86_darwin) + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syscall-amd64-darwin.S b/coregrind/m_syswrap/syscall-amd64-darwin.S index f4ab1b4ec5..fbc334fb55 100644 --- a/coregrind/m_syswrap/syscall-amd64-darwin.S +++ b/coregrind/m_syswrap/syscall-amd64-darwin.S @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_amd64_darwin) + #include "pub_core_basics_asm.h" #include "pub_core_vkiscnums_asm.h" #include "libvex_guest_offsets.h" @@ -247,6 +249,7 @@ ML_(blksys_complete_UNIX): .quad MK_L_SCCLASS_N(UNIX,3) ML_(blksys_committed_UNIX): .quad MK_L_SCCLASS_N(UNIX,4) ML_(blksys_finished_UNIX): .quad MK_L_SCCLASS_N(UNIX,5) +#endif // defined(VGP_amd64_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_syswrap/syscall-amd64-linux.S b/coregrind/m_syswrap/syscall-amd64-linux.S index 273cf442ac..3e7c697c14 100644 --- a/coregrind/m_syswrap/syscall-amd64-linux.S +++ b/coregrind/m_syswrap/syscall-amd64-linux.S @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_amd64_linux) + #include "pub_core_basics_asm.h" #include "pub_core_vkiscnums_asm.h" #include "libvex_guest_offsets.h" @@ -206,6 +208,8 @@ ML_(blksys_finished): .quad 5b /* Let the linker know we don't need an executable stack */ .section .note.GNU-stack,"",@progbits +#endif // defined(VGP_amd64_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syscall-ppc32-aix5.S b/coregrind/m_syswrap/syscall-ppc32-aix5.S index c5dbcdd6a4..7d8d16cc22 100644 --- a/coregrind/m_syswrap/syscall-ppc32-aix5.S +++ b/coregrind/m_syswrap/syscall-ppc32-aix5.S @@ -31,6 +31,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_ppc32_aix5) + #include "pub_core_basics_asm.h" #include "libvex_guest_offsets.h" @@ -216,6 +218,7 @@ ML_(blksys_complete): .long Lvg3 ML_(blksys_committed): .long Lvg4 ML_(blksys_finished): .long Lvg5 +#endif // defined(VGP_ppc32_aix5) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_syswrap/syscall-ppc32-linux.S b/coregrind/m_syswrap/syscall-ppc32-linux.S index e99cfd597c..4a89135914 100644 --- a/coregrind/m_syswrap/syscall-ppc32-linux.S +++ b/coregrind/m_syswrap/syscall-ppc32-linux.S @@ -27,6 +27,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_ppc32_linux) + #include "pub_core_basics_asm.h" #include "pub_core_vkiscnums_asm.h" #include "libvex_guest_offsets.h" @@ -156,6 +158,8 @@ ML_(blksys_finished): .long 5b /* Let the linker know we don't need an executable stack */ .section .note.GNU-stack,"",@progbits +#endif // defined(VGP_ppc32_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syscall-ppc64-aix5.S b/coregrind/m_syswrap/syscall-ppc64-aix5.S index 5d308e171e..ee4ad51e61 100644 --- a/coregrind/m_syswrap/syscall-ppc64-aix5.S +++ b/coregrind/m_syswrap/syscall-ppc64-aix5.S @@ -31,6 +31,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_ppc64_aix5) + #include "pub_core_basics_asm.h" #include "libvex_guest_offsets.h" @@ -216,6 +218,7 @@ ML_(blksys_complete): .llong Lvg3 ML_(blksys_committed): .llong Lvg4 ML_(blksys_finished): .llong Lvg5 +#endif // defined(VGP_ppc64_aix5) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_syswrap/syscall-ppc64-linux.S b/coregrind/m_syswrap/syscall-ppc64-linux.S index 5230b38c22..4c0fb10ea6 100644 --- a/coregrind/m_syswrap/syscall-ppc64-linux.S +++ b/coregrind/m_syswrap/syscall-ppc64-linux.S @@ -27,6 +27,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_ppc64_linux) + #include "pub_core_basics_asm.h" #include "pub_core_vkiscnums_asm.h" #include "libvex_guest_offsets.h" @@ -163,6 +165,8 @@ ML_(blksys_finished): .quad 5b /* Let the linker know we don't need an executable stack */ .section .note.GNU-stack,"",@progbits +#endif // defined(VGP_ppc64_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syscall-x86-darwin.S b/coregrind/m_syswrap/syscall-x86-darwin.S index e388abd532..3d45610c9c 100644 --- a/coregrind/m_syswrap/syscall-x86-darwin.S +++ b/coregrind/m_syswrap/syscall-x86-darwin.S @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_x86_darwin) + #include "pub_core_basics_asm.h" #include "pub_core_vkiscnums_asm.h" #include "libvex_guest_offsets.h" @@ -245,7 +247,7 @@ ML_(blksys_complete_UNIX): .long MK_L_SCCLASS_N(UNIX,3) ML_(blksys_committed_UNIX): .long MK_L_SCCLASS_N(UNIX,4) ML_(blksys_finished_UNIX): .long MK_L_SCCLASS_N(UNIX,5) - +#endif // defined(VGP_x86_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_syswrap/syscall-x86-linux.S b/coregrind/m_syswrap/syscall-x86-linux.S index 6eb36a5a7b..f460199d0a 100644 --- a/coregrind/m_syswrap/syscall-x86-linux.S +++ b/coregrind/m_syswrap/syscall-x86-linux.S @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_x86_linux) + #include "pub_core_basics_asm.h" #include "pub_core_vkiscnums_asm.h" #include "libvex_guest_offsets.h" @@ -166,6 +168,8 @@ ML_(blksys_finished): .long 5b /* Let the linker know we don't need an executable stack */ .section .note.GNU-stack,"",@progbits +#endif // defined(VGP_x86_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-aix5.c b/coregrind/m_syswrap/syswrap-aix5.c index 38de8caf9d..90e966e0b2 100644 --- a/coregrind/m_syswrap/syswrap-aix5.c +++ b/coregrind/m_syswrap/syswrap-aix5.c @@ -33,6 +33,8 @@ without prior written permission. */ +#if defined(VGO_aix5) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -2574,6 +2576,8 @@ PRE(sys_yield) #undef PRE #undef POST +#endif // defined(VGO_aix5) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-amd64-darwin.c b/coregrind/m_syswrap/syswrap-amd64-darwin.c index 714a75585b..0347db4544 100644 --- a/coregrind/m_syswrap/syswrap-amd64-darwin.c +++ b/coregrind/m_syswrap/syswrap-amd64-darwin.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_amd64_darwin) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_threadstate.h" @@ -455,3 +457,9 @@ void wqthread_hijack(Addr self, Addr kport, Addr stackaddr, Addr workitem, /*NOTREACHED*/ vg_assert(0); } + +#endif // defined(VGP_amd64_darwin) + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c index b3de9e526c..baf4f6631f 100644 --- a/coregrind/m_syswrap/syswrap-amd64-linux.c +++ b/coregrind/m_syswrap/syswrap-amd64-linux.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_amd64_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -1373,6 +1375,8 @@ const SyscallTableEntry ML_(syscall_table)[] = { const UInt ML_(syscall_table_size) = sizeof(ML_(syscall_table)) / sizeof(ML_(syscall_table)[0]); +#endif // defined(VGP_amd64_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 6189ce05fc..4deb3a7a3c 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_darwin) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -7565,7 +7567,8 @@ const UInt ML_(mach_trap_table_size) = const UInt ML_(mdep_trap_table_size) = sizeof(ML_(mdep_trap_table)) / sizeof(ML_(mdep_trap_table)[0]); +#endif // defined(VGO_darwin) /*--------------------------------------------------------------------*/ -/*--- end syswrap-darwin.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 5fc855ac16..a1fb344349 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -1,6 +1,7 @@ /*--------------------------------------------------------------------*/ -/*--- Wrappers for generic Unix system calls syswrap-generic.c ---*/ +/*--- Wrappers for generic (non-AIX5!) Unix system calls ---*/ +/*--- syswrap-generic.c ---*/ /*--------------------------------------------------------------------*/ /* @@ -28,6 +29,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_linux) || defined(VGO_darwin) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -4085,6 +4088,8 @@ POST(sys_sigaltstack) #undef PRE #undef POST +#endif // defined(VGO_linux) || defined(VGO_darwin) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-linux-variants.c b/coregrind/m_syswrap/syswrap-linux-variants.c index 1d17ab84a1..7c188c02e4 100644 --- a/coregrind/m_syswrap/syswrap-linux-variants.c +++ b/coregrind/m_syswrap/syswrap-linux-variants.c @@ -29,10 +29,11 @@ The GNU General Public License is contained in the file COPYING. */ -/* The files syswrap-generic.c, syswrap-linux.c, syswrap-x86-linux.c, - syswrap-amd64-linux.c and syswrap-ppc32-linux.c, and associated - vki*.h header files, constitute Valgrind's model of how a vanilla - Linux kernel behaves with respect to syscalls. +#if defined(VGO_linux) + +/* The files syswrap-generic.c, syswrap-linux.c, syswrap-*-linux.c, + and associated vki*.h header files, constitute Valgrind's model of how a + vanilla Linux kernel behaves with respect to syscalls. On a few occasions, it is useful to run with a kernel that has some (minor) extensions to the vanilla model, either due to running on a @@ -86,7 +87,8 @@ void ML_(linux_variant_POST_sys_bproc)( UWord arg1, UWord arg2, { } +#endif // defined(VGO_linux) /*--------------------------------------------------------------------*/ -/*--- end syswrap-linux-variants.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index db68261ec1..b8fd7c40b9 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -5252,12 +5254,11 @@ ML_(linux_POST_sys_getsockopt) ( ThreadId tid, } } - #undef PRE #undef POST +#endif // defined(VGO_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ - - diff --git a/coregrind/m_syswrap/syswrap-ppc32-aix5.c b/coregrind/m_syswrap/syswrap-ppc32-aix5.c index 1e5c767767..1286b794fc 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-aix5.c +++ b/coregrind/m_syswrap/syswrap-ppc32-aix5.c @@ -33,6 +33,8 @@ without prior written permission. */ +#if defined(VGP_ppc32_aix5) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -908,6 +910,8 @@ SyscallTableEntry* ML_(get_ppc32_aix5_syscall_entry) ( UInt sysno ) return &aix5_ppc32_syscall_table[i].wrappers; } +#endif // defined(VGP_ppc32_aix5) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c index 2575159eb7..3cfe556ead 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_ppc32_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -1870,6 +1872,8 @@ const SyscallTableEntry ML_(syscall_table)[] = { const UInt ML_(syscall_table_size) = sizeof(ML_(syscall_table)) / sizeof(ML_(syscall_table)[0]); +#endif // defined(VGP_ppc32_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-ppc64-aix5.c b/coregrind/m_syswrap/syswrap-ppc64-aix5.c index 6cd68ae4a8..02263f0809 100644 --- a/coregrind/m_syswrap/syswrap-ppc64-aix5.c +++ b/coregrind/m_syswrap/syswrap-ppc64-aix5.c @@ -33,6 +33,8 @@ without prior written permission. */ +#if defined(VGP_ppc64_aix5) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -788,6 +790,8 @@ SyscallTableEntry* ML_(get_ppc64_aix5_syscall_entry) ( UInt sysno ) return &aix5_ppc64_syscall_table[i].wrappers; } +#endif // defined(VGP_ppc64_aix5) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c index dbf113b63b..3f869e92db 100644 --- a/coregrind/m_syswrap/syswrap-ppc64-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_ppc64_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" @@ -1510,6 +1512,8 @@ const SyscallTableEntry ML_(syscall_table)[] = { const UInt ML_(syscall_table_size) = sizeof(ML_(syscall_table)) / sizeof(ML_(syscall_table)[0]); +#endif // defined(VGP_ppc64_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-x86-darwin.c b/coregrind/m_syswrap/syswrap-x86-darwin.c index 5532033233..7fd327d894 100644 --- a/coregrind/m_syswrap/syswrap-x86-darwin.c +++ b/coregrind/m_syswrap/syswrap-x86-darwin.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_x86_darwin) + #include "pub_core_basics.h" #include "pub_core_vki.h" #include "pub_core_threadstate.h" @@ -497,6 +499,8 @@ void wqthread_hijack(Addr self, Addr kport, Addr stackaddr, Addr workitem, vg_assert(0); } +#endif // defined(VGP_x86_darwin) + /*--------------------------------------------------------------------*/ -/*--- end syswrap-x86-darwin.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c index af3a61f952..d47b116876 100644 --- a/coregrind/m_syswrap/syswrap-x86-linux.c +++ b/coregrind/m_syswrap/syswrap-x86-linux.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGP_x86_linux) + /* TODO/FIXME jrs 20050207: assignments to the syscall return result in interrupted_syscall() need to be reviewed. They don't seem to assign the shadow state. @@ -2248,6 +2250,8 @@ const SyscallTableEntry ML_(syscall_table)[] = { const UInt ML_(syscall_table_size) = sizeof(ML_(syscall_table)) / sizeof(ML_(syscall_table)[0]); +#endif // defined(VGP_x86_linux) + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_ume/elf.c b/coregrind/m_ume/elf.c index 8dfbb1f05e..3d7c5152cd 100644 --- a/coregrind/m_ume/elf.c +++ b/coregrind/m_ume/elf.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_linux) + #include "pub_core_basics.h" #include "pub_core_vki.h" @@ -44,8 +46,6 @@ #include "priv_ume.h" -#if defined(HAVE_ELF) - /* --- !!! --- EXTERNAL HEADERS start --- !!! --- */ #define _GNU_SOURCE #define _FILE_OFFSET_BITS 64 @@ -511,7 +511,7 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info) return 0; } -#endif /* defined(HAVE_ELF) */ +#endif // defined(VGO_linux) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_ume/macho.c b/coregrind/m_ume/macho.c index db5db4f9b5..4f42ea6990 100644 --- a/coregrind/m_ume/macho.c +++ b/coregrind/m_ume/macho.c @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_darwin) + #include "pub_core_basics.h" #include "pub_core_vki.h" @@ -45,9 +47,6 @@ #include "priv_ume.h" - -#if defined(HAVE_MACHO) - #include #include @@ -768,7 +767,7 @@ Int VG_(load_macho)(Int fd, const HChar *name, ExeInfo *info) return 0; } -#endif // defined(HAVE_MACHO) +#endif // defined(VGO_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_ume/main.c b/coregrind/m_ume/main.c index 1673fc9809..504bd5349f 100644 --- a/coregrind/m_ume/main.c +++ b/coregrind/m_ume/main.c @@ -46,21 +46,20 @@ typedef struct { - const HChar *name; Bool (*match_fn)(Char *hdr, Int len); Int (*load_fn)(Int fd, const HChar *name, ExeInfo *info); } ExeHandler; static ExeHandler exe_handlers[] = { -# if defined(HAVE_ELF) - { "ELF", VG_(match_ELF), VG_(load_ELF) }, -# endif -# if defined(HAVE_SCRIPT) - { "script", VG_(match_script), VG_(load_script) }, -# endif -# if defined(HAVE_MACHO) - { "Mach-O", VG_(match_macho), VG_(load_macho) }, -# endif + // Nb: AIX5 doesn't use m_ume, which is why it's not represented here. +#if defined(VGO_linux) + { VG_(match_ELF), VG_(load_ELF) }, +#elif defined(VGO_darwin) + { VG_(match_macho), VG_(load_macho) }, +#else +# error "unknown OS" +#endif + { VG_(match_script), VG_(load_script) }, }; #define EXE_HANDLER_COUNT (sizeof(exe_handlers)/sizeof(exe_handlers[0])) diff --git a/coregrind/m_ume/priv_ume.h b/coregrind/m_ume/priv_ume.h index ca3f95bc1a..1fe5ba79b3 100644 --- a/coregrind/m_ume/priv_ume.h +++ b/coregrind/m_ume/priv_ume.h @@ -27,27 +27,30 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_linux) || defined(VGO_darwin) + #ifndef __PRIV_UME_H #define __PRIV_UME_H extern int VG_(do_exec_inner)(const HChar *exe, ExeInfo *info); -#if defined(HAVE_ELF) +#if defined(VGO_linux) extern Bool VG_(match_ELF) ( Char *hdr, Int len ); extern Int VG_(load_ELF) ( Int fd, const HChar *name, ExeInfo *info ); +#elif defined(VGO_darwin) +extern Bool VG_(match_macho) ( Char *hdr, Int len ); +extern Int VG_(load_macho) ( Int fd, const HChar *name, ExeInfo *info ); +#else +# error Unknown OS #endif -#if defined(HAVE_SCRIPT) extern Bool VG_(match_script) ( Char *hdr, Int len ); extern Int VG_(load_script) ( Int fd, const HChar *name, ExeInfo *info ); -#endif -#if defined(HAVE_MACHO) -extern Bool VG_(match_macho) ( Char *hdr, Int len ); -extern Int VG_(load_macho) ( Int fd, const HChar *name, ExeInfo *info ); -#endif -#endif /* __PRIV_UME_H */ +#endif // __PRIV_UME_H + +#endif // defined(VGO_linux) || defined(VGO_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/m_ume/script.c b/coregrind/m_ume/script.c index 582469bbab..83a250e7b3 100644 --- a/coregrind/m_ume/script.c +++ b/coregrind/m_ume/script.c @@ -40,9 +40,6 @@ #include "priv_ume.h" - -#if defined(HAVE_SCRIPT) - Bool VG_(match_script)(Char *hdr, Int len) { Char* end = hdr + len; @@ -143,8 +140,6 @@ Int VG_(load_script)(Int fd, const HChar* name, ExeInfo* info) return VG_(do_exec_inner)(interp, info); } -#endif /* defined(HAVE_SCRIPT) */ - /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/coregrind/pub_core_mach.h b/coregrind/pub_core_mach.h index 719df440d6..94f3220760 100644 --- a/coregrind/pub_core_mach.h +++ b/coregrind/pub_core_mach.h @@ -28,6 +28,8 @@ The GNU General Public License is contained in the file COPYING. */ +#if defined(VGO_darwin) + #ifndef __PUB_CORE_MACH_H #define __PUB_CORE_MACH_H @@ -36,12 +38,12 @@ // for operating systems like Darwin / Mac OS X that use it. //-------------------------------------------------------------------- -#if defined(VGO_darwin) // Call this early in Valgrind's main(). It depends on nothing. extern void VG_(mach_init)(void); -#endif -#endif // __PUB_CORE_MACH_H +#endif // __PUB_CORE_MACH_H + +#endif // defined(VGO_darwin) /*--------------------------------------------------------------------*/ /*--- end ---*/ diff --git a/coregrind/pub_core_ume.h b/coregrind/pub_core_ume.h index b6e59e56b8..7a089639cf 100644 --- a/coregrind/pub_core_ume.h +++ b/coregrind/pub_core_ume.h @@ -36,21 +36,6 @@ // and exec'ing. //-------------------------------------------------------------------- -#if defined(VGO_linux) -# define HAVE_ELF -# define HAVE_SCRIPT - -#elif defined(VGO_aix5) -// The AIX port doesn't use UME. - -#elif defined(VGO_darwin) -# define HAVE_MACHO -# define HAVE_SCRIPT - -#else -#error unknown architecture -#endif - /*------------------------------------------------------------*/ /*--- Loading files ---*/ /*------------------------------------------------------------*/ diff --git a/docs/xml/Makefile.am b/docs/xml/Makefile.am index 791287221b..9201905160 100644 --- a/docs/xml/Makefile.am +++ b/docs/xml/Makefile.am @@ -3,10 +3,14 @@ EXTRA_DIST = \ dist-docs.xml \ index.xml \ licenses.xml \ - manual.xml manual-intro.xml manual-core.xml \ + manual.xml \ + manual-intro.xml \ + manual-core.xml \ + manual-core-adv.xml \ manual-writing-tools.xml\ + design-impl.xml \ quick-start-guide.xml \ tech-docs.xml \ - new-tech-docs.xml \ + valgrind-manpage.xml \ vg-entities.xml \ xml_help.txt diff --git a/docs/xml/new-tech-docs.xml b/docs/xml/design-impl.xml similarity index 98% rename from docs/xml/new-tech-docs.xml rename to docs/xml/design-impl.xml index 3cc9ac6b30..6e7b5934f4 100644 --- a/docs/xml/new-tech-docs.xml +++ b/docs/xml/design-impl.xml @@ -3,7 +3,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - The Design and Implementation of Valgrind diff --git a/docs/xml/manual-writing-tools.xml b/docs/xml/manual-writing-tools.xml index 7b0e2bfdeb..fd386d8a2b 100644 --- a/docs/xml/manual-writing-tools.xml +++ b/docs/xml/manual-writing-tools.xml @@ -140,7 +140,7 @@ top-level directory valgrind/. It should automake, configure and compile without errors, diff --git a/docs/xml/tech-docs.xml b/docs/xml/tech-docs.xml index 552631331a..8be5922fb6 100644 --- a/docs/xml/tech-docs.xml +++ b/docs/xml/tech-docs.xml @@ -17,10 +17,7 @@ - - diff --git a/drd/Makefile.am b/drd/Makefile.am index 6f4b099e18..d1ccb211e0 100644 --- a/drd/Makefile.am +++ b/drd/Makefile.am @@ -1,140 +1,10 @@ include $(top_srcdir)/Makefile.tool.am -noinst_PROGRAMS = -noinst_DSYMS = -if VGCONF_PLATFORMS_INCLUDE_X86_LINUX - noinst_PROGRAMS += drd-x86-linux vgpreload_drd-x86-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX - noinst_PROGRAMS += drd-amd64-linux vgpreload_drd-amd64-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX - noinst_PROGRAMS += drd-ppc32-linux vgpreload_drd-ppc32-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX - noinst_PROGRAMS += drd-ppc64-linux vgpreload_drd-ppc64-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 - noinst_PROGRAMS += drd-ppc32-aix5 vgpreload_drd-ppc32-aix5.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 - noinst_PROGRAMS += drd-ppc64-aix5 vgpreload_drd-ppc64-aix5.so -endif -if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN - noinst_PROGRAMS += drd-x86-darwin vgpreload_drd-x86-darwin.so - noinst_DSYMS += vgpreload_drd-x86-darwin.so -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN - noinst_PROGRAMS += drd-amd64-darwin vgpreload_drd-amd64-darwin.so - noinst_DSYMS += vgpreload_drd-amd64-darwin.so -endif - - -VGPRELOAD_DRD_SOURCES = \ - drd_gomp_intercepts.c \ - drd_pthread_intercepts.c \ - drd_qtcore_intercepts.c \ - drd_strmem_intercepts.c - - -DRD_CFLAGS = \ - @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@ \ - -O2 \ - @FLAG_W_EXTRA@ \ - -Wformat-nonliteral \ - -Wno-inline \ - -Wno-unused-parameter - -AM_CFLAGS_X86_LINUX += $(DRD_CFLAGS) -AM_CFLAGS_AMD64_LINUX += $(DRD_CFLAGS) -AM_CFLAGS_PPC32_LINUX += $(DRD_CFLAGS) -AM_CFLAGS_PPC64_LINUX += $(DRD_CFLAGS) -AM_CFLAGS_PPC32_AIX5 += $(DRD_CFLAGS) -AM_CFLAGS_PPC64_AIX5 += $(DRD_CFLAGS) - -vgpreload_drd_x86_linux_so_SOURCES = $(VGPRELOAD_DRD_SOURCES) -vgpreload_drd_x86_linux_so_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -vgpreload_drd_x86_linux_so_CFLAGS = $(AM_CFLAGS_X86_LINUX) $(AM_CFLAGS_PIC) -vgpreload_drd_x86_linux_so_CCASFLAGS = $(AM_CCASFLAGS_X86_LINUX) -vgpreload_drd_x86_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_LINUX) -vgpreload_drd_x86_linux_so_LDFLAGS = $(PRELOAD_LDFLAGS_X86_LINUX)\ - $(LIBREPLACEMALLOC_LDFLAGS_X86_LINUX) - -vgpreload_drd_amd64_linux_so_SOURCES = $(VGPRELOAD_DRD_SOURCES) -vgpreload_drd_amd64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -vgpreload_drd_amd64_linux_so_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) $(AM_CFLAGS_PIC) -vgpreload_drd_amd64_linux_so_CCASFLAGS = $(AM_CCASFLAGS_AMD64_LINUX) -vgpreload_drd_amd64_linux_so_DEPENDENCIES = -vgpreload_drd_amd64_linux_so_LDFLAGS = $(PRELOAD_LDFLAGS_AMD64_LINUX)\ - $(LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX) - -vgpreload_drd_ppc32_linux_so_SOURCES = $(VGPRELOAD_DRD_SOURCES) -vgpreload_drd_ppc32_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -vgpreload_drd_ppc32_linux_so_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) $(AM_CFLAGS_PIC) -vgpreload_drd_ppc32_linux_so_CCASFLAGS = $(AM_CCASFLAGS_PPC32_LINUX) -vgpreload_drd_ppc32_linux_so_DEPENDENCIES = -vgpreload_drd_ppc32_linux_so_LDFLAGS = $(PRELOAD_LDFLAGS_PPC32_LINUX)\ - $(LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX) - -vgpreload_drd_ppc64_linux_so_SOURCES = $(VGPRELOAD_DRD_SOURCES) -vgpreload_drd_ppc64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -vgpreload_drd_ppc64_linux_so_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) $(AM_CFLAGS_PIC) -vgpreload_drd_ppc64_linux_so_CCASFLAGS = $(AM_CCASFLAGS_PPC64_LINUX) -vgpreload_drd_ppc64_linux_so_DEPENDENCIES = -vgpreload_drd_ppc64_linux_so_LDFLAGS = $(PRELOAD_LDFLAGS_PPC64_LINUX)\ - $(LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX) - -vgpreload_drd_ppc32_aix5_so_SOURCES = $(VGPRELOAD_DRD_SOURCES) -vgpreload_drd_ppc32_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -vgpreload_drd_ppc32_aix5_so_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) $(AM_CFLAGS_PIC) -vgpreload_drd_ppc32_aix5_so_CCASFLAGS = $(AM_CCASFLAGS_PPC32_AIX5) -vgpreload_drd_ppc32_aix5_so_DEPENDENCIES = -vgpreload_drd_ppc32_aix5_so_LDFLAGS = $(PRELOAD_LDFLAGS_PPC32_AIX5)\ - $(LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5) - -vgpreload_drd_ppc64_aix5_so_SOURCES = $(VGPRELOAD_DRD_SOURCES) -vgpreload_drd_ppc64_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -vgpreload_drd_ppc64_aix5_so_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) $(AM_CFLAGS_PIC) -vgpreload_drd_ppc64_aix5_so_CCASFLAGS = $(AM_CCASFLAGS_PPC64_AIX5) -vgpreload_drd_ppc64_aix5_so_DEPENDENCIES = -vgpreload_drd_ppc64_aix5_so_LDFLAGS = $(PRELOAD_LDFLAGS_PPC64_AIX5)\ - $(LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5) - -vgpreload_drd_x86_darwin_so_SOURCES = $(VGPRELOAD_DRD_SOURCES) -vgpreload_drd_x86_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -vgpreload_drd_x86_darwin_so_CFLAGS = $(AM_CFLAGS_X86_DARWIN) $(AM_CFLAGS_PIC) -vgpreload_drd_x86_darwin_so_CCASFLAGS = $(AM_CCASFLAGS_X86_DARWIN) -vgpreload_drd_x86_darwin_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_DARWIN) -vgpreload_drd_x86_darwin_so_LDFLAGS = $(PRELOAD_LDFLAGS_X86_DARWIN)\ - $(LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN) - -vgpreload_drd_amd64_darwin_so_SOURCES = $(VGPRELOAD_DRD_SOURCES) -vgpreload_drd_amd64_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -vgpreload_drd_amd64_darwin_so_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) $(AM_CFLAGS_PIC) -vgpreload_drd_amd64_darwin_so_CCASFLAGS = $(AM_CCASFLAGS_AMD64_DARWIN) -vgpreload_drd_amd64_darwin_so_DEPENDENCIES = -vgpreload_drd_amd64_darwin_so_LDFLAGS = $(PRELOAD_LDFLAGS_AMD64_DARWIN)\ - $(LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN) - - -DRD_SOURCES = \ - drd_barrier.c \ - drd_bitmap2_node.c \ - drd_clientobj.c \ - drd_clientreq.c \ - drd_cond.c \ - drd_error.c \ - drd_load_store.c \ - drd_main.c \ - drd_malloc_wrappers.c \ - drd_mutex.c \ - drd_rwlock.c \ - drd_semaphore.c \ - drd_suppression.c - -drdincludedir = $(includedir)/valgrind +#---------------------------------------------------------------------------- +# Headers, flags +#---------------------------------------------------------------------------- -drdinclude_HEADERS = drd.h +pkginclude_HEADERS = drd.h noinst_HEADERS = \ drd_barrier.h \ @@ -160,60 +30,104 @@ noinst_HEADERS = \ drd_vc.h \ pub_drd_bitmap.h -drd_x86_linux_SOURCES = $(DRD_SOURCES) -drd_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -drd_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) -drd_x86_linux_DEPENDENCIES = $(COREGRIND_LIBS_X86_LINUX) -drd_x86_linux_LDADD = $(TOOL_LDADD_X86_LINUX) -drd_x86_linux_LDFLAGS = $(TOOL_LDFLAGS_X86_LINUX) +DRD_CFLAGS = \ + @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@ \ + -O2 \ + @FLAG_W_EXTRA@ \ + -Wformat-nonliteral \ + -Wno-inline \ + -Wno-unused-parameter -drd_amd64_linux_SOURCES = $(DRD_SOURCES) -drd_amd64_linux_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -drd_amd64_linux_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) -drd_amd64_linux_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_LINUX) -drd_amd64_linux_LDADD = $(TOOL_LDADD_AMD64_LINUX) -drd_amd64_linux_LDFLAGS = $(TOOL_LDFLAGS_AMD64_LINUX) +#---------------------------------------------------------------------------- +# drd- +#---------------------------------------------------------------------------- + +noinst_PROGRAMS = drd-@VGCONF_ARCH_PRI@-@VGCONF_OS@ +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += drd-@VGCONF_ARCH_SEC@-@VGCONF_OS@ +endif -drd_ppc32_linux_SOURCES = $(DRD_SOURCES) -drd_ppc32_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -drd_ppc32_linux_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) -drd_ppc32_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_LINUX) -drd_ppc32_linux_LDADD = $(TOOL_LDADD_PPC32_LINUX) -drd_ppc32_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC32_LINUX) +DRD_SOURCES_COMMON = \ + drd_barrier.c \ + drd_bitmap2_node.c \ + drd_clientobj.c \ + drd_clientreq.c \ + drd_cond.c \ + drd_error.c \ + drd_load_store.c \ + drd_main.c \ + drd_malloc_wrappers.c \ + drd_mutex.c \ + drd_rwlock.c \ + drd_semaphore.c \ + drd_suppression.c -drd_ppc64_linux_SOURCES = $(DRD_SOURCES) -drd_ppc64_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -drd_ppc64_linux_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) -drd_ppc64_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_LINUX) -drd_ppc64_linux_LDADD = $(TOOL_LDADD_PPC64_LINUX) -drd_ppc64_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC64_LINUX) +drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = $(DRD_SOURCES_COMMON) +drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(DRD_CFLAGS) +drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) +drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) +drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = $(DRD_SOURCES_COMMON) +drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(DRD_CFLAGS) +drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) +drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@) +drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -drd_ppc32_aix5_SOURCES = $(DRD_SOURCES) -drd_ppc32_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -drd_ppc32_aix5_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) -drd_ppc32_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_AIX5) -drd_ppc32_aix5_LDADD = $(TOOL_LDADD_PPC32_AIX5) -drd_ppc32_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC32_AIX5) +#---------------------------------------------------------------------------- +# vgpreload_drd-.so +#---------------------------------------------------------------------------- -drd_ppc64_aix5_SOURCES = $(DRD_SOURCES) -drd_ppc64_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -drd_ppc64_aix5_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) -drd_ppc64_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_AIX5) -drd_ppc64_aix5_LDADD = $(TOOL_LDADD_PPC64_AIX5) -drd_ppc64_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC64_AIX5) +noinst_PROGRAMS += vgpreload_drd-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += vgpreload_drd-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so +endif -drd_x86_darwin_SOURCES = $(DRD_SOURCES) -drd_x86_darwin_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -drd_x86_darwin_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -drd_x86_darwin_DEPENDENCIES = $(COREGRIND_LIBS_X86_DARWIN) -drd_x86_darwin_LDADD = $(TOOL_LDADD_X86_DARWIN) -drd_x86_darwin_LDFLAGS = $(TOOL_LDFLAGS_X86_DARWIN) +if VGCONF_OS_IS_DARWIN +noinst_DSYMS = $(noinst_PROGRAMS) +endif -drd_amd64_darwin_SOURCES = $(DRD_SOURCES) -drd_amd64_darwin_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -drd_amd64_darwin_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) -drd_amd64_darwin_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_DARWIN) -drd_amd64_darwin_LDADD = $(TOOL_LDADD_AMD64_DARWIN) -drd_amd64_darwin_LDFLAGS = $(TOOL_LDFLAGS_AMD64_DARWIN) +VGPRELOAD_DRD_SOURCES_COMMON = \ + drd_gomp_intercepts.c \ + drd_pthread_intercepts.c \ + drd_qtcore_intercepts.c \ + drd_strmem_intercepts.c +vgpreload_drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = \ + $(VGPRELOAD_DRD_SOURCES_COMMON) +vgpreload_drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(AM_CFLAGS_PIC) $(DRD_CFLAGS) +vgpreload_drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_DEPENDENCIES = \ + $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) \ + $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +vgpreload_drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = \ + $(VGPRELOAD_DRD_SOURCES_COMMON) +vgpreload_drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(AM_CFLAGS_PIC) $(DRD_CFLAGS) +vgpreload_drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_DEPENDENCIES = \ + $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) \ + $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index b17cced2e7..7115853e3b 100644 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -1,19 +1,17 @@ include $(top_srcdir)/Makefile.tool-tests.am -SUBDIRS = . - -DIST_SUBDIRS = . - -noinst_SCRIPTS = \ +dist_noinst_SCRIPTS = \ filter_error_summary \ filter_stderr \ filter_stderr_and_thread_no \ run_openmp_test \ supported_libpthread +noinst_HEADERS = \ + tsan_thread_wrappers_pthread.h + EXTRA_DIST = \ - $(noinst_SCRIPTS) \ annotate_order_1.stderr.exp \ annotate_order_1.vgtest \ annotate_order_2.stderr.exp \ @@ -278,6 +276,9 @@ if HAVE_QTCORE check_PROGRAMS += qt4_mutex qt4_rwlock qt4_semaphore endif +if ! VGCONF_OS_IS_DARWIN +check_PROGRAMS += tsan_unittest +endif AM_CFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ -Wno-inline -Wno-unused-parameter AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ -Wno-inline -Wno-unused-parameter diff --git a/exp-ptrcheck/Makefile.am b/exp-ptrcheck/Makefile.am index 37b3ef55b8..99ccf60535 100644 --- a/exp-ptrcheck/Makefile.am +++ b/exp-ptrcheck/Makefile.am @@ -1,170 +1,93 @@ include $(top_srcdir)/Makefile.tool.am -noinst_PROGRAMS = -noinst_DSYMS = -if VGCONF_PLATFORMS_INCLUDE_X86_LINUX -noinst_PROGRAMS += exp-ptrcheck-x86-linux vgpreload_exp-ptrcheck-x86-linux.so +#---------------------------------------------------------------------------- +# Headers, etc +#---------------------------------------------------------------------------- + +noinst_HEADERS = \ + h_main.h \ + pc_common.h \ + sg_main.h + +#---------------------------------------------------------------------------- +# exp-ptrcheck- +#---------------------------------------------------------------------------- + +noinst_PROGRAMS = exp-ptrcheck-@VGCONF_ARCH_PRI@-@VGCONF_OS@ +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += exp-ptrcheck-@VGCONF_ARCH_SEC@-@VGCONF_OS@ endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX -noinst_PROGRAMS += exp-ptrcheck-amd64-linux vgpreload_exp-ptrcheck-amd64-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX -noinst_PROGRAMS += exp-ptrcheck-ppc32-linux vgpreload_exp-ptrcheck-ppc32-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX -noinst_PROGRAMS += exp-ptrcheck-ppc64-linux vgpreload_exp-ptrcheck-ppc64-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 -noinst_PROGRAMS += exp-ptrcheck-ppc32-aix5 vgpreload_exp-ptrcheck-ppc32-aix5.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 -noinst_PROGRAMS += exp-ptrcheck-ppc64-aix5 vgpreload_exp-ptrcheck-ppc64-aix5.so -endif -if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN -noinst_PROGRAMS += exp-ptrcheck-x86-darwin vgpreload_exp-ptrcheck-x86-darwin.so -noinst_DSYMS += vgpreload_exp-ptrcheck-x86-darwin.so -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN -noinst_PROGRAMS += exp-ptrcheck-amd64-darwin vgpreload_exp-ptrcheck-amd64-darwin.so -noinst_DSYMS += vgpreload_exp-ptrcheck-amd64-darwin.so -endif - - -VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON = h_intercepts.c - -vgpreload_exp_ptrcheck_x86_linux_so_SOURCES = $(VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON) -vgpreload_exp_ptrcheck_x86_linux_so_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -vgpreload_exp_ptrcheck_x86_linux_so_CFLAGS = $(AM_CFLAGS_X86_LINUX) $(AM_CFLAGS_PIC) -O2 -vgpreload_exp_ptrcheck_x86_linux_so_CCASFLAGS = $(AM_CCASFLAGS_X86_LINUX) -vgpreload_exp_ptrcheck_x86_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_LINUX) -vgpreload_exp_ptrcheck_x86_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_X86_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_X86_LINUX) - -vgpreload_exp_ptrcheck_amd64_linux_so_SOURCES = $(VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON) -vgpreload_exp_ptrcheck_amd64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -vgpreload_exp_ptrcheck_amd64_linux_so_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) $(AM_CFLAGS_PIC) -O2 -vgpreload_exp_ptrcheck_amd64_linux_so_CCASFLAGS = $(AM_CCASFLAGS_AMD64_LINUX) -vgpreload_exp_ptrcheck_amd64_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_AMD64_LINUX) -vgpreload_exp_ptrcheck_amd64_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_AMD64_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX) - -vgpreload_exp_ptrcheck_ppc32_linux_so_SOURCES = $(VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON) -vgpreload_exp_ptrcheck_ppc32_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -vgpreload_exp_ptrcheck_ppc32_linux_so_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) $(AM_CFLAGS_PIC) -O2 -vgpreload_exp_ptrcheck_ppc32_linux_so_CCASFLAGS = $(AM_CCASFLAGS_PPC32_LINUX) -vgpreload_exp_ptrcheck_ppc32_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC32_LINUX) -vgpreload_exp_ptrcheck_ppc32_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC32_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX) - -vgpreload_exp_ptrcheck_ppc64_linux_so_SOURCES = $(VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON) -vgpreload_exp_ptrcheck_ppc64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -vgpreload_exp_ptrcheck_ppc64_linux_so_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) $(AM_CFLAGS_PIC) -O2 -vgpreload_exp_ptrcheck_ppc64_linux_so_CCASFLAGS = $(AM_CCASFLAGS_PPC64_LINUX) -vgpreload_exp_ptrcheck_ppc64_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC64_LINUX) -vgpreload_exp_ptrcheck_ppc64_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC64_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX) - -vgpreload_exp_ptrcheck_ppc32_aix5_so_SOURCES = $(VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON) -vgpreload_exp_ptrcheck_ppc32_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -vgpreload_exp_ptrcheck_ppc32_aix5_so_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) $(AM_CFLAGS_PIC) -O2 -vgpreload_exp_ptrcheck_ppc32_aix5_so_CCASFLAGS = $(AM_CCASFLAGS_PPC32_AIX5) -vgpreload_exp_ptrcheck_ppc32_aix5_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC32_AIX5) -vgpreload_exp_ptrcheck_ppc32_aix5_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC32_AIX5) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5) - -vgpreload_exp_ptrcheck_ppc64_aix5_so_SOURCES = $(VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON) -vgpreload_exp_ptrcheck_ppc64_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -vgpreload_exp_ptrcheck_ppc64_aix5_so_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) $(AM_CFLAGS_PIC) -O2 -vgpreload_exp_ptrcheck_ppc64_aix5_so_CCASFLAGS = $(AM_CCASFLAGS_PPC64_AIX5) -vgpreload_exp_ptrcheck_ppc64_aix5_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC64_AIX5) -vgpreload_exp_ptrcheck_ppc64_aix5_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC64_AIX5) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5) - -vgpreload_exp_ptrcheck_x86_darwin_so_SOURCES = $(VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON) -vgpreload_exp_ptrcheck_x86_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -vgpreload_exp_ptrcheck_x86_darwin_so_CFLAGS = $(AM_CFLAGS_X86_DARWIN) $(AM_CFLAGS_PIC) -O2 -vgpreload_exp_ptrcheck_x86_darwin_so_CCASFLAGS = $(AM_CCASFLAGS_X86_DARWIN) -vgpreload_exp_ptrcheck_x86_darwin_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_DARWIN) -vgpreload_exp_ptrcheck_x86_darwin_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_X86_DARWIN) \ - $(LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN) - -vgpreload_exp_ptrcheck_amd64_darwin_so_SOURCES = $(VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON) -vgpreload_exp_ptrcheck_amd64_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -vgpreload_exp_ptrcheck_amd64_darwin_so_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) $(AM_CFLAGS_PIC) -O2 -vgpreload_exp_ptrcheck_amd64_darwin_so_CCASFLAGS = $(AM_CCASFLAGS_AMD64_DARWIN) -vgpreload_exp_ptrcheck_amd64_darwin_so_DEPENDENCIES = $(LIBREPLACEMALLOC_AMD64_DARWIN) -vgpreload_exp_ptrcheck_amd64_darwin_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_AMD64_DARWIN) \ - $(LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN) - - EXP_PTRCHECK_SOURCES_COMMON = \ - pc_common.c h_main.c sg_main.c pc_main.c - -exp_ptrcheck_x86_linux_SOURCES = $(EXP_PTRCHECK_SOURCES_COMMON) -exp_ptrcheck_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -exp_ptrcheck_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) -exp_ptrcheck_x86_linux_DEPENDENCIES = $(COREGRIND_LIBS_X86_LINUX) -exp_ptrcheck_x86_linux_LDADD = $(TOOL_LDADD_X86_LINUX) -exp_ptrcheck_x86_linux_LDFLAGS = $(TOOL_LDFLAGS_X86_LINUX) - -exp_ptrcheck_amd64_linux_SOURCES = $(EXP_PTRCHECK_SOURCES_COMMON) -exp_ptrcheck_amd64_linux_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -exp_ptrcheck_amd64_linux_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) -exp_ptrcheck_amd64_linux_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_LINUX) -exp_ptrcheck_amd64_linux_LDADD = $(TOOL_LDADD_AMD64_LINUX) -exp_ptrcheck_amd64_linux_LDFLAGS = $(TOOL_LDFLAGS_AMD64_LINUX) - -exp_ptrcheck_ppc32_linux_SOURCES = $(EXP_PTRCHECK_SOURCES_COMMON) -exp_ptrcheck_ppc32_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -exp_ptrcheck_ppc32_linux_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) -exp_ptrcheck_ppc32_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_LINUX) -exp_ptrcheck_ppc32_linux_LDADD = $(TOOL_LDADD_PPC32_LINUX) -exp_ptrcheck_ppc32_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC32_LINUX) - -exp_ptrcheck_ppc64_linux_SOURCES = $(EXP_PTRCHECK_SOURCES_COMMON) -exp_ptrcheck_ppc64_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -exp_ptrcheck_ppc64_linux_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) -exp_ptrcheck_ppc64_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_LINUX) -exp_ptrcheck_ppc64_linux_LDADD = $(TOOL_LDADD_PPC64_LINUX) -exp_ptrcheck_ppc64_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC64_LINUX) + h_main.c \ + pc_common.c \ + pc_main.c \ + sg_main.c + +exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = \ + $(EXP_PTRCHECK_SOURCES_COMMON) +exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) +exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) +exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = \ + $(EXP_PTRCHECK_SOURCES_COMMON) +exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) +exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@) +exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -exp_ptrcheck_ppc32_aix5_SOURCES = $(EXP_PTRCHECK_SOURCES_COMMON) -exp_ptrcheck_ppc32_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -exp_ptrcheck_ppc32_aix5_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) -exp_ptrcheck_ppc32_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_AIX5) -exp_ptrcheck_ppc32_aix5_LDADD = $(TOOL_LDADD_PPC32_AIX5) -exp_ptrcheck_ppc32_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC32_AIX5) +#---------------------------------------------------------------------------- +# vgpreload_exp-ptrcheck-.so +#---------------------------------------------------------------------------- -exp_ptrcheck_ppc64_aix5_SOURCES = $(EXP_PTRCHECK_SOURCES_COMMON) -exp_ptrcheck_ppc64_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -exp_ptrcheck_ppc64_aix5_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) -exp_ptrcheck_ppc64_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_AIX5) -exp_ptrcheck_ppc64_aix5_LDADD = $(TOOL_LDADD_PPC64_AIX5) -exp_ptrcheck_ppc64_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC64_AIX5) +noinst_PROGRAMS += vgpreload_exp-ptrcheck-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += vgpreload_exp-ptrcheck-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so +endif -exp_ptrcheck_x86_darwin_SOURCES = $(EXP_PTRCHECK_SOURCES_COMMON) -exp_ptrcheck_x86_darwin_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -exp_ptrcheck_x86_darwin_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -exp_ptrcheck_x86_darwin_DEPENDENCIES = $(COREGRIND_LIBS_X86_DARWIN) -exp_ptrcheck_x86_darwin_LDADD = $(TOOL_LDADD_X86_DARWIN) -exp_ptrcheck_x86_darwin_LDFLAGS = $(TOOL_LDFLAGS_X86_DARWIN) +if VGCONF_OS_IS_DARWIN +noinst_DSYMS = $(noinst_PROGRAMS) +endif -exp_ptrcheck_amd64_darwin_SOURCES = $(EXP_PTRCHECK_SOURCES_COMMON) -exp_ptrcheck_amd64_darwin_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -exp_ptrcheck_amd64_darwin_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) -exp_ptrcheck_amd64_darwin_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_DARWIN) -exp_ptrcheck_amd64_darwin_LDADD = $(TOOL_LDADD_AMD64_DARWIN) -exp_ptrcheck_amd64_darwin_LDFLAGS = $(TOOL_LDFLAGS_AMD64_DARWIN) +VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON = h_intercepts.c -noinst_HEADERS = h_main.h sg_main.h pc_common.h +vgpreload_exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = \ + $(VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON) +vgpreload_exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(AM_CFLAGS_PIC) -O2 +vgpreload_exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_DEPENDENCIES = \ + $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_exp_ptrcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) \ + $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +vgpreload_exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = \ + $(VGPRELOAD_EXP_PTRCHECK_SOURCES_COMMON) +vgpreload_exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(AM_CFLAGS_PIC) -O2 +vgpreload_exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_DEPENDENCIES = \ + $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_exp_ptrcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) \ + $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -EXTRA_DIST = diff --git a/exp-ptrcheck/tests/Makefile.am b/exp-ptrcheck/tests/Makefile.am index 6a1d884d3a..b3560ab9df 100644 --- a/exp-ptrcheck/tests/Makefile.am +++ b/exp-ptrcheck/tests/Makefile.am @@ -1,16 +1,10 @@ include $(top_srcdir)/Makefile.tool-tests.am -#SUBDIRS = . -#if VGCONF_ARCHS_INCLUDE_X86 -#SUBDIRS += x86 - -#DIST_SUBDIRS = x86 . - -noinst_SCRIPTS = filter_stderr filter_add filter_suppgen \ +dist_noinst_SCRIPTS = filter_stderr filter_add filter_suppgen \ sh_script -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ add.vgtest-disabled add.stderr.exp \ and.vgtest-disabled and.stderr.exp \ arith.vgtest-disabled arith.stderr.exp \ diff --git a/exp-ptrcheck/tests/x86/Makefile.am b/exp-ptrcheck/tests/x86/Makefile.am deleted file mode 100644 index 7aa8beedd3..0000000000 --- a/exp-ptrcheck/tests/x86/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -include $(top_srcdir)/Makefile.tool-tests.am - -noinst_SCRIPTS = filter_stderr - -check_PROGRAMS = asm lea - -EXTRA_DIST = $(noinst_SCRIPTS) \ - asm.vgtest-disabled asm.stderr.exp \ - lea.vgtest-disabled lea.stderr.exp - - -AM_CFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE) -AM_CXXFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE) -AM_CCASFLAGS += @FLAG_M32@ - -asm_SOURCES = asm.S -lea_SOURCES = lea.S diff --git a/exp-ptrcheck/tests/x86/asm.S b/exp-ptrcheck/tests/x86/asm.S deleted file mode 100644 index 372adef0e3..0000000000 --- a/exp-ptrcheck/tests/x86/asm.S +++ /dev/null @@ -1,81 +0,0 @@ - .file "asm.S" - .text -.globl main - .type main,@function -main: - pushl %ebp - movl %esp, %ebp - subl $8, %esp - andl $-16, %esp - movl $0, %eax - subl %eax, %esp - - /* ----------------------------------------------------------------- */ - /* Setup */ - /* ----------------------------------------------------------------- */ - pushl %esi - pushl %edi - pushl %ebx - - subl $12, %esp - pushl $1365 - call malloc - addl $16, %esp - movl %eax, %esi - movl %eax, %edi - addl $4, %edi - - rdtsc - cpuid - - bsf %eax, %ebx - bsf %esi, %ebx // error - bsr %eax, %ebx - bsr %esi, %ebx // error - - sahf - lahf - - movl %esi, %edx - shldl $1, %eax, %ebx - shldl $1, %edx, %ebx // error - shldl $1, %eax, %edx // error - - movl %esi, %edx - shrdl $1, %eax, %ebx - shrdl $1, %edx, %ebx // error - shrdl $1, %eax, %edx // error - - movw %si, %dx - shldw $1, %ax, %bx - shldw $1, %ax, %si - shldw $1, %si, %bx - - movw %si, %dx - shrdw $1, %ax, %bx - shrdw $1, %ax, %si - shrdw $1, %si, %bx - - fstsw %ax - fstsw (%esp) // ok (I get seg faults if I use %esi...) - - movl $1, %ecx -// movsd // for get_dirflag - - /* ----------------------------------------------------------------- */ - /* End */ - /* ----------------------------------------------------------------- */ - popl %ebx - popl %edi - popl %esi - - movl $0, %eax - xorw %ax, %ax - leave - ret -.Lfe1: - .size main,.Lfe1-main - .comm foo,24,4 - .ident "GCC: (GNU) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)" - - diff --git a/exp-ptrcheck/tests/x86/asm.stderr.exp b/exp-ptrcheck/tests/x86/asm.stderr.exp deleted file mode 100644 index d18786f806..0000000000 --- a/exp-ptrcheck/tests/x86/asm.stderr.exp +++ /dev/null @@ -1,3 +0,0 @@ - - -ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/exp-ptrcheck/tests/x86/asm.vgtest-disabled b/exp-ptrcheck/tests/x86/asm.vgtest-disabled deleted file mode 100644 index 34c2a22e49..0000000000 --- a/exp-ptrcheck/tests/x86/asm.vgtest-disabled +++ /dev/null @@ -1 +0,0 @@ -prog: asm diff --git a/exp-ptrcheck/tests/x86/filter_stderr b/exp-ptrcheck/tests/x86/filter_stderr deleted file mode 100755 index 0ae9313a9f..0000000000 --- a/exp-ptrcheck/tests/x86/filter_stderr +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -../filter_stderr diff --git a/exp-ptrcheck/tests/x86/lea.S b/exp-ptrcheck/tests/x86/lea.S deleted file mode 100644 index 2d6e4f81cc..0000000000 --- a/exp-ptrcheck/tests/x86/lea.S +++ /dev/null @@ -1,85 +0,0 @@ - .file "lea.S" - .text -.globl main - .type main,@function -main: - pushl %ebp - movl %esp, %ebp - subl $8, %esp - andl $-16, %esp - movl $0, %eax - subl %eax, %esp - - /* ----------------------------------------------------------------- */ - /* Setup */ - /* ----------------------------------------------------------------- */ - pushl %esi - - subl $12, %esp - pushl $1365 - call malloc - addl $16, %esp - movl %eax, %esi - - movl $foo, %ecx /* %ecx = foo */ - - xorl %edx, %edx /* %edx = 0 */ - - /* ----------------------------------------------------------------- */ - /* Start */ - /* ----------------------------------------------------------------- */ - /* At one point, for LEA1 result I was just using t1.vseg. This - * is too simplistic, because sometimes the offset can be a static data - * pointer, so if t1 is a known non-ptr, the result should not be a - * non-ptr, but unknown. Before I fixed it, the following instruction - * would have caused this warning: - * - * ==5234== Invalid read - * ==5234== at 0x8048306: main (lea.S:21) - * ==5234== by 0x8048264: ??? (start.S:81) - * ==5234== Address 0x80494CC is not derived from any heap block - */ - movl foo(%edx), %eax /* ?(n) case */ - - /* Do a similar check with LEA2 */ - movl foo(%edx,%edx,1), %eax - - /* ok -------------------------------------------------------------- */ - movl 0(%ecx,%edx,1), %eax // ok - movl 0(%edx,%ecx,1), %eax // ok - movl 0(%esi,%edx,1), %eax // ok - movl 0(%edx,%esi,1), %eax // ok - - movl 0(%ecx,%edx,2), %eax // ok - movl 0(%esi,%edx,2), %eax // ok - - /* bad ------------------------------------------------------------- */ - movl -1(%ecx,%edx,1), %eax // undet - movl -1(%edx,%ecx,1), %eax // undet - movl -1(%esi,%edx,1), %eax // det - movl -1(%edx,%esi,1), %eax // det - - movl -1(%ecx,%edx,2), %eax // undet - movl -1(%esi,%edx,2), %eax // det - - /* bad (type error) ------------------------------------------------ */ - leal 0(%esi,%esi,1), %eax // adding two pointers - - /* ----------------------------------------------------------------- */ - /* Scale known pointer by 2. */ - leal 0(%edx,%esi,2), %eax /* result is pointer */ - - /* ----------------------------------------------------------------- */ - /* End */ - /* ----------------------------------------------------------------- */ - popl %esi - - movl $0, %eax - leave - ret -.Lfe1: - .size main,.Lfe1-main - .comm foo,24,4 - .ident "GCC: (GNU) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)" - - diff --git a/exp-ptrcheck/tests/x86/lea.stderr.exp b/exp-ptrcheck/tests/x86/lea.stderr.exp deleted file mode 100644 index 944ac2b999..0000000000 --- a/exp-ptrcheck/tests/x86/lea.stderr.exp +++ /dev/null @@ -1,47 +0,0 @@ - -Invalid read of size 4 - at 0x........: main (lea.S:59) - by 0x........: __libc_start_main (...libc...) - by 0x........: ... -Address 0x........ is 1 bytes before the accessing pointer's - legitimate range, the 1365-byte block alloc'd - at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (lea.S:20) - by 0x........: __libc_start_main (...libc...) - by 0x........: ... - -Invalid read of size 4 - at 0x........: main (lea.S:60) - by 0x........: __libc_start_main (...libc...) - by 0x........: ... -Address 0x........ is 1 bytes before the accessing pointer's - legitimate range, the 1365-byte block alloc'd - at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (lea.S:20) - by 0x........: __libc_start_main (...libc...) - by 0x........: ... - -Invalid read of size 4 - at 0x........: main (lea.S:63) - by 0x........: __libc_start_main (...libc...) - by 0x........: ... -Address 0x........ is 1 bytes before the accessing pointer's - legitimate range, the 1365-byte block alloc'd - at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (lea.S:20) - by 0x........: __libc_start_main (...libc...) - by 0x........: ... - -Invalid LEA2 - at 0x........: main (lea.S:66) - by 0x........: __libc_start_main (...libc...) - by 0x........: ... -Both args derived from address 0x........ of 1365-byte block alloc'd - at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (lea.S:20) - by 0x........: __libc_start_main (...libc...) - by 0x........: ... - -Scaling known pointer by value > 1 in lea instruction - -ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0) diff --git a/exp-ptrcheck/tests/x86/lea.vgtest-disabled b/exp-ptrcheck/tests/x86/lea.vgtest-disabled deleted file mode 100644 index e47ec3267c..0000000000 --- a/exp-ptrcheck/tests/x86/lea.vgtest-disabled +++ /dev/null @@ -1 +0,0 @@ -prog: lea diff --git a/helgrind/Makefile.am b/helgrind/Makefile.am index 55379c2f91..1266b05409 100644 --- a/helgrind/Makefile.am +++ b/helgrind/Makefile.am @@ -1,166 +1,99 @@ include $(top_srcdir)/Makefile.tool.am -noinst_PROGRAMS = -noinst_DSYMS = -if VGCONF_PLATFORMS_INCLUDE_X86_LINUX -noinst_PROGRAMS += helgrind-x86-linux vgpreload_helgrind-x86-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX -noinst_PROGRAMS += helgrind-amd64-linux vgpreload_helgrind-amd64-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX -noinst_PROGRAMS += helgrind-ppc32-linux vgpreload_helgrind-ppc32-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX -noinst_PROGRAMS += helgrind-ppc64-linux vgpreload_helgrind-ppc64-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 -noinst_PROGRAMS += helgrind-ppc32-aix5 vgpreload_helgrind-ppc32-aix5.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 -noinst_PROGRAMS += helgrind-ppc64-aix5 vgpreload_helgrind-ppc64-aix5.so -endif -if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN -noinst_PROGRAMS += helgrind-x86-darwin vgpreload_helgrind-x86-darwin.so -noinst_DSYMS += vgpreload_helgrind-x86-darwin.so -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN -noinst_PROGRAMS += helgrind-amd64-darwin vgpreload_helgrind-amd64-darwin.so -noinst_DSYMS += vgpreload_helgrind-amd64-darwin.so -endif +#---------------------------------------------------------------------------- +# Headers, etc +#---------------------------------------------------------------------------- -VGPRELOAD_HELGRIND_SOURCES_COMMON = hg_intercepts.c - -vgpreload_helgrind_x86_linux_so_SOURCES = $(VGPRELOAD_HELGRIND_SOURCES_COMMON) -vgpreload_helgrind_x86_linux_so_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -vgpreload_helgrind_x86_linux_so_CFLAGS = $(AM_CFLAGS_X86_LINUX) $(AM_CFLAGS_PIC) -vgpreload_helgrind_x86_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_LINUX) -vgpreload_helgrind_x86_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_X86_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_X86_LINUX) - -vgpreload_helgrind_amd64_linux_so_SOURCES = $(VGPRELOAD_HELGRIND_SOURCES_COMMON) -vgpreload_helgrind_amd64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -vgpreload_helgrind_amd64_linux_so_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) $(AM_CFLAGS_PIC) -vgpreload_helgrind_amd64_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_AMD64_LINUX) -vgpreload_helgrind_amd64_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_AMD64_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX) - -vgpreload_helgrind_ppc32_linux_so_SOURCES = $(VGPRELOAD_HELGRIND_SOURCES_COMMON) -vgpreload_helgrind_ppc32_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -vgpreload_helgrind_ppc32_linux_so_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) $(AM_CFLAGS_PIC) -vgpreload_helgrind_ppc32_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC32_LINUX) -vgpreload_helgrind_ppc32_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC32_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX) +pkginclude_HEADERS = helgrind.h -vgpreload_helgrind_ppc64_linux_so_SOURCES = $(VGPRELOAD_HELGRIND_SOURCES_COMMON) -vgpreload_helgrind_ppc64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -vgpreload_helgrind_ppc64_linux_so_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) $(AM_CFLAGS_PIC) -vgpreload_helgrind_ppc64_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC64_LINUX) -vgpreload_helgrind_ppc64_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC64_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX) - -vgpreload_helgrind_ppc32_aix5_so_SOURCES = $(VGPRELOAD_HELGRIND_SOURCES_COMMON) -vgpreload_helgrind_ppc32_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -vgpreload_helgrind_ppc32_aix5_so_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) $(AM_CFLAGS_PIC) -vgpreload_helgrind_ppc32_aix5_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC32_AIX5) -vgpreload_helgrind_ppc32_aix5_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC32_AIX5) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5) +noinst_HEADERS = \ + hg_basics.h \ + hg_errors.h \ + hg_lock_n_thread.h \ + hg_wordset.h \ + libhb.h -vgpreload_helgrind_ppc64_aix5_so_SOURCES = $(VGPRELOAD_HELGRIND_SOURCES_COMMON) -vgpreload_helgrind_ppc64_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -vgpreload_helgrind_ppc64_aix5_so_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) $(AM_CFLAGS_PIC) -vgpreload_helgrind_ppc64_aix5_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC64_AIX5) -vgpreload_helgrind_ppc64_aix5_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC64_AIX5) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5) +EXTRA_DIST = README_MSMProp2.txt README_YARD.txt -vgpreload_helgrind_x86_darwin_so_SOURCES = $(VGPRELOAD_HELGRIND_SOURCES_COMMON) -vgpreload_helgrind_x86_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -vgpreload_helgrind_x86_darwin_so_CFLAGS = $(AM_CFLAGS_X86_DARWIN) $(AM_CFLAGS_PIC) -vgpreload_helgrind_x86_darwin_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_DARWIN) -vgpreload_helgrind_x86_darwin_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_X86_DARWIN) \ - $(LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN) +#---------------------------------------------------------------------------- +# helgrind- +#---------------------------------------------------------------------------- -vgpreload_helgrind_amd64_darwin_so_SOURCES = $(VGPRELOAD_HELGRIND_SOURCES_COMMON) -vgpreload_helgrind_amd64_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -vgpreload_helgrind_amd64_darwin_so_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) $(AM_CFLAGS_PIC) -vgpreload_helgrind_amd64_darwin_so_DEPENDENCIES = $(LIBREPLACEMALLOC_AMD64_DARWIN) -vgpreload_helgrind_amd64_darwin_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_AMD64_DARWIN) \ - $(LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN) +noinst_PROGRAMS = helgrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@ +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += helgrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@ +endif HELGRIND_SOURCES_COMMON = \ - hg_basics.c hg_lock_n_thread.c hg_wordset.c libhb_core.c \ - hg_errors.c hg_main.c - -helgrind_x86_linux_SOURCES = $(HELGRIND_SOURCES_COMMON) -helgrind_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -helgrind_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) -O2 -helgrind_x86_linux_DEPENDENCIES = $(COREGRIND_LIBS_X86_LINUX) -helgrind_x86_linux_LDADD = $(TOOL_LDADD_X86_LINUX) -helgrind_x86_linux_LDFLAGS = $(TOOL_LDFLAGS_X86_LINUX) - -helgrind_amd64_linux_SOURCES = $(HELGRIND_SOURCES_COMMON) -helgrind_amd64_linux_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -helgrind_amd64_linux_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) -O2 -helgrind_amd64_linux_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_LINUX) -helgrind_amd64_linux_LDADD = $(TOOL_LDADD_AMD64_LINUX) -helgrind_amd64_linux_LDFLAGS = $(TOOL_LDFLAGS_AMD64_LINUX) - -helgrind_ppc32_linux_SOURCES = $(HELGRIND_SOURCES_COMMON) -helgrind_ppc32_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -helgrind_ppc32_linux_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) -O2 -helgrind_ppc32_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_LINUX) -helgrind_ppc32_linux_LDADD = $(TOOL_LDADD_PPC32_LINUX) -helgrind_ppc32_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC32_LINUX) - -helgrind_ppc64_linux_SOURCES = $(HELGRIND_SOURCES_COMMON) -helgrind_ppc64_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -helgrind_ppc64_linux_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) -O2 -helgrind_ppc64_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_LINUX) -helgrind_ppc64_linux_LDADD = $(TOOL_LDADD_PPC64_LINUX) -helgrind_ppc64_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC64_LINUX) - -helgrind_ppc32_aix5_SOURCES = $(HELGRIND_SOURCES_COMMON) -helgrind_ppc32_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -helgrind_ppc32_aix5_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) -O2 -helgrind_ppc32_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_AIX5) -helgrind_ppc32_aix5_LDADD = $(TOOL_LDADD_PPC32_AIX5) -helgrind_ppc32_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC32_AIX5) - -helgrind_ppc64_aix5_SOURCES = $(HELGRIND_SOURCES_COMMON) -helgrind_ppc64_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -helgrind_ppc64_aix5_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) -O2 -helgrind_ppc64_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_AIX5) -helgrind_ppc64_aix5_LDADD = $(TOOL_LDADD_PPC64_AIX5) -helgrind_ppc64_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC64_AIX5) + hg_basics.c \ + hg_errors.c \ + hg_lock_n_thread.c \ + hg_main.c \ + hg_wordset.c \ + libhb_core.c + +helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = $(HELGRIND_SOURCES_COMMON) +helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -O2 +helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) +helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) +helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = $(HELGRIND_SOURCES_COMMON) +helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -O2 +helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) +helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@) +helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -helgrind_x86_darwin_SOURCES = $(HELGRIND_SOURCES_COMMON) -helgrind_x86_darwin_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -helgrind_x86_darwin_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -O2 -helgrind_x86_darwin_DEPENDENCIES = $(COREGRIND_LIBS_X86_DARWIN) -helgrind_x86_darwin_LDADD = $(TOOL_LDADD_X86_DARWIN) -helgrind_x86_darwin_LDFLAGS = $(TOOL_LDFLAGS_X86_DARWIN) +#---------------------------------------------------------------------------- +# vgpreload_helgrind-.so +#---------------------------------------------------------------------------- -helgrind_amd64_darwin_SOURCES = $(HELGRIND_SOURCES_COMMON) -helgrind_amd64_darwin_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -helgrind_amd64_darwin_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) -O2 -helgrind_amd64_darwin_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_DARWIN) -helgrind_amd64_darwin_LDADD = $(TOOL_LDADD_AMD64_DARWIN) -helgrind_amd64_darwin_LDFLAGS = $(TOOL_LDFLAGS_AMD64_DARWIN) +noinst_PROGRAMS += vgpreload_helgrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += vgpreload_helgrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so +endif -hgincludedir = $(includedir)/valgrind +if VGCONF_OS_IS_DARWIN +noinst_DSYMS = $(noinst_PROGRAMS) +endif -hginclude_HEADERS = helgrind.h +VGPRELOAD_HELGRIND_SOURCES_COMMON = hg_intercepts.c -noinst_HEADERS = \ - hg_basics.h hg_lock_n_thread.h hg_errors.h hg_wordset.h \ - libhb.h +vgpreload_helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = \ + $(VGPRELOAD_HELGRIND_SOURCES_COMMON) +vgpreload_helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(AM_CFLAGS_PIC) +vgpreload_helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_DEPENDENCIES = \ + $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) \ + $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +vgpreload_helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = \ + $(VGPRELOAD_HELGRIND_SOURCES_COMMON) +vgpreload_helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(AM_CFLAGS_PIC) +vgpreload_helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_DEPENDENCIES = \ + $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) \ + $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -EXTRA_DIST = README_MSMProp2.txt README_YARD.txt diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am index 5f68d4094f..8dba343b48 100644 --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -1,9 +1,9 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr +dist_noinst_SCRIPTS = filter_stderr -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ bar_bad.vgtest bar_bad.stdout.exp bar_bad.stderr.exp \ bar_trivial.vgtest bar_trivial.stdout.exp bar_trivial.stderr.exp \ hg01_all_ok.vgtest hg01_all_ok.stdout.exp hg01_all_ok.stderr.exp \ diff --git a/include/Makefile.am b/include/Makefile.am index 24f604f8d6..00ac124931 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,9 +1,7 @@ -SUBDIRS = vki - -incincdir = $(includedir)/valgrind - -incinc_HEADERS = \ +# The "nobase" means that the vki/ path on some of them will be preserved +# when they are installed into $(includedir)/valgrind. +nobase_pkginclude_HEADERS = \ pub_tool_basics.h \ pub_tool_basics_asm.h \ pub_tool_aspacehl.h \ @@ -38,4 +36,25 @@ incinc_HEADERS = \ pub_tool_vkiscnums_asm.h \ pub_tool_wordfm.h \ pub_tool_xarray.h \ - valgrind.h + valgrind.h \ + vki/vki-linux.h \ + vki/vki-darwin.h \ + vki/vki-posixtypes-amd64-linux.h\ + vki/vki-posixtypes-ppc32-linux.h\ + vki/vki-posixtypes-ppc64-linux.h\ + vki/vki-posixtypes-x86-linux.h \ + vki/vki-amd64-linux.h \ + vki/vki-ppc32-linux.h \ + vki/vki-ppc64-linux.h \ + vki/vki-x86-linux.h \ + vki/vki-scnums-amd64-linux.h \ + vki/vki-scnums-ppc32-linux.h \ + vki/vki-scnums-ppc64-linux.h \ + vki/vki-scnums-x86-linux.h \ + vki/vki-scnums-darwin.h + +noinst_HEADERS = \ + vki/vki-ppc32-aix5.h \ + vki/vki-ppc64-aix5.h \ + vki/vki-scnums-aix5.h + diff --git a/include/vki/Makefile.am b/include/vki/Makefile.am deleted file mode 100644 index 81b40e58c1..0000000000 --- a/include/vki/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ - -incincdir = $(includedir)/valgrind/vki - -incinc_HEADERS = \ - vki-linux.h \ - vki-darwin.h \ - vki-posixtypes-amd64-linux.h \ - vki-posixtypes-ppc32-linux.h \ - vki-posixtypes-ppc64-linux.h \ - vki-posixtypes-x86-linux.h \ - vki-amd64-linux.h \ - vki-ppc32-linux.h \ - vki-ppc64-linux.h \ - vki-x86-linux.h \ - vki-scnums-amd64-linux.h \ - vki-scnums-ppc32-linux.h \ - vki-scnums-ppc64-linux.h \ - vki-scnums-x86-linux.h \ - vki-scnums-darwin.h - -noinst_HEADERS = \ - vki-ppc32-aix5.h \ - vki-ppc64-aix5.h \ - vki-scnums-aix5.h diff --git a/lackey/Makefile.am b/lackey/Makefile.am index 6a2ff3d95f..6e0aa7a85e 100644 --- a/lackey/Makefile.am +++ b/lackey/Makefile.am @@ -1,85 +1,38 @@ include $(top_srcdir)/Makefile.tool.am -noinst_PROGRAMS = -if VGCONF_PLATFORMS_INCLUDE_X86_LINUX -noinst_PROGRAMS += lackey-x86-linux -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX -noinst_PROGRAMS += lackey-amd64-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX -noinst_PROGRAMS += lackey-ppc32-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX -noinst_PROGRAMS += lackey-ppc64-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 -noinst_PROGRAMS += lackey-ppc32-aix5 -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 -noinst_PROGRAMS += lackey-ppc64-aix5 -endif -if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN -noinst_PROGRAMS += lackey-x86-darwin -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN -noinst_PROGRAMS += lackey-amd64-darwin +#---------------------------------------------------------------------------- +# lackey- +#---------------------------------------------------------------------------- + +noinst_PROGRAMS = lackey-@VGCONF_ARCH_PRI@-@VGCONF_OS@ +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += lackey-@VGCONF_ARCH_SEC@-@VGCONF_OS@ endif LACKEY_SOURCES_COMMON = lk_main.c -lackey_x86_linux_SOURCES = $(LACKEY_SOURCES_COMMON) -lackey_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -lackey_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) -lackey_x86_linux_DEPENDENCIES = $(COREGRIND_LIBS_X86_LINUX) -lackey_x86_linux_LDADD = $(TOOL_LDADD_X86_LINUX) -lackey_x86_linux_LDFLAGS = $(TOOL_LDFLAGS_X86_LINUX) - -lackey_amd64_linux_SOURCES = $(LACKEY_SOURCES_COMMON) -lackey_amd64_linux_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -lackey_amd64_linux_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) -lackey_amd64_linux_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_LINUX) -lackey_amd64_linux_LDADD = $(TOOL_LDADD_AMD64_LINUX) -lackey_amd64_linux_LDFLAGS = $(TOOL_LDFLAGS_AMD64_LINUX) - -lackey_ppc32_linux_SOURCES = $(LACKEY_SOURCES_COMMON) -lackey_ppc32_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -lackey_ppc32_linux_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) -lackey_ppc32_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_LINUX) -lackey_ppc32_linux_LDADD = $(TOOL_LDADD_PPC32_LINUX) -lackey_ppc32_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC32_LINUX) - -lackey_ppc64_linux_SOURCES = $(LACKEY_SOURCES_COMMON) -lackey_ppc64_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -lackey_ppc64_linux_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) -lackey_ppc64_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_LINUX) -lackey_ppc64_linux_LDADD = $(TOOL_LDADD_PPC64_LINUX) -lackey_ppc64_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC64_LINUX) - -lackey_ppc32_aix5_SOURCES = $(LACKEY_SOURCES_COMMON) -lackey_ppc32_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -lackey_ppc32_aix5_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) -lackey_ppc32_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_AIX5) -lackey_ppc32_aix5_LDADD = $(TOOL_LDADD_PPC32_AIX5) -lackey_ppc32_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC32_AIX5) - -lackey_ppc64_aix5_SOURCES = $(LACKEY_SOURCES_COMMON) -lackey_ppc64_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -lackey_ppc64_aix5_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) -lackey_ppc64_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_AIX5) -lackey_ppc64_aix5_LDADD = $(TOOL_LDADD_PPC64_AIX5) -lackey_ppc64_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC64_AIX5) - -lackey_x86_darwin_SOURCES = $(LACKEY_SOURCES_COMMON) -lackey_x86_darwin_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -lackey_x86_darwin_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -lackey_x86_darwin_DEPENDENCIES = $(COREGRIND_LIBS_X86_DARWIN) -lackey_x86_darwin_LDADD = $(TOOL_LDADD_X86_DARWIN) -lackey_x86_darwin_LDFLAGS = $(TOOL_LDFLAGS_X86_DARWIN) +lackey_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = $(LACKEY_SOURCES_COMMON) +lackey_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +lackey_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +lackey_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) +lackey_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) +lackey_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +lackey_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = $(LACKEY_SOURCES_COMMON) +lackey_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +lackey_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +lackey_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) +lackey_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@) +lackey_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -lackey_amd64_darwin_SOURCES = $(LACKEY_SOURCES_COMMON) -lackey_amd64_darwin_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -lackey_amd64_darwin_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) -lackey_amd64_darwin_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_DARWIN) -lackey_amd64_darwin_LDADD = $(TOOL_LDADD_AMD64_DARWIN) -lackey_amd64_darwin_LDFLAGS = $(TOOL_LDFLAGS_AMD64_DARWIN) diff --git a/lackey/tests/Makefile.am b/lackey/tests/Makefile.am index e586af521e..e16c9a13ed 100644 --- a/lackey/tests/Makefile.am +++ b/lackey/tests/Makefile.am @@ -1,4 +1,3 @@ -noinst_SCRIPTS = filter_stderr +dist_noinst_SCRIPTS = filter_stderr -EXTRA_DIST = $(noinst_SCRIPTS) \ - true.stderr.exp true.vgtest +EXTRA_DIST = true.stderr.exp true.vgtest diff --git a/massif/Makefile.am b/massif/Makefile.am index 3033df1ebc..75104803d2 100644 --- a/massif/Makefile.am +++ b/massif/Makefile.am @@ -4,153 +4,75 @@ SUBDIRS += perf bin_SCRIPTS = ms_print -noinst_PROGRAMS = -noinst_DSYMS = -if VGCONF_PLATFORMS_INCLUDE_X86_LINUX -noinst_PROGRAMS += massif-x86-linux vgpreload_massif-x86-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX -noinst_PROGRAMS += massif-amd64-linux vgpreload_massif-amd64-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX -noinst_PROGRAMS += massif-ppc32-linux vgpreload_massif-ppc32-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX -noinst_PROGRAMS += massif-ppc64-linux vgpreload_massif-ppc64-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 -noinst_PROGRAMS += massif-ppc32-aix5 vgpreload_massif-ppc32-aix5.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 -noinst_PROGRAMS += massif-ppc64-aix5 vgpreload_massif-ppc64-aix5.so -endif -if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN -noinst_PROGRAMS += massif-x86-darwin vgpreload_massif-x86-darwin.so -noinst_DSYMS += vgpreload_massif-x86-darwin.so -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN -noinst_PROGRAMS += massif-amd64-darwin vgpreload_massif-amd64-darwin.so -noinst_DSYMS += vgpreload_massif-amd64-darwin.so -endif - -vgpreload_massif_x86_linux_so_SOURCES = -vgpreload_massif_x86_linux_so_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -vgpreload_massif_x86_linux_so_CFLAGS = $(AM_CFLAGS_X86_LINUX) $(AM_CFLAGS_PIC) -vgpreload_massif_x86_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_LINUX) -vgpreload_massif_x86_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_X86_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_X86_LINUX) - -vgpreload_massif_amd64_linux_so_SOURCES = -vgpreload_massif_amd64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -vgpreload_massif_amd64_linux_so_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) $(AM_CFLAGS_PIC) -vgpreload_massif_amd64_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_AMD64_LINUX) -vgpreload_massif_amd64_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_AMD64_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX) - -vgpreload_massif_ppc32_linux_so_SOURCES = -vgpreload_massif_ppc32_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -vgpreload_massif_ppc32_linux_so_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) $(AM_CFLAGS_PIC) -vgpreload_massif_ppc32_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC32_LINUX) -vgpreload_massif_ppc32_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC32_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX) +#---------------------------------------------------------------------------- +# massif- +#---------------------------------------------------------------------------- -vgpreload_massif_ppc64_linux_so_SOURCES = -vgpreload_massif_ppc64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -vgpreload_massif_ppc64_linux_so_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) $(AM_CFLAGS_PIC) -vgpreload_massif_ppc64_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC64_LINUX) -vgpreload_massif_ppc64_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC64_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX) - -vgpreload_massif_ppc32_aix5_so_SOURCES = -vgpreload_massif_ppc32_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -vgpreload_massif_ppc32_aix5_so_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) $(AM_CFLAGS_PIC) -vgpreload_massif_ppc32_aix5_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC32_AIX5) -vgpreload_massif_ppc32_aix5_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC32_AIX5) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5) - -vgpreload_massif_ppc64_aix5_so_SOURCES = -vgpreload_massif_ppc64_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -vgpreload_massif_ppc64_aix5_so_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) $(AM_CFLAGS_PIC) -vgpreload_massif_ppc64_aix5_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC64_AIX5) -vgpreload_massif_ppc64_aix5_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC64_AIX5) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5) - -vgpreload_massif_x86_darwin_so_SOURCES = -vgpreload_massif_x86_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -vgpreload_massif_x86_darwin_so_CFLAGS = $(AM_CFLAGS_X86_DARWIN) $(AM_CFLAGS_PIC) -vgpreload_massif_x86_darwin_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_DARWIN) -vgpreload_massif_x86_darwin_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_X86_DARWIN) \ - $(LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN) - -vgpreload_massif_amd64_darwin_so_SOURCES = -vgpreload_massif_amd64_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -vgpreload_massif_amd64_darwin_so_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) $(AM_CFLAGS_PIC) -vgpreload_massif_amd64_darwin_so_DEPENDENCIES = $(LIBREPLACEMALLOC_AMD64_DARWIN) -vgpreload_massif_amd64_darwin_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_AMD64_DARWIN) \ - $(LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN) +noinst_PROGRAMS = massif-@VGCONF_ARCH_PRI@-@VGCONF_OS@ +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += massif-@VGCONF_ARCH_SEC@-@VGCONF_OS@ +endif MASSIF_SOURCES_COMMON = ms_main.c -massif_x86_linux_SOURCES = $(MASSIF_SOURCES_COMMON) -massif_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -massif_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) -massif_x86_linux_DEPENDENCIES = $(COREGRIND_LIBS_X86_LINUX) -massif_x86_linux_LDADD = $(TOOL_LDADD_X86_LINUX) -massif_x86_linux_LDFLAGS = $(TOOL_LDFLAGS_X86_LINUX) - -massif_amd64_linux_SOURCES = $(MASSIF_SOURCES_COMMON) -massif_amd64_linux_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -massif_amd64_linux_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) -massif_amd64_linux_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_LINUX) -massif_amd64_linux_LDADD = $(TOOL_LDADD_AMD64_LINUX) -massif_amd64_linux_LDFLAGS = $(TOOL_LDFLAGS_AMD64_LINUX) - -massif_ppc32_linux_SOURCES = $(MASSIF_SOURCES_COMMON) -massif_ppc32_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -massif_ppc32_linux_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) -massif_ppc32_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_LINUX) -massif_ppc32_linux_LDADD = $(TOOL_LDADD_PPC32_LINUX) -massif_ppc32_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC32_LINUX) +massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = $(MASSIF_SOURCES_COMMON) +massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) +massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) +massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = $(MASSIF_SOURCES_COMMON) +massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) +massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@) +massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -massif_ppc64_linux_SOURCES = $(MASSIF_SOURCES_COMMON) -massif_ppc64_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -massif_ppc64_linux_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) -massif_ppc64_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_LINUX) -massif_ppc64_linux_LDADD = $(TOOL_LDADD_PPC64_LINUX) -massif_ppc64_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC64_LINUX) +#---------------------------------------------------------------------------- +# vgpreload_massif-.so +#---------------------------------------------------------------------------- -massif_ppc32_aix5_SOURCES = $(MASSIF_SOURCES_COMMON) -massif_ppc32_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -massif_ppc32_aix5_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) -massif_ppc32_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_AIX5) -massif_ppc32_aix5_LDADD = $(TOOL_LDADD_PPC32_AIX5) -massif_ppc32_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC32_AIX5) +noinst_PROGRAMS += vgpreload_massif-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += vgpreload_massif-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so +endif -massif_ppc64_aix5_SOURCES = $(MASSIF_SOURCES_COMMON) -massif_ppc64_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -massif_ppc64_aix5_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) -massif_ppc64_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_AIX5) -massif_ppc64_aix5_LDADD = $(TOOL_LDADD_PPC64_AIX5) -massif_ppc64_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC64_AIX5) +if VGCONF_OS_IS_DARWIN +noinst_DSYMS = $(noinst_PROGRAMS) +endif -massif_x86_darwin_SOURCES = $(MASSIF_SOURCES_COMMON) -massif_x86_darwin_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -massif_x86_darwin_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -massif_x86_darwin_DEPENDENCIES = $(COREGRIND_LIBS_X86_DARWIN) -massif_x86_darwin_LDADD = $(TOOL_LDADD_X86_DARWIN) -massif_x86_darwin_LDFLAGS = $(TOOL_LDFLAGS_X86_DARWIN) +vgpreload_massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = +vgpreload_massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(AM_CFLAGS_PIC) +vgpreload_massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_DEPENDENCIES = \ + $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) \ + $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +vgpreload_massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = +vgpreload_massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(AM_CFLAGS_PIC) +vgpreload_massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_DEPENDENCIES = \ + $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) \ + $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -massif_amd64_darwin_SOURCES = $(MASSIF_SOURCES_COMMON) -massif_amd64_darwin_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -massif_amd64_darwin_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) -massif_amd64_darwin_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_DARWIN) -massif_amd64_darwin_LDADD = $(TOOL_LDADD_AMD64_DARWIN) -massif_amd64_darwin_LDFLAGS = $(TOOL_LDFLAGS_AMD64_DARWIN) diff --git a/massif/tests/Makefile.am b/massif/tests/Makefile.am index c85bbfbe28..ecdd01a4d6 100644 --- a/massif/tests/Makefile.am +++ b/massif/tests/Makefile.am @@ -1,9 +1,9 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr filter_verbose +dist_noinst_SCRIPTS = filter_stderr filter_verbose -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ alloc-fns-A.post.exp alloc-fns-A.stderr.exp alloc-fns-A.vgtest \ alloc-fns-B.post.exp alloc-fns-B.stderr.exp alloc-fns-B.vgtest \ basic.post.exp basic.stderr.exp basic.vgtest \ diff --git a/memcheck/Makefile.am b/memcheck/Makefile.am index e11e841444..e521c6ce66 100644 --- a/memcheck/Makefile.am +++ b/memcheck/Makefile.am @@ -2,108 +2,24 @@ include $(top_srcdir)/Makefile.tool.am SUBDIRS += perf -noinst_PROGRAMS = -noinst_DSYMS = -if VGCONF_PLATFORMS_INCLUDE_X86_LINUX -noinst_PROGRAMS += memcheck-x86-linux vgpreload_memcheck-x86-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX -noinst_PROGRAMS += memcheck-amd64-linux vgpreload_memcheck-amd64-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX -noinst_PROGRAMS += memcheck-ppc32-linux vgpreload_memcheck-ppc32-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX -noinst_PROGRAMS += memcheck-ppc64-linux vgpreload_memcheck-ppc64-linux.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 -noinst_PROGRAMS += memcheck-ppc32-aix5 vgpreload_memcheck-ppc32-aix5.so -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 -noinst_PROGRAMS += memcheck-ppc64-aix5 vgpreload_memcheck-ppc64-aix5.so -endif -if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN -noinst_PROGRAMS += memcheck-x86-darwin vgpreload_memcheck-x86-darwin.so -noinst_DSYMS += vgpreload_memcheck-x86-darwin.so -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN -noinst_PROGRAMS += memcheck-amd64-darwin vgpreload_memcheck-amd64-darwin.so -noinst_DSYMS += vgpreload_memcheck-amd64-darwin.so -endif +#---------------------------------------------------------------------------- +# Headers +#---------------------------------------------------------------------------- -VGPRELOAD_MEMCHECK_SOURCES_COMMON = mc_replace_strmem.c +pkginclude_HEADERS = \ + memcheck.h -vgpreload_memcheck_x86_linux_so_SOURCES = $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) -vgpreload_memcheck_x86_linux_so_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -vgpreload_memcheck_x86_linux_so_CFLAGS = $(AM_CFLAGS_X86_LINUX) $(AM_CFLAGS_PIC) -O2 -vgpreload_memcheck_x86_linux_so_CCASFLAGS = $(AM_CCASFLAGS_X86_LINUX) -vgpreload_memcheck_x86_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_LINUX) -vgpreload_memcheck_x86_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_X86_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_X86_LINUX) - -vgpreload_memcheck_amd64_linux_so_SOURCES = $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) -vgpreload_memcheck_amd64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -vgpreload_memcheck_amd64_linux_so_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) $(AM_CFLAGS_PIC) -O2 -vgpreload_memcheck_amd64_linux_so_CCASFLAGS = $(AM_CCASFLAGS_AMD64_LINUX) -vgpreload_memcheck_amd64_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_AMD64_LINUX) -vgpreload_memcheck_amd64_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_AMD64_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_AMD64_LINUX) - -vgpreload_memcheck_ppc32_linux_so_SOURCES = $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) -vgpreload_memcheck_ppc32_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -vgpreload_memcheck_ppc32_linux_so_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) $(AM_CFLAGS_PIC) -O2 -vgpreload_memcheck_ppc32_linux_so_CCASFLAGS = $(AM_CCASFLAGS_PPC32_LINUX) -vgpreload_memcheck_ppc32_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC32_LINUX) -vgpreload_memcheck_ppc32_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC32_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX) - -vgpreload_memcheck_ppc64_linux_so_SOURCES = $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) -vgpreload_memcheck_ppc64_linux_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -vgpreload_memcheck_ppc64_linux_so_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) $(AM_CFLAGS_PIC) -O2 -vgpreload_memcheck_ppc64_linux_so_CCASFLAGS = $(AM_CCASFLAGS_PPC64_LINUX) -vgpreload_memcheck_ppc64_linux_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC64_LINUX) -vgpreload_memcheck_ppc64_linux_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC64_LINUX) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX) - -vgpreload_memcheck_ppc32_aix5_so_SOURCES = $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) -vgpreload_memcheck_ppc32_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -vgpreload_memcheck_ppc32_aix5_so_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) $(AM_CFLAGS_PIC) -O2 -vgpreload_memcheck_ppc32_aix5_so_CCASFLAGS = $(AM_CCASFLAGS_PPC32_AIX5) -vgpreload_memcheck_ppc32_aix5_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC32_AIX5) -vgpreload_memcheck_ppc32_aix5_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC32_AIX5) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5) - -vgpreload_memcheck_ppc64_aix5_so_SOURCES = $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) -vgpreload_memcheck_ppc64_aix5_so_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -vgpreload_memcheck_ppc64_aix5_so_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) $(AM_CFLAGS_PIC) -O2 -vgpreload_memcheck_ppc64_aix5_so_CCASFLAGS = $(AM_CCASFLAGS_PPC64_AIX5) -vgpreload_memcheck_ppc64_aix5_so_DEPENDENCIES = $(LIBREPLACEMALLOC_PPC64_AIX5) -vgpreload_memcheck_ppc64_aix5_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_PPC64_AIX5) \ - $(LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5) - -vgpreload_memcheck_x86_darwin_so_SOURCES = $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) -vgpreload_memcheck_x86_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -vgpreload_memcheck_x86_darwin_so_CFLAGS = $(AM_CFLAGS_X86_DARWIN) $(AM_CFLAGS_PIC) -O2 -vgpreload_memcheck_x86_darwin_so_CCASFLAGS = $(AM_CCASFLAGS_X86_DARWIN) -vgpreload_memcheck_x86_darwin_so_DEPENDENCIES = $(LIBREPLACEMALLOC_X86_DARWIN) -vgpreload_memcheck_x86_darwin_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_X86_DARWIN) \ - $(LIBREPLACEMALLOC_LDFLAGS_X86_DARWIN) - -vgpreload_memcheck_amd64_darwin_so_SOURCES = $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) -vgpreload_memcheck_amd64_darwin_so_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -vgpreload_memcheck_amd64_darwin_so_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) $(AM_CFLAGS_PIC) -O2 -vgpreload_memcheck_amd64_darwin_so_CCASFLAGS = $(AM_CCASFLAGS_AMD64_DARWIN) -vgpreload_memcheck_amd64_darwin_so_DEPENDENCIES = $(LIBREPLACEMALLOC_AMD64_DARWIN) -vgpreload_memcheck_amd64_darwin_so_LDFLAGS = \ - $(PRELOAD_LDFLAGS_AMD64_DARWIN) \ - $(LIBREPLACEMALLOC_LDFLAGS_AMD64_DARWIN) +noinst_HEADERS = \ + mc_include.h + +#---------------------------------------------------------------------------- +# memcheck- +#---------------------------------------------------------------------------- + +noinst_PROGRAMS = memcheck-@VGCONF_ARCH_PRI@-@VGCONF_OS@ +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += memcheck-@VGCONF_ARCH_SEC@-@VGCONF_OS@ +endif MEMCHECK_SOURCES_COMMON = \ mc_leakcheck.c \ @@ -113,78 +29,72 @@ MEMCHECK_SOURCES_COMMON = \ mc_machine.c \ mc_errors.c -memcheck_x86_linux_SOURCES = $(MEMCHECK_SOURCES_COMMON) -memcheck_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -memcheck_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) -O2 -memcheck_x86_linux_CCASFLAGS = $(AM_CCASFLAGS_X86_LINUX) -memcheck_x86_linux_DEPENDENCIES = $(COREGRIND_LIBS_X86_LINUX) -memcheck_x86_linux_LDADD = $(TOOL_LDADD_X86_LINUX) -memcheck_x86_linux_LDFLAGS = $(TOOL_LDFLAGS_X86_LINUX) - -memcheck_amd64_linux_SOURCES = $(MEMCHECK_SOURCES_COMMON) -memcheck_amd64_linux_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -memcheck_amd64_linux_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) -O2 -memcheck_amd64_linux_CCASFLAGS = $(AM_CCASFLAGS_AMD64_LINUX) -memcheck_amd64_linux_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_LINUX) -memcheck_amd64_linux_LDADD = $(TOOL_LDADD_AMD64_LINUX) -memcheck_amd64_linux_LDFLAGS = $(TOOL_LDFLAGS_AMD64_LINUX) - -memcheck_ppc32_linux_SOURCES = $(MEMCHECK_SOURCES_COMMON) -memcheck_ppc32_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -memcheck_ppc32_linux_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) -O2 -memcheck_ppc32_linux_CCASFLAGS = $(AM_CCASFLAGS_PPC32_LINUX) -memcheck_ppc32_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_LINUX) -memcheck_ppc32_linux_LDADD = $(TOOL_LDADD_PPC32_LINUX) -memcheck_ppc32_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC32_LINUX) - -memcheck_ppc64_linux_SOURCES = $(MEMCHECK_SOURCES_COMMON) -memcheck_ppc64_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -memcheck_ppc64_linux_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) -O2 -memcheck_ppc64_linux_CCASFLAGS = $(AM_CCASFLAGS_PPC64_LINUX) -memcheck_ppc64_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_LINUX) -memcheck_ppc64_linux_LDADD = $(TOOL_LDADD_PPC64_LINUX) -memcheck_ppc64_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC64_LINUX) - -memcheck_ppc32_aix5_SOURCES = $(MEMCHECK_SOURCES_COMMON) -memcheck_ppc32_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -memcheck_ppc32_aix5_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) -O2 -memcheck_ppc32_aix5_CCASFLAGS = $(AM_CCASFLAGS_PPC32_AIX5) -memcheck_ppc32_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_AIX5) -memcheck_ppc32_aix5_LDADD = $(TOOL_LDADD_PPC32_AIX5) -memcheck_ppc32_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC32_AIX5) - -memcheck_ppc64_aix5_SOURCES = $(MEMCHECK_SOURCES_COMMON) -memcheck_ppc64_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -memcheck_ppc64_aix5_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) -O2 -memcheck_ppc64_aix5_CCASFLAGS = $(AM_CCASFLAGS_PPC64_AIX5) -memcheck_ppc64_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_AIX5) -memcheck_ppc64_aix5_LDADD = $(TOOL_LDADD_PPC64_AIX5) -memcheck_ppc64_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC64_AIX5) - -memcheck_x86_darwin_SOURCES = $(MEMCHECK_SOURCES_COMMON) -memcheck_x86_darwin_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -memcheck_x86_darwin_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -O2 -memcheck_x86_darwin_CCASFLAGS = $(AM_CCASFLAGS_X86_DARWIN) -memcheck_x86_darwin_DEPENDENCIES = $(COREGRIND_LIBS_X86_DARWIN) -memcheck_x86_darwin_LDADD = $(TOOL_LDADD_X86_DARWIN) -memcheck_x86_darwin_LDFLAGS = $(TOOL_LDFLAGS_X86_DARWIN) - -memcheck_amd64_darwin_SOURCES = $(MEMCHECK_SOURCES_COMMON) -memcheck_amd64_darwin_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -memcheck_amd64_darwin_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) -O2 -memcheck_amd64_darwin_CCASFLAGS = $(AM_CCASFLAGS_AMD64_DARWIN) -memcheck_amd64_darwin_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_DARWIN) -memcheck_amd64_darwin_LDADD = $(TOOL_LDADD_AMD64_DARWIN) -memcheck_amd64_darwin_LDFLAGS = $(TOOL_LDFLAGS_AMD64_DARWIN) - -mcincludedir = $(includedir)/valgrind - -mcinclude_HEADERS = \ - memcheck.h +memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = $(MEMCHECK_SOURCES_COMMON) +memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -O2 +memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) +memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) +memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = $(MEMCHECK_SOURCES_COMMON) +memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -O2 +memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) +memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@) +memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -noinst_HEADERS = \ - mc_include.h +mc_main.o: CFLAGS += -fomit-frame-pointer + +#---------------------------------------------------------------------------- +# vgpreload_memcheck-.so +#---------------------------------------------------------------------------- + +noinst_PROGRAMS += vgpreload_memcheck-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += vgpreload_memcheck-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so +endif + +if VGCONF_OS_IS_DARWIN +noinst_DSYMS = $(noinst_PROGRAMS) +endif + +VGPRELOAD_MEMCHECK_SOURCES_COMMON = mc_replace_strmem.c + +vgpreload_memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = \ + $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) +vgpreload_memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(AM_CFLAGS_PIC) -O2 +vgpreload_memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_DEPENDENCIES = \ + $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_PRI_CAPS@) +vgpreload_memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) \ + $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +vgpreload_memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = \ + $(VGPRELOAD_MEMCHECK_SOURCES_COMMON) +vgpreload_memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(AM_CFLAGS_PIC) -O2 +vgpreload_memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_DEPENDENCIES = \ + $(LIBREPLACEMALLOC_@VGCONF_PLATFORM_SEC_CAPS@) +vgpreload_memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = \ + $(PRELOAD_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) \ + $(LIBREPLACEMALLOC_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif mc_replace_strmem.o: CFLAGS += -fno-omit-frame-pointer -mc_main.o: CFLAGS += -fomit-frame-pointer diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 96101cb669..ee32dd8654 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -26,7 +26,7 @@ endif DIST_SUBDIRS = x86 amd64 linux darwin x86-linux . -noinst_SCRIPTS = \ +dist_noinst_SCRIPTS = \ filter_addressable \ filter_allocs \ filter_stderr filter_xml \ @@ -34,7 +34,7 @@ noinst_SCRIPTS = \ noinst_HEADERS = leak.h -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ addressable.stderr.exp addressable.stdout.exp addressable.vgtest \ badaddrvalue.stderr.exp \ badaddrvalue.stdout.exp badaddrvalue.vgtest \ diff --git a/memcheck/tests/amd64/Makefile.am b/memcheck/tests/amd64/Makefile.am index 5dedb0d23b..a48a105edc 100644 --- a/memcheck/tests/amd64/Makefile.am +++ b/memcheck/tests/amd64/Makefile.am @@ -1,13 +1,11 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr - -noinst_HEADERS = +dist_noinst_SCRIPTS = filter_stderr INSN_TESTS = insn_basic insn_mmx insn_sse insn_sse2 insn_fpu -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ $(addsuffix .stderr.exp,$(INSN_TESTS)) \ $(addsuffix .stdout.exp,$(INSN_TESTS)) \ $(addsuffix .vgtest,$(INSN_TESTS)) \ diff --git a/memcheck/tests/darwin/Makefile.am b/memcheck/tests/darwin/Makefile.am index 54270213e0..c1cef03a8d 100644 --- a/memcheck/tests/darwin/Makefile.am +++ b/memcheck/tests/darwin/Makefile.am @@ -1,11 +1,11 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr +dist_noinst_SCRIPTS = filter_stderr noinst_HEADERS = scalar.h -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ scalar.stderr.exp scalar.vgtest \ scalar_fork.stderr.exp scalar_fork.vgtest \ scalar_nocancel.stderr.exp scalar_nocancel.vgtest \ diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am index 664ee632b7..d5f808879b 100644 --- a/memcheck/tests/linux/Makefile.am +++ b/memcheck/tests/linux/Makefile.am @@ -1,9 +1,9 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr +dist_noinst_SCRIPTS = filter_stderr -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ brk.stderr.exp brk.vgtest \ capget capget.stderr.exp \ stack_switch.stderr.exp stack_switch.vgtest \ diff --git a/memcheck/tests/x86-linux/Makefile.am b/memcheck/tests/x86-linux/Makefile.am index f8944dfcc4..e9fdbac5b3 100644 --- a/memcheck/tests/x86-linux/Makefile.am +++ b/memcheck/tests/x86-linux/Makefile.am @@ -1,13 +1,13 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = \ +dist_noinst_SCRIPTS = \ filter_scalar_exit_group \ filter_stderr noinst_HEADERS = scalar.h -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ bug133694.vgtest bug133694.stderr.exp bug133694.stdout.exp \ int3-x86.vgtest int3-x86.stderr.exp int3-x86.stdout.exp \ scalar.stderr.exp scalar.vgtest \ diff --git a/memcheck/tests/x86/Makefile.am b/memcheck/tests/x86/Makefile.am index 2cd7b03bcb..f2c740cd22 100644 --- a/memcheck/tests/x86/Makefile.am +++ b/memcheck/tests/x86/Makefile.am @@ -1,11 +1,11 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr filter_pushfpopf filter_tronical +dist_noinst_SCRIPTS = filter_stderr filter_pushfpopf filter_tronical INSN_TESTS = insn_basic insn_fpu insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2 -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ bug152022.vgtest bug152022.stderr.exp bug152022.stdout.exp \ espindola2.vgtest espindola2.stderr.exp \ fpeflags.stderr.exp fpeflags.vgtest \ diff --git a/mpi/Makefile.am b/mpi/Makefile.am new file mode 100644 index 0000000000..d00c730263 --- /dev/null +++ b/mpi/Makefile.am @@ -0,0 +1,82 @@ +include $(top_srcdir)/Makefile.all.am + +# HACK WARNING: automake isn't good at supporting non-$(CC) compilers. +# But we need to use $(MPI_CC) for the MPI stuff. So we have this mpi stuff +# in its own directory so we can use the following blunt instruments, which +# override the C compiler and all the default flags. +CC = $(MPI_CC) +DEFS = +DEFAULT_INCLUDES = +CPPFLAGS = +CFLAGS = +LDFLAGS = + +EXTRA_DIST = \ + libmpiwrap_aix5.exp \ + mpiwrap_type_test.c + +#---------------------------------------------------------------------------- +# libmpiwrap-.so +#---------------------------------------------------------------------------- + +noinst_PROGRAMS = +if BUILD_MPIWRAP_PRI +noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so +endif +if BUILD_MPIWRAP_SEC +noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so +endif + +if VGCONF_OS_IS_DARWIN +noinst_DSYMS = $(noinst_PROGRAMS) +endif + + +if VGCONF_OS_IS_LINUX + CFLAGS_MPI = -g -O -fno-omit-frame-pointer -Wall -fpic + LDFLAGS_MPI = -fpic -shared + MPI_FLAG_M3264_PRI = $(AM_FLAG_M3264_PRI) + MPI_FLAG_M3264_SEC = $(AM_FLAG_M3264_SEC) +endif +if VGCONF_OS_IS_AIX5 + # MPICC on AIX is called XLC. It uses weird options. + CFLAGS_MPI = -g -O -qflag=w:w -qlanglvl=extended + LDFLAGS_MPI = -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \ + -qflag=w:w -qlanglvl=extended + # The sed bit changes eg. "maix32" to "q32" which is the XLC option. + MPI_FLAG_M3264_PRI = `echo $(AM_FLAG_M3264_PRI) | sed s/maix/q/g` + MPI_FLAG_M3264_SEC = `echo $(AM_FLAG_M3264_SEC) | sed s/maix/q/g` +endif +if VGCONF_OS_IS_DARWIN + CFLAGS_MPI = -g -O -fno-omit-frame-pointer -Wall -dynamic + LDFLAGS_MPI = -dynamic -dynamiclib -all_load + MPI_FLAG_M3264_PRI = $(AM_FLAG_M3264_PRI) + MPI_FLAG_M3264_SEC = $(AM_FLAG_M3264_SEC) +endif + + +if BUILD_MPIWRAP_PRI +libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES = libmpiwrap.c +libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = -I../include +libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS = \ + $(CFLAGS_MPI) $(MPI_FLAG_M3264_PRI) +libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS = $(LDFLAGS_MPI) +endif +if BUILD_MPIWRAP_SEC +libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES = libmpiwrap.c +libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = -I../include +libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS = \ + $(CFLAGS_MPI) $(MPI_FLAG_M3264_SEC) +libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS = $(LDFLAGS_MPI) +endif + +#---------------------------------------------------------------------------- +# General stuff +#---------------------------------------------------------------------------- + +all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS + +clean-local: clean-noinst_DSYMS + +install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS + diff --git a/auxprogs/libmpiwrap.c b/mpi/libmpiwrap.c similarity index 100% rename from auxprogs/libmpiwrap.c rename to mpi/libmpiwrap.c diff --git a/auxprogs/libmpiwrap_aix5.exp b/mpi/libmpiwrap_aix5.exp similarity index 100% rename from auxprogs/libmpiwrap_aix5.exp rename to mpi/libmpiwrap_aix5.exp diff --git a/auxprogs/mpiwrap_type_test.c b/mpi/mpiwrap_type_test.c similarity index 100% rename from auxprogs/mpiwrap_type_test.c rename to mpi/mpiwrap_type_test.c diff --git a/nightly/README.txt b/nightly/README.txt index 204f359972..c4f292b6c2 100644 --- a/nightly/README.txt +++ b/nightly/README.txt @@ -13,13 +13,14 @@ the script starts running, so if any commits happen while the tests are running they will not be tested.) If the two trees are different (i.e. there have been commits in the past 24 -hours) it builds ("make"), installs ("make install") and runs the regression -tests ("make regtest") in both, and compares the results. Note that the -"make install" isn't necessary in order to run the tests because the -regression tests use the code built (with "make") within the tree, but it's -worth doing because it tests that "make install" isn't totally broken. -After checking both trees, it emails a summary of the results to a -recipient. All this typically takes something like 30 minutes. +hours, either to the trunk or a branch) it builds ("make"), installs ("make +install") and runs the regression tests ("make regtest") in both, and +compares the results. Note that the "make install" isn't necessary in order +to run the tests because the regression tests use the code built (with +"make") within the tree, but it's worth doing because it tests that "make +install" isn't totally broken. After checking both trees, it emails a +summary of the results to a recipient. All this typically takes something +like 30 minutes. If the two trees are identical, the tests are not run and no results are emailed. This avoids spamming people with uninteresting results emails when @@ -70,10 +71,10 @@ To set up nightly testing for a machine, do the following. empty. - ABT_EVAL: if provided, it must be the name of a shell script that - executes the shell command $1 with arguments $2 .. ${$#}. Allows to + executes the shell command $1 with arguments $2 .. ${$#}. Allows to compile and run the Valgrind regression tests on another system than - the system the 'nightly' script runs on. It is assumed that the remote - system shares the local filesystem tree through e.g. NFS. It is the + the system the 'nightly' script runs on. It is assumed that the remote + system shares the local filesystem tree through e.g. NFS. It is the responsibility of the shell script to set the remote working directory such that it matches the local current directory ($PWD). @@ -84,8 +85,6 @@ To set up nightly testing for a machine, do the following. - ABT_JOBS: allows parallel builds -- it's passed as the argument to "make -j" when building Valgrind and the tests. The default is 1. - [XXX: the .NOTPARALLEL that currently resides in Makefile.all.am foils - this!] Note that the appropriate syntax to use in this file will depend on the shell from which the $DIR/bin/nightly script is run (which in turn may diff --git a/none/Makefile.am b/none/Makefile.am index 34061af3f8..7cb7e977d5 100644 --- a/none/Makefile.am +++ b/none/Makefile.am @@ -1,85 +1,39 @@ include $(top_srcdir)/Makefile.tool.am -noinst_PROGRAMS = -if VGCONF_PLATFORMS_INCLUDE_X86_LINUX -noinst_PROGRAMS += none-x86-linux -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX -noinst_PROGRAMS += none-amd64-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX -noinst_PROGRAMS += none-ppc32-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX -noinst_PROGRAMS += none-ppc64-linux -endif -if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 -noinst_PROGRAMS += none-ppc32-aix5 -endif -if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 -noinst_PROGRAMS += none-ppc64-aix5 -endif -if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN -noinst_PROGRAMS += none-x86-darwin -endif -if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN -noinst_PROGRAMS += none-amd64-darwin +#---------------------------------------------------------------------------- +# none- +#---------------------------------------------------------------------------- + +noinst_PROGRAMS = none-@VGCONF_ARCH_PRI@-@VGCONF_OS@ +if VGCONF_HAVE_PLATFORM_SEC +noinst_PROGRAMS += none-@VGCONF_ARCH_SEC@-@VGCONF_OS@ endif NONE_SOURCES_COMMON = nl_main.c -none_x86_linux_SOURCES = $(NONE_SOURCES_COMMON) -none_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) -none_x86_linux_CFLAGS = $(AM_CFLAGS_X86_LINUX) -none_x86_linux_DEPENDENCIES = $(COREGRIND_LIBS_X86_LINUX) -none_x86_linux_LDADD = $(TOOL_LDADD_X86_LINUX) -none_x86_linux_LDFLAGS = $(TOOL_LDFLAGS_X86_LINUX) - -none_amd64_linux_SOURCES = $(NONE_SOURCES_COMMON) -none_amd64_linux_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX) -none_amd64_linux_CFLAGS = $(AM_CFLAGS_AMD64_LINUX) -none_amd64_linux_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_LINUX) -none_amd64_linux_LDADD = $(TOOL_LDADD_AMD64_LINUX) -none_amd64_linux_LDFLAGS = $(TOOL_LDFLAGS_AMD64_LINUX) - -none_ppc32_linux_SOURCES = $(NONE_SOURCES_COMMON) -none_ppc32_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX) -none_ppc32_linux_CFLAGS = $(AM_CFLAGS_PPC32_LINUX) -none_ppc32_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_LINUX) -none_ppc32_linux_LDADD = $(TOOL_LDADD_PPC32_LINUX) -none_ppc32_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC32_LINUX) - -none_ppc64_linux_SOURCES = $(NONE_SOURCES_COMMON) -none_ppc64_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX) -none_ppc64_linux_CFLAGS = $(AM_CFLAGS_PPC64_LINUX) -none_ppc64_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_LINUX) -none_ppc64_linux_LDADD = $(TOOL_LDADD_PPC64_LINUX) -none_ppc64_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC64_LINUX) - -none_ppc32_aix5_SOURCES = $(NONE_SOURCES_COMMON) -none_ppc32_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5) -none_ppc32_aix5_CFLAGS = $(AM_CFLAGS_PPC32_AIX5) -none_ppc32_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_AIX5) -none_ppc32_aix5_LDADD = $(TOOL_LDADD_PPC32_AIX5) -none_ppc32_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC32_AIX5) - -none_ppc64_aix5_SOURCES = $(NONE_SOURCES_COMMON) -none_ppc64_aix5_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5) -none_ppc64_aix5_CFLAGS = $(AM_CFLAGS_PPC64_AIX5) -none_ppc64_aix5_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_AIX5) -none_ppc64_aix5_LDADD = $(TOOL_LDADD_PPC64_AIX5) -none_ppc64_aix5_LDFLAGS = $(TOOL_LDFLAGS_PPC64_AIX5) +none_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = $(NONE_SOURCES_COMMON) +none_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +none_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +none_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) +none_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@) +none_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +if VGCONF_HAVE_PLATFORM_SEC +none_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = $(NONE_SOURCES_COMMON) +none_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +none_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +none_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ + $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) +none_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \ + $(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@) +none_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \ + $(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif -none_x86_darwin_SOURCES = $(NONE_SOURCES_COMMON) -none_x86_darwin_CPPFLAGS = $(AM_CPPFLAGS_X86_DARWIN) -none_x86_darwin_CFLAGS = $(AM_CFLAGS_X86_DARWIN) -none_x86_darwin_DEPENDENCIES = $(COREGRIND_LIBS_X86_DARWIN) -none_x86_darwin_LDADD = $(TOOL_LDADD_X86_DARWIN) -none_x86_darwin_LDFLAGS = $(TOOL_LDFLAGS_X86_DARWIN) -none_amd64_darwin_SOURCES = $(NONE_SOURCES_COMMON) -none_amd64_darwin_CPPFLAGS = $(AM_CPPFLAGS_AMD64_DARWIN) -none_amd64_darwin_CFLAGS = $(AM_CFLAGS_AMD64_DARWIN) -none_amd64_darwin_DEPENDENCIES = $(COREGRIND_LIBS_AMD64_DARWIN) -none_amd64_darwin_LDADD = $(TOOL_LDADD_AMD64_DARWIN) -none_amd64_darwin_LDFLAGS = $(TOOL_LDFLAGS_AMD64_DARWIN) diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index de9e123fcb..061eab656c 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -32,13 +32,13 @@ endif DIST_SUBDIRS = x86 amd64 ppc32 ppc64 linux darwin x86-linux . -noinst_SCRIPTS = \ +dist_noinst_SCRIPTS = \ filter_cmdline0 filter_linenos \ filter_fdleak filter_none_discards filter_stderr noinst_HEADERS = fdleak.h -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ ansi.stderr.exp ansi.vgtest \ args.stderr.exp args.stdout.exp args.vgtest \ async-sigs.stderr.exp async-sigs.vgtest \ diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index 798bf86e08..314b627166 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -1,7 +1,7 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_cpuid filter_stderr filter_int gen_insn_test.pl +dist_noinst_SCRIPTS = filter_cpuid filter_stderr filter_int gen_insn_test.pl CLEANFILES = $(addsuffix .c,$(INSN_TESTS)) @@ -16,7 +16,7 @@ endif # Explicitly include insn_sse3 even if ! BUILD_SSE3_TESTS, # to avoid packaging screwups if 'make dist' is run on a machine # which failed the BUILD_SSE3_TESTS test in configure.in. -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ bug127521-64.vgtest bug127521-64.stdout.exp bug127521-64.stderr.exp \ bug132813-amd64.vgtest bug132813-amd64.stdout.exp \ bug132813-amd64.stderr.exp \ diff --git a/none/tests/darwin/Makefile.am b/none/tests/darwin/Makefile.am index b4c90bfaff..3d06695ce0 100644 --- a/none/tests/darwin/Makefile.am +++ b/none/tests/darwin/Makefile.am @@ -1,9 +1,9 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr +dist_noinst_SCRIPTS = filter_stderr -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ apple-main-arg.stderr.exp apple-main-arg.vgtest \ rlimit.stderr.exp rlimit.vgtest diff --git a/none/tests/linux/Makefile.am b/none/tests/linux/Makefile.am index 0cafb62b2a..58e3243e1b 100644 --- a/none/tests/linux/Makefile.am +++ b/none/tests/linux/Makefile.am @@ -1,9 +1,9 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr +dist_noinst_SCRIPTS = filter_stderr -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ blockfault.stderr.exp blockfault.vgtest \ mremap.stderr.exp mremap.stderr.exp-glibc27 mremap.stdout.exp \ mremap.vgtest \ diff --git a/none/tests/ppc32/Makefile.am b/none/tests/ppc32/Makefile.am index d964a2acd9..1f564fb57c 100644 --- a/none/tests/ppc32/Makefile.am +++ b/none/tests/ppc32/Makefile.am @@ -1,9 +1,9 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr +dist_noinst_SCRIPTS = filter_stderr -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ bug129390-ppc32.stdout.exp bug129390-ppc32.stderr.exp \ bug129390-ppc32.vgtest \ bug139050-ppc32.stdout.exp bug139050-ppc32.stderr.exp \ diff --git a/none/tests/ppc64/Makefile.am b/none/tests/ppc64/Makefile.am index 1399e3d914..5d8b08d77c 100644 --- a/none/tests/ppc64/Makefile.am +++ b/none/tests/ppc64/Makefile.am @@ -1,9 +1,9 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_stderr +dist_noinst_SCRIPTS = filter_stderr -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ jm-int.stderr.exp jm-int.stdout.exp jm-int.vgtest \ jm-fp.stderr.exp jm-fp.stdout.exp jm-fp.vgtest \ jm-vmx.stderr.exp jm-vmx.stdout.exp jm-vmx.vgtest \ diff --git a/none/tests/x86-linux/Makefile.am b/none/tests/x86-linux/Makefile.am index ea80609cf1..22b15c50f9 100644 --- a/none/tests/x86-linux/Makefile.am +++ b/none/tests/x86-linux/Makefile.am @@ -1,10 +1,10 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = \ +dist_noinst_SCRIPTS = \ filter_stderr -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ seg_override.stderr.exp seg_override.stdout.exp seg_override.vgtest \ sigcontext.stdout.exp sigcontext.stderr.exp sigcontext.vgtest diff --git a/none/tests/x86/Makefile.am b/none/tests/x86/Makefile.am index f405c51eef..693cec0f33 100644 --- a/none/tests/x86/Makefile.am +++ b/none/tests/x86/Makefile.am @@ -1,7 +1,7 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = filter_cpuid filter_stderr gen_insn_test.pl +dist_noinst_SCRIPTS = filter_cpuid filter_stderr gen_insn_test.pl CLEANFILES = $(addsuffix .c,$(INSN_TESTS)) @@ -17,7 +17,7 @@ endif # Explicitly include insn_sse3 even if ! BUILD_SSE3_TESTS, # to avoid packaging screwups if 'make dist' is run on a machine # which failed the BUILD_SSE3_TESTS test in configure.in. -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ badseg.stderr.exp badseg.stdout.exp badseg.vgtest \ bt_everything.stderr.exp bt_everything.stdout.exp bt_everything.vgtest \ bt_literal.stderr.exp bt_literal.stdout.exp bt_literal.vgtest \ diff --git a/perf/Makefile.am b/perf/Makefile.am index 1101ac95cf..6d4eb42403 100644 --- a/perf/Makefile.am +++ b/perf/Makefile.am @@ -1,9 +1,9 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = vg_perf +dist_noinst_SCRIPTS = vg_perf -EXTRA_DIST = $(noinst_SCRIPTS) \ +EXTRA_DIST = \ bigcode1.vgperf \ bigcode2.vgperf \ bz2.vgperf \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 2cf5a82f92..46353e8c7c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ include $(top_srcdir)/Makefile.tool-tests.am -noinst_SCRIPTS = \ +dist_noinst_SCRIPTS = \ filter_addresses \ filter_discards \ filter_libc \ @@ -16,8 +16,6 @@ noinst_HEADERS = \ malloc.h \ sys_mman.h -EXTRA_DIST = $(noinst_SCRIPTS) - check_PROGRAMS = \ arch_test \ os_test \