Skip to content

Commit ef57a05

Browse files
committed
wIP build sel_ldr + irt on more platforms
1 parent b6be067 commit ef57a05

1 file changed

Lines changed: 44 additions & 13 deletions

File tree

‎external_deps/build.sh‎

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ VORBIS_VERSION=1.3.7
5959
OPUS_VERSION=1.5.2
6060
OPUSFILE_VERSION=0.12
6161
NACLSDK_VERSION=44.0.2403.155
62-
NACLRUNTIME_REVISION=2aea5fcfce504862a825920fcaea1a8426afbd6f
62+
NACLRUNTIME_REVISION=ab09db9ab6da96f2549b382e14d19212b482634a
6363
NCURSES_VERSION=6.5
6464
SCONS_VERSION=4.8.1
6565
WASISDK_VERSION=16.0
@@ -1092,29 +1092,60 @@ build_native-scons() {
10921092
ln -s --force "${dir_name}/bin/scons" "${NATIVE_PREFIX}/bin/scons"
10931093
}
10941094

1095-
# Only builds nacl_loader and nacl_helper_bootstrap for now, not IRT.
10961095
build_naclruntime() {
1096+
local dir_name="DaemonEngine-native_client-${NACLRUNTIME_REVISION:0:7}"
1097+
local archive_name="native_client-${NACLRUNTIME_REVISION}.zip"
1098+
1099+
download_extract naclruntime "${archive_name}" \
1100+
"${NACLRUNTIME_BASEURL}/${NACLRUNTIME_REVISION}"
1101+
1102+
"${download_only}" && return
1103+
1104+
cd "${dir_name}"
1105+
10971106
case "${PLATFORM}" in
10981107
linux-amd64-*)
1099-
local NACL_ARCH=x86-64
1108+
naclruntime_impl linux-amd64-default linux x86-64
1109+
;;
1110+
linux-i686-*)
1111+
naclruntime_impl linux-i686-default linux x86-32
1112+
;;
1113+
linux-armhf-*)
1114+
naclruntime_impl linux-armhf-default linux arm
1115+
;;
1116+
linux-arm64-*)
1117+
naclruntime_impl linux-armhf-default linux arm
1118+
# Later after making output names distinguishable we can add:
1119+
# naclruntime_impl linux-amd64-default linux x86-64
1120+
;;
1121+
macos-*-*)
1122+
naclruntime_impl macos-amd64-default darwin x86-64
11001123
;;
11011124
*)
11021125
log ERROR 'Unsupported platform for naclruntime'
11031126
;;
11041127
esac
1128+
}
11051129

1106-
local dir_name="DaemonEngine-native_client-${NACLRUNTIME_REVISION:0:7}"
1107-
local archive_name="native_client-${NACLRUNTIME_REVISION}.zip"
1108-
1109-
download_extract naclruntime "${archive_name}" \
1110-
"{$NACLRUNTIME_BASEURL}/${NACLRUNTIME_REVISION}"
1130+
naclruntime_impl() {
1131+
local target_platform="${1}"
1132+
local nacl_os="${2}"
1133+
local nacl_arch="${3}"
11111134

1112-
"${download_only}" && return
1135+
# TODO: better way to detect native platform
1136+
source <("${SCRIPT_DIR}/../cmake/Yokai/Detection/detect" cc | tr A-Z a-z)
1137+
native_sys="${yokai_target_system_name}-${yokai_target_arch_name}"
11131138

1114-
cd "${dir_name}"
1115-
scons --mode=opt-linux "platform=${NACL_ARCH}" werror=0 sysinfo=0 sel_ldr
1116-
smart_copy "scons-out/opt-linux-${NACL_ARCH}/staging/nacl_helper_bootstrap" "${PREFIX}/nacl_helper_bootstrap"
1117-
smart_copy "scons-out/opt-linux-${NACL_ARCH}/staging/sel_ldr" "${PREFIX}/nacl_loader"
1139+
(
1140+
setup_platform "${target_platform}"
1141+
# FIXME SDK version
1142+
scons saigo_newlib_dir="${WORK_DIR}/saigosdk-${native_sys}_20260925" --mode="opt-${nacl_os},nacl" platform="${nacl_arch}" saigo=1 --no-clang werror=0 sysinfo=0 sel_ldr irt_core
1143+
)
1144+
cp "scons-out/opt-${nacl_os}-${nacl_arch}/staging/sel_ldr" "${PREFIX}/nacl_loader"
1145+
if [ -f "scons-out/opt-linux-${nacl_arch}/staging/nacl_helper_bootstrap" ]
1146+
then
1147+
cp "scons-out/opt-linux-${nacl_arch}/staging/nacl_helper_bootstrap" "${PREFIX}/nacl_helper_bootstrap"
1148+
fi
11181149
}
11191150

11201151
# Check for DLL dependencies on MinGW stuff. For MSVC platforms this is bad because it should work

0 commit comments

Comments
 (0)