]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: boost valgrind fixes for boost::lockfree::queue
authorJason Dillaman <dillaman@redhat.com>
Fri, 28 Jun 2019 14:50:22 +0000 (10:50 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 28 Jun 2019 14:56:03 +0000 (10:56 -0400)
The issue has been fixed upstream under lockfree commit
7e23dac52d08ed1a099de9a6fb8bcdefbb06d2da but is not yet available in
a boost release.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
cmake/modules/BuildBoost.cmake
cmake/modules/boost_lockfree_queue_valgrind_error.patch [new file with mode: 0644]

index 92ba07be1c7241631331503db7faf979a45beaa3..97aed8685eba68c178242b220d25f242c1054900 100644 (file)
@@ -163,7 +163,9 @@ function(do_build_boost version)
   include(ExternalProject)
   ExternalProject_Add(Boost
     ${source_dir}
-    PATCH_COMMAND patch -d <SOURCE_DIR> -p1 < ${CMAKE_MODULE_PATH}/boost_context_asm_arm_syntax_unified.patch
+    PATCH_COMMAND
+      patch -d <SOURCE_DIR> -p1 < ${CMAKE_MODULE_PATH}/boost_context_asm_arm_syntax_unified.patch &&
+      patch -d <SOURCE_DIR> -p1 < ${CMAKE_MODULE_PATH}/boost_lockfree_queue_valgrind_error.patch
     CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${configure_command}
     BUILD_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${build_command}
     BUILD_IN_SOURCE 1
diff --git a/cmake/modules/boost_lockfree_queue_valgrind_error.patch b/cmake/modules/boost_lockfree_queue_valgrind_error.patch
new file mode 100644 (file)
index 0000000..17d9e16
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/boost/lockfree/queue.hpp
++++ b/boost/lockfree/queue.hpp
+@@ -108,7 +108,7 @@
+         typedef typename detail::select_tagged_handle<node, node_based>::handle_type handle_type;
+         node(T const & v, handle_type null_handle):
+-            data(v)//, next(tagged_node_handle(0, 0))
++            next(tagged_node_handle(null_handle, 0)), data(v)
+         {
+             /* increment tag to avoid ABA problem */
+             tagged_node_handle old_next = next.load(memory_order_relaxed);