Skip to content

Commit 0664704

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 2b169fd commit 0664704

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

‎cmake/NaClFlags.cmake‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
option(USE_WERROR "Tell the compiler to make the build fail when warnings are present." OFF)
22

3+
if (YOKAI_TARGET_SYSTEM_LINUX_COMPATIBILITY)
4+
if (YOKAI_TARGET_ARCH_ARMHF)
5+
option(USE_ARMHF_LARGE_PAGESIZE "Build armhf binaries with large page size." ON)
6+
endif()
7+
endif()
8+
39
macro(set_ASM_flag FLAG)
410
set(lang ASM)
511
if (${ARGC} GREATER 1)
@@ -84,6 +90,16 @@ macro(set_linker_flag FLAG)
8490
endforeach()
8591
endmacro()
8692

93+
if (YOKAI_TARGET_SYSTEM_LINUX_COMPATIBILITY)
94+
if (USE_ARMHF_LARGE_PAGESIZE)
95+
set(MAX_PAGE_SIZE 0x10000)
96+
else()
97+
set(MAX_PAGE_SIZE 0x1000)
98+
endif()
99+
100+
set_linker_flag("-Wl,-z,max-page-size=${MAX_PAGE_SIZE}")
101+
endif()
102+
87103
#TODO: Import from SetUpClang() from (root)/SConstruct.
88104
#TODO: This is mostly ASAN configurations.
89105

‎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)