Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(951)

Side by Side Diff: native_client_sdk/doc_generated/faq.html

Issue 438403003: [NaCl SDK Docs] Only generate one top-level <section> element. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 {{+bindTo:partials.standard_nacl_article}} 1 {{+bindTo:partials.standard_nacl_article}}
2 2
3 <section id="frequently-asked-questions"> 3 <section id="frequently-asked-questions">
4 <h1 id="frequently-asked-questions">Frequently Asked Questions</h1> 4 <h1 id="frequently-asked-questions">Frequently Asked Questions</h1>
5 <div class="contents local" id="contents" style="display: none"> 5 <div class="contents local" id="contents" style="display: none">
6 <ul class="small-gap"> 6 <ul class="small-gap">
7 <li><p class="first"><a class="reference internal" href="#what-is-native-client- good-for" id="id1">What is Native Client Good For?</a></p> 7 <li><p class="first"><a class="reference internal" href="#what-is-native-client- good-for" id="id1">What is Native Client Good For?</a></p>
8 <ul class="small-gap"> 8 <ul class="small-gap">
9 <li><a class="reference internal" href="#why-did-google-build-native-client" id= "id2">Why did Google build Native Client?</a></li> 9 <li><a class="reference internal" href="#why-did-google-build-native-client" id= "id2">Why did Google build Native Client?</a></li>
10 <li><a class="reference internal" href="#when-should-i-use-portable-native-clien t-instead-of-native-client" id="id3">When should I use Portable Native Client in stead of Native Client?</a></li> 10 <li><a class="reference internal" href="#when-should-i-use-portable-native-clien t-instead-of-native-client" id="id3">When should I use Portable Native Client in stead of Native Client?</a></li>
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 </div><p>This document answers some frequently asked questions about Native 73 </div><p>This document answers some frequently asked questions about Native
74 Client (NaCl) and Portable Native Client (PNaCl, pronounced 74 Client (NaCl) and Portable Native Client (PNaCl, pronounced
75 &#8220;pinnacle&#8221;). For a high-level overview of Native Client, see the 75 &#8220;pinnacle&#8221;). For a high-level overview of Native Client, see the
76 <a class="reference internal" href="/native-client/overview.html"><em>Technical Overview</em></a>.</p> 76 <a class="reference internal" href="/native-client/overview.html"><em>Technical Overview</em></a>.</p>
77 <p>If you have questions that aren&#8217;t covered in this FAQ:</p> 77 <p>If you have questions that aren&#8217;t covered in this FAQ:</p>
78 <ul class="small-gap"> 78 <ul class="small-gap">
79 <li>Scan through the <a class="reference internal" href="/native-client/sdk/rele ase-notes.html"><em>Release Notes</em></a>.</li> 79 <li>Scan through the <a class="reference internal" href="/native-client/sdk/rele ase-notes.html"><em>Release Notes</em></a>.</li>
80 <li>Search through or ask on the <a class="reference internal" href="/native-cli ent/help.html"><em>Native Client Forums</em></a>.</li> 80 <li>Search through or ask on the <a class="reference internal" href="/native-cli ent/help.html"><em>Native Client Forums</em></a>.</li>
81 </ul> 81 </ul>
82 <section id="what-is-native-client-good-for">
83 <h2 id="what-is-native-client-good-for">What is Native Client Good For?</h2> 82 <h2 id="what-is-native-client-good-for">What is Native Client Good For?</h2>
84 <section id="why-did-google-build-native-client">
85 <h3 id="why-did-google-build-native-client">Why did Google build Native Client?< /h3> 83 <h3 id="why-did-google-build-native-client">Why did Google build Native Client?< /h3>
86 <ul class="small-gap"> 84 <ul class="small-gap">
87 <li><strong>Performance:</strong> Native Client modules run nearly as fast as na tive 85 <li><strong>Performance:</strong> Native Client modules run nearly as fast as na tive
88 compiled code.</li> 86 compiled code.</li>
89 <li><strong>Security:</strong> Native Client lets users run native compiled code in the 87 <li><strong>Security:</strong> Native Client lets users run native compiled code in the
90 browser with the same level of security and privacy as traditional web 88 browser with the same level of security and privacy as traditional web
91 applications.</li> 89 applications.</li>
92 <li><p class="first"><strong>Convenience:</strong></p> 90 <li><p class="first"><strong>Convenience:</strong></p>
93 <ul class="small-gap"> 91 <ul class="small-gap">
94 <li>Developers can leverage existing code, written in C/C++ or other 92 <li>Developers can leverage existing code, written in C/C++ or other
(...skipping 23 matching lines...) Expand all
118 already-released applications.</li> 116 already-released applications.</li>
119 <li><strong>Convenience:</strong> Developers only need to ship a single <code>.p exe</code> file, 117 <li><strong>Convenience:</strong> Developers only need to ship a single <code>.p exe</code> file,
120 not one <code>.nexe</code> file per supported architecture.</li> 118 not one <code>.nexe</code> file per supported architecture.</li>
121 <li><strong>Portability:</strong> Developers and users don&#8217;t need to worry about 119 <li><strong>Portability:</strong> Developers and users don&#8217;t need to worry about
122 already-released applications not working on new hardware: PNaCl 120 already-released applications not working on new hardware: PNaCl
123 already supports all architectures NaCl does, and as PNaCl evolves it 121 already supports all architectures NaCl does, and as PNaCl evolves it
124 gains support for new processors and fully uses their capabilities.</li> 122 gains support for new processors and fully uses their capabilities.</li>
125 </ul> 123 </ul>
126 <p>For more details, refer to the <a class="reference internal" href="/native-cl ient/nacl-and-pnacl.html"><em>history behind and comparison of 124 <p>For more details, refer to the <a class="reference internal" href="/native-cl ient/nacl-and-pnacl.html"><em>history behind and comparison of
127 NaCl and PNaCl</em></a>.</p> 125 NaCl and PNaCl</em></a>.</p>
128 </section><section id="when-should-i-use-portable-native-client-instead-of-nativ e-client">
129 <h3 id="when-should-i-use-portable-native-client-instead-of-native-client">When should I use Portable Native Client instead of Native Client?</h3> 126 <h3 id="when-should-i-use-portable-native-client-instead-of-native-client">When should I use Portable Native Client instead of Native Client?</h3>
130 <p>See <a class="reference internal" href="/native-client/nacl-and-pnacl.html">< em>NaCl and PNaCl</em></a>. In short: PNaCl works on the Open 127 <p>See <a class="reference internal" href="/native-client/nacl-and-pnacl.html">< em>NaCl and PNaCl</em></a>. In short: PNaCl works on the Open
131 Web platform delivered by Chrome whereas NaCl only works on the Chrome Web 128 Web platform delivered by Chrome whereas NaCl only works on the Chrome Web
132 Store.</p> 129 Store.</p>
133 </section><section id="when-should-i-use-portable-native-client-native-client">
134 <h3 id="when-should-i-use-portable-native-client-native-client">When should I us e Portable Native Client / Native Client?</h3> 130 <h3 id="when-should-i-use-portable-native-client-native-client">When should I us e Portable Native Client / Native Client?</h3>
135 <p>The following are some typical use cases. For details, see the 131 <p>The following are some typical use cases. For details, see the
136 <a class="reference internal" href="/native-client/overview.html"><em>Technical Overview</em></a>.</p> 132 <a class="reference internal" href="/native-client/overview.html"><em>Technical Overview</em></a>.</p>
137 <ul class="small-gap"> 133 <ul class="small-gap">
138 <li>Porting existing applications or software components, written in C/C++ or 134 <li>Porting existing applications or software components, written in C/C++ or
139 virtual machines written in C/C++, for use in a web application.</li> 135 virtual machines written in C/C++, for use in a web application.</li>
140 <li><p class="first">Using compute-intensive applications, including threads and SIMD, such as:</p> 136 <li><p class="first">Using compute-intensive applications, including threads and SIMD, such as:</p>
141 <ul class="small-gap"> 137 <ul class="small-gap">
142 <li>Scientific computing.</li> 138 <li>Scientific computing.</li>
143 <li>Handling multimedia for a web application.</li> 139 <li>Handling multimedia for a web application.</li>
144 <li>Various aspects of web-based games, including physics engines and AI.</li> 140 <li>Various aspects of web-based games, including physics engines and AI.</li>
145 </ul> 141 </ul>
146 </li> 142 </li>
147 <li>Running untrusted code on a server or within an application (such as a plugi n 143 <li>Running untrusted code on a server or within an application (such as a plugi n
148 system for a game).</li> 144 system for a game).</li>
149 </ul> 145 </ul>
150 <p>Portable Native Client and Native Client are versatile technologies which are 146 <p>Portable Native Client and Native Client are versatile technologies which are
151 used in many other contexts outside of Chrome.</p> 147 used in many other contexts outside of Chrome.</p>
152 </section><section id="how-fast-does-code-run-in-portable-native-client">
153 <h3 id="how-fast-does-code-run-in-portable-native-client">How fast does code run in Portable Native Client?</h3> 148 <h3 id="how-fast-does-code-run-in-portable-native-client">How fast does code run in Portable Native Client?</h3>
154 <p>Fast! The SPEC2k benchmarks (C, C++ and floating-point benchmarks) give 149 <p>Fast! The SPEC2k benchmarks (C, C++ and floating-point benchmarks) give
155 the following overhead for optimized PNaCl compared to regular optimized 150 the following overhead for optimized PNaCl compared to regular optimized
156 LLVM:</p> 151 LLVM:</p>
157 <table border="1" class="docutils"> 152 <table border="1" class="docutils">
158 <colgroup> 153 <colgroup>
159 </colgroup> 154 </colgroup>
160 <tbody valign="top"> 155 <tbody valign="top">
161 <tr class="row-odd"><td>x86-32</td> 156 <tr class="row-odd"><td>x86-32</td>
162 <td>15%</td> 157 <td>15%</td>
(...skipping 14 matching lines...) Expand all
177 native code such as <a class="reference internal" href="/native-client/reference /pnacl-c-cpp-language-support.html#language-support-threading"><em>threading</em ></a> and 172 native code such as <a class="reference internal" href="/native-client/reference /pnacl-c-cpp-language-support.html#language-support-threading"><em>threading</em ></a> and
178 <a class="reference internal" href="/native-client/reference/pnacl-c-cpp-languag e-support.html#portable-simd-vectors"><em>Portable SIMD Vectors</em></a>.</p> 173 <a class="reference internal" href="/native-client/reference/pnacl-c-cpp-languag e-support.html#portable-simd-vectors"><em>Portable SIMD Vectors</em></a>.</p>
179 <p>For details, see:</p> 174 <p>For details, see:</p>
180 <ul class="small-gap"> 175 <ul class="small-gap">
181 <li><a class="reference external" href="https://www.youtube.com/watch?v=675znN6t ntw&amp;list=PLOU2XLYxmsIIwGK7v7jg3gQvIAWJzdat_">PNaCl SIMD: Speed on the Web</a >.</li> 176 <li><a class="reference external" href="https://www.youtube.com/watch?v=675znN6t ntw&amp;list=PLOU2XLYxmsIIwGK7v7jg3gQvIAWJzdat_">PNaCl SIMD: Speed on the Web</a >.</li>
182 <li><a class="reference external" href="https://nativeclient.googlecode.com/svn/ data/site/NaCl_SFI.pdf">Adapting Software Fault Isolation to Contemporary CPU Ar chitectures</a> (PDF).</li> 177 <li><a class="reference external" href="https://nativeclient.googlecode.com/svn/ data/site/NaCl_SFI.pdf">Adapting Software Fault Isolation to Contemporary CPU Ar chitectures</a> (PDF).</li>
183 <li><a class="reference external" href="http://research.google.com/pubs/pub34913 .html">Native Client: A Sandbox for Portable, Untrusted x86 Code</a> (PDF).</li> 178 <li><a class="reference external" href="http://research.google.com/pubs/pub34913 .html">Native Client: A Sandbox for Portable, Untrusted x86 Code</a> (PDF).</li>
184 </ul> 179 </ul>
185 <p>If your code isn&#8217;t performing as close to native speed as you&#8217;d e xpect, 180 <p>If your code isn&#8217;t performing as close to native speed as you&#8217;d e xpect,
186 <a class="reference internal" href="/native-client/help.html"><em>let us know</e m></a>!</p> 181 <a class="reference internal" href="/native-client/help.html"><em>let us know</e m></a>!</p>
187 </section><section id="why-use-portable-native-client-instead-of-technology-x">
188 <h3 id="why-use-portable-native-client-instead-of-technology-x">Why use Portable Native Client instead of <em>&lt;technology X&gt;</em>?</h3> 182 <h3 id="why-use-portable-native-client-instead-of-technology-x">Why use Portable Native Client instead of <em>&lt;technology X&gt;</em>?</h3>
189 <p>Many other technologies can be compared to Portable Native Client: 183 <p>Many other technologies can be compared to Portable Native Client:
190 Flash, Java, Silverlight, ActiveX, .NET, asm.js, etc...</p> 184 Flash, Java, Silverlight, ActiveX, .NET, asm.js, etc...</p>
191 <p>Different technologies have different strengths and weaknesses. In 185 <p>Different technologies have different strengths and weaknesses. In
192 appropriate contexts, Portable Native Client can be faster, more secure, 186 appropriate contexts, Portable Native Client can be faster, more secure,
193 and/or more compatible across operating systems and architectures than 187 and/or more compatible across operating systems and architectures than
194 other technologies.</p> 188 other technologies.</p>
195 <p>Portable Native Client complement other technologies by giving web 189 <p>Portable Native Client complement other technologies by giving web
196 developers a new capability: the ability to run fast, secure native code 190 developers a new capability: the ability to run fast, secure native code
197 from a web browser in an architecture-independent way.</p> 191 from a web browser in an architecture-independent way.</p>
198 </section><section id="if-i-want-direct-access-to-the-os-should-i-use-native-cli ent">
199 <h3 id="if-i-want-direct-access-to-the-os-should-i-use-native-client">If I want direct access to the OS, should I use Native Client?</h3> 192 <h3 id="if-i-want-direct-access-to-the-os-should-i-use-native-client">If I want direct access to the OS, should I use Native Client?</h3>
200 <p>No&#8212;Native Client does not provide direct access to the OS or devices, 193 <p>No&#8212;Native Client does not provide direct access to the OS or devices,
201 or otherwise bypass the JavaScript security model. For more information, 194 or otherwise bypass the JavaScript security model. For more information,
202 see later sections of this FAQ.</p> 195 see later sections of this FAQ.</p>
203 </section></section><section id="development-environments-and-tools">
204 <h2 id="development-environments-and-tools">Development Environments and Tools</ h2> 196 <h2 id="development-environments-and-tools">Development Environments and Tools</ h2>
205 <section id="what-development-environment-and-development-operating-system-do-yo u-recommend">
206 <h3 id="what-development-environment-and-development-operating-system-do-you-rec ommend">What development environment and development operating system do you rec ommend?</h3> 197 <h3 id="what-development-environment-and-development-operating-system-do-you-rec ommend">What development environment and development operating system do you rec ommend?</h3>
207 <p>You can develop on Windows, Mac, or Linux, and the resulting Native Client or 198 <p>You can develop on Windows, Mac, or Linux, and the resulting Native Client or
208 Portable Native Client application will run inside the Google Chrome browser on 199 Portable Native Client application will run inside the Google Chrome browser on
209 all those platforms as well as ChromeOS. You can also develop on ChromeOS with 200 all those platforms as well as ChromeOS. You can also develop on ChromeOS with
210 <a class="reference external" href="https://github.com/dnschneid/crouton">Crouto n</a> or our <a class="reference external" href="https://www.youtube.com/watch?v =OzNuzBDEWzk&amp;list=PLOU2XLYxmsIIwGK7v7jg3gQvIAWJzdat_">experimental developme nt environment which runs within NaCl</a>, 201 <a class="reference external" href="https://github.com/dnschneid/crouton">Crouto n</a> or our <a class="reference external" href="https://www.youtube.com/watch?v =OzNuzBDEWzk&amp;list=PLOU2XLYxmsIIwGK7v7jg3gQvIAWJzdat_">experimental developme nt environment which runs within NaCl</a>,
211 and we&#8217;re working on self-hosting a full development environment on Portab le 202 and we&#8217;re working on self-hosting a full development environment on Portab le
212 Native Client.</p> 203 Native Client.</p>
213 <p>Any editor+shell combination should work as well as IDEs like Eclipse, 204 <p>Any editor+shell combination should work as well as IDEs like Eclipse,
214 Visual Studio with the <a class="reference internal" href="/native-client/devgui de/devcycle/vs-addin.html"><em>Native Client Add-In</em></a> on Windows, or Xcod e on Mac OSX.</p> 205 Visual Studio with the <a class="reference internal" href="/native-client/devgui de/devcycle/vs-addin.html"><em>Native Client Add-In</em></a> on Windows, or Xcod e on Mac OSX.</p>
215 </section><section id="i-m-not-familiar-with-native-development-tools-can-i-stil l-use-the-native-client-sdk">
216 <h3 id="i-m-not-familiar-with-native-development-tools-can-i-still-use-the-nativ e-client-sdk">I&#8217;m not familiar with native development tools, can I still use the Native Client SDK?</h3> 206 <h3 id="i-m-not-familiar-with-native-development-tools-can-i-still-use-the-nativ e-client-sdk">I&#8217;m not familiar with native development tools, can I still use the Native Client SDK?</h3>
217 <p>You may find our <a class="reference internal" href="/native-client/devguide/ tutorial/index.html"><em>Tutorial</em></a> and <a class="reference internal" hre f="/native-client/devguide/devcycle/building.html"><em>Building 207 <p>You may find our <a class="reference internal" href="/native-client/devguide/ tutorial/index.html"><em>Tutorial</em></a> and <a class="reference internal" hre f="/native-client/devguide/devcycle/building.html"><em>Building
218 instructions</em></a> useful, and you can look at 208 instructions</em></a> useful, and you can look at
219 the code and Makefiles for the SDK examples to understand how the 209 the code and Makefiles for the SDK examples to understand how the
220 examples are built and run.</p> 210 examples are built and run.</p>
221 <p>You&#8217;ll need to learn how to use some tools (like GCC, LLVM, make, Eclip se, 211 <p>You&#8217;ll need to learn how to use some tools (like GCC, LLVM, make, Eclip se,
222 Visual Studio, or Xcode) before you can get very far with the SDK. Try seaching 212 Visual Studio, or Xcode) before you can get very far with the SDK. Try seaching
223 for an <a class="reference external" href="https://www.google.com/search?q=gcc+i ntroduction">introduction to GCC</a>.</p> 213 for an <a class="reference external" href="https://www.google.com/search?q=gcc+i ntroduction">introduction to GCC</a>.</p>
224 </section></section><section id="openness-and-supported-architectures-and-langua ges">
225 <h2 id="openness-and-supported-architectures-and-languages">Openness, and Suppor ted Architectures and Languages</h2> 214 <h2 id="openness-and-supported-architectures-and-languages">Openness, and Suppor ted Architectures and Languages</h2>
226 <section id="is-native-client-open-is-it-a-standard">
227 <h3 id="is-native-client-open-is-it-a-standard">Is Native Client open? Is it a s tandard?</h3> 215 <h3 id="is-native-client-open-is-it-a-standard">Is Native Client open? Is it a s tandard?</h3>
228 <p>Native Client is completely open: the executable format is open and the 216 <p>Native Client is completely open: the executable format is open and the
229 <a class="reference external" href="https://code.google.com/p/nativeclient/">sou rce code is open</a>. Right 217 <a class="reference external" href="https://code.google.com/p/nativeclient/">sou rce code is open</a>. Right
230 now the Native Client project is in its early stages, so it&#8217;s premature 218 now the Native Client project is in its early stages, so it&#8217;s premature
231 to consider Native Client for standardization.</p> 219 to consider Native Client for standardization.</p>
232 <p>We consistenly try to document our design and implementation and hope to 220 <p>We consistenly try to document our design and implementation and hope to
233 standardize Portable Native Client when it gains more traction. A good 221 standardize Portable Native Client when it gains more traction. A good
234 example is our <a class="reference internal" href="/native-client/reference/pnac l-bitcode-abi.html"><em>PNaCl bitcode reference manual</em></a>.</p> 222 example is our <a class="reference internal" href="/native-client/reference/pnac l-bitcode-abi.html"><em>PNaCl bitcode reference manual</em></a>.</p>
235 </section><section id="what-are-the-supported-instruction-set-architectures">
236 <h3 id="what-are-the-supported-instruction-set-architectures">What are the suppo rted instruction set architectures?</h3> 223 <h3 id="what-are-the-supported-instruction-set-architectures">What are the suppo rted instruction set architectures?</h3>
237 <p>Portable Native Client uses an architecture-independent format (the 224 <p>Portable Native Client uses an architecture-independent format (the
238 <code>.pexe</code>) which can currently be translated to execute on processors 225 <code>.pexe</code>) which can currently be translated to execute on processors
239 with the x86-32, x86-64, and ARM instruction set architectures, as well 226 with the x86-32, x86-64, and ARM instruction set architectures, as well
240 as experimental support for MIPS. As new architectures come along and 227 as experimental support for MIPS. As new architectures come along and
241 become popular we expect Portable Native Client to support them without 228 become popular we expect Portable Native Client to support them without
242 developers having to recompile their code.</p> 229 developers having to recompile their code.</p>
243 <p>Native Client can currently execute on the same architectures as 230 <p>Native Client can currently execute on the same architectures as
244 Portable Native Client but is only supported on the Chrome Web 231 Portable Native Client but is only supported on the Chrome Web
245 Store. Native Client&#8217;s <code>.nexe</code> files are architecture-dependent and 232 Store. Native Client&#8217;s <code>.nexe</code> files are architecture-dependent and
246 cannot adapt to new architectures without recompilation, we therefore 233 cannot adapt to new architectures without recompilation, we therefore
247 deem them better suited to a web store than to the open web.</p> 234 deem them better suited to a web store than to the open web.</p>
248 <p>With Portable Native Client we deliver a system that has comparable 235 <p>With Portable Native Client we deliver a system that has comparable
249 portability to JavaScript and can adapt to new instruction set 236 portability to JavaScript and can adapt to new instruction set
250 architectures without requiring recompilation. The web is better when 237 architectures without requiring recompilation. The web is better when
251 it&#8217;s platform-independent, and we&#8217;d like it to stay that way.</p> 238 it&#8217;s platform-independent, and we&#8217;d like it to stay that way.</p>
252 </section><section id="do-i-have-to-use-c-or-c-i-d-really-like-to-use-another-la nguage"> 239 <h3 id="do-i-have-to-use-c-or-c-i-d-really-like-to-use-another-language"><span i d="other-languages"></span>Do I have to use C or C++? I&#8217;d really like to u se another language.</h3>
253 <span id="other-languages"></span><h3 id="do-i-have-to-use-c-or-c-i-d-really-lik e-to-use-another-language"><span id="other-languages"></span>Do I have to use C or C++? I&#8217;d really like to use another language.</h3>
254 <p>Right now only C and C++ are supported directly by the toolchain in the SDK. C# 240 <p>Right now only C and C++ are supported directly by the toolchain in the SDK. C#
255 and other languages in the .NET family are supported via the <a class="reference external" href="https://github.com/elijahtaylor/mono">Mono port</a> for 241 and other languages in the .NET family are supported via the <a class="reference external" href="https://github.com/elijahtaylor/mono">Mono port</a> for
256 Native Client. Moreover, there are several ongoing projects to support 242 Native Client. Moreover, there are several ongoing projects to support
257 additional language runtimes (e.g. <a class="reference external" href="https://c ode.google.com/p/naclports/source/browse#svn%2Ftrunk%2Fsrc%2Fexamples%2Ftools">n aclports supports Lua, Python and Ruby</a>) 243 additional language runtimes (e.g. <a class="reference external" href="https://c ode.google.com/p/naclports/source/browse#svn%2Ftrunk%2Fsrc%2Fexamples%2Ftools">n aclports supports Lua, Python and Ruby</a>)
258 as well as to compile more languages to LLVM&#8217;s intermediate representation 244 as well as to compile more languages to LLVM&#8217;s intermediate representation
259 (e.g. support <a class="reference external" href="http://halide-lang.org/">Halid e</a>, Haskell with <a class="reference external" href="http://www.haskell.org/g hc/docs/latest/html/users_guide/code-generators.html">GHC</a> or support Fortran with <a class="reference external" href="https://flang-gsoc.blogspot.ie/2013/09 /end-of-gsoc-report.html">flang</a>), or 245 (e.g. support <a class="reference external" href="http://halide-lang.org/">Halid e</a>, Haskell with <a class="reference external" href="http://www.haskell.org/g hc/docs/latest/html/users_guide/code-generators.html">GHC</a> or support Fortran with <a class="reference external" href="https://flang-gsoc.blogspot.ie/2013/09 /end-of-gsoc-report.html">flang</a>), or
260 transpile languages to C/C++ (source-to-source compilation).</p> 246 transpile languages to C/C++ (source-to-source compilation).</p>
261 <p>If you&#8217;re interested in getting other languages working, please contact the 247 <p>If you&#8217;re interested in getting other languages working, please contact the
262 Native Client team by way of the <a class="reference external" href="https://gro ups.google.com/group/native-client-discuss">native-client-discuss</a> mailing li st.</p> 248 Native Client team by way of the <a class="reference external" href="https://gro ups.google.com/group/native-client-discuss">native-client-discuss</a> mailing li st.</p>
263 </section><section id="do-you-only-support-chrome-what-about-other-browsers">
264 <h3 id="do-you-only-support-chrome-what-about-other-browsers">Do you only suppor t Chrome? What about other browsers?</h3> 249 <h3 id="do-you-only-support-chrome-what-about-other-browsers">Do you only suppor t Chrome? What about other browsers?</h3>
265 <p>We aim to support multiple browsers. However, a number of features that 250 <p>We aim to support multiple browsers. However, a number of features that
266 we consider requirements for a production-quality system that keeps the 251 we consider requirements for a production-quality system that keeps the
267 user safe are difficult to implement without help from the 252 user safe are difficult to implement without help from the
268 browser. Specific examples are an out-of-process plugin architecture and 253 browser. Specific examples are an out-of-process plugin architecture and
269 appropriate interfaces for integrated 3D graphics. We have worked 254 appropriate interfaces for integrated 3D graphics. We have worked
270 closely with Chromium developers to deliver these features and we are 255 closely with Chromium developers to deliver these features and we are
271 eager to collaborate with developers from other browsers.</p> 256 eager to collaborate with developers from other browsers.</p>
272 </section><section id="what-s-the-difference-between-npapi-and-pepper">
273 <h3 id="what-s-the-difference-between-npapi-and-pepper">What&#8217;s the differe nce between NPAPI and Pepper?</h3> 257 <h3 id="what-s-the-difference-between-npapi-and-pepper">What&#8217;s the differe nce between NPAPI and Pepper?</h3>
274 <p><a class="reference internal" href="/native-client/pepper_stable/index.html"> <em>Pepper</em></a> (also known as PPAPI) is a new API that 258 <p><a class="reference internal" href="/native-client/pepper_stable/index.html"> <em>Pepper</em></a> (also known as PPAPI) is a new API that
275 lets Native Client modules communicate with the browser. Pepper supports 259 lets Native Client modules communicate with the browser. Pepper supports
276 various features that don&#8217;t have robust support in NPAPI, such as event 260 various features that don&#8217;t have robust support in NPAPI, such as event
277 handling, out-of-process plugins, and asynchronous interfaces. Native 261 handling, out-of-process plugins, and asynchronous interfaces. Native
278 Client has transitioned from using NPAPI to using Pepper.</p> 262 Client has transitioned from using NPAPI to using Pepper.</p>
279 </section><section id="is-npapi-part-of-the-native-client-sdk">
280 <h3 id="is-npapi-part-of-the-native-client-sdk">Is NPAPI part of the Native Clie nt SDK?</h3> 263 <h3 id="is-npapi-part-of-the-native-client-sdk">Is NPAPI part of the Native Clie nt SDK?</h3>
281 <p>NPAPI is not supported by the Native Client SDK, and is <a class="reference e xternal" href="http://blog.chromium.org/2013/09/saying-goodbye-to-our-old-friend -npapi.html">deprecated in Chrome</a>.</p> 264 <p>NPAPI is not supported by the Native Client SDK, and is <a class="reference e xternal" href="http://blog.chromium.org/2013/09/saying-goodbye-to-our-old-friend -npapi.html">deprecated in Chrome</a>.</p>
282 </section><section id="does-native-client-support-simd-vector-instructions">
283 <h3 id="does-native-client-support-simd-vector-instructions">Does Native Client support SIMD vector instructions?</h3> 265 <h3 id="does-native-client-support-simd-vector-instructions">Does Native Client support SIMD vector instructions?</h3>
284 <p>Native Client currently supports SSE on x86 and NEON on ARM. Support for 266 <p>Native Client currently supports SSE on x86 and NEON on ARM. Support for
285 AVX on x86 is under way.</p> 267 AVX on x86 is under way.</p>
286 <p>Portable Native Client supports portable SIMD vectors, as detailed in 268 <p>Portable Native Client supports portable SIMD vectors, as detailed in
287 <a class="reference internal" href="/native-client/reference/pnacl-c-cpp-languag e-support.html#portable-simd-vectors"><em>Portable SIMD Vectors</em></a>.</p> 269 <a class="reference internal" href="/native-client/reference/pnacl-c-cpp-languag e-support.html#portable-simd-vectors"><em>Portable SIMD Vectors</em></a>.</p>
288 </section><section id="can-i-use-native-client-for-3d-graphics">
289 <h3 id="can-i-use-native-client-for-3d-graphics">Can I use Native Client for 3D graphics?</h3> 270 <h3 id="can-i-use-native-client-for-3d-graphics">Can I use Native Client for 3D graphics?</h3>
290 <p>Yes. Native Client supports <a class="reference external" href="https://www.k hronos.org/opengles/">OpenGL ES 2.0</a>.</p> 271 <p>Yes. Native Client supports <a class="reference external" href="https://www.k hronos.org/opengles/">OpenGL ES 2.0</a>.</p>
291 <p>To alert the user regarding their hardware platform&#8217;s 3D feature set 272 <p>To alert the user regarding their hardware platform&#8217;s 3D feature set
292 before loading a large NaCl application, see <a class="reference internal" href= "/native-client/devguide/coding/3D-graphics.html"><em>Vetting the driver in 273 before loading a large NaCl application, see <a class="reference internal" href= "/native-client/devguide/coding/3D-graphics.html"><em>Vetting the driver in
293 Javascript</em></a>.</p> 274 Javascript</em></a>.</p>
294 <p>Some GL extensions are exposed to Native Client applications, see the <a clas s="reference external" href="https://code.google.com/p/chromium/codesearch#chrom ium/src/ppapi/lib/gl/gles2/gles2.c">GLES2 275 <p>Some GL extensions are exposed to Native Client applications, see the <a clas s="reference external" href="https://code.google.com/p/chromium/codesearch#chrom ium/src/ppapi/lib/gl/gles2/gles2.c">GLES2
295 file</a>. This file is part of the GL wrapper supplied by the library 276 file</a>. This file is part of the GL wrapper supplied by the library
296 <code>ppapi_gles2</code> which you&#8217;ll want to include in your project. In most cases 277 <code>ppapi_gles2</code> which you&#8217;ll want to include in your project. In most cases
297 extensions map to extensions available on other platforms, or differ very 278 extensions map to extensions available on other platforms, or differ very
298 slightly (if they differ, the extension is usually CHROMIUM or ANGLE instead of 279 slightly (if they differ, the extension is usually CHROMIUM or ANGLE instead of
299 EXT).</p> 280 EXT).</p>
300 </section><section id="does-native-client-support-concurrency-parallelism">
301 <h3 id="does-native-client-support-concurrency-parallelism">Does Native Client s upport concurrency/parallelism?</h3> 281 <h3 id="does-native-client-support-concurrency-parallelism">Does Native Client s upport concurrency/parallelism?</h3>
302 <p>Native Client and Portable Native Client both support pthreads, 282 <p>Native Client and Portable Native Client both support pthreads,
303 C11/C++11 threads, and low-level synchronization primitives (mutex, 283 C11/C++11 threads, and low-level synchronization primitives (mutex,
304 barriers, atomic read/modify/write, compare-and-exchange, etc...), thus 284 barriers, atomic read/modify/write, compare-and-exchange, etc...), thus
305 allowing your Native Client application to utilize several CPU cores. 285 allowing your Native Client application to utilize several CPU cores.
306 Note that this allows you to modify datastructures concurrently without 286 Note that this allows you to modify datastructures concurrently without
307 needing to copy them, which is often a limitation of shared-nothing 287 needing to copy them, which is often a limitation of shared-nothing
308 systems. For more information see <a class="reference internal" href="/native-cl ient/reference/pnacl-c-cpp-language-support.html#memory-model-and-atomics"><em>m emory model and atomics</em></a> and <a class="reference internal" href="/native -client/reference/pnacl-c-cpp-language-support.html#language-support-threading"> <em>threading</em></a>.</p> 288 systems. For more information see <a class="reference internal" href="/native-cl ient/reference/pnacl-c-cpp-language-support.html#memory-model-and-atomics"><em>m emory model and atomics</em></a> and <a class="reference internal" href="/native -client/reference/pnacl-c-cpp-language-support.html#language-support-threading"> <em>threading</em></a>.</p>
309 <p>Native Client doesn&#8217;t support HTML5 Web Workers directly but can 289 <p>Native Client doesn&#8217;t support HTML5 Web Workers directly but can
310 interact with JavaScript code which does.</p> 290 interact with JavaScript code which does.</p>
311 </section></section><section id="coming-soon">
312 <h2 id="coming-soon">Coming Soon</h2> 291 <h2 id="coming-soon">Coming Soon</h2>
313 <section id="do-native-client-modules-have-access-to-external-devices">
314 <h3 id="do-native-client-modules-have-access-to-external-devices">Do Native Clie nt modules have access to external devices?</h3> 292 <h3 id="do-native-client-modules-have-access-to-external-devices">Do Native Clie nt modules have access to external devices?</h3>
315 <p>At this time Native Client modules do not have access to serial ports, 293 <p>At this time Native Client modules do not have access to serial ports,
316 camera devices, or microphones: Native Client can only use native 294 camera devices, or microphones: Native Client can only use native
317 resources that today&#8217;s browsers can access. However, we intend to 295 resources that today&#8217;s browsers can access. However, we intend to
318 recommend such features to the standards bodies and piggyback on their 296 recommend such features to the standards bodies and piggyback on their
319 efforts to make these resources available inside the browser.</p> 297 efforts to make these resources available inside the browser.</p>
320 <p>You can generally think of Pepper as the C/C++ bindings to the 298 <p>You can generally think of Pepper as the C/C++ bindings to the
321 capabilities of HTML5. The goal is for Pepper and JavaScript to evolve 299 capabilities of HTML5. The goal is for Pepper and JavaScript to evolve
322 together and stay on par with each other with respect to features and 300 together and stay on par with each other with respect to features and
323 capabilities.</p> 301 capabilities.</p>
324 </section></section><section id="security-and-privacy">
325 <h2 id="security-and-privacy">Security and Privacy</h2> 302 <h2 id="security-and-privacy">Security and Privacy</h2>
326 <section id="what-happens-to-my-data-when-i-use-native-client">
327 <h3 id="what-happens-to-my-data-when-i-use-native-client">What happens to my dat a when I use Native Client?</h3> 303 <h3 id="what-happens-to-my-data-when-i-use-native-client">What happens to my dat a when I use Native Client?</h3>
328 <p>Users can opt-in to sending usage statistics and crash information in 304 <p>Users can opt-in to sending usage statistics and crash information in
329 Chrome, which includes usage statistics and crash information about 305 Chrome, which includes usage statistics and crash information about
330 Native Client. Crashes in your code won&#8217;t otherwise send your 306 Native Client. Crashes in your code won&#8217;t otherwise send your
331 information to Google: Google counts the number of such crashes, but 307 information to Google: Google counts the number of such crashes, but
332 does so anonymously without sending your application&#8217;s data or its debug 308 does so anonymously without sending your application&#8217;s data or its debug
333 information.</p> 309 information.</p>
334 <p>For additional information about privacy and Chrome, see the <a class="refere nce external" href="https://www.google.com/chrome/intl/en/privacy.html">Google C hrome 310 <p>For additional information about privacy and Chrome, see the <a class="refere nce external" href="https://www.google.com/chrome/intl/en/privacy.html">Google C hrome
335 privacy policy</a> and the <a class="reference external" href="https://www.googl e.com/chrome/intl/en/eula_text.html">Google Chrome Terms of Service</a>.</p> 311 privacy policy</a> and the <a class="reference external" href="https://www.googl e.com/chrome/intl/en/eula_text.html">Google Chrome Terms of Service</a>.</p>
336 </section><section id="how-does-native-client-prevent-sandboxed-code-from-doing- bad-things">
337 <h3 id="how-does-native-client-prevent-sandboxed-code-from-doing-bad-things">How does Native Client prevent sandboxed code from doing Bad Things?</h3> 312 <h3 id="how-does-native-client-prevent-sandboxed-code-from-doing-bad-things">How does Native Client prevent sandboxed code from doing Bad Things?</h3>
338 <p>Native Client&#8217;s sandbox works by validating the untrusted code (the 313 <p>Native Client&#8217;s sandbox works by validating the untrusted code (the
339 compiled Native Client module) before running it. The validator checks 314 compiled Native Client module) before running it. The validator checks
340 the following:</p> 315 the following:</p>
341 <ul class="small-gap"> 316 <ul class="small-gap">
342 <li><strong>Data integrity:</strong> No loads or stores are permitted outside of the 317 <li><strong>Data integrity:</strong> No loads or stores are permitted outside of the
343 data sandbox. In particular this means that once loaded into memory, 318 data sandbox. In particular this means that once loaded into memory,
344 the binary is not writable. This is enforced by operating system 319 the binary is not writable. This is enforced by operating system
345 protection mechanisms. While new instructions can be inserted at 320 protection mechanisms. While new instructions can be inserted at
346 runtime to support things like JIT compilers, such instructions will 321 runtime to support things like JIT compilers, such instructions will
347 be subject to runtime verification according to the following 322 be subject to runtime verification according to the following
348 constraints before they are executed.</li> 323 constraints before they are executed.</li>
349 <li><strong>No unsafe instructions:</strong> The validator ensures that the Nati ve 324 <li><strong>No unsafe instructions:</strong> The validator ensures that the Nati ve
350 Client application does not contain any unsafe instructions. Examples 325 Client application does not contain any unsafe instructions. Examples
351 of unsafe instructions are <code>syscall</code>, <code>int</code>, and <code>lds </code>.</li> 326 of unsafe instructions are <code>syscall</code>, <code>int</code>, and <code>lds </code>.</li>
352 <li><strong>Control flow integrity:</strong> The validator ensures that all dire ct and 327 <li><strong>Control flow integrity:</strong> The validator ensures that all dire ct and
353 indirect branches target a safe instruction.</li> 328 indirect branches target a safe instruction.</li>
354 </ul> 329 </ul>
355 <p>The beauty of the Native Client sandbox is in reducing &#8220;safe&#8221; cod e to a 330 <p>The beauty of the Native Client sandbox is in reducing &#8220;safe&#8221; cod e to a
356 few simple rules that can be verified by a small trusted validator: the 331 few simple rules that can be verified by a small trusted validator: the
357 compiler isn&#8217;t trusted. The same applies to Portable Native Client where 332 compiler isn&#8217;t trusted. The same applies to Portable Native Client where
358 even the <code>.pexe</code> to <code>.nexe</code> translator, a simplified compi ler 333 even the <code>.pexe</code> to <code>.nexe</code> translator, a simplified compi ler
359 backend, isn&#8217;t trusted: it is validated before executing, and so is its 334 backend, isn&#8217;t trusted: it is validated before executing, and so is its
360 output.</p> 335 output.</p>
361 <p>In addition to static analysis of untrusted code, the Native Client runtime a lso 336 <p>In addition to static analysis of untrusted code, the Native Client runtime a lso
362 includes an outer sandbox that mediates system calls. For more details about 337 includes an outer sandbox that mediates system calls. For more details about
363 both sandboxes, see <a class="reference external" href="http://research.google.c om/pubs/pub34913.html">Native Client: A Sandbox for Portable, Untrusted x86 Code </a> 338 both sandboxes, see <a class="reference external" href="http://research.google.c om/pubs/pub34913.html">Native Client: A Sandbox for Portable, Untrusted x86 Code </a>
364 (PDF).</p> 339 (PDF).</p>
365 </section><section id="how-does-google-know-that-the-safety-measures-in-native-c lient-are-sufficient">
366 <h3 id="how-does-google-know-that-the-safety-measures-in-native-client-are-suffi cient">How does Google know that the safety measures in Native Client are suffic ient?</h3> 340 <h3 id="how-does-google-know-that-the-safety-measures-in-native-client-are-suffi cient">How does Google know that the safety measures in Native Client are suffic ient?</h3>
367 <p>Google has taken several steps to ensure that Native Client&#8217;s security works, 341 <p>Google has taken several steps to ensure that Native Client&#8217;s security works,
368 including:</p> 342 including:</p>
369 <ul class="small-gap"> 343 <ul class="small-gap">
370 <li>Open source, peer-reviewed papers describing the design.</li> 344 <li>Open source, peer-reviewed papers describing the design.</li>
371 <li>A <a class="reference internal" href="/native-client/community/security-cont est/index.html"><em>security contest</em></a>.</li> 345 <li>A <a class="reference internal" href="/native-client/community/security-cont est/index.html"><em>security contest</em></a>.</li>
372 <li>Multiple internal and external security reviews.</li> 346 <li>Multiple internal and external security reviews.</li>
373 <li>The ongoing vigilance of our engineering and developer community.</li> 347 <li>The ongoing vigilance of our engineering and developer community.</li>
374 </ul> 348 </ul>
375 <p>Google is committed to making Native Client safer than JavaScript and other 349 <p>Google is committed to making Native Client safer than JavaScript and other
376 popular browser technologies. If you have suggestions for security improvements, 350 popular browser technologies. If you have suggestions for security improvements,
377 let the team know, by way of the <a class="reference external" href="https://gro ups.google.com/group/native-client-discuss">native-client-discuss</a> mailing li st.</p> 351 let the team know, by way of the <a class="reference external" href="https://gro ups.google.com/group/native-client-discuss">native-client-discuss</a> mailing li st.</p>
378 </section></section><section id="development">
379 <h2 id="development">Development</h2> 352 <h2 id="development">Development</h2>
380 <section id="how-do-i-debug">
381 <h3 id="how-do-i-debug">How do I debug?</h3> 353 <h3 id="how-do-i-debug">How do I debug?</h3>
382 <p>Instructions on <a class="reference internal" href="/native-client/sdk/exampl es.html#debugging-the-sdk-examples"><em>debugging the SDK examples</em></a> usin g GDB are available. You can also 354 <p>Instructions on <a class="reference internal" href="/native-client/sdk/exampl es.html#debugging-the-sdk-examples"><em>debugging the SDK examples</em></a> usin g GDB are available. You can also
383 debug Native Client modules with some <a class="reference internal" href="/nativ e-client/devguide/devcycle/debugging.html"><em>alternative approaches</em></a>.< /p> 355 debug Native Client modules with some <a class="reference internal" href="/nativ e-client/devguide/devcycle/debugging.html"><em>alternative approaches</em></a>.< /p>
384 </section><section id="how-do-i-build-x86-32-x86-64-or-arm-nexes">
385 <h3 id="how-do-i-build-x86-32-x86-64-or-arm-nexes">How do I build x86-32, x86-64 or ARM <code>.nexes</code>?</h3> 356 <h3 id="how-do-i-build-x86-32-x86-64-or-arm-nexes">How do I build x86-32, x86-64 or ARM <code>.nexes</code>?</h3>
386 <p>By default, the applications in the <code>/examples</code> folder create 357 <p>By default, the applications in the <code>/examples</code> folder create
387 architecture-independent <code>.pexe</code> for Portable Native Client. To 358 architecture-independent <code>.pexe</code> for Portable Native Client. To
388 generate a <code>.nexe</code> targetting one specific architecture using the 359 generate a <code>.nexe</code> targetting one specific architecture using the
389 Native Client or Portable Native Client toolchains, see the 360 Native Client or Portable Native Client toolchains, see the
390 <a class="reference internal" href="/native-client/devguide/devcycle/building.ht ml"><em>Building instructions</em></a>.</p> 361 <a class="reference internal" href="/native-client/devguide/devcycle/building.ht ml"><em>Building instructions</em></a>.</p>
391 </section><section id="how-can-my-web-application-determine-which-nexe-to-load">
392 <h3 id="how-can-my-web-application-determine-which-nexe-to-load">How can my web application determine which <code>.nexe</code> to load?</h3> 362 <h3 id="how-can-my-web-application-determine-which-nexe-to-load">How can my web application determine which <code>.nexe</code> to load?</h3>
393 <p>Your application does not need to make the decision of loading an 363 <p>Your application does not need to make the decision of loading an
394 x86-32, x86-64 or ARM <code>.nexe</code> explicitly&#8212;the Native Client runt ime 364 x86-32, x86-64 or ARM <code>.nexe</code> explicitly&#8212;the Native Client runt ime
395 examines a manifest file (<code>.nmf</code>) to pick the right <code>.nexe</code > file for 365 examines a manifest file (<code>.nmf</code>) to pick the right <code>.nexe</code > file for
396 a given user. You can generate a manifest file using a Python script 366 a given user. You can generate a manifest file using a Python script
397 that&#8217;s included in the SDK (see the <code>Makefile</code> in any of the SD K 367 that&#8217;s included in the SDK (see the <code>Makefile</code> in any of the SD K
398 examples for an illustration of how to do so). Your HTML file specifies 368 examples for an illustration of how to do so). Your HTML file specifies
399 the manifest filename in the <code>src</code> attribute of the <code>&lt;embed&g t;</code> 369 the manifest filename in the <code>src</code> attribute of the <code>&lt;embed&g t;</code>
400 tag. You can see the way the pieces fit together by examining the 370 tag. You can see the way the pieces fit together by examining the
401 examples included in the SDK.</p> 371 examples included in the SDK.</p>
402 </section><section id="is-it-possible-to-build-a-native-client-module-with-just- plain-c-not-c">
403 <h3 id="is-it-possible-to-build-a-native-client-module-with-just-plain-c-not-c"> Is it possible to build a Native Client module with just plain C (not C++)?</h3> 372 <h3 id="is-it-possible-to-build-a-native-client-module-with-just-plain-c-not-c"> Is it possible to build a Native Client module with just plain C (not C++)?</h3>
404 <p>Yes. See the <code>&quot;Hello, World!&quot;</code> in C example in the SDK u nder 373 <p>Yes. See the <code>&quot;Hello, World!&quot;</code> in C example in the SDK u nder
405 <code>examples/tutorial/using_ppapi_simple/</code>, or the Game of Life example 374 <code>examples/tutorial/using_ppapi_simple/</code>, or the Game of Life example
406 under <code>examples/demo/life/life.c</code>.</p> 375 under <code>examples/demo/life/life.c</code>.</p>
407 </section><section id="what-unix-system-calls-can-i-make-through-native-client">
408 <h3 id="what-unix-system-calls-can-i-make-through-native-client">What UNIX syste m calls can I make through Native Client?</h3> 376 <h3 id="what-unix-system-calls-can-i-make-through-native-client">What UNIX syste m calls can I make through Native Client?</h3>
409 <p>Native Client doesn&#8217;t directly expose any system calls from the host OS 377 <p>Native Client doesn&#8217;t directly expose any system calls from the host OS
410 because of the inherent security risks and because the resulting 378 because of the inherent security risks and because the resulting
411 application would not be portable across operating systems. Instead, 379 application would not be portable across operating systems. Instead,
412 Native Client provides portable cross-OS abstractions wrapping or 380 Native Client provides portable cross-OS abstractions wrapping or
413 proxying OS functionality or emulating UNIX system calls. For example, 381 proxying OS functionality or emulating UNIX system calls. For example,
414 Native Client provides an <code>mmap()</code> system call that behaves much like 382 Native Client provides an <code>mmap()</code> system call that behaves much like
415 the standard UNIX <code>mmap()</code> system call.</p> 383 the standard UNIX <code>mmap()</code> system call.</p>
416 </section><section id="is-my-favorite-third-party-library-available-for-native-c lient">
417 <h3 id="is-my-favorite-third-party-library-available-for-native-client">Is my fa vorite third-party library available for Native Client?</h3> 384 <h3 id="is-my-favorite-third-party-library-available-for-native-client">Is my fa vorite third-party library available for Native Client?</h3>
418 <p>Google has ported several third-party libraries to Native Client; such librar ies 385 <p>Google has ported several third-party libraries to Native Client; such librar ies
419 are available in the <a class="reference external" href="https://code.google.com /p/naclports">naclports</a> project. We encourage you to contribute 386 are available in the <a class="reference external" href="https://code.google.com /p/naclports">naclports</a> project. We encourage you to contribute
420 libraries to naclports, and/or to host your own ported libraries, and to let the 387 libraries to naclports, and/or to host your own ported libraries, and to let the
421 team know about it on <a class="reference external" href="https://groups.google. com/group/native-client-discuss">native-client-discuss</a> when you do.</p> 388 team know about it on <a class="reference external" href="https://groups.google. com/group/native-client-discuss">native-client-discuss</a> when you do.</p>
422 </section><section id="do-all-the-files-in-an-application-need-to-be-served-from -the-same-domain">
423 <h3 id="do-all-the-files-in-an-application-need-to-be-served-from-the-same-domai n">Do all the files in an application need to be served from the same domain?</h 3> 389 <h3 id="do-all-the-files-in-an-application-need-to-be-served-from-the-same-domai n">Do all the files in an application need to be served from the same domain?</h 3>
424 <p>The <code>.nmf</code>, and <code>.nexe</code> or <code>.pexe</code> files mus t either be served from the 390 <p>The <code>.nmf</code>, and <code>.nexe</code> or <code>.pexe</code> files mus t either be served from the
425 same origin as the embedding page or an origin that has been configured 391 same origin as the embedding page or an origin that has been configured
426 correctly using <a class="reference external" href="http://en.wikipedia.org/wiki /Cross-origin_resource_sharing">CORS</a>.</p> 392 correctly using <a class="reference external" href="http://en.wikipedia.org/wiki /Cross-origin_resource_sharing">CORS</a>.</p>
427 <p>For applications installed from the Chrome Web Store the Web Store manifest 393 <p>For applications installed from the Chrome Web Store the Web Store manifest
428 must include the correct, verified domain of the embedding page.</p> 394 must include the correct, verified domain of the embedding page.</p>
429 </section></section><section id="portability">
430 <h2 id="portability">Portability</h2> 395 <h2 id="portability">Portability</h2>
431 <section id="do-i-have-to-do-anything-special-to-make-my-application-run-on-diff erent-operating-systems">
432 <h3 id="do-i-have-to-do-anything-special-to-make-my-application-run-on-different -operating-systems">Do I have to do anything special to make my application run on different operating systems?</h3> 396 <h3 id="do-i-have-to-do-anything-special-to-make-my-application-run-on-different -operating-systems">Do I have to do anything special to make my application run on different operating systems?</h3>
433 <p>No. Native Client and Portable Native Client applications run without 397 <p>No. Native Client and Portable Native Client applications run without
434 modification on all supported operating systems.</p> 398 modification on all supported operating systems.</p>
435 <p>However, to run on different instruction set architectures (such as 399 <p>However, to run on different instruction set architectures (such as
436 x86-32, x86-64 or ARM), you currently have to either:</p> 400 x86-32, x86-64 or ARM), you currently have to either:</p>
437 <ul class="small-gap"> 401 <ul class="small-gap">
438 <li>Use Portable Native Client.</li> 402 <li>Use Portable Native Client.</li>
439 <li>Build and supply a separate <code>.nexe</code> file for each architecture, a nd 403 <li>Build and supply a separate <code>.nexe</code> file for each architecture, a nd
440 make them available on the Chrome Web Store. See <a class="reference internal" h ref="/native-client/devguide/devcycle/building.html"><em>target 404 make them available on the Chrome Web Store. See <a class="reference internal" h ref="/native-client/devguide/devcycle/building.html"><em>target
441 architectures</em></a> for details about which 405 architectures</em></a> for details about which
442 <code>.nexe</code> files will run on which architectures.</li> 406 <code>.nexe</code> files will run on which architectures.</li>
443 </ul> 407 </ul>
444 </section><section id="how-easy-is-it-to-port-my-existing-native-code-to-native- client">
445 <h3 id="how-easy-is-it-to-port-my-existing-native-code-to-native-client">How eas y is it to port my existing native code to Native Client?</h3> 408 <h3 id="how-easy-is-it-to-port-my-existing-native-code-to-native-client">How eas y is it to port my existing native code to Native Client?</h3>
446 <p>In most cases you won&#8217;t have to rewrite much, if any, code. The Native 409 <p>In most cases you won&#8217;t have to rewrite much, if any, code. The Native
447 Client-specific tools, such as <code>pnacl-clang++</code> or <code>x86_64-nacl-g ++</code>, 410 Client-specific tools, such as <code>pnacl-clang++</code> or <code>x86_64-nacl-g ++</code>,
448 take care of most of the necessary changes. You may need to make some 411 take care of most of the necessary changes. You may need to make some
449 changes to your operating system calls and interactions with external 412 changes to your operating system calls and interactions with external
450 devices to work with the web. Porting existing Linux libraries is 413 devices to work with the web. Porting existing Linux libraries is
451 generally straightforward, with large libraries often requiring no 414 generally straightforward, with large libraries often requiring no
452 source change.</p> 415 source change.</p>
453 <p>The following kinds of code may be more challenging to port:</p> 416 <p>The following kinds of code may be more challenging to port:</p>
454 <ul class="small-gap"> 417 <ul class="small-gap">
455 <li>Code that does direct TCP/IP or UDP networking. For security reasons 418 <li>Code that does direct TCP/IP or UDP networking. For security reasons
456 these APIs are only available to packaged applications, not on the 419 these APIs are only available to packaged applications, not on the
457 open web, after asking for the appropriate permissions. Native Client 420 open web, after asking for the appropriate permissions. Native Client
458 is otherwise restricted to the networking APIs available in the 421 is otherwise restricted to the networking APIs available in the
459 browser.</li> 422 browser.</li>
460 <li>Code that creates processes, including UNIX forks. Creating processes 423 <li>Code that creates processes, including UNIX forks. Creating processes
461 is not supported for security reasons. However, threads are supported.</li> 424 is not supported for security reasons. However, threads are supported.</li>
462 <li>Code that needs to do local file I/O. Native Client is restricted to 425 <li>Code that needs to do local file I/O. Native Client is restricted to
463 accessing URLs and to local storage in the browser (the Pepper file I/O API 426 accessing URLs and to local storage in the browser (the Pepper file I/O API
464 has access to the same per-application storage that JavaScript has via Local 427 has access to the same per-application storage that JavaScript has via Local
465 Storage). HTML5 File System can be used, among others. For POSIX compatabiliy 428 Storage). HTML5 File System can be used, among others. For POSIX compatabiliy
466 the Native Client SDK includes a library called nacl_io which allows the 429 the Native Client SDK includes a library called nacl_io which allows the
467 application to interact with all these types of files via standard POSIX I/O 430 application to interact with all these types of files via standard POSIX I/O
468 functions (e.g. open/fopen/read/write/...). See <a class="reference internal" hr ef="/native-client/devguide/coding/nacl_io.html"><em>Using NaCl I/O</em></a> for more details.</li> 431 functions (e.g. open/fopen/read/write/...). See <a class="reference internal" hr ef="/native-client/devguide/coding/nacl_io.html"><em>Using NaCl I/O</em></a> for more details.</li>
469 </ul> 432 </ul>
470 </section></section><section id="troubleshooting"> 433 <h2 id="troubleshooting"><span id="faq-troubleshooting"></span>Troubleshooting</ h2>
471 <span id="faq-troubleshooting"></span><h2 id="troubleshooting"><span id="faq-tro ubleshooting"></span>Troubleshooting</h2>
472 <section id="my-pexe-isn-t-loading-help">
473 <h3 id="my-pexe-isn-t-loading-help">My <code>.pexe</code> isn&#8217;t loading, h elp!</h3> 434 <h3 id="my-pexe-isn-t-loading-help">My <code>.pexe</code> isn&#8217;t loading, h elp!</h3>
474 <ul class="small-gap"> 435 <ul class="small-gap">
475 <li>You must use Google Chrome version 31 or greater for Portable Native 436 <li>You must use Google Chrome version 31 or greater for Portable Native
476 Client. Make sure you have Portable Native Client installed in 437 Client. Make sure you have Portable Native Client installed in
477 <code>about:nacl</code>; if not open <code>about:components</code> and &#8220;Ch eck for 438 <code>about:nacl</code>; if not open <code>about:components</code> and &#8220;Ch eck for
478 update&#8221; for PNaCl.</li> 439 update&#8221; for PNaCl.</li>
479 <li>PNaCl <code>.pexe</code> must be compiled with pepper_31 SDK or higher (earl ier 440 <li>PNaCl <code>.pexe</code> must be compiled with pepper_31 SDK or higher (earl ier
480 SDK versions had experimental support for PNaCl, now deprecated).</li> 441 SDK versions had experimental support for PNaCl, now deprecated).</li>
481 <li>Your application can verify that Portable Native Client is supported 442 <li>Your application can verify that Portable Native Client is supported
482 in JavaScript with <code>navigator.mimeTypes['application/x-pnacl'] !== 443 in JavaScript with <code>navigator.mimeTypes['application/x-pnacl'] !==
483 undefined</code>. This is preferred over checking the Chrome version.</li> 444 undefined</code>. This is preferred over checking the Chrome version.</li>
484 </ul> 445 </ul>
485 </section><section id="my-nexe-files-never-finish-loading-what-gives">
486 <h3 id="my-nexe-files-never-finish-loading-what-gives">My <code>.nexe</code> fil es never finish loading. What gives?</h3> 446 <h3 id="my-nexe-files-never-finish-loading-what-gives">My <code>.nexe</code> fil es never finish loading. What gives?</h3>
487 <p>Here are ways to resolve some common problems that can prevent loading:</p> 447 <p>Here are ways to resolve some common problems that can prevent loading:</p>
488 <ul class="small-gap"> 448 <ul class="small-gap">
489 <li>You must use Google Chrome version 14 or greater for Native Client.</li> 449 <li>You must use Google Chrome version 14 or greater for Native Client.</li>
490 <li>If you haven&#8217;t already done so, enable the Native Client flag in 450 <li>If you haven&#8217;t already done so, enable the Native Client flag in
491 Google Chrome. Type <code>about:flags</code> in the Chrome address bar, scroll 451 Google Chrome. Type <code>about:flags</code> in the Chrome address bar, scroll
492 down to &#8220;Native Client&#8221;, click the &#8220;Enable&#8221; link, scroll down to the 452 down to &#8220;Native Client&#8221;, click the &#8220;Enable&#8221; link, scroll down to the
493 bottom of the page, and click the &#8220;Relaunch Now&#8221; button (all browser 453 bottom of the page, and click the &#8220;Relaunch Now&#8221; button (all browser
494 windows will restart).</li> 454 windows will restart).</li>
495 <li>Verify that the Native Client plugin is enabled in Google Chrome. Type 455 <li>Verify that the Native Client plugin is enabled in Google Chrome. Type
(...skipping 12 matching lines...) Expand all
508 greater.</li> 468 greater.</li>
509 <li>You must load the correct <code>.nexe</code> file for your machine&#8217;s s pecific 469 <li>You must load the correct <code>.nexe</code> file for your machine&#8217;s s pecific
510 instruction set architecture (x86-32, x86-64 or ARM). You can ensure 470 instruction set architecture (x86-32, x86-64 or ARM). You can ensure
511 you&#8217;re loading the correct <code>.nexe</code> file by building a separate 471 you&#8217;re loading the correct <code>.nexe</code> file by building a separate
512 <code>.nexe</code> for each architecture, and using a <code>.nmf</code> manifest file to 472 <code>.nexe</code> for each architecture, and using a <code>.nmf</code> manifest file to
513 let the browser select the correct <code>.nexe</code> file. Note: the need to 473 let the browser select the correct <code>.nexe</code> file. Note: the need to
514 select a processor-specific <code>.nexe</code> goes away with Portable Native 474 select a processor-specific <code>.nexe</code> goes away with Portable Native
515 Client.</li> 475 Client.</li>
516 <li>If things still aren&#8217;t working, <a class="reference internal" href="/n ative-client/help.html"><em>ask for help</em></a>!</li> 476 <li>If things still aren&#8217;t working, <a class="reference internal" href="/n ative-client/help.html"><em>ask for help</em></a>!</li>
517 </ul> 477 </ul>
518 </section></section></section> 478 </section>
519 479
520 {{/partials.standard_nacl_article}} 480 {{/partials.standard_nacl_article}}
OLDNEW
« no previous file with comments | « native_client_sdk/doc_generated/devguide/tutorial/tutorial-part2.html ('k') | native_client_sdk/doc_generated/help.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698