Skip to content

Commit

Permalink
- Merge with release 3.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
stass committed Oct 23, 2010
2 parents 9f1b3aa + a93bad3 commit 8e0e37f
Show file tree
Hide file tree
Showing 796 changed files with 130,947 additions and 12,612 deletions.
15 changes: 10 additions & 5 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

Julian Seward was the original founder, designer and author of Valgrind,
created the dynamic translation frameworks, wrote Memcheck and 3.3.X
Helgrind, and did lots of other things.
Julian Seward was the original founder, designer and author of
Valgrind, created the dynamic translation frameworks, wrote Memcheck,
the 3.X versions of Helgrind, Ptrcheck, DHAT, and did lots of other
things.

Nicholas Nethercote did the core/tool generalisation, wrote
Cachegrind and Massif, and tons of other stuff.
Expand Down Expand Up @@ -33,8 +34,12 @@ other tweakage.

Bart Van Assche wrote and maintains DRD.

Cerion Armour-Brown worked on PowerPC instruction set support in
the Vex dynamic-translation framework.
Cerion Armour-Brown worked on PowerPC instruction set support in the
Vex dynamic-translation framework. Maynard Johnson improved the
Power6 support.

Kirill Batuzov and Dmitry Zhurikhin did the NEON instruction set
support for ARM. Donna Robinson did the v6 media instruction support.

Donna Robinson created and maintains the very excellent
http://www.valgrind.org.
Expand Down
22 changes: 15 additions & 7 deletions Makefile.all.am
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ AM_CFLAGS_BASE = \
# 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
AM_CFLAGS_PIC = -dynamic -O -g -fno-omit-frame-pointer -fno-strict-aliasing \
-mno-dynamic-no-pic -fpic -fPIC
else
AM_CFLAGS_PIC = -fpic -O -g -fno-omit-frame-pointer -fno-strict-aliasing
endif
Expand All @@ -116,16 +117,16 @@ endif
# 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) \
-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) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/VEX/pub \
-DVGA_@VGCONF_ARCH_SEC@=1 \
-DVGO_@VGCONF_OS@=1 \
Expand Down Expand Up @@ -155,6 +156,11 @@ AM_CFLAGS_X86_FREEBSD = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ \
$(AM_CFLAGS_BASE)
AM_CCASFLAGS_X86_FREEBSD = $(AM_CPPFLAGS_X86_FREEBSD) @FLAG_M32@ -g

AM_FLAG_M3264_ARM_LINUX = @FLAG_M32@
AM_CFLAGS_ARM_LINUX = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ \
$(AM_CFLAGS_BASE) -marm
AM_CCASFLAGS_ARM_LINUX = $(AM_CPPFLAGS_ARM_LINUX) @FLAG_M32@ -marm -g

AM_FLAG_M3264_AMD64_FREEBSD = @FLAG_M64@
AM_CFLAGS_AMD64_FREEBSD = @FLAG_M64@ -fomit-frame-pointer \
@PREFERRED_STACK_BOUNDARY@ $(AM_CFLAGS_BASE)
Expand All @@ -172,8 +178,9 @@ AM_CCASFLAGS_PPC64_AIX5 = $(AM_CPPFLAGS_PPC64_AIX5) \

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
-mmacosx-version-min=10.5 \
-fno-stack-protector -fno-pic -fno-PIC

AM_CCASFLAGS_X86_DARWIN = $(AM_CPPFLAGS_X86_DARWIN) -arch i386 -g

AM_FLAG_M3264_AMD64_DARWIN = -arch x86_64
Expand Down Expand Up @@ -210,6 +217,7 @@ PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
PRELOAD_LDFLAGS_PPC64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
PRELOAD_LDFLAGS_X86_FREEBSD = $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M32@
PRELOAD_LDFLAGS_AMD64_FREEBSD= $(PRELOAD_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@
PRELOAD_LDFLAGS_ARM_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
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
Expand Down
6 changes: 4 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ TOOLS = memcheck \
drd

EXP_TOOLS = exp-ptrcheck \
exp-bbv
exp-bbv \
exp-dhat

# DDD: once all tools work on Darwin, TEST_TOOLS and TEST_EXP_TOOLS can be
# replaced with TOOLS and EXP_TOOLS.
Expand Down Expand Up @@ -49,7 +50,8 @@ SUPP_FILES = \
glibc-2.X-drd.supp \
exp-ptrcheck.supp \
darwin9.supp darwin9-drd.supp \
freebsd.supp
freebsd.supp \
darwin10.supp darwin10-drd.supp
DEFAULT_SUPP_FILES = @DEFAULT_SUPP@

# We include all the base .supp files in the distribution, but not
Expand Down
161 changes: 35 additions & 126 deletions Makefile.tool.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,41 @@ TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ = \
endif


TOOL_LDFLAGS_COMMON_LINUX = -static \
-Wl,-defsym,valt_load_address=@VALT_LOAD_ADDRESS@ \
-nodefaultlibs -nostartfiles -u _start
# -Wl,--build-id=none is needed when linking tools on Linux. Without this
# flag newer ld versions (2.20 and later) create a .note.gnu.build-id at the
# default text segment address, which of course means the resulting executable
# is unusable. So we have to tell ld not to generate that, with --build-id=none.
TOOL_LDFLAGS_COMMON_LINUX = \
-static -nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@
TOOL_LDFLAGS_COMMON_AIX5 = \
-static -Wl,-e_start_valgrind
TOOL_LDFLAGS_COMMON_DARWIN = \
-nodefaultlibs -nostartfiles -Wl,-u,__start -Wl,-e,__start
TOOL_LDFLAGS_COMMON_FREEBSD = -static \
-Wl,-defsym,valt_load_address=@VALT_LOAD_ADDRESS@ \
-nodefaultlibs -nostartfiles -u _start
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
-nodefaultlibs -nostartfiles -u _start @FLAG_NO_BUILD_ID@

TOOL_LDFLAGS_X86_LINUX = \
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ \
-Wl,-T,$(top_builddir)/valt_load_address_x86_linux.lds
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@

TOOL_LDFLAGS_X86_FREEBSD = \
$(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M32@ \
-Wl,-T,$(top_builddir)/valt_load_address_x86_freebsd.lds

TOOL_LDFLAGS_AMD64_LINUX = \
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ \
-Wl,-T,$(top_builddir)/valt_load_address_amd64_linux.lds
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@

TOOL_LDFLAGS_AMD64_FREEBSD = \
$(TOOL_LDFLAGS_COMMON_FREEBSD) @FLAG_M64@ \
-Wl,-T,$(top_builddir)/valt_load_address_amd64_freebsd.lds

TOOL_LDFLAGS_PPC32_LINUX = \
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ \
-Wl,-T,$(top_builddir)/valt_load_address_ppc32_linux.lds
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@

TOOL_LDFLAGS_PPC64_LINUX = \
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ \
-Wl,-T,$(top_builddir)/valt_load_address_ppc64_linux.lds
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@

TOOL_LDFLAGS_ARM_LINUX = \
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@

TOOL_LDFLAGS_PPC32_AIX5 = \
$(TOOL_LDFLAGS_COMMON_AIX5) @FLAG_MAIX32@
Expand All @@ -67,120 +69,19 @@ TOOL_LDFLAGS_PPC64_AIX5 = \
$(TOOL_LDFLAGS_COMMON_AIX5) @FLAG_MAIX64@ -Wl,-bbigtoc

TOOL_LDFLAGS_X86_DARWIN = \
$(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386 \
-Wl,-seg1addr,0xf0080000 \
-Wl,-stack_addr,0xf0080000 -Wl,-stack_size,0x80000 \
-Wl,-pagezero_size,0xf0000000
$(TOOL_LDFLAGS_COMMON_DARWIN) -arch i386

# pagezero can't be unmapped and remapped. Use stack instead.
# GrP fixme no stack guard
TOOL_LDFLAGS_AMD64_DARWIN = \
$(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64 \
-Wl,-seg1addr,0x7fff55000000 \
-Wl,-stack_addr,0x7fff50080000 -Wl,-stack_size,0x7ffe50080000 \
-Wl,-pagezero_size,0x100000000

$(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64

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_X86_FREEBSD
BUILT_SOURCES += $(top_builddir)/valt_load_address_x86_freebsd.lds
CLEANFILES += $(top_builddir)/valt_load_address_x86_freebsd.lds
endif
if VGCONF_PLATFORMS_INCLUDE_AMD64_FREEBSD
BUILT_SOURCES += $(top_builddir)/valt_load_address_amd64_freebsd.lds
CLEANFILES += $(top_builddir)/valt_load_address_amd64_freebsd.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;
# NB for 64-bit darwin. We may want to set -Wl,-pagezero_size to
# something smaller than the default of 4G, so as to facilitate
# loading clients who are also linked thusly (currently m_ume.c
# will fail to load them). Although such setting is probably
# better done in link_tool_exe.c.
#
# 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_x86_freebsd.lds: Makefile
$(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed -E \
-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_freebsd.lds: Makefile
$(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed -E \
-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 $@
# -Wl,-pagezero_size,0x100000000


#----------------------------------------------------------------------------
# vgpreload_<tool>-<platform>.a stuff
Expand All @@ -201,6 +102,9 @@ LIBREPLACEMALLOC_PPC64_LINUX = \
LIBREPLACEMALLOC_X86_FREEBSD = \
$(top_builddir)/coregrind/libreplacemalloc_toolpreload-x86-freebsd.a

LIBREPLACEMALLOC_ARM_LINUX = \
$(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a

LIBREPLACEMALLOC_AMD64_FREEBSD = \
$(top_builddir)/coregrind/libreplacemalloc_toolpreload-amd64-freebsd.a

Expand Down Expand Up @@ -237,6 +141,11 @@ LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX = \
$(LIBREPLACEMALLOC_PPC64_LINUX) \
-Wl,--no-whole-archive

LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
-Wl,--whole-archive \
$(LIBREPLACEMALLOC_ARM_LINUX) \
-Wl,--no-whole-archive

LIBREPLACEMALLOC_LDFLAGS_X86_FREEBSD = \
-Wl,--whole-archive \
$(LIBREPLACEMALLOC_X86_FREEBSD) \
Expand Down
20 changes: 16 additions & 4 deletions Makefile.vex.am
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ noinst_HEADERS = \
priv/guest_arm_defs.h \
priv/host_generic_regs.h \
priv/host_generic_simd64.h \
priv/host_generic_simd128.h \
priv/host_x86_defs.h \
priv/host_amd64_defs.h \
priv/host_ppc_defs.h \
Expand All @@ -51,12 +52,22 @@ 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:
pub/libvex_guest_offsets.h: auxprogs/genoffsets.c \
pub/libvex_basictypes.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
rm -f auxprogs/genoffsets.s
$(CC) $(LIBVEX_CFLAGS) -O -S -o auxprogs/genoffsets.s \
auxprogs/genoffsets.c
$(CC) $(LIBVEX_CFLAGS) \
$(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) \
-O -S -o auxprogs/genoffsets.s \
auxprogs/genoffsets.c
grep xyzzy auxprogs/genoffsets.s | grep define \
| sed "s/xyzzy\\$$//g" | sed "s/xyzzy//g" \
| sed "s/xyzzy\\$$//g" \
| sed "s/xyzzy#//g" \
| sed "s/xyzzy//g" \
> pub/libvex_guest_offsets.h
rm -f auxprogs/genoffsets.s

Expand Down Expand Up @@ -88,6 +99,7 @@ LIBVEX_SOURCES_COMMON = \
priv/guest_arm_toIR.c \
priv/host_generic_regs.c \
priv/host_generic_simd64.c \
priv/host_generic_simd128.c \
priv/host_generic_reg_alloc2.c \
priv/host_x86_defs.c \
priv/host_x86_isel.c \
Expand Down
Loading

0 comments on commit 8e0e37f

Please sign in to comment.