From a107c79fcdde80d1dea0a1caf5859647f77b48c9 Mon Sep 17 00:00:00 2001
From: Sergei Petrunia <psergey@askmonty.org>
Date: Tue, 22 May 2018 19:36:51 +0300
Subject: [PATCH] MDEV-12439: MariaRocks produces numerous (spurious?) valgrind
 failures

Step#1: RocksDB files require a special #define when they are compiled
with valgrind. Without that, valgrind fails with an 'unimplemented syscall'
error for fcntl call.
---
 storage/rocksdb/CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 2821b74c2fa..2a4ea4dfc0f 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -19,6 +19,9 @@ IF(HAVE_SCHED_GETCPU)
   ADD_DEFINITIONS(-DHAVE_SCHED_GETCPU=1 -DROCKSDB_SCHED_GETCPU_PRESENT)
 ENDIF()
 
+IF(WITH_VALGRIND)
+  ADD_DEFINITIONS(-DROCKSDB_VALGRIND_RUN=1)
+ENDIF()
 
 # We've had our builders hang during the build process. This prevents MariaRocks
 # to be built on 32 bit intel OS kernels.
-- 
2.30.9