diff --git a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt --- a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt +++ b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt @@ -102,6 +102,11 @@ add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS) list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON ${WEAK_SYMBOL_LINK_FLAGS}) + + if (CMAKE_CXX_STANDARD GREATER 14) + # For c++17 sanitizer_allocator_test requires language features introduced in macos 10.13 + list(APPEND SANITIZER_TEST_CFLAGS_COMMON "-mmacosx-version-min=10.13") + endif() endif() # MSVC linker is allocating 1M for the stack by default, which is not