Josh Heitzman
Josh Heitzman

Reputation: 1834

On Windows, how to run Google's Native Client run outside of Chrome?

This question is specifically about Windows (64-bit).

A similar question was asked here, but the answers appear to be specific to Linux (and perhaps OS X).

The non-Windows answer is to use sel_ldr but no such file is present in a Chrome install on Windows. nacl64.exe seem like it is the file that files the same function. This page mentions the "NaCl Process" and that even though Chrome is 32-bit process on x64 Windows, sel_ldr needs to be 64-bit and thus a separate process. I also see nacl64.exe running when my plug-in is loaded, and not running when when I just start Chrome without a NaCl plug-in loaded.

The NaCl plug-in for Visual Studio requires being run on 64-bit windows, thus the comments about 64-bit above.

On this page I found an example that was reported as successful on Linux:

~/nacl_sdk/pepper_19/tools/sel_ldr_x86_64 -B ~/nacl_sdk/pepper_19/tools/irt_x86_64.nexe hello_x86_64.nexe

and here I found this example also for Linux:

/home/ubuntu/nacl_sdk/pepper_19/tools/sel_ldr_x86_32 -a -S -B /home/ubuntu/nacl_sdk/pepper_19/tools/irt_core_x86_32.nexe <plug-in path>

so I tried some commands modeled on that but all have resulted in nacl64.exe crashing:

<user directory>\AppData\Local\Google\Chrome\Application\23.0.1271.91>nacl64.exe -B nacl_irt_x86_64.nexe <NaCL SDK root>\vs_addin\examples\hello_nacl_cpp\hello_nacl_cpp\NaCl64\newlib\Debug\hello_nacl_cpp_64.nexe

d:\><user directory>\AppData\Local\Google\Chrome\Application\23.0.1271.64\nacl64.exe -B <user directory>\AppData\Local\Google\Chrome\Application\23.0.1271.64\nacl_irt_x86_64.nexe <NaCL SDK root>\vs_addin\examples\hello_nacl_cpp\hello_nacl_cpp\NaCl64\newlib\Debug\hello_nacl_cpp_64.nexe

d:\><user directory>\AppData\Local\Google\Chrome\Application\23.0.1271.64\nacl64.exe -a -S -B <user directory>\AppData\Local\Google\Chrome\Application\23.0.1271.64\nacl_irt_x86_64.nexe <NaCL SDK root>\vs_addin\examples\hello_nacl_cpp\hello_nacl_cpp\NaCl64\newlib\Debug\hello_nacl_cpp_64.nexe

and I've verified that hello_nacl_cpp_64.nexe works when run in Chrome via a web page.

So then the question is, on Windows, how does one successfully run Google's Native Client run outside of Chrome?

Upvotes: 3

Views: 4323

Answers (1)

Ha.
Ha.

Reputation: 3454

You can find sel_ldr.exe and non-browser IRT in NaCl SDK in pepper_<version>/tools folder.

Note that NaCl application can't be run successfully both in browser and sel_ldr. Browser application shouldn't have main, command line application must have it. Also command line application can not use Pepper APIs since sel_ldr doesn't implement them.

Upvotes: 3

Related Questions