forked from Green-Sky/tomato
fix asan option for gcc
This commit is contained in:
@@ -31,13 +31,21 @@ if (TOMATO_ASAN)
|
|||||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||||
if (NOT WIN32) # exclude mingw
|
if (NOT WIN32) # exclude mingw
|
||||||
add_compile_options(-fno-omit-frame-pointer)
|
add_compile_options(-fno-omit-frame-pointer)
|
||||||
add_compile_options(-fsanitize=address,undefined,nullability)
|
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||||
|
add_compile_options(-fsanitize=address,undefined,nullability)
|
||||||
|
else()
|
||||||
|
add_compile_options(-fsanitize=address,undefined)
|
||||||
|
endif()
|
||||||
#add_compile_options(-fsanitize=address,undefined,pointer-compare,pointer-subtract)
|
#add_compile_options(-fsanitize=address,undefined,pointer-compare,pointer-subtract)
|
||||||
#add_compile_options(-fhardened)
|
#add_compile_options(-fhardened)
|
||||||
#add_compile_options(-D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -ftrivial-auto-var-init=zero -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-strong -fstack-clash-protection -fcf-protection=full)
|
#add_compile_options(-D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -ftrivial-auto-var-init=zero -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-strong -fstack-clash-protection -fcf-protection=full)
|
||||||
|
|
||||||
add_link_options(-fno-omit-frame-pointer)
|
add_link_options(-fno-omit-frame-pointer)
|
||||||
add_link_options(-fsanitize=address,undefined,nullability)
|
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||||
|
add_link_options(-fsanitize=address,undefined,nullability)
|
||||||
|
else()
|
||||||
|
add_link_options(-fsanitize=address,undefined)
|
||||||
|
endif8)
|
||||||
#add_link_options(-fsanitize=address,undefined,pointer-compare,pointer-subtract)
|
#add_link_options(-fsanitize=address,undefined,pointer-compare,pointer-subtract)
|
||||||
#add_link_options(-fhardened)
|
#add_link_options(-fhardened)
|
||||||
#add_link_options(-D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -ftrivial-auto-var-init=zero -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-strong -fstack-clash-protection -fcf-protection=full)
|
#add_link_options(-D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -ftrivial-auto-var-init=zero -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-strong -fstack-clash-protection -fcf-protection=full)
|
||||||
|
|||||||
Reference in New Issue
Block a user