Skip to content

Commit 1338b8e

Browse files
Workaround macOS SDK 15 address sanitizer regression
In debug mode, address sanitizer reports errors that are false positives when loading a library with dlopen for the second time.
1 parent 49886fc commit 1338b8e

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

loader/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,11 @@ else()
432432
if (LOADER_ENABLE_ADDRESS_SANITIZER)
433433
target_compile_options(vulkan PUBLIC -fsanitize=address,undefined)
434434
target_link_options(vulkan PUBLIC -fsanitize=address,undefined)
435+
# workaround regression in macOS SDK 15 when address sanitizer is enabled in debug mode
436+
# https://developer.apple.com/forums/thread/774632
437+
if (APPLE)
438+
target_compile_options(vulkan PRIVATE -mllvm -asan-globals=0)
439+
endif()
435440
endif()
436441
if (LOADER_ENABLE_THREAD_SANITIZER)
437442
target_compile_options(vulkan PUBLIC -fsanitize=thread)

tests/framework/util/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ if (UNIX)
6060
if (LOADER_ENABLE_ADDRESS_SANITIZER)
6161
target_compile_options(testing_framework_util PUBLIC -fsanitize=address,undefined)
6262
target_link_options(testing_framework_util PUBLIC -fsanitize=address,undefined)
63+
# workaround regression in macOS SDK 15 when address sanitizer is enabled in debug mode
64+
# https://developer.apple.com/forums/thread/774632
65+
if (APPLE)
66+
target_compile_options(testing_framework_util PRIVATE -mllvm -asan-globals=0)
67+
endif()
6368
endif()
6469
if (LOADER_ENABLE_THREAD_SANITIZER)
6570
target_compile_options(testing_framework_util PUBLIC -fsanitize=thread)

0 commit comments

Comments
 (0)