[FFmpeg-cvslog] configure: Add basic valgrind-memcheck support

Reinhard Tartler git at videolan.org
Sun May 5 11:00:07 CEST 2013


ffmpeg | branch: master | Reinhard Tartler <siretart at tauware.de> | Sat May  4 10:25:41 2013 +0200| [b1ee8eec849f17fce2f411a297de9cbf2edaeb3a] | committer: Reinhard Tartler

configure: Add basic valgrind-memcheck support

With the parameter --valgrind-memcheck, the configure script sets
reasonable defaults that can be overridden as explained in the
documentation.

The idea of using set_defaults is from Luca Barbato.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b1ee8eec849f17fce2f411a297de9cbf2edaeb3a
---

 configure          |    8 ++++++--
 doc/developer.texi |   12 ++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 269c708..5deb69e 100755
--- a/configure
+++ b/configure
@@ -2210,6 +2210,10 @@ case "$toolchain" in
         add_cflags  -fsanitize=thread -pie
         add_ldflags -fsanitize=thread -pie
     ;;
+    valgrind-memcheck)
+        target_exec_default="valgrind"
+        target_exec_args="--track-origins=yes --leak-check=full"
+    ;;
     msvc)
         cc_default="c99wrap cl"
         ld_default="c99wrap link"
@@ -2226,7 +2230,7 @@ case "$toolchain" in
     ;;
 esac
 
-set_default arch cc pkg_config sysinclude target_os
+set_default arch cc pkg_config sysinclude target_exec target_os
 enabled cross_compile || host_cc_default=$cc
 set_default host_cc
 
@@ -4024,7 +4028,7 @@ HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
 HOSTCC_C=$HOSTCC_C
 HOSTCC_O=$HOSTCC_O
 HOSTLD_O=$HOSTLD_O
-TARGET_EXEC=$target_exec
+TARGET_EXEC=$target_exec $target_exec_args
 TARGET_PATH=$target_path
 LIBS-avplay=$sdl_libs
 CFLAGS-avplay=$sdl_cflags
diff --git a/doc/developer.texi b/doc/developer.texi
index 3d574e4..c3d0f20 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -574,6 +574,18 @@ You can use the command @code{make lcov-reset} to reset the coverage
 measurements. You will need to rerun @code{make lcov} after running a
 new test.
 
+ at subsection Using Valgrind
+
+The configure script provides a shortcut for using valgrind to spot bugs
+related to memory handling. Just add the option
+ at code{--toolchain=valgrind-memcheck} to your configure line, and
+reasonable defaults will be set for running FATE under the supervision
+of the @strong{memcheck} tool of the valgrind suite.
+
+In case you need finer control over how valgrind is invoked, use the
+ at code{--target-exec='valgrind <your_custom_valgrind_options>} option in
+your configure line instead.
+
 @anchor{Release process}
 @section Release process
 



More information about the ffmpeg-cvslog mailing list