Skip to content

Commit 084f3b2

Browse files
16bit-ykikoclaude
andauthored
docs(cmake): restore ASan workaround comments (#380)
## Summary - Restore comment explaining clang-cl manual ASan runtime linking workaround - Restore comment explaining OPT:NOICF for ASan ODR false positives on Windows These were accidentally removed in #379. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Improved internal build configuration for Debug builds on Windows to enhance development and testing infrastructure with better error detection and optimization settings. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eb0a6b3 commit 084f3b2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
6464
add_compile_options(-fsanitize=address)
6565

6666
if(CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
67+
# clang-cl (MSVC frontend): manually link ASan runtime since clang-cl
68+
# doesn't handle -fsanitize=address linking automatically.
6769
execute_process(
6870
COMMAND ${CMAKE_CXX_COMPILER} --print-resource-dir
6971
OUTPUT_VARIABLE CLANG_RESOURCE_DIR
@@ -87,6 +89,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
8789
endif()
8890

8991
if(WIN32)
92+
# Disable Identical COMDAT Folding in Debug to avoid ASan ODR false positives.
9093
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,/OPT:NOICF")
9194
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,/OPT:NOICF")
9295
endif()

0 commit comments

Comments
 (0)