Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 About | |
| 2 ===== | |
| 3 | |
| 4 This directory contains the necessary components to run Non-SFI NaCl | |
| 5 nexes (native executables) from within Mojo. | |
| 6 | |
| 7 Using | |
| 8 ===== | |
| 9 | |
| 10 The Non-SFI NaCl and accompanying tests should be built by default for Linux. | |
| 11 The boolean indicating if they are built is "mojo_use_nacl_nonsfi", defined | |
| 12 inside the BUILD files. | |
| 13 | |
| 14 Build mojo (all following commands assume you are in the root of the mojo | |
| 15 repository): | |
| 16 | |
| 17 ``` | |
| 18 $ ./mojo/tools/mojob.py gn | |
| 19 $ ./mojo/tools/mojob.py build | |
| 20 ``` | |
| 21 | |
| 22 Doing this build step will automatically create a pexe of unit tests, at | |
| 23 `./out/Debug/newlib_pnacl/monacl_test.pexe`. To translate a pexe into a | |
| 24 non-SFI nexe: | |
| 25 | |
| 26 ``` | |
| 27 $ ./native_client/toolchain/linux_x86/pnacl_newlib/bin/pnacl-translate | |
|
Mark Seaborn
2015/10/12 17:18:50
How about adding a "\" to the end, since this is s
Sean Klein
2015/10/12 19:10:44
Done.
| |
| 28 ./out/Debug/newlib_pnacl/FOOBAR.pexe -o FOOBAR.nexe -arch x86-32-nonsfi | |
| 29 ``` | |
| 30 | |
| 31 Now, you should have the fully translated nexe (called | |
| 32 "FOOBAR.nexe"). You can run the nexe through the monacl shell | |
| 33 (a minimal, "nexe-only" shell, which loads the nexe ELF file -- see | |
| 34 monacl_shell_nonsfi.cc): | |
| 35 | |
| 36 ``` | |
| 37 $ ./out/Debug/clang_x86/monacl_shell_nonsfi FOOBAR.nexe | |
|
Mark Seaborn
2015/10/12 17:18:50
Nit: remove one space after "$"
Sean Klein
2015/10/12 19:10:44
Done.
| |
| 38 ``` | |
| 39 | |
| 40 This monacl_shell_nonsfi is the easiest way to run nexes in mojo -- however, it | |
|
Mark Seaborn
2015/10/12 17:18:50
"mojo" -> "Mojo"?
Sean Klein
2015/10/12 19:10:44
Done.
| |
| 41 is not the only way. Usually, applications are launched through the | |
| 42 "mojo_shell", but some additional information is required to know how to handle | |
| 43 this content (i.e., how does the mojo_shell know it is dealing with a nonsfi | |
| 44 nexe?). | |
| 45 | |
| 46 The BUILD.gn files in mojo automatically make this pexe, translate it to a | |
| 47 nexe, and prepend a line ("#!mojo mojo:nacl_content_handler_nonsfi") to the | |
| 48 front of the file, at which point it is also runnable through the mojo_shell. | |
| 49 These files, which start with this "#!" line, are ".mojo" files. The nexes can | |
| 50 be run like this: | |
| 51 | |
| 52 ``` | |
| 53 $ ./out/Debug/mojo_shell --enable-multiprocess out/Debug/FOOBAR.mojo | |
| 54 ``` | |
| 55 | |
| 56 TODO | |
| 57 ============= | |
|
Mark Seaborn
2015/10/12 17:18:50
Less "="s, to match text?
Sean Klein
2015/10/12 19:10:44
Done.
| |
| 58 | |
| 59 * Enable content handling of Non-SFI pexes, which should be translated and run | |
| 60 as nexes. | |
| 61 * Use subzero (a NaCl project to improve translation speed) for pexe | |
| 62 translation. | |
| 63 * Enable caching of translated pexes. | |
| OLD | NEW |