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

feat: ASAN build #2307

Merged
merged 2 commits into from
Sep 14, 2023
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
8 changes: 8 additions & 0 deletions barretenberg/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,11 @@ include(cmake/gtest.cmake)
include(cmake/benchmark.cmake)
include(cmake/module.cmake)
add_subdirectory(src)
if (ENABLE_ASAN AND NOT(FUZZING))
find_program(LLVM_SYMBOLIZER_PATH NAMES llvm-symbolizer-16)
if (NOT(LLVM_SYMBOLIZER_PATH))
message(WARNING "LLVM symbolizer not found, so ASAN output will be limited")
else()
message(AUTHOR_WARNING "Run `export ASAN_SYMBOLIZER_PATH=\"${LLVM_SYMBOLIZER_PATH}\"` before running tests for better ASAN output (at which lines the bugs are).")
endif()
endif()
27 changes: 25 additions & 2 deletions barretenberg/cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@
"DISABLE_ASM": "ON"
}
},
{"name":"asan",
"displayName": "Debugging build with address sanitizer on Clang-16",
"description": "Build with address sanitizer on clang16 with debugging information",
"inherits":"clang16-dbg",
"binaryDir": "build-asan",
"environment": {
"CMAKE_BUILD_TYPE": "Debug"
},
"cacheVariables": {
"ENABLE_ASAN": "ON",
"DISABLE_ASM": "ON"
}

},
{
"name": "gcc",
"displayName": "Build with GCC",
Expand Down Expand Up @@ -82,7 +96,7 @@
"name": "fuzzing",
"displayName": "Build with fuzzing",
"description": "Build default preset but with fuzzing enabled",
"inherits": "default",
"inherits": "clang16",
"binaryDir": "build-fuzzing",
"cacheVariables": {
"FUZZING": "ON"
Expand Down Expand Up @@ -179,6 +193,10 @@
"name": "clang16-dbg",
"inherits": "default",
"configurePreset": "clang16-dbg"
},{
"name": "asan",
"inherits": "default",
"configurePreset": "asan"
},
{
"name": "gcc",
Expand All @@ -197,7 +215,7 @@
},
{
"name": "fuzzing",
"inherits": "default",
"inherits": "clang16",
"configurePreset": "fuzzing"
},
{
Expand Down Expand Up @@ -260,6 +278,11 @@
"inherits": "default",
"configurePreset": "clang16-dbg"
},
{
"name": "asan",
"inherits": "default",
"configurePreset": "asan"
},
{
"name": "gcc",
"inherits": "default",
Expand Down