Rafał Sobota
Rafał Sobota

Reputation: 1468

Can I run Google's Native Client outside of the browser?

Is it possible to run Google NaCl outside of the browser as a process sandbox?

Upvotes: 15

Views: 2902

Answers (4)

Deqing
Deqing

Reputation: 14632

You can try run.py which included in Native Client's source.

Here is an example that runs a hello world program.

make test_hello_world_nexe
python native_client/run.py out/Debug/hello_world_newlib_x64.nexe

This script can build, search and invoke sel_ldr, and pass proper arguments to it automatically.

Upvotes: 2

garethm
garethm

Reputation: 2174

The Native Client documentation is probably a good starting point for trying to figure out how everything works.

As Mark Seaborn and Bennet Yee indicate, you are probably best off looking into using sel_ldr. More details about how sel_ldr is included in "The life of sel_ldr".

I haven't personally implemented anything that uses NaCl outside of a browser, so I can't unfortunately comment on the ease of doing so.

Upvotes: 6

Bennet Yee
Bennet Yee

Reputation: 526

To add to Mark's answer, take a look at the sel_universal target. There are obviously some interfaces that cannot be supported, e.g., Pepper interfaces, since such a stand-alone run doesn't involve a browser. Furthermore, the stable ABI that we support is that which is exposed by the "integrated runtime" or irt, and the irt code thunk assumes that the browser is present. a standalone use of NaCl via sel_ldr would probably have to use the syscall interface initially, until an alternate irt is written. (NB: we make no guarantees about the stability of the syscall interface.)

Upvotes: 4

Mark Seaborn
Mark Seaborn

Reputation: 1462

Yes. The standalone build of Native Client contains a program called "sel_ldr" which runs the NaCl sandbox outside of the web browser. A lot of NaCl's test suite tests NaCl by running programs under sel_ldr rather than under the browser.

Upvotes: 9

Related Questions