[PATCH] D123908: Add LLVM_SYS_PAGE_SIZE option to support 4K/8K/16K/64K page size system

Xiaodong Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 17 05:41:32 PDT 2022


XiaodongLoong created this revision.
Herald added a subscriber: mgorny.
Herald added a project: All.
XiaodongLoong requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123908

Files:
  llvm/CMakeLists.txt


Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -557,6 +557,22 @@
   option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF)
 endif()
 
+set(LLVM_SYS_PAGE_SIZE "4K" CACHE STRING
+  "Define the system page size used to update ring buffer in HWasan.")
+if( LLVM_SYS_PAGE_SIZE STREQUAL "4K")
+  add_definitions(-DSYS_PAGE_SIZE_4K)
+endif()
+if( LLVM_SYS_PAGE_SIZE STREQUAL "8K")
+  add_definitions(-DSYS_PAGE_SIZE_8K)
+endif()
+if( LLVM_SYS_PAGE_SIZE STREQUAL "16K")
+  add_definitions(-DSYS_PAGE_SIZE_16K)
+endif()
+if( LLVM_SYS_PAGE_SIZE STREQUAL "64K")
+  add_definitions(-DSYS_PAGE_SIZE_64K)
+endif()
+
+
 # Define the default arguments to use with 'lit', and an option for the user to
 # override.
 set(LIT_ARGS_DEFAULT "-sv")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123908.423287.patch
Type: text/x-patch
Size: 845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220417/f8b9b33c/attachment.bin>


More information about the llvm-commits mailing list