diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-02-23 15:31:24 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-02-23 15:31:24 +0100 |
commit | db39910f080534159ce8c7d55fa458365de7c3f3 (patch) | |
tree | a0c872edccc12d60bad587b65d5e8eaf374e5060 | |
parent | 925942e7af49eebc5ffeff705bb2167eb86a9dcb (diff) | |
download | mariadb-git-db39910f080534159ce8c7d55fa458365de7c3f3.tar.gz |
disable safemalloc for valgrind builds.
always try to use valgrind headers in debug builds.
define HAVE_valgrind for --with-valgrind
fix valgrind check in my_valgrind.h
-rwxr-xr-x | BUILD/SETUP.sh | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | config.h.cmake | 6 | ||||
-rw-r--r-- | configure.cmake | 9 | ||||
-rw-r--r-- | include/my_global.h | 6 | ||||
-rw-r--r-- | include/my_valgrind.h | 2 |
6 files changed, 11 insertions, 15 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 6c45c23587f..c9eb1ebc03f 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -148,7 +148,6 @@ fi # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro # LINT_INIT(), which is only useful for silencing spurious warnings # of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind. -valgrind_flags="-DHAVE_valgrind -DHAVE_purify -USAFEMALLOC" valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized" valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" valgrind_configs="--with-valgrind" diff --git a/CMakeLists.txt b/CMakeLists.txt index 27c43f1328a..4e210a8d87e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,7 +197,7 @@ ENDIF() IF(WITH_SAFEMALLOC MATCHES "ON") ADD_DEFINITIONS( -DSAFEMALLOC ${DUSE_MYSYS_NEW}) -ELSEIF(WITH_SAFEMALLOC MATCHES "AUTO" AND NOT WIN32) +ELSEIF(WITH_SAFEMALLOC MATCHES "AUTO" AND NOT WIN32 AND NOT WITH_VALGRIND) SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC ${DUSE_MYSYS_NEW}") ENDIF() diff --git a/config.h.cmake b/config.h.cmake index eae3a4ba886..529e1c7ad1d 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -313,7 +313,11 @@ #define USE_MB 1 #define USE_MB_IDENT 1 -#cmakedefine HAVE_VALGRIND +/* this means that valgrind headers and macros are available */ +#cmakedefine HAVE_VALGRIND 1 + +/* this means WITH_VALGRIND - we change some code paths for valgrind */ +#cmakedefine HAVE_valgrind 1 /* Types we may use */ #ifdef __APPLE__ diff --git a/configure.cmake b/configure.cmake index ea000ad69a0..66ee73ddc03 100644 --- a/configure.cmake +++ b/configure.cmake @@ -1024,13 +1024,12 @@ if available and 'smp' configuration otherwise.") MARK_AS_ADVANCED(WITH_ATOMIC_LOCKS MY_ATOMIC_MODE_RWLOCK MY_ATOMIC_MODE_DUMMY) IF(WITH_VALGRIND) - CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h" - HAVE_VALGRIND_HEADERS) - IF(HAVE_VALGRIND_HEADERS) - SET(HAVE_VALGRIND 1) - ENDIF() + SET(HAVE_valgrind 1) ENDIF() +CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h" + HAVE_VALGRIND) + #-------------------------------------------------------------------- # Check for IPv6 support #-------------------------------------------------------------------- diff --git a/include/my_global.h b/include/my_global.h index 26cba5b4ed7..8efd9986670 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -89,12 +89,6 @@ #define IF_WIN(A,B) B #endif -#ifdef HAVE_purify -#define IF_PURIFY(A,B) A -#else -#define IF_PURIFY(A,B) B -#endif - #ifndef EMBEDDED_LIBRARY #ifdef WITH_NDB_BINLOG #define HAVE_NDB_BINLOG 1 diff --git a/include/my_valgrind.h b/include/my_valgrind.h index f82dd35b369..5af3a14cf10 100644 --- a/include/my_valgrind.h +++ b/include/my_valgrind.h @@ -23,7 +23,7 @@ #define IF_VALGRIND(A,B) B #endif -#if defined(HAVE_VALGRIND) && defined(HAVE_VALGRIND_MEMCHECK_H) +#if defined(HAVE_VALGRIND) # include <valgrind/memcheck.h> # define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len) # define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) |