[clang] [llvm] [libc++][hardening] Fix references to old names for hardening modes (PR #71743)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 15:14:21 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Konstantin Varlamov (var-const)

<details>
<summary>Changes</summary>

This should fix some builds broken by https://github.com/llvm/llvm-project/pull/70575


---
Full diff: https://github.com/llvm/llvm-project/pull/71743.diff


3 Files Affected:

- (modified) clang/cmake/caches/Fuchsia-stage2.cmake (+1-1) 
- (modified) clang/cmake/caches/Fuchsia.cmake (+1-1) 
- (modified) llvm/cmake/modules/HandleLLVMOptions.cmake (+4-4) 


``````````diff
diff --git a/clang/cmake/caches/Fuchsia-stage2.cmake b/clang/cmake/caches/Fuchsia-stage2.cmake
index a4d2926559eee7f..4b9085d99378c6f 100644
--- a/clang/cmake/caches/Fuchsia-stage2.cmake
+++ b/clang/cmake/caches/Fuchsia-stage2.cmake
@@ -81,7 +81,7 @@ if(APPLE)
   set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
   set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
-  set(LIBCXX_HARDENING_MODE "unchecked" CACHE STRING "")
+  set(LIBCXX_HARDENING_MODE "none" CACHE STRING "")
   set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
   set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
 endif()
diff --git a/clang/cmake/caches/Fuchsia.cmake b/clang/cmake/caches/Fuchsia.cmake
index 4c9cd12101d478a..dad434be720da11 100644
--- a/clang/cmake/caches/Fuchsia.cmake
+++ b/clang/cmake/caches/Fuchsia.cmake
@@ -116,7 +116,7 @@ else()
   set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
   set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
-  set(LIBCXX_HARDENING_MODE "unchecked" CACHE STRING "")
+  set(LIBCXX_HARDENING_MODE "none" CACHE STRING "")
   set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
   set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
   set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index ca7cedd6e4afff4..6a3c49edc912ded 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -111,12 +111,12 @@ if( LLVM_ENABLE_ASSERTIONS )
   endif()
   # Enable assertions in libstdc++.
   add_compile_definitions(_GLIBCXX_ASSERTIONS)
-  # Cautiously enable the safe hardened mode in libc++.
+  # Cautiously enable the extensive hardening mode in libc++.
   if((DEFINED LIBCXX_HARDENING_MODE) AND
-     (NOT LIBCXX_HARDENING_MODE STREQUAL "safe"))
-    message(WARNING "LLVM_ENABLE_ASSERTIONS implies LIBCXX_HARDENING_MODE \"safe\" but is overriden from command line with value \"${LIBCXX_HARDENING_MODE}\".")
+     (NOT LIBCXX_HARDENING_MODE STREQUAL "extensive"))
+    message(WARNING "LLVM_ENABLE_ASSERTIONS implies LIBCXX_HARDENING_MODE \"extensive\" but is overriden from command line with value \"${LIBCXX_HARDENING_MODE}\".")
   else()
-    set(LIBCXX_HARDENING_MODE "safe")
+    set(LIBCXX_HARDENING_MODE "extensive")
   endif()
 endif()
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/71743


More information about the llvm-commits mailing list