mirror of
https://github.com/henrydcase/pqc.git
synced 2024-11-22 07:35:38 +00:00
Adds flags for memory and address sanitizer
This commit is contained in:
parent
0a13e56dd9
commit
0626363895
@ -115,6 +115,23 @@ if(CLANG)
|
|||||||
-Wmissing-variable-declarations")
|
-Wmissing-variable-declarations")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Build with address sanitizer
|
||||||
|
if(ADDRSAN)
|
||||||
|
set(CLANG 1)
|
||||||
|
set(C_CXX_FLAGS "${C_CXX_FLAGS} -fsanitize=undefined,address,leak -fno-omit-frame-pointer")
|
||||||
|
set(LDFLAGS "${LDFLAGS} -fsanitize=undefined,address,leak")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Build with memory sanitizer
|
||||||
|
if(MEMSAN)
|
||||||
|
if(ADDRSAN)
|
||||||
|
message(FATAL_ERROR "Can't use MSAN and ASAN")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CLANG 1)
|
||||||
|
set(C_CXX_FLAGS "${C_CXX_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer")
|
||||||
|
endif()
|
||||||
|
|
||||||
include(.cmake/common.mk)
|
include(.cmake/common.mk)
|
||||||
|
|
||||||
# Control Debug/Release mode
|
# Control Debug/Release mode
|
||||||
|
Loading…
Reference in New Issue
Block a user