Skip to content

Commit 40abd97

Browse files
committed
MDEV-34236 Mroonga build with ASAN/UBSAN with GCC 12+ extremely slow.
Workaround by disabling sanitizer for single source file.
1 parent 38cbef8 commit 40abd97

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

storage/mroonga/vendor/groonga/lib/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,15 @@ IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" AND
188188
CMAKE_C_COMPILER_VERSION VERSION_GREATER "5")
189189
ADD_COMPILE_FLAGS(ts/ts_expr_node.c COMPILE_FLAGS "-fno-tree-loop-vectorize")
190190
ENDIF()
191+
192+
# Workaround long compile times with GCC and sanitizers
193+
IF(CMAKE_C_COMPILER_ID STREQUAL "GNU"
194+
AND CMAKE_C_COMPILER_VERSION VERSION_GREATER "11.99")
195+
IF(WITH_UBSAN)
196+
ADD_COMPILE_FLAGS(expr.c COMPILE_FLAGS "-fno-sanitize=undefined")
197+
ENDIF()
198+
IF(WITH_ASAN)
199+
ADD_COMPILE_FLAGS(expr.c COMPILE_FLAGS "-fno-sanitize=address")
200+
ENDIF()
201+
ENDIF()
202+

0 commit comments

Comments
 (0)