Skip to content

Commit 4f64f21

Browse files
committed
Enhance mksnapshot build configuration in CMake
- Added MSAN_OPTIONS to suppress uninitialized memory report and halt on error. - Disabled memory sanitizer instrumentation for mksnapshot when using Clang to prevent false positives.
1 parent 9a54f95 commit 4f64f21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ if (NOT CMAKE_CROSSCOMPILING)
623623
endif()
624624
add_custom_command(
625625
COMMAND
626+
MSAN_OPTIONS=report_umrs=0:halt_on_error=0
626627
ASAN_OPTIONS=detect_container_overflow=0
627628
${V8_MKSNAPSHOT}
628629
--embedded_src ${CMAKE_CURRENT_BINARY_DIR}/embedded.S
@@ -1100,6 +1101,11 @@ if (NOT CMAKE_CROSSCOMPILING)
11001101
target_compile_definitions(mksnapshot PRIVATE ${v8_defines} $<${is-msvc}:_HAS_EXCEPTIONS=0>)
11011102
target_compile_options(mksnapshot PRIVATE ${disable-exceptions})
11021103
target_include_directories(mksnapshot PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/v8)
1104+
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1105+
# mksnapshot is a host build tool; disable MSan instrumentation to avoid false positives
1106+
target_compile_options(mksnapshot PRIVATE -fno-sanitize=memory)
1107+
target_link_options(mksnapshot PRIVATE -fno-sanitize=memory)
1108+
endif()
11031109
target_link_libraries(mksnapshot
11041110
PRIVATE
11051111
v8_libbase

0 commit comments

Comments
 (0)