Skip to content

Commit 926823b

Browse files
lavenzgmeta-codesync[bot]
authored andcommitted
Improve test speed when ASAN is turned on
Summary: Pass `-fno-omit-frame-pointer` for ASAN builds as it allows faster unwind. Reviewed By: avp Differential Revision: D96827585 fbshipit-source-id: 4027b93acc212a7be3e2fb5e3ecc0cffea2ec208
1 parent 67dbcf9 commit 926823b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ if(HERMESVM_CRASH_TRACE)
457457
add_definitions(-DHERMESVM_CRASH_TRACE=1)
458458
endif()
459459
if (HERMES_ENABLE_ADDRESS_SANITIZER)
460-
append("-fsanitize=address" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
460+
# Leave frame pointers. Allows the fast unwinder to function properly.
461+
append("-fsanitize=address -fno-omit-frame-pointer" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
461462
# MSVC handles ASAN runtime linking automatically when objects compiled with
462463
# /fsanitize=address are linked. Don't pass the flag to the linker on MSVC.
463464
if (MSVC)

tools/shermes/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ set(SHERMES_CC_LIB_PATH "$<TARGET_FILE_DIR:hermesvm>:$<TARGET_FILE_DIR:jsi>:$<TA
2525
"Library path when invoking CC")
2626

2727
if (HERMES_ENABLE_ADDRESS_SANITIZER)
28-
append("-fsanitize=address" SHERMES_CC_SYSCFLAGS SHERMES_CC_SYSLDFLAGS)
28+
# Leave frame pointers. Allows the fast unwinder to function properly.
29+
append("-fsanitize=address -fno-omit-frame-pointer" SHERMES_CC_SYSCFLAGS SHERMES_CC_SYSLDFLAGS)
2930
endif()
3031

3132
if (HERMES_ENABLE_UNDEFINED_BEHAVIOR_SANITIZER)

0 commit comments

Comments
 (0)