Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[misc] move asan options to hpcc #917

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ option(PPLNN_ENABLE_PYTHON_API "enable python api support" OFF)

option(PPLNN_HOLD_DEPS "don't update dependencies" OFF)

option(PPLNN_ENABLE_SANITIZE_OPTIONS "use -fsanitize options to check memory errors. Note that this option is only available for GCC and Clang." OFF)

if(MSVC)
option(PPLNN_USE_MSVC_STATIC_RUNTIME "" ON)
endif()
Expand All @@ -44,6 +42,9 @@ endif()
if(HPCC_USE_RISCV)
message(FATAL_ERROR "`HPCC_USE_RISCV` is deprecated. use `PPLNN_USE_RISCV64` instead.")
endif()
if(PPLNN_ENABLE_SANITIZE_OPTIONS)
message(FATAL_ERROR "`PPLNN_ENABLE_SANITIZE_OPTIONS` is deprecated. use `HPCC_ENABLE_SANITIZE_OPTIONS` instead.")
endif()

# --------------------------------------------------------------------------- #

Expand Down
14 changes: 0 additions & 14 deletions cmake/arm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,6 @@ if (PPLNN_USE_NUMA)
target_compile_definitions(pplnn_arm_static PUBLIC PPLNN_USE_NUMA)
endif()

if(PPLNN_ENABLE_SANITIZE_OPTIONS)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(__ASAN_FLAGS__ "-fsanitize=undefined -fsanitize=address -fsanitize=leak -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${__ASAN_FLAGS__}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${__ASAN_FLAGS__}")
unset(__ASAN_FLAGS__)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
add_link_options("-static-libasan")
endif()
else()
message(FATAL_ERROR "UNSUPPORTED: `PPLNN_USE_SANITIZE` is ON when using compiler `${CMAKE_CXX_COMPILER_ID}`.")
endif()
endif()

target_link_libraries(pplnn_static INTERFACE pplnn_arm_static)

if(PPLNN_INSTALL)
Expand Down
14 changes: 0 additions & 14 deletions cmake/x86.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ target_link_libraries(pplnn_x86_static PUBLIC pplnn_basic_static pplkernelx86_st

target_compile_definitions(pplnn_x86_static PUBLIC PPLNN_USE_X86)

if(PPLNN_ENABLE_SANITIZE_OPTIONS)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(__ASAN_FLAGS__ "-fsanitize=undefined -fsanitize=address -fsanitize=leak -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${__ASAN_FLAGS__}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${__ASAN_FLAGS__}")
unset(__ASAN_FLAGS__)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
add_link_options("-static-libasan")
endif()
else()
message(FATAL_ERROR "UNSUPPORTED: `PPLNN_USE_SANITIZE` is ON when using compiler `${CMAKE_CXX_COMPILER_ID}`.")
endif()
endif()

target_link_libraries(pplnn_static INTERFACE pplnn_x86_static)

if(PPLNN_INSTALL)
Expand Down
Loading