Skip to content

Deps: use our own NaCl runtime incl. IRT everywhere - #2024

Open
slipher wants to merge 6 commits into
DaemonEngine:masterfrom
slipher:naclrt-build
Open

slipher wants to merge 6 commits into
DaemonEngine:masterfrom
slipher:naclrt-build

Conversation

@slipher

@slipher slipher commented Oct 27, 2026

Copy link
Copy Markdown
Member

Build the Native Client loader in external_deps/build.sh for all *nix platforms. Incorporate our Saigo SDK to also build the IRT which was not built by us previously. For Windows platforms, download an NaCl release built by myself using MSVC (see DaemonEngine/native_client#78).

Some commits from #1986 are included to use the host-mode deps package infrastructure. Scons can now be installed by the script using a Python venv instead of expecting it to be installed on the host system.

The download URL for the Windows NaCl release is not set up yet. I tested it by dropping the zips into the download cache.

@illwieckz illwieckz closed this Oct 27, 2026
@illwieckz illwieckz reopened this Oct 27, 2026
@illwieckz

Copy link
Copy Markdown
Member

lol @ the misclick

@illwieckz

Copy link
Copy Markdown
Member

I wanted to say: Thanks a lot! 😄️

@slipher

slipher commented Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

@slipher

slipher commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

Ready to go.

@slipher

slipher commented Nov 8, 2026 •

Copy link
Copy Markdown
Member Author

Fixes Unvanquished/Unvanquished#3562. Also fixes Unvanquished/Unvanquished#3286 given that one runs the deps build script; I successfully ran some tests on a VM with 64k pages. Well, you also need to add the max page size to the engine build for that.

- Don't clear enviro vars for Scons.  The scons build here in fact pays
far less attention to environment variables than other build systems.
The main one that matters is PATH.  PATH will be needed once we update
the native_client reference since I de-hardcoded the /usr/bin/clang path
(also we will probably use GCC which never had that).

- Fix a typo {$NACLRUNTIME_BASEURL} instead of ${NACLRUNTIME_BASEURL}.
This went unnoticed since apparently curl does bash-style brace
expansion on the URL, but unlike Bash it allows an expansion with only 1
option.

- Add naclruntime to list of all known packages.
Installs with a Python venv.
When building the external_deps package, make it optional to bundle the
armhf libc and libc++ and patch the loader's binary interpreter. This
can be omitted if the target system already has the necessary libaries
installed. The patching and bundling is moved to a new build.sh package
named naclruntime-vendor-libc.

In CMake this is handled by only copying lib-armhf/ if it exists in the
deps package. At runtime LD_LIBRARY_PATH and PWD are still always set,
but this has no effect if the dir doesn't exist.
When spawning the NaCl loader on an arm64 Linux host machine, the engine
always set LD_LIBRARY_PATH=lib-armhf (relative to libpath). But this
should only be done if the engine is arm64. It does not make sense to
set this with an armhf engine on arm64 host, for two reasons:
- CMake does not create lib-armhf for a native armhf engine.
- If the armhf engine is already running, there is presumably a working
  libc anyway.
On Linux and Mac, build the Native Client loader and IRT from source for
for the external_deps package on all supported platforms. (Previously,
only the loader was build and only for Linux amd64.) On Windows,
download a NaCl build built by us rather than Google.

The Saigo SDK is required to build the IRT. It must me installed in the
current directory ($WORK_DIR).

Regarding vendored armhf libs for the arm64 target, they must now be
installed on the build machine rather than copied from the PNaCl SDK
(those are too old).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants