From 055ae5c476cd8fcc41c2c86cb9ea257349586ae0 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 13 Oct 2017 13:01:59 +0800 Subject: [PATCH] cmake: use CMAKE_POSITION_INDEPENDENT_CODE not -fPIC we use the global setting of CMAKE_POSITION_INDEPENDENT_CODE for defining this flag. Signed-off-by: Kefu Chai --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b24d7737206..fc3b73a78ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -511,8 +511,8 @@ if(WITH_TSAN) message(FATAL_ERROR "Cannot combine -fsanitize-leak w/-fsanitize-thread") endif() set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -pie -ltsan ") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -fPIC") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer") if(HAVE_JEMALLOC) message(FATAL "TSAN does not work well with JeMalloc") endif()