Skip to content

Commit a5ae566

Browse files
committed
cmake: make possible to build sel_ldr with 16K PageSize
1 parent 670c780 commit a5ae566

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

cmake/NaClFlags.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ if (NOT MSVC)
44
option(USE_STATIC_LIBS "Tries to use static libs where possible." OFF)
55
endif()
66

7+
if (ARCH_armhf)
8+
option(USE_ARMHF_16K_PAGESIZE "Build armhf binaries with 16K PageSize." OFF)
9+
list(APPEND INHERITED_OPTIONS "USE_ARMHF_16K_PAGESIZE")
10+
endif()
11+
712
macro(set_ASM_flag FLAG)
813
set(lang ASM)
914
if (${ARGC} GREATER 1)
@@ -93,6 +98,10 @@ if (USE_STATIC_LIBS)
9398
set_linker_flag("-static")
9499
endif()
95100

101+
if (USE_ARMHF_16K_PAGESIZE)
102+
set_linker_flag("-Wl,-z,max-page-size=16384")
103+
endif()
104+
96105
#TODO: Import from SetUpClang() from (root)/SConstruct.
97106
#TODO: This is mostly ASAN configurations.
98107

src/trusted/service_runtime/linux/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,20 @@ string(REPLACE ";" " " BOOTSTRAP_FLAGS_STRING "${BOOTSTRAP_FLAGS}")
9090
add_library(nacl_bootstrap OBJECT "nacl_bootstrap.c")
9191
set_target_properties(nacl_bootstrap PROPERTIES COMPILE_FLAGS ${BOOTSTRAP_FLAGS_STRING})
9292

93+
if (USE_ARMHF_16K_PAGESIZE)
94+
set(MAX_PAGE_SIZE 0x4000)
95+
else()
96+
set(MAX_PAGE_SIZE 0x1000)
97+
endif()
98+
9399
add_custom_target(nacl_bootstrap_raw
94100
COMMAND env "${PYTHON}"
95101
"${CMAKE_CURRENT_LIST_DIR}/ld_bfd.py"
96102
--compiler "${COMPILER_OVERRIDE}"
97103
-m "${LD_EMUL}"
98104
--build-id
99105
-static
100-
-z "max-page-size=0x1000"
106+
-z "max-page-size=${MAX_PAGE_SIZE}"
101107
--defsym RESERVE_TOP="${RESERVE_TOP}"
102108
--script "${CMAKE_CURRENT_LIST_DIR}/nacl_bootstrap.x"
103109
-o "${CMAKE_CURRENT_BINARY_DIR}/nacl_bootstrap_raw"

0 commit comments

Comments
 (0)