Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 82 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,60 @@
Fork of https://chromium.googlesource.com/native_client/src/native_client
with edits to enable building NaCl without the Chromium
dev tools. History had to be cut off due to 200 MB zip files in the history.
Currently it only works for amd64 host+target. (run.py won't work
since NaCl targets aren't supported yet.)
Dependencies:
- LLVM (must be installed in /usr/bin)
# Native Client loader

This project makes possible to rebuild the Native Client loader for usage with the [Dæmon game engine](https://github.com/DaemonEngine/Daemon). The Dæmon engine is the open-source game engine powering the [Unvanquished game](https://unvanquished.net). The Dæmon engine uses Native Client to securely and portably run downloadable compiled games.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The very long lines are annoying.


Native Client is a sandboxing technology by Google, it was used by Chrome extensions and Chrome apps.

Google publicly annouced [in May of 2017](https://www.tomshardware.com/news/chrome-deprecates-pnacl-embraces-webassembly%2C34583.html) the (then-)upcoming deprecation and abandonment of Native Client technologies in favor of WebAssembly, and announced the actual deprecation [in 2020](https://developer.chrome.com/deprecated). But Google also [supported](https://developer.chrome.com/docs/native-client) the Native Client-powered ChromeOS 138 [until July of 2025](https://support.google.com/chrome/a/answer/10314655) and as such continued developpement of some Native Client technologies.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last link isn't very useful. It goes to a list of all release notes without giving any clue which version I'm supposed to look at.


The related project to rebuild the Saigo Native Client compiler can be found there:

- [github.com/DaemonEngine/saigo-release-scripts](https://github.com/DaemonEngine/saigo-release-scripts)

Nothing about Native Client should be expected from Google anymore.


## History

This is a fork of the upstream repository:

- [chromium.googlesource.com/native_client/src/native_client](https://chromium.googlesource.com/native_client/src/native_client)

The Git history has been rewritten to remove very large files (multiple MinGW archives were stored in Git and things like that!), reducing the history size from 384MB to 57MB.

More information about this history rewriting can be found there:

- [github.com/DaemonEngine/native_client/issues/13](https://github.com/DaemonEngine/native_client/issues/13)

This fork brings edits to enable the building of NaCl without the Chromium

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use a more prominent billing, like in the first paragraph. The fact it can be built without gclient or any other Chromium repos.

dev tools.

Many of the original project pages are no longer available. Some documentation about Native Client can be found at:

- Documentation for [contributors to Native Client](https://web.archive.org/web/20250323050839/https://www.chromium.org/nativeclient/) (Web archive)
- [Research papers](https://web.archive.org/web/20250821150630/https://www.chromium.org/nativeclient/reference/research-papers/) (Web archive)


## Status

Currently it only works for amd64 host+target (`run.py` won't work
since NaCl targets aren't supported yet).


## Dependencies

- LLVM (must be installed in `/usr/bin`)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slipher do we still need LLVM be in /usr/bin/?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to rewrite this line as GCC or Clang.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the LLVM location is still hard-coded. GCC just needs to be in the PATH. And with the other PR LLVM is now optional.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the way to use GCC is by putting --no-clang in the command line.

- SCons

### Build the NaCl loader and boostrap loader
```

## Build the NaCl loader and boostrap loader

```sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can mention the other possible architectures are x86 and arm.

scons --mode=opt-host platform=x86-64 sel_ldr
```


### Build the IRT

This requires the Saigo NaCl toolchain. You can provide it by either
(a) passing `saigo_newlib_dir=<path>` on the command line (the directory
you want to target is normally called `saigo_newlib`), or
Expand All @@ -21,67 +63,51 @@ top-level directory from `saigo_newlib` to `saigo_newlib_raw`.

The following command builds one `irt_core_raw.nexe`. You need to strip it
yourself; ordinary Linux `strip` seems to work.
```

```sh
scons --mode=nacl saigo=1 platform=x86-64 irt_core_raw [optional saigo_newlib_dir=...]
```

### Try some tests

## Try some tests

This builds both components and runs some tests.
```

```sh
scons --mode=opt-host,nacl saigo=1 platform=x86-64 --keep-going small_tests medium_tests
```

To enable crash dump tests, add the option `breakpad_tools_dir=<path to breakpad>`. The
repository can be found at `daemon/libs/breakpad`. You need to have built the Breakpad
tools in-source.
```
---

# Native Client

Native Client is a deprecated sandboxing technology. It is currently used by a
few third party chrome extensions and chrome apps. Many of the original project
pages are not longer available. Some documentation can be found at:
* Documentation for [contributors to Native
Client](http://www.chromium.org/nativeclient)
* [Research
papers](http://www.chromium.org/nativeclient/reference/research-papers)

## Directory structure
## Directory structure

The following list describes major files and directories that you'll see in
your working copy of the repository, including some directories that don't
exist until you've built Native Client. Paths are relative to the
`native_client` directory.

* `COPYING NOTICE README.md RELEASE_NOTES documentation/`: Documentation,
release, and license information.

* `SConstruct scons.bat scons scons-out/ site_scons/`: Build-related files.
The `scons.bat` and `scons` files, with data from `SConstruct`, let you
build Native Client and its tests. The `scons-out` and `site-scons`
directories don't exist in the git repository; they're created when Native
Client is built. The `scons-out/*/staging` directories contain files, such
as the Native Client plug-in and compiled examples, that let you use and
test Native Client.

* `src/`: Core source code for Native Client.

* `src/include/`: Header files that are missing from some platforms and are
used by more than one major part of Native Client

* `src/shared/`: Source code that's used by both trusted code (such as the
service runtime) and untrusted code (such as Native Client modules)

* `src/third_party`: Other people's source code

* `src/trusted/`: Source code that's used only by trusted code

* `src/untrusted/`: Source code that's used only by untrusted code

* `tests/common/`: Source code for examples and tests.

* `../third_party/`: Third-party source code and binaries that aren't part of
the service runtime. When built, the Native Client toolchain is in
`src/third_party/nacl_sdk/`.

* `tools/`: Utilities such as the plug-in installer.
- `COPYING NOTICE README.md RELEASE_NOTES documentation/`: Documentation,
release, and license information.
- `SConstruct scons.bat scons scons-out/ site_scons/`: Build-related files.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scons (+ scons.bat I guess) could be dropped as we no longer use a vendored scons, just the scons command normally installed. Though ./scons still works apparently.

The `scons.bat` and `scons` files, with data from `SConstruct`, let you
build Native Client and its tests. The `scons-out` and `site-scons`
directories don't exist in the git repository; they're created when Native
Client is built. The `scons-out/*/staging` directories contain files, such
as the Native Client plug-in and compiled examples, that let you use and
test Native Client.
- `src/`: Core source code for Native Client.
- `src/include/`: Header files that are missing from some platforms and are
used by more than one major part of Native Client
- `src/shared/`: Source code that's used by both trusted code (such as the
service runtime) and untrusted code (such as Native Client modules)
- `src/third_party`: Other people's source code
- `src/trusted/`: Source code that's used only by trusted code
- `src/untrusted/`: Source code that's used only by untrusted code
- `tests/common/`: Source code for examples and tests.
- `../third_party/`: Third-party source code and binaries that aren't part of

@illwieckz illwieckz Jun 22, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can delete this ../third_party mention. The first purpose of the fork was to not require things outside this repository.

the service runtime. When built, the Native Client toolchain is in
`src/third_party/nacl_sdk/`.
- `tools/`: Utilities such as the plug-in installer (deprecated).