Skip to content

Commit 555055d

Browse files
committed
cmake: make possible to build sel_ldr with 16K PageSize
1 parent 7620780 commit 555055d

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

cmake/NaClFlags.cmake

+9
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

+7-1
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,20 @@ string(REPLACE ";" " " BOOTSTRAP_FLAGS_STRING "${BOOTSTRAP_FLAGS}")
8484
add_library(nacl_bootstrap OBJECT "nacl_bootstrap.c")
8585
set_target_properties(nacl_bootstrap PROPERTIES COMPILE_FLAGS ${BOOTSTRAP_FLAGS_STRING})
8686

87+
if (USE_ARMHF_16K_PAGESIZE)
88+
set(MAX_PAGE_SIZE 0x4000)
89+
else()
90+
set(MAX_PAGE_SIZE 0x1000)
91+
endif()
92+
8793
add_custom_target(nacl_bootstrap_raw
8894
COMMAND env "${PYTHON}"
8995
"${CMAKE_CURRENT_LIST_DIR}/ld_bfd.py"
9096
--compiler "${COMPILER_OVERRIDE}"
9197
-m "${LD_EMUL}"
9298
--build-id
9399
-static
94-
-z "max-page-size=0x1000"
100+
-z "max-page-size=${MAX_PAGE_SIZE}"
95101
--defsym RESERVE_TOP="${RESERVE_TOP}"
96102
--script "${CMAKE_CURRENT_LIST_DIR}/nacl_bootstrap.x"
97103
-o "${CMAKE_CURRENT_BINARY_DIR}/nacl_bootstrap_raw"

0 commit comments

Comments
 (0)