You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
(5) |
2
|
3
|
|
4
(2) |
5
|
6
|
7
(2) |
8
(2) |
9
(6) |
10
(1) |
|
11
(2) |
12
|
13
(3) |
14
|
15
(3) |
16
(1) |
17
|
|
18
(6) |
19
|
20
|
21
(2) |
22
|
23
|
24
|
|
25
|
26
|
27
|
28
(1) |
29
(2) |
30
|
31
|
|
From: Philippe W. <phi...@so...> - 2018-03-18 17:23:02
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=ab773096df7aaaf46e8883af5ed4690f4d4499af commit ab773096df7aaaf46e8883af5ed4690f4d4499af Author: Philippe Waroquiers <phi...@sk...> Date: Sun Mar 11 22:26:08 2018 +0100 Fix 338252 - building valgrind with -flto (link time optimisation) fails * Addition of a new configure option --enable-lto=yes or --enable-lto=no Default value is --enable-lto=no, as the build is significantly slower, so is not appropriate for valgrind development : this should be used only on buildbots and/or by packagers. * Some files containins asm functions have to be compiled without lto: coregrind/m_libcsetjmp.c coregrind/m_main.c If these are compiled with lto, that gives undefined symbols at link time. The files to compile without lto are coregrind/m_libcsetjmp.c coregrind/m_main.c To compile these files with other options, a noinst target lib is defined. The objects of this library are then added to the libcoregrind. * memcheck/mc_main.c : move the handwritten asm helpers to mc_main_asm.c. This avoids undefined symbols on some toolchains. Due to this, the preprocessor symbols that activate the fast or asm memcheck helpers are moved to mc_include.h Platforms with handwritten helpers will also have the memcheck primary map defined non static. * In VEX, auxprogs/genoffsets.c also has to be compiled without lto, as the asm produced by the compiler is post-processed to produce pub/libvex_guest_offsets.h. lto not producing asm means the generation fails if we used -flto to compile this file. * all the various Makefile*am are modified to use LTO_CFLAGS for (most) targets. LTO_CFLAGS is empty when --enable-lto=no, otherwise is set to the flags needed for gcc. If --enable-lto=no, LTO_AR and LTO_RANLIB are the standard AR and RANLIB, otherwise they are the lto capable versions (gcc-ar and gcc-ranlib). * This has been tested on: debian 9.4/gcc 6.3.0/amd64+x86 rhel 7.4/gcc 6.4.0/amd64 ubuntu 17.10/gcc 7.2.0/amd64+x86 fedora26/gcc 7.3.1/s390x No regressions on the above. Diff: --- Makefile.vex.am | 11 ++- NEWS | 8 +- README_PACKAGERS | 5 +- cachegrind/Makefile.am | 4 +- callgrind/Makefile.am | 4 +- configure.ac | 63 +++++++++++++++ coregrind/Makefile.am | 48 +++++++++-- coregrind/m_libcsetjmp.c | 7 +- drd/Makefile.am | 4 +- exp-bbv/Makefile.am | 4 +- exp-dhat/Makefile.am | 4 +- exp-sgcheck/Makefile.am | 4 +- helgrind/Makefile.am | 4 +- lackey/Makefile.am | 4 +- massif/Makefile.am | 4 +- memcheck/Makefile.am | 6 +- memcheck/mc_include.h | 6 ++ memcheck/mc_main.c | 161 +++++-------------------------------- memcheck/mc_main_asm.c | 204 +++++++++++++++++++++++++++++++++++++++++++++++ none/Makefile.am | 4 +- 20 files changed, 384 insertions(+), 175 deletions(-) diff --git a/Makefile.vex.am b/Makefile.vex.am index 4ad5ffa..64f8373 100644 --- a/Makefile.vex.am +++ b/Makefile.vex.am @@ -68,6 +68,10 @@ else CFLAGS_FOR_GENOFFSETS = $(CFLAGS) endif +# for VEX building, use the LTO versions, in case they differ from non lto versions +AR = ${LTO_AR} +RANLIB = ${LTO_RANLIB} + # 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. @@ -86,7 +90,7 @@ pub/libvex_guest_offsets.h: auxprogs/genoffsets.c \ rm -f auxprogs/genoffsets.s $(mkdir_p) auxprogs pub $(CC) $(CFLAGS_FOR_GENOFFSETS) \ - $(LIBVEX_CFLAGS) \ + $(LIBVEX_CFLAGS_NO_LTO) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) \ -O -S -o auxprogs/genoffsets.s \ $(srcdir)/auxprogs/genoffsets.c @@ -162,10 +166,13 @@ LIBVEX_SOURCES_COMMON = \ LIBVEXMULTIARCH_SOURCES = priv/multiarch_main_main.c -LIBVEX_CFLAGS = \ +LIBVEX_CFLAGS_NO_LTO = \ -Wbad-function-cast \ -fstrict-aliasing +LIBVEX_CFLAGS = ${LTO_CFLAGS} \ + ${LIBVEX_CFLAGS_NO_LTO} + 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 diff --git a/NEWS b/NEWS index 3d04b75..f762530 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,11 @@ support for X86/macOS 10.13, AMD64/macOS 10.13. * ==================== OTHER CHANGES ==================== +* A new configure option --enable-lto=yes allows to build Valgrind + with link time optimisation. If the toolchain supports it, + this produces a smaller/faster Valgrind (up to 10%). + Note that if you are doing some Valgrind development, --enable-lto=yes + significantly slows down the build. * ==================== FIXED BUGS ==================== @@ -52,6 +57,7 @@ where XXXXXX is the bug number as listed below. 79362 Debug info is lost for .so files when they are dlclose'd 208052 strlcpy error when n = 0 255603 exp-sgcheck Assertion '!already_present' failed +338252 - building valgrind with -flto (link time optimisation) fails 376257 helgrind history full speed up using a cached stack 379373 Fix syscall param msg->desc.port.name points to uninitialised byte(s) on macOS 10.12 @@ -91,7 +97,7 @@ where XXXXXX is the bug number as listed below. 387712 s390x cgijnl reports Conditional jump depends on uninitialised value 387773 .gnu_debugaltlink paths resolve relative to .debug file, not symlink 388862 Add replacements for wmemchr and wcsnlen on Linux -389373 exp-sgcheck the 'impossible' happened as st_LoadG is not instrumented +389373 exp-sgcheck the 'impossible' happened as Ist_LoadG is not instrumented 389065 valgrind meets gcc flag -Wlogical-op 390723 make xtree dump files world wide readable, similar to log files diff --git a/README_PACKAGERS b/README_PACKAGERS index 28ee8ba..e86c153 100644 --- a/README_PACKAGERS +++ b/README_PACKAGERS @@ -5,6 +5,9 @@ building binary distributions of Valgrind. Thanks for taking the time and effort to make a binary distribution of Valgrind. The following notes may save you some trouble. +-- If your toolchain (compiler, linker) support lto, using the configure + option --enable-lto=yes will produce a smaller/faster valgrind + (up to 10%). -- Do not ship your Linux distro with a completely stripped /lib/ld.so. At least leave the debugging symbol names on -- line @@ -28,7 +31,7 @@ Valgrind. The following notes may save you some trouble. not any debuginfo or extra symbols for any other libraries. --- (Unfortunate but true) When you configure to build with the +-- (Unfortunate but true) When you configure to build with the --prefix=/foo/bar/xyzzy option, the prefix /foo/bar/xyzzy gets baked into valgrind. The consequence is that you _must_ install valgrind at the location specified in the prefix. If you don't, diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am index a587d24..f8447a1 100644 --- a/cachegrind/Makefile.am +++ b/cachegrind/Makefile.am @@ -53,7 +53,7 @@ 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 = \ +cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) cachegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -73,7 +73,7 @@ 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 = \ +cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS)\ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) cachegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) diff --git a/callgrind/Makefile.am b/callgrind/Makefile.am index 56e8a04..7cecb44 100644 --- a/callgrind/Makefile.am +++ b/callgrind/Makefile.am @@ -53,7 +53,7 @@ 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 = \ +callgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(CALLGRIND_CFLAGS_COMMON) callgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -73,7 +73,7 @@ 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 = \ +callgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(CALLGRIND_CFLAGS_COMMON) callgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) diff --git a/configure.ac b/configure.ac index 3988d62..0370498 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,12 @@ AC_PROG_CXX # AC_SUBST([OBJCFLAGS]) # ]) AC_PROG_RANLIB +# Set LTO_RANLIB variable to an lto enabled ranlib +if test "x$LTO_RANLIB" = "x"; then + AC_PATH_PROGS([LTO_RANLIB], [gcc-ranlib]) +fi +AC_ARG_VAR([LTO_RANLIB],[Library indexer command for link time optimisation]) + # provide a very basic definition for AC_PROG_SED if it's not provided by # autoconf (as e.g. in autoconf 2.59). m4_ifndef([AC_PROG_SED], @@ -60,6 +66,13 @@ if test "x$AR" = "x"; then fi AC_ARG_VAR([AR],[Archiver command]) +# same for LTO_AR variable for lto enabled archiver +if test "x$LTO_AR" = "x"; then + AC_PATH_PROGS([LTO_AR], [gcc-ar]) +fi +AC_ARG_VAR([LTO_AR],[Archiver command for link time optimisation]) + + # Check for the compiler support if test "${GCC}" != "yes" ; then AC_MSG_ERROR([Valgrind relies on GCC to be compiled]) @@ -1945,6 +1958,55 @@ AM_CONDITIONAL(HAS_MLONG_DOUBLE_128, test x$ac_compiler_supports_mlong_double_12 FLAG_MLONG_DOUBLE_128="-mlong-double-128" AC_SUBST(FLAG_MLONG_DOUBLE_128) +# does this toolchain support lto ? +# Not checked for if --enable-lto=no was given, or if LTO_AR or LTO_RANLIG +# are not defined +# If not enable-lto=* arg is provided, default to no, as lto builds are +# a lot slower, and so not appropriate for Valgrind developments. +# --enable-lto=yes should be used by distro packagers. +AC_CACHE_CHECK([for using the link time optimisation], vg_cv_lto, + [AC_ARG_ENABLE(lto, + [ --enable-lto enables building with link time optimisation], + [vg_cv_lto=$enableval], + [vg_cv_lto=no])]) + +if test "x${vg_cv_lto}" != "xno" -a "x${LTO_AR}" != "x" -a "x${LTO_RANLIB}" != "x"; then +AC_MSG_CHECKING([if toolchain accepts lto]) +safe_CFLAGS=$CFLAGS +TEST_LTO_CFLAGS="-flto -flto-partition=one -fuse-linker-plugin" +# Note : using 'one' partition is giving a slightly smaller/faster memcheck +# and ld/lto-trans1 still needs a reasonable memory (about 0.5GB) when linking. +CFLAGS="$TEST_LTO_CFLAGS -Werror" + +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ + extern void somefun(void); + somefun(); + return 0; +]])], [ +LTO_CFLAGS=$TEST_LTO_CFLAGS +AC_MSG_RESULT([yes]) +], [ +LTO_CFLAGS="" +AC_MSG_RESULT([no]) +]) +CFLAGS=$safe_CFLAGS +fi + +AC_SUBST(LTO_CFLAGS) + +# if we could not compile with lto args, or lto was disabled, +# then set LTO_AR/LTO_RANLIB to the non lto values +# define in config.h ENABLE_LTO (not needed by the code currently, but +# this guarantees we recompile everything if we re-configure and rebuild +# in a build dir previously build with another value of --enable-lto +if test "x${LTO_CFLAGS}" = "x"; then + LTO_AR=${AR} + LTO_RANLIB=${RANLIB} + vg_cv_lto=no +else + vg_cv_lto=yes + AC_DEFINE([ENABLE_LTO], 1, [configured to build with lto link time optimisation]) +fi # Convenience function to check whether GCC supports a particular # warning option. Takes two arguments, @@ -4585,6 +4647,7 @@ cat<<EOF Primary build arch: ${VGCONF_ARCH_PRI} Secondary build arch: ${VGCONF_ARCH_SEC} Build OS: ${VGCONF_OS} + Link Time Optimisation: ${vg_cv_lto} Primary build target: ${VGCONF_PLATFORM_PRI_CAPS} Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS} Platform variant: ${VGCONF_PLATVARIANT} diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index e55ab9a..4acacae 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -50,8 +50,12 @@ valgrind_SOURCES = \ m_debuglog.c endif +# for valgrind coregrind building, use the LTO versions, in case they differ from non lto versions +AR = ${LTO_AR} +RANLIB = ${LTO_RANLIB} + valgrind_CPPFLAGS = $(AM_CPPFLAGS_PRI) -valgrind_CFLAGS = $(AM_CFLAGS_PRI) +valgrind_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) valgrind_CCASFLAGS = $(AM_CCASFLAGS_PRI) valgrind_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@ # If there is no secondary platform, and the platforms include x86-darwin, @@ -90,7 +94,7 @@ vgdb_SOURCES += vgdb-invoker-solaris.c endif vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI) -vgdb_CFLAGS = $(AM_CFLAGS_PRI) +vgdb_CFLAGS = $(AM_CFLAGS_PRI) $(LTO_CFLAGS) vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI) vgdb_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@ if VGCONF_PLATVARIANT_IS_ANDROID @@ -308,10 +312,8 @@ COREGRIND_SOURCES_COMMON = \ m_libcfile.c \ m_libcprint.c \ m_libcproc.c \ - m_libcsetjmp.c \ m_libcsignal.c \ m_machine.c \ - m_main.c \ m_mallocfree.c \ m_options.c \ m_oset.c \ @@ -461,13 +463,43 @@ COREGRIND_SOURCES_COMMON = \ m_ume/main.c \ m_ume/script.c +# The below files cannot be compiled with lto, otherwise that gives +# undefined symbols at link time. So, define a noinst library to +# build the needed .o with specific flags. +# These objects are added to the libcoregrind library. +NOLTO_COREGRIND_SOURCES_COMMON = \ + m_libcsetjmp.c \ + m_main.c +noinst_LIBRARIES = libnolto_coregrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a +libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \ + $(NOLTO_COREGRIND_SOURCES_COMMON) +libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CCASFLAGS = \ + $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) + +if VGCONF_HAVE_PLATFORM_SEC +noinst_LIBRARIES += libnolto_coregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a +libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \ + $(NOLTO_COREGRIND_SOURCES_COMMON) +libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \ + $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \ + $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CCASFLAGS = \ + $(AM_CCASFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) +endif + + 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 = \ +libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CCASFLAGS = \ $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) @@ -477,6 +509,8 @@ libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES += \ libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS += \ -DENABLE_LINUX_TICKET_LOCK endif +libcoregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_LIBADD = \ + $(libnolto_coregrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_OBJECTS) if VGCONF_HAVE_PLATFORM_SEC libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \ @@ -485,7 +519,7 @@ 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 = \ +libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CCASFLAGS = \ $(AM_CCASFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) @@ -495,6 +529,8 @@ libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES += \ libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS += \ -DENABLE_LINUX_TICKET_LOCK endif +libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_LIBADD = \ + $(libnolto_coregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_OBJECTS) endif #---------------------------------------------------------------------------- diff --git a/coregrind/m_libcsetjmp.c b/coregrind/m_libcsetjmp.c index 68c101e..c731806 100644 --- a/coregrind/m_libcsetjmp.c +++ b/coregrind/m_libcsetjmp.c @@ -2,7 +2,7 @@ /*--------------------------------------------------------------------*/ /*--- A minimal setjmp/longjmp implementation. m_libcsetjmp.c ---*/ /*--------------------------------------------------------------------*/ - + /* This file is part of Valgrind, a dynamic binary instrumentation framework. @@ -29,11 +29,13 @@ /* Contributed by Julian Seward <js...@ac...> */ +/* This file must be compiled without link time optimisation, as otherwise + the asm functions below become undefined references at link time for + unclear reasons. */ #include "pub_core_basics.h" #include "pub_core_libcsetjmp.h" /* self */ - /* See include/pub_tool_libcsetjmp.h for background and rationale. */ /* The alternative implementations are for ppc{32,64}-linux and @@ -689,7 +691,6 @@ __asm__( ".previous \n\t" ); #endif /* VGP_mips64_linux */ - /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/drd/Makefile.am b/drd/Makefile.am index 9ba4c58..93e2507 100644 --- a/drd/Makefile.am +++ b/drd/Makefile.am @@ -73,7 +73,7 @@ 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 = \ +drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(DRD_CFLAGS) drd_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -93,7 +93,7 @@ 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 = \ +drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(DRD_CFLAGS) drd_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) diff --git a/exp-bbv/Makefile.am b/exp-bbv/Makefile.am index 78d9e53..8cb5c30 100644 --- a/exp-bbv/Makefile.am +++ b/exp-bbv/Makefile.am @@ -17,7 +17,7 @@ exp_bbv_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = \ $(BBV_SOURCES_COMMON) exp_bbv_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -exp_bbv_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ +exp_bbv_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) exp_bbv_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -37,7 +37,7 @@ exp_bbv_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = \ $(BBV_SOURCES_COMMON) exp_bbv_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -exp_bbv_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ +exp_bbv_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) exp_bbv_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) diff --git a/exp-dhat/Makefile.am b/exp-dhat/Makefile.am index 647b72b..b745298 100644 --- a/exp-dhat/Makefile.am +++ b/exp-dhat/Makefile.am @@ -25,7 +25,7 @@ exp_dhat_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = \ $(EXP_DHAT_SOURCES_COMMON) exp_dhat_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -exp_dhat_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ +exp_dhat_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) exp_dhat_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -45,7 +45,7 @@ exp_dhat_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = \ $(EXP_DHAT_SOURCES_COMMON) exp_dhat_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -exp_dhat_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ +exp_dhat_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) exp_dhat_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) diff --git a/exp-sgcheck/Makefile.am b/exp-sgcheck/Makefile.am index 211a5ff..8927ff6 100644 --- a/exp-sgcheck/Makefile.am +++ b/exp-sgcheck/Makefile.am @@ -30,7 +30,7 @@ exp_sgcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = \ $(EXP_PTRCHECK_SOURCES_COMMON) exp_sgcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \ $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -exp_sgcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = \ +exp_sgcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) exp_sgcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -50,7 +50,7 @@ exp_sgcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = \ $(EXP_PTRCHECK_SOURCES_COMMON) exp_sgcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \ $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -exp_sgcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = \ +exp_sgcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) exp_sgcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) diff --git a/helgrind/Makefile.am b/helgrind/Makefile.am index b6f1b89..6865ef2 100644 --- a/helgrind/Makefile.am +++ b/helgrind/Makefile.am @@ -41,7 +41,7 @@ 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 = \ +helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -O2 helgrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -61,7 +61,7 @@ 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 = \ +helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -O2 helgrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) diff --git a/lackey/Makefile.am b/lackey/Makefile.am index 39ada21..a630232 100644 --- a/lackey/Makefile.am +++ b/lackey/Makefile.am @@ -17,7 +17,7 @@ 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 = \ +lackey_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) lackey_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -37,7 +37,7 @@ 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 = \ +lackey_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) lackey_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) diff --git a/massif/Makefile.am b/massif/Makefile.am index 2933403..f631831 100644 --- a/massif/Makefile.am +++ b/massif/Makefile.am @@ -25,7 +25,7 @@ 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 = \ +massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) massif_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -45,7 +45,7 @@ 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 = \ +massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) massif_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) diff --git a/memcheck/Makefile.am b/memcheck/Makefile.am index 721cb21..4a9512d 100644 --- a/memcheck/Makefile.am +++ b/memcheck/Makefile.am @@ -24,7 +24,7 @@ endif MEMCHECK_SOURCES_COMMON = \ mc_leakcheck.c \ mc_malloc_wrappers.c \ - mc_main.c \ + mc_main.c mc_main_asm.c \ mc_translate.c \ mc_machine.c \ mc_errors.c @@ -33,7 +33,7 @@ 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 = \ +memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -O2 memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -53,7 +53,7 @@ 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 = \ +memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -O2 memcheck_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) diff --git a/memcheck/mc_include.h b/memcheck/mc_include.h index 765634b..7b4c555 100644 --- a/memcheck/mc_include.h +++ b/memcheck/mc_include.h @@ -372,6 +372,12 @@ extern ULong MC_(event_ctr)[MCPE_LAST]; #define V_BITS64_DEFINED 0ULL #define V_BITS64_UNDEFINED 0xFFFFFFFFFFFFFFFFULL +/* Set to 1 to enable handwritten assembly helpers on targets for + which it is supported. */ +#define ENABLE_ASSEMBLY_HELPERS 1 + +/* Comment the below to disable the fast case LOADV */ +#define PERF_FAST_LOADV 1 /*------------------------------------------------------------*/ /*--- Leak checking ---*/ diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 834f597..6908942 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -54,11 +54,6 @@ #include "mc_include.h" #include "memcheck.h" /* for client requests */ - -/* Set to 1 to enable handwritten assembly helpers on targets for - which it is supported. */ -#define ENABLE_ASSEMBLY_HELPERS 1 - /* Set to 1 to do a little more sanity checking */ #define VG_DEBUG_MEMORY 0 @@ -74,7 +69,7 @@ static void ocache_sarp_Clear_Origins ( Addr, UWord ); /* fwds */ // Comment these out to disable the fast cases (don't just set them to zero). -#define PERF_FAST_LOADV 1 +/* PERF_FAST_LOADV is in mc_include.h */ #define PERF_FAST_STOREV 1 #define PERF_FAST_SARP 1 @@ -374,7 +369,17 @@ static void update_SM_counts(SecMap* oldSM, SecMap* newSM) space, addresses 0 .. (N_PRIMARY_MAP << 16)-1. The rest of it is handled using the auxiliary primary map. */ -static SecMap* primary_map[N_PRIMARY_MAP]; +#if ENABLE_ASSEMBLY_HELPERS && defined(PERF_FAST_LOADV) \ + && (defined(VGP_arm_linux) \ + || defined(VGP_x86_linux) || defined(VGP_x86_solaris)) +/* mc_main_asm.c needs visibility on a few things declared in this file. + MC_MAIN_STATIC allows to define them static if ok, i.e. on + platforms that are not using hand-coded asm statements. */ +#define MC_MAIN_STATIC +#else +#define MC_MAIN_STATIC static +#endif +MC_MAIN_STATIC SecMap* primary_map[N_PRIMARY_MAP]; /* An entry in the auxiliary primary map. base must be a 64k-aligned @@ -1364,8 +1369,13 @@ void mc_LOADV_128_or_256_slow ( /*OUT*/ULong* res, MC_(record_address_error)( VG_(get_running_tid)(), a, szB, False ); } +MC_MAIN_STATIC +__attribute__((noinline)) +__attribute__((used)) +VG_REGPARM(3) +ULong mc_LOADVn_slow ( Addr a, SizeT nBits, Bool bigendian ); -static +MC_MAIN_STATIC __attribute__((noinline)) __attribute__((used)) VG_REGPARM(3) /* make sure we're using a fixed calling convention, since @@ -4861,78 +4871,11 @@ VG_REGPARM(1) ULong MC_(helperc_LOADV64be) ( Addr a ) // Non-generic assembly for arm32-linux #if ENABLE_ASSEMBLY_HELPERS && defined(PERF_FAST_LOADV) \ && defined(VGP_arm_linux) -__asm__( /* Derived from the 32 bit assembly helper */ -".text \n" -".align 2 \n" -".global vgMemCheck_helperc_LOADV64le \n" -".type vgMemCheck_helperc_LOADV64le, %function \n" -"vgMemCheck_helperc_LOADV64le: \n" -" tst r0, #7 \n" -" movw r3, #:lower16:primary_map \n" -" bne .LLV64LEc4 \n" // if misaligned -" lsr r2, r0, #16 \n" -" movt r3, #:upper16:primary_map \n" -" ldr r2, [r3, r2, lsl #2] \n" -" uxth r1, r0 \n" // r1 is 0-(16)-0 X-(13)-X 000 -" movw r3, #0xAAAA \n" -" lsr r1, r1, #2 \n" // r1 is 0-(16)-0 00 X-(13)-X 0 -" ldrh r1, [r2, r1] \n" -" cmp r1, r3 \n" // 0xAAAA == VA_BITS16_DEFINED -" bne .LLV64LEc0 \n" // if !all_defined -" mov r1, #0x0 \n" // 0x0 == V_BITS32_DEFINED -" mov r0, #0x0 \n" // 0x0 == V_BITS32_DEFINED -" bx lr \n" -".LLV64LEc0: \n" -" movw r3, #0x5555 \n" -" cmp r1, r3 \n" // 0x5555 == VA_BITS16_UNDEFINED -" bne .LLV64LEc4 \n" // if !all_undefined -" mov r1, #0xFFFFFFFF \n" // 0xFFFFFFFF == V_BITS32_UNDEFINED -" mov r0, #0xFFFFFFFF \n" // 0xFFFFFFFF == V_BITS32_UNDEFINED -" bx lr \n" -".LLV64LEc4: \n" -" push {r4, lr} \n" -" mov r2, #0 \n" -" mov r1, #64 \n" -" bl mc_LOADVn_slow \n" -" pop {r4, pc} \n" -".size vgMemCheck_helperc_LOADV64le, .-vgMemCheck_helperc_LOADV64le \n" -".previous\n" -); +/* See mc_main_asm.c */ #elif ENABLE_ASSEMBLY_HELPERS && defined(PERF_FAST_LOADV) \ && (defined(VGP_x86_linux) || defined(VGP_x86_solaris)) -__asm__( -".text\n" -".align 16\n" -".global vgMemCheck_helperc_LOADV64le\n" -".type vgMemCheck_helperc_LOADV64le, @function\n" -"vgMemCheck_helperc_LOADV64le:\n" -" test $0x7, %eax\n" -" jne .LLV64LE2\n" /* jump if not aligned */ -" mov %eax, %ecx\n" -" movzwl %ax, %edx\n" -" shr $0x10, %ecx\n" -" mov primary_map(,%ecx,4), %ecx\n" -" shr $0x3, %edx\n" -" movzwl (%ecx,%edx,2), %edx\n" -" cmp $0xaaaa, %edx\n" -" jne .LLV64LE1\n" /* jump if not all defined */ -" xor %eax, %eax\n" /* return 0 in edx:eax */ -" xor %edx, %edx\n" -" ret\n" -".LLV64LE1:\n" -" cmp $0x5555, %edx\n" -" jne .LLV64LE2\n" /* jump if not all undefined */ -" or $0xffffffff, %eax\n" /* else return all bits set in edx:eax */ -" or $0xffffffff, %edx\n" -" ret\n" -".LLV64LE2:\n" -" xor %ecx, %ecx\n" /* tail call to mc_LOADVn_slow(a, 64, 0) */ -" mov $64, %edx\n" -" jmp mc_LOADVn_slow\n" -".size vgMemCheck_helperc_LOADV64le, .-vgMemCheck_helperc_LOADV64le\n" -".previous\n" -); +/* See mc_main_asm.c */ #else // Generic for all platforms except {arm32,x86}-linux and x86-solaris @@ -5064,71 +5007,11 @@ VG_REGPARM(1) UWord MC_(helperc_LOADV32be) ( Addr a ) // Non-generic assembly for arm32-linux #if ENABLE_ASSEMBLY_HELPERS && defined(PERF_FAST_LOADV) \ && defined(VGP_arm_linux) -__asm__( /* Derived from NCode template */ -".text \n" -".align 2 \n" -".global vgMemCheck_helperc_LOADV32le \n" -".type vgMemCheck_helperc_LOADV32le, %function \n" -"vgMemCheck_helperc_LOADV32le: \n" -" tst r0, #3 \n" // 1 -" movw r3, #:lower16:primary_map \n" // 1 -" bne .LLV32LEc4 \n" // 2 if misaligned -" lsr r2, r0, #16 \n" // 3 -" movt r3, #:upper16:primary_map \n" // 3 -" ldr r2, [r3, r2, lsl #2] \n" // 4 -" uxth r1, r0 \n" // 4 -" ldrb r1, [r2, r1, lsr #2] \n" // 5 -" cmp r1, #0xAA \n" // 6 0xAA == VA_BITS8_DEFINED -" bne .LLV32LEc0 \n" // 7 if !all_defined -" mov r0, #0x0 \n" // 8 0x0 == V_BITS32_DEFINED -" bx lr \n" // 9 -".LLV32LEc0: \n" -" cmp r1, #0x55 \n" // 0x55 == VA_BITS8_UNDEFINED -" bne .LLV32LEc4 \n" // if !all_undefined -" mov r0, #0xFFFFFFFF \n" // 0xFFFFFFFF == V_BITS32_UNDEFINED -" bx lr \n" -".LLV32LEc4: \n" -" push {r4, lr} \n" -" mov r2, #0 \n" -" mov r1, #32 \n" -" bl mc_LOADVn_slow \n" -" pop {r4, pc} \n" -".size vgMemCheck_helperc_LOADV32le, .-vgMemCheck_helperc_LOADV32le \n" -".previous\n" -); +/* See mc_main_asm.c */ #elif ENABLE_ASSEMBLY_HELPERS && defined(PERF_FAST_LOADV) \ && (defined(VGP_x86_linux) || defined(VGP_x86_solaris)) -__asm__( -".text\n" -".align 16\n" -".global vgMemCheck_helperc_LOADV32le\n" -".type vgMemCheck_helperc_LOADV32le, @function\n" -"vgMemCheck_helperc_LOADV32le:\n" -" test $0x3, %eax\n" -" jnz .LLV32LE2\n" /* jump if misaligned */ -" mov %eax, %edx\n" -" shr $16, %edx\n" -" mov primary_map(,%edx,4), %ecx\n" -" movzwl %ax, %edx\n" -" shr $2, %edx\n" -" movzbl (%ecx,%edx,1), %edx\n" -" cmp $0xaa, %edx\n" /* compare to VA_BITS8_DEFINED */ -" jne .LLV32LE1\n" /* jump if not completely defined */ -" xor %eax, %eax\n" /* else return V_BITS32_DEFINED */ -" ret\n" -".LLV32LE1:\n" -" cmp $0x55, %edx\n" /* compare to VA_BITS8_UNDEFINED */ -" jne .LLV32LE2\n" /* jump if not completely undefined */ -" or $0xffffffff, %eax\n" /* else return V_BITS32_UNDEFINED */ -" ret\n" -".LLV32LE2:\n" -" xor %ecx, %ecx\n" /* tail call mc_LOADVn_slow(a, 32, 0) */ -" mov $32, %edx\n" -" jmp mc_LOADVn_slow\n" -".size vgMemCheck_helperc_LOADV32le, .-vgMemCheck_helperc_LOADV32le\n" -".previous\n" -); +/* See mc_main_asm.c */ #else // Generic for all platforms except {arm32,x86}-linux and x86-solaris diff --git a/memcheck/mc_main_asm.c b/memcheck/mc_main_asm.c new file mode 100644 index 0000000..a853ccd --- /dev/null +++ b/memcheck/mc_main_asm.c @@ -0,0 +1,204 @@ +/* -*- mode: C; c-basic-offset: 3; -*- */ + +/*--------------------------------------------------------------------*/ +/*--- MemCheck: some non-generic asm implementations of mc_main.c */ +/*--- functions ---*/ +/*--- mc_main_asm.c ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of MemCheck, a heavyweight Valgrind tool for + detecting memory errors. + + Copyright (C) 2000-2018 Julian Seward + js...@ac... + + 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. +*/ + +/* Having these in mc_main.c gives undefined references at link time, + when compiling with lto. Having them in a separate file solves this. + Also, for some toolchain, we might maybe need to disable lto. */ + +// A bunch of include only needed for mc_include.h +#include "pub_tool_basics.h" +#include "pub_tool_poolalloc.h" +#include "pub_tool_hashtable.h" +#include "pub_tool_tooliface.h" + +#include "mc_include.h" + +// Non-generic assembly for arm32-linux +#if ENABLE_ASSEMBLY_HELPERS && defined(PERF_FAST_LOADV) \ + && defined(VGP_arm_linux) +__asm__( /* Derived from the 32 bit assembly helper */ +".text \n" +".align 2 \n" +".global vgMemCheck_helperc_LOADV64le \n" +".type vgMemCheck_helperc_LOADV64le, %function \n" +"vgMemCheck_helperc_LOADV64le: \n" +" tst r0, #7 \n" +" movw r3, #:lower16:primary_map \n" +" bne .LLV64LEc4 \n" // if misaligned +" lsr r2, r0, #16 \n" +" movt r3, #:upper16:primary_map \n" +" ldr r2, [r3, r2, lsl #2] \n" +" uxth r1, r0 \n" // r1 is 0-(16)-0 X-(13)-X 000 +" movw r3, #0xAAAA \n" +" lsr r1, r1, #2 \n" // r1 is 0-(16)-0 00 X-(13)-X 0 +" ldrh r1, [r2, r1] \n" +" cmp r1, r3 \n" // 0xAAAA == VA_BITS16_DEFINED +" bne .LLV64LEc0 \n" // if !all_defined +" mov r1, #0x0 \n" // 0x0 == V_BITS32_DEFINED +" mov r0, #0x0 \n" // 0x0 == V_BITS32_DEFINED +" bx lr \n" +".LLV64LEc0: \n" +" movw r3, #0x5555 \n" +" cmp r1, r3 \n" // 0x5555 == VA_BITS16_UNDEFINED +" bne .LLV64LEc4 \n" // if !all_undefined +" mov r1, #0xFFFFFFFF \n" // 0xFFFFFFFF == V_BITS32_UNDEFINED +" mov r0, #0xFFFFFFFF \n" // 0xFFFFFFFF == V_BITS32_UNDEFINED +" bx lr \n" +".LLV64LEc4: \n" +" push {r4, lr} \n" +" mov r2, #0 \n" +" mov r1, #64 \n" +" bl mc_LOADVn_slow \n" +" pop {r4, pc} \n" +".size vgMemCheck_helperc_LOADV64le, .-vgMemCheck_helperc_LOADV64le \n" +".previous\n" +); + +#elif ENABLE_ASSEMBLY_HELPERS && defined(PERF_FAST_LOADV) \ + && (defined(VGP_x86_linux) || defined(VGP_x86_solaris)) +__asm__( +".text\n" +".align 16\n" +".global vgMemCheck_helperc_LOADV64le\n" +".type vgMemCheck_helperc_LOADV64le, @function\n" +"vgMemCheck_helperc_LOADV64le:\n" +" test $0x7, %eax\n" +" jne .LLV64LE2\n" /* jump if not aligned */ +" mov %eax, %ecx\n" +" movzwl %ax, %edx\n" +" shr $0x10, %ecx\n" +" mov primary_map(,%ecx,4), %ecx\n" +" shr $0x3, %edx\n" +" movzwl (%ecx,%edx,2), %edx\n" +" cmp $0xaaaa, %edx\n" +" jne .LLV64LE1\n" /* jump if not all defined */ +" xor %eax, %eax\n" /* return 0 in edx:eax */ +" xor %edx, %edx\n" +" ret\n" +".LLV64LE1:\n" +" cmp $0x5555, %edx\n" +" jne .LLV64LE2\n" /* jump if not all undefined */ +" or $0xffffffff, %eax\n" /* else return all bits set in edx:eax */ +" or $0xffffffff, %edx\n" +" ret\n" +".LLV64LE2:\n" +" xor %ecx, %ecx\n" /* tail call to mc_LOADVn_slow(a, 64, 0) */ +" mov $64, %edx\n" +" jmp mc_LOADVn_slow\n" +".size vgMemCheck_helperc_LOADV64le, .-vgMemCheck_helperc_LOADV64le\n" +".previous\n" +); + +#else +// Generic for all platforms except {arm32,x86}-linux and x86-solaris +// is in mc_main.c +#endif + + +// Non-generic assembly for arm32-linux +#if ENABLE_ASSEMBLY_HELPERS && defined(PERF_FAST_LOADV) \ + && defined(VGP_arm_linux) +__asm__( /* Derived from NCode template */ +".text \n" +".align 2 \n" +".global vgMemCheck_helperc_LOADV32le \n" +".type vgMemCheck_helperc_LOADV32le, %function \n" +"vgMemCheck_helperc_LOADV32le: \n" +" tst r0, #3 \n" // 1 +" movw r3, #:lower16:primary_map \n" // 1 +" bne .LLV32LEc4 \n" // 2 if misaligned +" lsr r2, r0, #16 \n" // 3 +" movt r3, #:upper16:primary_map \n" // 3 +" ldr r2, [r3, r2, lsl #2] \n" // 4 +" uxth r1, r0 \n" // 4 +" ldrb r1, [r2, r1, lsr #2] \n" // 5 +" cmp r1, #0xAA \n" // 6 0xAA == VA_BITS8_DEFINED +" bne .LLV32LEc0 \n" // 7 if !all_defined +" mov r0, #0x0 \n" // 8 0x0 == V_BITS32_DEFINED +" bx lr \n" // 9 +".LLV32LEc0: \n" +" cmp r1, #0x55 \n" // 0x55 == VA_BITS8_UNDEFINED +" bne .LLV32LEc4 \n" // if !all_undefined +" mov r0, #0xFFFFFFFF \n" // 0xFFFFFFFF == V_BITS32_UNDEFINED +" bx lr \n" +".LLV32LEc4: \n" +" push {r4, lr} \n" +" mov r2, #0 \n" +" mov r1, #32 \n" +" bl mc_LOADVn_slow \n" +" pop {r4, pc} \n" +".size vgMemCheck_helperc_LOADV32le, .-vgMemCheck_helperc_LOADV32le \n" +".previous\n" +); + +#elif ENABLE_ASSEMBLY_HELPERS && defined(PERF_FAST_LOADV) \ + && (defined(VGP_x86_linux) || defined(VGP_x86_solaris)) +__asm__( +".text\n" +".align 16\n" +".global vgMemCheck_helperc_LOADV32le\n" +".type vgMemCheck_helperc_LOADV32le, @function\n" +"vgMemCheck_helperc_LOADV32le:\n" +" test $0x3, %eax\n" +" jnz .LLV32LE2\n" /* jump if misaligned */ +" mov %eax, %edx\n" +" shr $16, %edx\n" +" mov primary_map(,%edx,4), %ecx\n" +" movzwl %ax, %edx\n" +" shr $2, %edx\n" +" movzbl (%ecx,%edx,1), %edx\n" +" cmp $0xaa, %edx\n" /* compare to VA_BITS8_DEFINED */ +" jne .LLV32LE1\n" /* jump if not completely defined */ +" xor %eax, %eax\n" /* else return V_BITS32_DEFINED */ +" ret\n" +".LLV32LE1:\n" +" cmp $0x55, %edx\n" /* compare to VA_BITS8_UNDEFINED */ +" jne .LLV32LE2\n" /* jump if not completely undefined */ +" or $0xffffffff, %eax\n" /* else return V_BITS32_UNDEFINED */ +" ret\n" +".LLV32LE2:\n" +" xor %ecx, %ecx\n" /* tail call mc_LOADVn_slow(a, 32, 0) */ +" mov $32, %edx\n" +" jmp mc_LOADVn_slow\n" +".size vgMemCheck_helperc_LOADV32le, .-vgMemCheck_helperc_LOADV32le\n" +".previous\n" +); + +#else +// Generic for all platforms except {arm32,x86}-linux and x86-solaris +// is in mc_main.c +#endif + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/none/Makefile.am b/none/Makefile.am index 753687e..5d8b72e 100644 --- a/none/Makefile.am +++ b/none/Makefile.am @@ -17,7 +17,7 @@ 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 = \ +none_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) none_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) @@ -37,7 +37,7 @@ 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 = \ +none_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \ $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) none_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \ $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) |
|
From: Bart V. A. <bva...@so...> - 2018-03-18 05:14:04
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=85cd72c0a80d64ddbfd3156743037925bb7f8f5f commit 85cd72c0a80d64ddbfd3156743037925bb7f8f5f Author: Bart Van Assche <bar...@wd...> Date: Sat Mar 17 22:12:31 2018 -0700 Add the drd/tests/bug322621 regression test Diff: --- .gitignore | 1 + drd/tests/Makefile.am | 13 +++++++++++-- drd/tests/bug322621.stderr.exp | 7 +++++++ drd/tests/bug322621.vgtest | 3 +++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4a38b11..2eb2683 100644 --- a/.gitignore +++ b/.gitignore @@ -312,6 +312,7 @@ /drd/tests/bar_trivial /drd/tests/boost_thread /drd/tests/bug-235681 +/drd/tests/bug322621 /drd/tests/circular_buffer /drd/tests/concurrent_close /drd/tests/custom_alloc diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index 6a9fd23..2a2c461 100644 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -81,6 +81,8 @@ EXTRA_DIST = \ annotate_static.vgtest \ atomic_var.stderr.exp \ atomic_var.vgtest \ + bug322621.vgtest \ + bug322621.stderr.exp \ bar_bad.stderr.exp \ bar_bad.stderr.exp-nohang \ bar_bad.stderr.exp-solaris \ @@ -438,8 +440,14 @@ check_PROGRAMS += omp_matinv omp_prime omp_printf endif if HAVE_PTHREAD_BARRIER -check_PROGRAMS += matinv pth_barrier pth_barrier_race pth_barrier_reinit \ - pth_barrier_thr_cr thread_name +check_PROGRAMS += \ + bug322621 \ + matinv \ + pth_barrier \ + pth_barrier_race \ + pth_barrier_reinit \ + pth_barrier_thr_cr \ + thread_name endif if HAVE_PTHREAD_CREATE_GLIBC_2_0 @@ -462,6 +470,7 @@ AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ @FLAG_FALIGNED_NEW@ \ LDADD = -lpthread +bug322621_SOURCES = ../../helgrind/tests/bug322621.cpp concurrent_close_SOURCES = concurrent_close.cpp dlopen_main_LDADD = -ldl dlopen_lib_so_SOURCES = dlopen_lib.c diff --git a/drd/tests/bug322621.stderr.exp b/drd/tests/bug322621.stderr.exp new file mode 100644 index 0000000..e3561f4 --- /dev/null +++ b/drd/tests/bug322621.stderr.exp @@ -0,0 +1,7 @@ + +Main at barrier 0 +Main after barrier 0 +Main at barrier 1 +Main after barrier 1 + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/drd/tests/bug322621.vgtest b/drd/tests/bug322621.vgtest new file mode 100644 index 0000000..1095603 --- /dev/null +++ b/drd/tests/bug322621.vgtest @@ -0,0 +1,3 @@ +prereq: test -e bug322621 && ./supported_libpthread +vgopts: --read-var-info=yes --check-stack-var=yes +prog: bug322621 |
|
From: Bart V. A. <bva...@so...> - 2018-03-18 05:13:57
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9d9af4e9e3e9de2bd51f4e3c5f574e3de9473176 commit 9d9af4e9e3e9de2bd51f4e3c5f574e3de9473176 Author: Bart Van Assche <bar...@wd...> Date: Sat Mar 17 14:28:36 2018 -0700 Add DRD suppression patterns for races triggered by std::ostream Diff: --- glibc-2.X-drd.supp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/glibc-2.X-drd.supp b/glibc-2.X-drd.supp index abddb51..cee5f22 100644 --- a/glibc-2.X-drd.supp +++ b/glibc-2.X-drd.supp @@ -58,6 +58,18 @@ fun:pthread_cond_broadcast@* fun:__cxa_guard_release } +{ + drd-libstdc++-std::__ostream_insert() + drd:ConflictingAccess + fun:_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l + fun:_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc +} +{ + drd-libstdc++-std::ostream::_M_insert<long>() + drd:ConflictingAccess + ... + fun:_ZNSo9_M_insertIlEERSoT_ +} # |
|
From: Bart V. A. <bva...@so...> - 2018-03-18 05:13:52
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9cf3d0193dee4cd9e193771ee7c79978debb853c commit 9cf3d0193dee4cd9e193771ee7c79978debb853c Author: Bart Van Assche <bar...@wd...> Date: Sat Mar 17 13:50:05 2018 -0700 Add the helgrind/tests/bug322621 regression test Diff: --- .gitignore | 1 + helgrind/tests/Makefile.am | 6 ++- helgrind/tests/bug322621.cpp | 89 +++++++++++++++++++++++++++++++++++++ helgrind/tests/bug322621.stderr.exp | 4 ++ helgrind/tests/bug322621.vgtest | 2 + 5 files changed, 101 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f9776ec..4a38b11 100644 --- a/.gitignore +++ b/.gitignore @@ -644,6 +644,7 @@ /helgrind/tests/annotate_rwlock /helgrind/tests/bar_bad /helgrind/tests/bar_trivial +/helgrind/tests/bug322621 /helgrind/tests/cond_init_destroy /helgrind/tests/cond_timedwait_invalid /helgrind/tests/cond_timedwait_test diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am index 040790c..f86cbde 100644 --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -13,6 +13,7 @@ EXTRA_DIST = \ annotate_rwlock.stderr.exp \ annotate_smart_pointer.vgtest annotate_smart_pointer.stdout.exp \ annotate_smart_pointer.stderr.exp \ + bug322621.vgtest bug322621.stderr.exp \ cond_init_destroy.vgtest cond_init_destroy.stderr.exp \ cond_timedwait_invalid.vgtest cond_timedwait_invalid.stdout.exp \ cond_timedwait_invalid.stderr.exp \ @@ -126,6 +127,7 @@ noinst_HEADERS = safe-pthread.h safe-semaphore.h # should be conditionally compiled like tc20_verifywrap is. check_PROGRAMS = \ annotate_hbefore \ + bug322621 \ cond_init_destroy \ cond_timedwait_invalid \ cond_timedwait_test \ @@ -201,7 +203,7 @@ tc08_hbl2_CFLAGS = $(AM_CFLAGS) endif if HAVE_PTHREAD_BARRIER -check_PROGRAMS += bar_bad bar_trivial +check_PROGRAMS += bar_bad bar_trivial bug322621 endif if HAVE_PTHREAD_MUTEX_TIMEDLOCK @@ -222,3 +224,5 @@ annotate_hbefore_CFLAGS = $(AM_CFLAGS) -mdynamic-no-pic else annotate_hbefore_CFLAGS = $(AM_CFLAGS) endif + +bug322621_SOURCES = bug322621.cpp diff --git a/helgrind/tests/bug322621.cpp b/helgrind/tests/bug322621.cpp new file mode 100644 index 0000000..8d31ca5 --- /dev/null +++ b/helgrind/tests/bug322621.cpp @@ -0,0 +1,89 @@ +// See also https://bugs.kde.org/show_bug.cgi?id=322621 + +#include <pthread.h> +#include <iostream> +#include "../helgrind.h" + +static int verbose; +static pthread_t ls_thread; +static pthread_barrier_t ls_barrier; + +char* ls_buf[2]; + +#define LS_BUF_SIZE (1024*1024) +#define NR_RUNS 2 + +void fill_buffer(int buf) +{ + if (verbose) + std::cerr << "Fill " << buf << "\n"; + for (int i = 0; i < LS_BUF_SIZE; i++) + ls_buf[buf][i] = 1; + if (verbose) + std::cerr << "Fill " << buf << " done\n"; +} + +int read_buffer(int buf) +{ + if (verbose) + std::cerr << "Read " << buf << "\n"; + int res = 0; + for (int i = 0; i < LS_BUF_SIZE; i++) + res += ls_buf[buf][i]; + if (verbose) + std::cerr << "Read " << buf << " done\n"; + return res; +} + +void *the_thread(void *ptr) +{ + int buf = 1; + + for (int i = 0; i < NR_RUNS; i++) { + + fill_buffer(buf); + + if (verbose) + std::cerr << "Aux at barrier " << i << "\n"; + pthread_barrier_wait(&ls_barrier); + if (verbose) + std::cerr << "Aux after barrier " << i << "\n"; + + buf = buf ^ 1; + } + return ptr; +} + + +int main() +{ + VALGRIND_HG_DISABLE_CHECKING(&std::cerr, sizeof(std::cerr)); + + ls_buf[0] = new char[LS_BUF_SIZE]; + ls_buf[1] = new char[LS_BUF_SIZE]; // second buffer only when multithreaded + + pthread_barrier_init(&ls_barrier, NULL, 2); + + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); + pthread_create(&ls_thread, &attr, the_thread, NULL); + pthread_attr_destroy(&attr); + + int buf = 0; + int res = 0; + for (int i = 0; i < NR_RUNS; i++) { + std::cerr << "Main at barrier " << i << "\n"; + pthread_barrier_wait(&ls_barrier); + std::cerr << "Main after barrier " << i << "\n"; + buf = buf ^ 1; + res += read_buffer(buf); + } + + pthread_join(ls_thread,NULL); + pthread_barrier_destroy(&ls_barrier); + delete[] ls_buf[1]; // second buffer only when multithreaded + delete[] ls_buf[0]; + + return 0; +} diff --git a/helgrind/tests/bug322621.stderr.exp b/helgrind/tests/bug322621.stderr.exp new file mode 100644 index 0000000..e85a7b8 --- /dev/null +++ b/helgrind/tests/bug322621.stderr.exp @@ -0,0 +1,4 @@ +Main at barrier 0 +Main after barrier 0 +Main at barrier 1 +Main after barrier 1 diff --git a/helgrind/tests/bug322621.vgtest b/helgrind/tests/bug322621.vgtest new file mode 100644 index 0000000..e4fcd44 --- /dev/null +++ b/helgrind/tests/bug322621.vgtest @@ -0,0 +1,2 @@ +vgopts: -q +prog: bug322621 |
|
From: Bart V. A. <bva...@so...> - 2018-03-18 05:13:47
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6607590ef52fd66cb8a47e0d52bc5b06c24b0add commit 6607590ef52fd66cb8a47e0d52bc5b06c24b0add Author: Bart Van Assche <bar...@wd...> Date: Sat Mar 17 15:02:10 2018 -0700 drd/tests/Makefile.am: Use -faligned-new for C++ code if supported Diff: --- drd/tests/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index ea058ff..6a9fd23 100644 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -456,7 +456,8 @@ 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 +AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) @FLAG_W_EXTRA@ @FLAG_FALIGNED_NEW@ \ + -Wno-inline -Wno-unused-parameter LDADD = -lpthread |
|
From: Bart V. A. <bva...@so...> - 2018-03-18 05:13:44
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=025344ae807746e74b69d342cdcbb7b23ad853c7 commit 025344ae807746e74b69d342cdcbb7b23ad853c7 Author: Bart Van Assche <bar...@wd...> Date: Sat Mar 17 15:01:35 2018 -0700 configure.ac: Detect support for -faligned-new Diff: --- configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/configure.ac b/configure.ac index 98d7ac6..3988d62 100644 --- a/configure.ac +++ b/configure.ac @@ -2057,6 +2057,27 @@ else AC_SUBST([FLAG_W_CAST_ALIGN], [-Wcast-align]) fi +# does this compiler support -faligned-new ? +AC_MSG_CHECKING([if g++ accepts -faligned-new]) + +safe_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-faligned-new -Werror" + +AC_LANG(C++) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ + return 0; +]])], [ +FLAG_FALIGNED_NEW="-faligned-new" +AC_MSG_RESULT([yes]) +], [ +FLAG_FALIGNED_NEW="" +AC_MSG_RESULT([no]) +]) +CXXFLAGS=$safe_CXXFLAGS +AC_LANG(C) + +AC_SUBST(FLAG_FALIGNED_NEW) + # does this compiler support -fno-stack-protector ? AC_MSG_CHECKING([if gcc accepts -fno-stack-protector]) |