]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake/boost: WITH_ASAN adds BOOST_USE_ASAN to context 50385/head
authorCasey Bodley <cbodley@redhat.com>
Sun, 5 Mar 2023 02:09:20 +0000 (21:09 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 7 Mar 2023 18:33:57 +0000 (13:33 -0500)
also adds 'context-impl=ucontext' to the b2 command line and the
BOOST_USE_UCONTEXT define as described in:
https://www.boost.org/doc/libs/1_79_0/libs/context/doc/html/context/stack/sanitizers.html

Signed-off-by: Casey Bodley <cbodley@redhat.com>
cmake/modules/BuildBoost.cmake

index 8db3de95963443ebd167780723ee3064a19a846d..8cccecd144bc4e9e6f3de8d5da36d6ad2ff4a95b 100644 (file)
@@ -136,6 +136,9 @@ function(do_build_boost root_dir version)
   if(WITH_BOOST_VALGRIND)
     list(APPEND b2 valgrind=on)
   endif()
+  if(WITH_ASAN)
+    list(APPEND b2 context-impl=ucontext)
+  endif()
   set(build_command
     ${b2} headers stage
     #"--buildid=ceph" # changes lib names--can omit for static
@@ -232,6 +235,10 @@ macro(build_boost version)
       set_target_properties(Boost::${c} PROPERTIES
         INTERFACE_COMPILE_DEFINITIONS "BOOST_USE_VALGRIND")
     endif()
+    if((c MATCHES "context") AND (WITH_ASAN))
+      set_target_properties(Boost::${c} PROPERTIES
+        INTERFACE_COMPILE_DEFINITIONS "BOOST_USE_ASAN;BOOST_USE_UCONTEXT")
+    endif()
     list(APPEND Boost_LIBRARIES ${Boost_${upper_c}_LIBRARY})
   endforeach()
   foreach(c ${Boost_BUILD_COMPONENTS})