Skip to content

Commit 1ce4e9f

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 beb304a commit 1ce4e9f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

SConstruct

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2683,6 +2683,8 @@ def MakeGenericLinuxEnv(platform=None):
26832683
LINK = '$CXX',
26842684
)
26852685

2686+
linux_env.SetDefault(MAX_PAGE_SIZE='0x1000')
2687+
26862688
# Prepend so we can disable warnings via Append
26872689
linux_env.Prepend(
26882690
CPPDEFINES = [['_POSIX_C_SOURCE', '199506'],
@@ -2705,6 +2707,7 @@ def MakeGenericLinuxEnv(platform=None):
27052707
LINKFLAGS = ['-m64'] + sysroot_flags,
27062708
)
27072709
elif linux_env.Bit('build_arm'):
2710+
linux_env.Replace(MAX_PAGE_SIZE='0x10000')
27082711
SetUpLinuxEnvArm(linux_env)
27092712
elif linux_env.Bit('build_mips32'):
27102713
SetUpLinuxEnvMips(linux_env)
@@ -2730,7 +2733,8 @@ def MakeGenericLinuxEnv(platform=None):
27302733
linux_env.Prepend(SHLINKFLAGS=['$COMMON_LINKFLAGS'])
27312734
linux_env.Prepend(COMMON_LINKFLAGS=['-Wl,-z,relro',
27322735
'-Wl,-z,now',
2733-
'-Wl,-z,noexecstack'])
2736+
'-Wl,-z,noexecstack',
2737+
'-Wl,-z,max-page-size=${MAX_PAGE_SIZE}'])
27342738
linux_env.Prepend(LINKFLAGS=['-pie'])
27352739
# The ARM toolchain has a linker that doesn't handle the code its
27362740
# 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)