From 99cfb8aa2bd98aa021d7ccd603dd302847429f6a Mon Sep 17 00:00:00 2001 From: sundy-li <543950155@qq.com> Date: Fri, 2 Oct 2020 10:26:59 +0800 Subject: [PATCH] USE PORTABLE to avoid Illegal instruction, add SANITIZE for rocksdb cmake build options --- contrib/CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 182057dddcf..6ccea277558 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -323,6 +323,17 @@ if (USE_INTERNAL_ROCKSDB_LIBRARY) set(WITH_TESTS OFF) set(WITH_BENCHMARK_TOOLS OFF) set(WITH_TOOLS OFF) - set (WITH_GFLAGS OFF) + set(WITH_GFLAGS OFF) + set(PORTABLE ON) + set(FORCE_SSE42 ON) + + if (SANITIZE STREQUAL "undefined") + set(WITH_UBSAN ON) + elseif (SANITIZE STREQUAL "address") + set(WITH_ASAN ON) + elseif (SANITIZE STREQUAL "thread") + set(WITH_TSAN ON) + endif() + add_subdirectory (rocksdb) endif()