Skip to content

Commit 2437961

Browse files
committed
scons: 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. SCons plumbing.
1 parent b52822c commit 2437961

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

SConstruct

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2688,6 +2688,8 @@ def MakeGenericLinuxEnv(platform=None):
26882688
LINK = '$CXX',
26892689
)
26902690

2691+
linux_env.SetDefault(MAX_PAGE_SIZE='0x1000')
2692+
26912693
# Prepend so we can disable warnings via Append
26922694
linux_env.Prepend(
26932695
CPPDEFINES = [['_POSIX_C_SOURCE', '199506'],
@@ -2710,6 +2712,7 @@ def MakeGenericLinuxEnv(platform=None):
27102712
LINKFLAGS = ['-m64'] + sysroot_flags,
27112713
)
27122714
elif linux_env.Bit('build_arm'):
2715+
linux_env.Replace(MAX_PAGE_SIZE='0x10000')
27132716
SetUpLinuxEnvArm(linux_env)
27142717
elif linux_env.Bit('build_mips32'):
27152718
SetUpLinuxEnvMips(linux_env)
@@ -2735,7 +2738,8 @@ def MakeGenericLinuxEnv(platform=None):
27352738
linux_env.Prepend(SHLINKFLAGS=['$COMMON_LINKFLAGS'])
27362739
linux_env.Prepend(COMMON_LINKFLAGS=['-Wl,-z,relro',
27372740
'-Wl,-z,now',
2738-
'-Wl,-z,noexecstack'])
2741+
'-Wl,-z,noexecstack',
2742+
'-Wl,-z,max-page-size=${MAX_PAGE_SIZE}'])
27392743
linux_env.Prepend(LINKFLAGS=['-pie'])
27402744
# The ARM toolchain has a linker that doesn't handle the code its
27412745
# compiler generates under -fPIE.

src/trusted/service_runtime/build.scons

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ if (env.Bit('linux') and not env.Bit('built_elsewhere')):
427427
'nacl_bootstrap_raw',
428428
[bootstrap_obj],
429429
("env CXX='${CXX}' ${PYTHON} %s %s " +
430-
'-m %s --build-id -static -z max-page-size=0x1000 ' +
430+
'-m %s --build-id -static -z max-page-size=${MAX_PAGE_SIZE} ' +
431431
'--orphan-handling=discard ' +
432432
'--defsym RESERVE_TOP=%s --script %s -o ${TARGET} ${SOURCES}') %
433433
(bootstrap_env.File('linux/ld_bfd.py'), compiler_override, ld_emul,

0 commit comments

Comments
 (0)