Skip to content

Commit 2513fa8

Browse files
committed
cmake: build arm sel_ldr and nacl_helper_bootstrap with 16K page size
1 parent 20f8b02 commit 2513fa8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

cmake/NaClFlags.cmake

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

3+
if ("${ARCH}" STREQUAL "armhf")
4+
option(USE_ARMHF_LARGE_PAGESIZE "Build armhf binaries with large page size." ON)
5+
list(APPEND INHERITED_OPTIONS "USE_ARMHF_LARGE_PAGESIZE")
6+
endif()
7+
38
macro(set_ASM_flag FLAG)
49
set(lang ASM)
510
if (${ARGC} GREATER 1)
@@ -84,6 +89,14 @@ macro(set_linker_flag FLAG)
8489
endforeach()
8590
endmacro()
8691

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

src/trusted/service_runtime/linux/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ add_custom_target(nacl_bootstrap_raw
113113
-m "${LD_EMUL}"
114114
--build-id
115115
-static
116-
-z "max-page-size=0x1000"
116+
-z "max-page-size=${MAX_PAGE_SIZE}"
117117
--defsym RESERVE_TOP="${RESERVE_TOP}"
118118
--script "${CMAKE_CURRENT_LIST_DIR}/nacl_bootstrap.x"
119119
-o "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/nacl_bootstrap_raw"

0 commit comments

Comments
 (0)