[compiler-rt] 9b194fe - [Sanitizer] Bump macOS deployment target for sanitizer unit test binary to support C++17 requirements.

Blue Gaston via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 03:44:41 PDT 2022


Author: Blue Gaston
Date: 2022-09-20T06:43:30-04:00
New Revision: 9b194fe2a2bd8e6e2ed43ef0b372f87bc939bba1

URL: https://github.com/llvm/llvm-project/commit/9b194fe2a2bd8e6e2ed43ef0b372f87bc939bba1
DIFF: https://github.com/llvm/llvm-project/commit/9b194fe2a2bd8e6e2ed43ef0b372f87bc939bba1.diff

LOG: [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

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
index 8b1d2df63ea1f..41b89aa43134f 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


        


More information about the llvm-commits mailing list