aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-07-16 22:18:57 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-07-16 22:18:57 +0100
commitcfd83431c040ffbd5dd946b4131a566195fe6d89 (patch)
tree7b42e7bcc8fc19cba2b0562a43d4d99d3d215f52
parentd2bf9fd226253e32d1d70f7ad379fcbb2ccb6d61 (diff)
downloadrspamd-cfd83431c040ffbd5dd946b4131a566195fe6d89.tar.gz
rspamd-cfd83431c040ffbd5dd946b4131a566195fe6d89.zip
[Minor] Another try to use the proper linker
-rw-r--r--CMakeLists.txt1
-rw-r--r--cmake/Sanitizer.cmake1
-rw-r--r--cmake/Toolset.cmake6
3 files changed, 5 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac2585669..5ea71a060 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,6 +85,7 @@ ENDIF()
FIND_PACKAGE(PkgConfig REQUIRED)
FIND_PACKAGE(Perl REQUIRED)
+option (SANITIZE "Enable sanitizer: address, memory, undefined, leak (comma separated list)" "")
INCLUDE(Toolset)
INCLUDE(Sanitizer)
diff --git a/cmake/Sanitizer.cmake b/cmake/Sanitizer.cmake
index b13e418e3..c2587066f 100644
--- a/cmake/Sanitizer.cmake
+++ b/cmake/Sanitizer.cmake
@@ -1,6 +1,5 @@
# Ported from Clickhouse: https://github.com/ClickHouse/ClickHouse/blob/master/cmake/sanitize.cmake
-option (SANITIZE "Enable sanitizer: address, memory, undefined, leak (comma separated list)" "")
set (SAN_FLAGS "${SAN_FLAGS} -g -fno-omit-frame-pointer -DSANITIZER")
# O1 is normally set by clang, and -Og by gcc
if (COMPILER_GCC)
diff --git a/cmake/Toolset.cmake b/cmake/Toolset.cmake
index dfd1d3008..4e7017dfd 100644
--- a/cmake/Toolset.cmake
+++ b/cmake/Toolset.cmake
@@ -80,12 +80,14 @@ if(NOT LINKER_NAME)
if(LLD_PATH)
if (COMPILER_CLANG)
set(LINKER_NAME "lld")
- else()
+ elseif(NOT SANITIZE)
if(GOLD_PATH)
set(LINKER_NAME "gold")
else()
- message(STATUS "Use generic 'ld' as a linker")
+ message(STATUS "Use generic 'ld' as a linker: gold not found")
endif()
+ else()
+ message(STATUS "Use generic 'ld' as a linker: sanitizers are enabled")
endif()
elseif(GOLD_PATH)
set(LINKER_NAME "gold")