[Sanitizer] Bump macOS deployment target for sanitizer unit test binary to support...
authorBlue Gaston <bgaston2@apple.com>
Fri, 16 Sep 2022 22:49:44 +0000 (15:49 -0700)
committerBlue Gaston <bgaston2@apple.com>
Tue, 20 Sep 2022 10:43:30 +0000 (06:43 -0400)
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

index 8b1d2df..41b89aa 100644 (file)
@@ -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