Skip to content

Commit a8436ab

Browse files
committed
cmake: make possible to build sel_ldr with 16K PageSize
1 parent 5b56162 commit a8436ab

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
@@ -99,14 +99,20 @@ string(REPLACE ";" " " BOOTSTRAP_FLAGS_STRING "${BOOTSTRAP_FLAGS}")
9999
add_library(nacl_bootstrap OBJECT "nacl_bootstrap.c")
100100
set_target_properties(nacl_bootstrap PROPERTIES COMPILE_FLAGS ${BOOTSTRAP_FLAGS_STRING})
101101

102+
if (USE_ARMHF_16K_PAGESIZE)
103+
set(MAX_PAGE_SIZE 0x4000)
104+
else()
105+
set(MAX_PAGE_SIZE 0x1000)
106+
endif()
107+
102108
add_custom_target(nacl_bootstrap_raw
103109
COMMAND env "${PYTHON}"
104110
"${CMAKE_CURRENT_LIST_DIR}/ld_bfd.py"
105111
--compiler "${COMPILER_OVERRIDE}"
106112
-m "${LD_EMUL}"
107113
--build-id
108114
-static
109-
-z "max-page-size=0x1000"
115+
-z "max-page-size=${MAX_PAGE_SIZE}"
110116
--defsym RESERVE_TOP="${RESERVE_TOP}"
111117
--script "${CMAKE_CURRENT_LIST_DIR}/nacl_bootstrap.x"
112118
-o "${CMAKE_CURRENT_BINARY_DIR}/nacl_bootstrap_raw"

0 commit comments

Comments
 (0)