From 9b194fe2a2bd8e6e2ed43ef0b372f87bc939bba1 Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Fri, 16 Sep 2022 15:49:44 -0700 Subject: [PATCH] [Sanitizer] Bump macOS deployment target for sanitizer unit test binary to support C++17 requirements. This patch fixes a test failure on Apple caused by changing standard to c++17. sanitizer_allocator_test.cpp requires language features introducied in 10.13 for c++17. After initial investigation, it was not clear how to add this flag to a single file: https://reviews.llvm.org/D133878 Becuase of this, we have upped the min version of this test suite to 10.13, the min version necessary to support necessary language features. We felt this was a better option than upping the min version of the product to support a single test. We are raising deployment target for a single test suite, rather than the product. Differential Revision: https://reviews.llvm.org/D134091 rdar://98737270 --- compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt index 8b1d2df63ea1..41b89aa43134 100644 --- a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt +++ b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt @@ -102,6 +102,8 @@ if(APPLE) add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS) list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON ${WEAK_SYMBOL_LINK_FLAGS}) + # 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() # MSVC linker is allocating 1M for the stack by default, which is not