Skip to content

Commit 23388dd

Browse files
committed
cmake: build arm sel_ldr and nacl_helper_bootstrap with 64K page size
Build arm sel_ldr and nacl_helper_bootstrap with 64K page size alignment. Makes it compatible with 16k page size kernels. CMake plumbing.
1 parent 8067a20 commit 23388dd

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎cmake/NaClFlags.cmake‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,20 @@ if (USE_PATH_SANITIZATION)
103103
endforeach()
104104
endif()
105105

106+
if (YOKAI_TARGET_SYSTEM_LINUX_COMPATIBILITY)
107+
if (YOKAI_TARGET_ARCH_ARMHF)
108+
option(USE_ARMHF_LARGE_PAGESIZE "Build armhf binaries with large page size." ON)
109+
endif()
110+
111+
if (USE_ARMHF_LARGE_PAGESIZE)
112+
set(MAX_PAGE_SIZE 0x10000)
113+
else()
114+
set(MAX_PAGE_SIZE 0x1000)
115+
endif()
116+
117+
set_linker_flag("-Wl,-z,max-page-size=${MAX_PAGE_SIZE}")
118+
endif()
119+
106120
#TODO: Import from SetUpClang() from (root)/SConstruct.
107121
#TODO: This is mostly ASAN configurations.
108122

‎src/trusted/service_runtime/linux/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ add_custom_target(nacl_bootstrap_raw
111111
-m "${LD_EMUL}"
112112
--build-id
113113
-static
114-
-z "max-page-size=0x1000"
114+
-z "max-page-size=${MAX_PAGE_SIZE}"
115115
--defsym RESERVE_TOP="${RESERVE_TOP}"
116116
--orphan-handling=discard
117117
--script "${CMAKE_CURRENT_LIST_DIR}/nacl_bootstrap.x"

0 commit comments

Comments
 (0)