[libc-commits] [libc] [libc] fortify jmp buffer for x86-64 (PR	#112769)
    Nick Desaulniers via libc-commits 
    libc-commits at lists.llvm.org
       
    Thu Oct 31 09:31:23 PDT 2024
    
    
  
================
@@ -1,3 +1,25 @@
+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
+  add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
+endif()
+
+if (LIBC_CONF_SETJMP_FORTIFICATION)
+  if (TARGET libc.src.setjmp.${LIBC_TARGET_OS}.checksum
+      AND LIBC_TARGET_ARCHITECTURE STREQUAL "x86_64")
+    add_object_library(
+      checksum
+      ALIAS
+      DEPENDS
+        .${LIBC_TARGET_OS}.checksum
+    )
+    set(fortification_deps libc.src.setjmp.checksum)
+    set(fortification_defs -DLIBC_COPT_SETJMP_FORTIFICATION=1)
+  else()
+    message(WARNING "Jmpbuf fortification is enabled but not supported for target ${LIBC_TARGET_ARCHITECTURE} ${LIBC_TARGET_OS}")
----------------
nickdesaulniers wrote:
Since `LIBC_CONF_SETJMP_FORTIFICATION` defaults to `true`, I guess for now we'll just warn for each non-x86_64 arch?
https://github.com/llvm/llvm-project/pull/112769
    
    
More information about the libc-commits
mailing list