Dæmon Saigo SDK — Modern Toolchain for Native Client

From Unvanquished
Jump to: navigation, search

Saigo is a modern toolchain for compiling Native Client applications.

📚️

Trivia

In Japanese, Saigo (さいご / 最後) means “the last”, “the end”, “the final” or “the conclusion”. This refers to the end of an era, the final stage of an event, or the last item in a sequence…

Saigo is the name Google gave to its latest compiler suite for building Native Client applications. The Dæmon Saigo SDK is based on it.

Information 48x48.png

Native Client is not a Google thing anymore

Google publicly announced in May of 2017 the (then-)upcoming deprecation and abandonment of Native Client technologies in favor of WebAssembly, and announced the actual deprecation in 2020. But Google also supported Native Client-powered ChromeOS 138 until ChromeOS 139 in July of 2025 and as such continued developpement of some Native Client technologies. This extra development materialized in the maintenance of the loader and a toolchain named Saigo, frequently rebased on the latest LLVM upstream at the time. The loader received commits from Google until April of 2025, while Saigo received commits from Google until January of 2025 and the last rebase was over Clang 21.

Nothing about Native Client should be expected from Google anymore.

Status

The Unvanquished team publishes frequent releases of the Dæmon Saigo SDK with ready-to-use prebuilt packages for a large number of platforms:

The Unvanquished game code is already buildable with Saigo. Saigo is meant to replace PNaCl for Unvanquished release builds.

The Unvanquished team is working on rebuilding the Native Client ecosystem to benefit from the updates implemented by Google over the years. This enables newer C and C++ versions, thanks to the Saigo compiler (from the Dæmon Saigo SDK) being based on Clang 21. It also makes sure everyone can rebuild the runtime and the toolchain.

Components

The Saigo SDK consists of:

  • C and C++ compilers based on LLVM clang;
  • Utilities like a linker, based on GNU binutils;
  • A debugger, based on GDB;
  • A libc based on Newlib and a libc++ based on LLVM.
  • Headers from the Native Client repositories.

The compiler supports latest C++ standards like C23 and C++23. Unlike PNaCl, Saigo compiles directly to .nexe.

Saigo may not support C++ exceptions as far as we know but supports setjmp/longjmp.

Sources

The project for rebuilding the Saigo Native Client SDK can be found there:

This project include patches applied over compile, binutils and debugger repositories before building. This project builds clang, binutils and gdb from Google repositories, and fetches headers from the Dæmon Native Client Runtime repository:

Platform support

Native Client Platform Compatibility
System Architecture Dæmon NaCl Runtime Google PNaCL SDK Dæmon Saigo SDK
Windows amd64 ✅️ native ✅️ native ✅️ native
i686 ✅️ native ✅️ native ✅️ native
Linux amd64 ✅️ native ✅️ native ✅️ native
i686 ✅️ native ❌️ ✅️ native
arm64 ☑️ armhf Multiarch
☑️ Box64 (WIP)
❌️ ✅️ native
armhf ✅️ native ❌️ ✅️ native
ppc64el ☑️ Box64 (WIP) ❌️ ✅️ native
riscv64 ☑️ Box64 (WIP) ❌️ ✅️ native
loong64 ☑️ Box64 (WIP, untested) ❌️ ✅️ native
macOS amd64 ✅️ native ✅️ native ✅️ native
arm64 ☑️ amd64 Rosetta2 ☑️ amd64 Rosetta2 ✅️ native
FreeBSD amd64 ☑️ Linuxulator ❌️ ✅️ native
i686 ☑️ Linuxulator (untested) ❌️ ✅️ native
Legend: ✅️ native support, ☑️ support through a compatibility layer, ❌️ no support.

Breakpad support

Code compiled with Saigo uses -2 instead of -1 as value for the CFA pseudo-register.

We patched Breakpad to also support Saigo binaries, see this patch.

Migration to Saigo

Here is a GitHub issue about the ongoing efforts for migrating to Saigo: