[llvm] 194e2ba - [CMake] Use `LLVM_ENABLE_ASSERTIONS` to enable the hardened mode in libc++.

Konstantin Varlamov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 23:09:41 PDT 2023


Author: Konstantin Varlamov
Date: 2023-07-26T23:09:23-07:00
New Revision: 194e2ba1250c97926ed83b1ade1fbcbb49112a05

URL: https://github.com/llvm/llvm-project/commit/194e2ba1250c97926ed83b1ade1fbcbb49112a05
DIFF: https://github.com/llvm/llvm-project/commit/194e2ba1250c97926ed83b1ade1fbcbb49112a05.diff

LOG: [CMake] Use `LLVM_ENABLE_ASSERTIONS` to enable the hardened mode in libc++.

Use the new libc++ hardened mode instead of the deprecated safe mode.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D156377

Added: 
    

Modified: 
    llvm/cmake/modules/HandleLLVMOptions.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index e8c8dff1f30c91..29b242d80051f0 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -85,8 +85,8 @@ if( LLVM_ENABLE_ASSERTIONS )
   endif()
   # Enable assertions in libstdc++.
   add_compile_definitions(_GLIBCXX_ASSERTIONS)
-  # Enable assertions in libc++.
-  add_compile_definitions(_LIBCPP_ENABLE_ASSERTIONS)
+  # Enable the hardened mode in libc++.
+  add_compile_definitions(_LIBCPP_ENABLE_HARDENED_MODE)
 endif()
 
 if(LLVM_ENABLE_EXPENSIVE_CHECKS)


        


More information about the llvm-commits mailing list