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

早过忘川 提交于 2019-11-28 21:25:35

问题


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


回答1:


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.




回答2:


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.




回答3:


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.)




回答4:


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.



来源:https://stackoverflow.com/questions/4690526/can-i-run-googles-native-client-outside-of-the-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!