When using ASAN, disable stack protection and source fortification
ASAN throws some false positive errors on stack overflows when used with the stack protector option, and doesn't support source fortification.
This commit is contained in:
parent
64d217edda
commit
d787596124
|
@ -350,6 +350,9 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
|||
if( KICAD_SANITIZE )
|
||||
add_definitions( -DKICAD_SANITIZE )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_SANITIZE_VECTOR -fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer" )
|
||||
|
||||
# ASAN shouldn't be used with these options (https://github.com/google/sanitizers/wiki/AddressSanitizer#faq)
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" )
|
||||
endif()
|
||||
|
||||
if( KICAD_STDLIB_DEBUG )
|
||||
|
|
Loading…
Reference in New Issue