diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/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")