Skip to content

Commit a4f70d0

Browse files
committed
external_deps: rebuild nacl_loader for Linux amd64
Add the naclruntime target to external_deps/build.sh. It builds nacl_loader and nacl_helper_bootstrap. This uses our version of the native_client repository with a hacked build script that lets us build native binaries without Chromium tools. The build brings two dependencies: LLVM and SCons. Fixes #1504 (NaCl crash handling doesn't work with recent Linux kernels.)
1 parent 886111a commit a4f70d0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

external_deps/build.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,34 @@ build_naclports() {
889889
cp pepper_*"/ports/lib/newlib_pnacl/Release/"{liblua.a,libfreetype.a,libpng16.a} "${PREFIX}/pnacl_deps/lib"
890890
}
891891

892+
893+
NATIVECLIENT_REVISION=27ccec9ff58b04b7635cd8a7b5b997a58c071952
894+
# Only builds nacl_loader and nacl_helper_bootstrap for now, not IRT.
895+
build_naclruntime() {
896+
case "${PLATFORM}" in
897+
linux-amd64-default)
898+
local NACL_ARCH=x86-64
899+
;;
900+
*)
901+
log error "naclruntime not implemented for ${PLATFORM}"
902+
;;
903+
esac
904+
905+
local dir_name="DaemonEngine-native_client-${NATIVECLIENT_REVISION:0:7}"
906+
local archive_name="native_client-${NATIVECLIENT_REVISION}.zip"
907+
908+
download_extract naclruntime "${archive_name}" \
909+
"https://api.github.com/repos/DaemonEngine/native_client/zipball/${NATIVECLIENT_REVISION}"
910+
911+
"${download_only}" && return
912+
913+
cd "${dir_name}"
914+
scons "platform=${NACL_ARCH}" MODE=opt-linux werror=0 naclsdk_validate=0 sysinfo=0 sel_ldr
915+
cp "scons-out/opt-linux-${NACL_ARCH}/staging/nacl_helper_bootstrap" "${PREFIX}/nacl_helper_bootstrap"
916+
cp "scons-out/opt-linux-${NACL_ARCH}/staging/sel_ldr" "${PREFIX}/nacl_loader"
917+
}
918+
919+
892920
# The import libraries generated by MinGW seem to have issues, so we use LLVM's version instead.
893921
# So LLVM must be installed, e.g. 'sudo apt install llvm'
894922
build_genlib() {
@@ -1265,6 +1293,7 @@ fi
12651293

12661294
# Enable parallel build
12671295
export MAKEFLAGS="-j`nproc 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null || echo 1`"
1296+
export SCONSFLAGS="${MAKEFLAGS}"
12681297

12691298
# Setup platform
12701299
platform="${1}"; shift

0 commit comments

Comments
 (0)