| Index: native_client_sdk/doc_generated/devguide/devcycle/building.html
|
| diff --git a/native_client_sdk/doc_generated/devguide/devcycle/building.html b/native_client_sdk/doc_generated/devguide/devcycle/building.html
|
| index f3afcf494b4d000734124c43d2d3ceb76a911358..93b307ce76ad88cbebfb5911b3b76d0e17075e21 100644
|
| --- a/native_client_sdk/doc_generated/devguide/devcycle/building.html
|
| +++ b/native_client_sdk/doc_generated/devguide/devcycle/building.html
|
| @@ -42,14 +42,12 @@
|
| </li>
|
| </ul>
|
|
|
| -</div><section id="introduction">
|
| -<h2 id="introduction">Introduction</h2>
|
| +</div><h2 id="introduction">Introduction</h2>
|
| <p>This document describes how to build Native Client modules. It is intended for
|
| developers who have experience writing, compiling, and linking C and C++ code.
|
| If you haven’t read the Native Client <a class="reference internal" href="/native-client/overview.html"><em>Technical Overview</em></a> and <a class="reference internal" href="/native-client/devguide/tutorial/index.html"><em>Tutorial</em></a>, we recommend starting
|
| with those.</p>
|
| -<section id="target-architectures">
|
| -<span id="id1"></span><h3 id="target-architectures"><span id="id1"></span>Target architectures</h3>
|
| +<h3 id="target-architectures"><span id="id1"></span>Target architectures</h3>
|
| <p>Portable Native Client (PNaCl) modules are written in C or C++ and compiled
|
| into an executable file ending in a <strong>.pexe</strong> extension using the PNaCl
|
| toolchain in the Native Client SDK. Chrome can load <strong>pexe</strong> files
|
| @@ -71,15 +69,13 @@ for multiple target architectures and how to generate manifest files, see the
|
| Makefiles included with the SDK examples.</p>
|
| <p>This section will mostly cover PNaCl, but also describes how to build
|
| <strong>nexe</strong> applications.</p>
|
| -</section><section id="c-libraries">
|
| <h3 id="c-libraries">C libraries</h3>
|
| <p>The PNaCl SDK has a single choice of C library: <a class="reference external" href="http://sourceware.org/newlib/">newlib</a>.</p>
|
| <p>The Native Client SDK also has a GCC-based toolchain for building
|
| <strong>nexes</strong>. The GCC-based toolchain has support for two C libraries:
|
| <a class="reference external" href="http://sourceware.org/newlib/">newlib</a> and <a class="reference external" href="http://www.gnu.org/software/libc/">glibc</a>. See <a class="reference internal" href="/native-client/devguide/devcycle/dynamic-loading.html"><em>Dynamic Linking & Loading with glibc</em></a> for information about these libraries, including factors to
|
| help you decide which to use.</p>
|
| -</section><section id="c-standard-libraries">
|
| -<span id="building-cpp-libraries"></span><h3 id="c-standard-libraries"><span id="building-cpp-libraries"></span>C++ standard libraries</h3>
|
| +<h3 id="c-standard-libraries"><span id="building-cpp-libraries"></span>C++ standard libraries</h3>
|
| <p>The PNaCl SDK can use either LLVM’s <a class="reference external" href="http://libcxx.llvm.org/">libc++</a>
|
| (the current default) or GCC’s <a class="reference external" href="http://gcc.gnu.org/libstdc++">libstdc++</a> (deprecated). The
|
| <code>-stdlib=[libc++|libstdc++]</code> command line argument can be used to
|
| @@ -90,7 +86,6 @@ features should work regardless of which standard library is used. The
|
| <code>-std=gnu++11</code> command line argument can be used to indicate which C++
|
| language standard to use (<code>-std=c++11</code> often doesn’t work well because newlib
|
| relies on some GNU extensions).</p>
|
| -</section><section id="sdk-toolchains">
|
| <h3 id="sdk-toolchains">SDK toolchains</h3>
|
| <p>The Native Client SDK includes multiple toolchains. It has one PNaCl toolchain
|
| and it has multiple GCC-based toolchains that are differentiated by target
|
| @@ -119,7 +114,6 @@ properly part of the toolchains but that you may find helpful in building and
|
| testing your application (e.g., the <code>create_nmf.py</code> script, which you can
|
| use to create a manifest file).
|
| </aside>
|
| -</section><section id="sdk-toolchains-versus-your-hosted-toolchain">
|
| <h3 id="sdk-toolchains-versus-your-hosted-toolchain">SDK toolchains versus your hosted toolchain</h3>
|
| <p>To build NaCl modules, you must use one of the Native Client toolchains
|
| included in the SDK. The SDK toolchains use a variety of techniques to
|
| @@ -144,7 +138,6 @@ modules written in other programming languages, such as C#. But this
|
| document covers only compiling C and C++ code, using the toolchains
|
| provided in the SDK.
|
| </aside>
|
| -</section></section><section id="the-pnacl-toolchain">
|
| <h2 id="the-pnacl-toolchain">The PNaCl toolchain</h2>
|
| <p>The PNaCl toolchain contains modified versions of the tools in the
|
| LLVM toolchain, as well as linkers and other tools from binutils.
|
| @@ -181,12 +174,10 @@ tools include:</p>
|
| </dl>
|
| <p>For the full list of tools, see the
|
| <code><NACL_SDK_ROOT>/toolchain/<platform>_pnacl/bin</code> directory.</p>
|
| -</section><section id="using-the-pnacl-tools-to-compile-link-debug-and-deploy">
|
| <h2 id="using-the-pnacl-tools-to-compile-link-debug-and-deploy">Using the PNaCl tools to compile, link, debug, and deploy</h2>
|
| <p>To build an application with the PNaCl SDK toolchain, you must compile
|
| your code, link it, test and debug it, and then deploy it. This section goes
|
| over some examples of how to use the tools.</p>
|
| -<section id="compile">
|
| <h3 id="compile">Compile</h3>
|
| <p>To compile a simple application consisting of <code>file1.cc</code> and <code>file2.cc</code> into
|
| <code>hello_world.pexe</code> with a single command, use the <code>pnacl-clang++</code> tool</p>
|
| @@ -252,7 +243,6 @@ choose is application-specific, you’ll therefore want to experiment with t
|
| value that you pass in: you’ll be trading off potential performance with
|
| <strong>pexe</strong> size and on-device translation speed.</dd>
|
| </dl>
|
| -</section><section id="create-a-static-library">
|
| <h3 id="create-a-static-library">Create a static library</h3>
|
| <p>The <code>pnacl-ar</code> and <code>pnacl-ranlib</code> tools allow you to create a
|
| <strong>static</strong> library from a set of bitcode files, which can later be linked
|
| @@ -263,7 +253,6 @@ into the full application.</p>
|
|
|
| <NACL_SDK_ROOT>/toolchain/win_pnacl/bin/pnacl-ranlib libfoo.a
|
| </pre>
|
| -</section><section id="link-the-application">
|
| <h3 id="link-the-application">Link the application</h3>
|
| <p>The <code>pnacl-clang++</code> tool is used to compile applications, but it can
|
| also be used link together compiled bitcode and libraries into a
|
| @@ -293,7 +282,6 @@ to reduce the size of the final <strong>pexe</strong> as well as making it trans
|
| faster. If you want to use C++ exceptions you should use the
|
| <code>--pnacl-exceptions=sjlj</code> linker flag as explained in the <a class="reference internal" href="/native-client/reference/pnacl-c-cpp-language-support.html#exception-handling"><em>exception
|
| handling</em></a> section of the C++ language support reference.</p>
|
| -</section><section id="finalizing-the-pexe-for-deployment">
|
| <h3 id="finalizing-the-pexe-for-deployment">Finalizing the <strong>pexe</strong> for deployment</h3>
|
| <p>Typically you would run the application to test it and debug it if needed before
|
| deploying. See the <a class="reference internal" href="/native-client/devguide/devcycle/running.html"><em>running</em></a> documentation for how to run a PNaCl
|
| @@ -314,8 +302,7 @@ stripping out debug information and other metadata.</p>
|
| refer to the final version of the application before deployment.
|
| The <code>create_nmf.py</code> tool helps generate an <code>.nmf</code> file, but <code>.nmf</code>
|
| files can also be written by hand.</p>
|
| -</section><section id="compressing-the-pexe-for-deployment">
|
| -<span id="pnacl-compress"></span><h3 id="compressing-the-pexe-for-deployment"><span id="pnacl-compress"></span>Compressing the <strong>pexe</strong> for deployment</h3>
|
| +<h3 id="compressing-the-pexe-for-deployment"><span id="pnacl-compress"></span>Compressing the <strong>pexe</strong> for deployment</h3>
|
| <p>Size compression is an optional step for deployment, and reduces the size of the
|
| <strong>pexe</strong> file that must be transmitted over the wire, resulting in faster
|
| download speed. The tool <code>pnacl-compress</code> applies compression strategies that
|
| @@ -339,7 +326,6 @@ configured for HTTP compression: both compressions are complementary. You’
|
| want to configure your web server to gzip <strong>pexe</strong> files: the gzipped version of
|
| a compressed <strong>pexe</strong> file is smaller than the corresponding uncompressed
|
| <strong>pexe</strong> file by 7.5% to 10%.</p>
|
| -</section></section><section id="the-gnu-based-toolchains">
|
| <h2 id="the-gnu-based-toolchains">The GNU-based toolchains</h2>
|
| <p>Besides the PNaCl toolchain, the Native Client SDK also includes modified
|
| versions of the tools in the standard GNU toolchain, including the GCC
|
| @@ -385,7 +371,6 @@ flags, e.g., you can specify <code>x86_64-nacl-gcc -m32</code> to compile a 32-b
|
| <li><prefix>strings</li>
|
| <li><prefix>strip</li>
|
| </ul>
|
| -<section id="compiling">
|
| <h3 id="compiling">Compiling</h3>
|
| <p>Compiling files with the GNU-based toolchain is similar to compiling
|
| files with the PNaCl-based toolchain, except that the output is
|
| @@ -403,7 +388,6 @@ of -m32. Alternatively, you could also use the version of the compiler that
|
| targets the x86-64 architecture, i.e., <code>x86_64-nacl-gcc</code>.</p>
|
| <p>You should name executable modules with a <strong>.nexe</strong> filename extension,
|
| regardless of what platform you’re using.</p>
|
| -</section><section id="creating-libraries-and-linking">
|
| <h3 id="creating-libraries-and-linking">Creating libraries and Linking</h3>
|
| <p>Creating libraries and linking with the GNU-based toolchain is similar
|
| to doing the same with the PNaCl toolchain. The relevant tools
|
| @@ -411,7 +395,6 @@ for creating <strong>static</strong> libraries are <code><prefix>ar</code>
|
| Linking can be done with <code><prefix>g++</code>. See the
|
| <a class="reference internal" href="/native-client/devguide/devcycle/dynamic-loading.html"><em>Dynamic Linking & Loading with glibc</em></a>
|
| section on how to create <strong>shared</strong> libraries.</p>
|
| -</section><section id="finalizing-a-nexe-for-deployment">
|
| <h3 id="finalizing-a-nexe-for-deployment">Finalizing a <strong>nexe</strong> for deployment</h3>
|
| <p>Unlike the PNaCl toolchain, no separate finalization step is required
|
| for <strong>nexe</strong> files. The <strong>nexe</strong> files are always in a <strong>stable</strong> format.
|
| @@ -419,7 +402,6 @@ However, the <strong>nexe</strong> file may contain debug information and symbol
|
| which may make the <strong>nexe</strong> file larger than needed for distribution.
|
| To minimize the size of the distributed file, you can run the
|
| <code><prefix>strip</code> tool to strip out debug information.</p>
|
| -</section></section><section id="using-make">
|
| <h2 id="using-make">Using make</h2>
|
| <p>This document doesn’t cover how to use <code>make</code>, but if you want to use
|
| <code>make</code> to build your Native Client module, you can base your Makefile on the
|
| @@ -486,7 +468,6 @@ numerous variables near the top (e.g., <code>CFLAGS</code>) that make it easy
|
| to customize the commands that are executed for your project and the options
|
| for each command.</p>
|
| <p>For details on how to use make, see the <a class="reference external" href="http://www.gnu.org/software/make/manual/make.html">GNU ‘make’ Manual</a>.</p>
|
| -</section><section id="libraries-and-header-files-provided-with-the-sdk">
|
| <h2 id="libraries-and-header-files-provided-with-the-sdk">Libraries and header files provided with the SDK</h2>
|
| <p>The Native Client SDK includes modified versions of standard toolchain-support
|
| libraries, such as libpthread and libc, plus the relevant header files.
|
| @@ -558,10 +539,8 @@ examples for the order in which specific libraries should be listed.</li>
|
| </ul>
|
|
|
| </aside>
|
| -</section><section id="troubleshooting">
|
| <h2 id="troubleshooting">Troubleshooting</h2>
|
| <p>Some common problems, and how to fix them:</p>
|
| -<section id="undefined-reference-error">
|
| <h3 id="undefined-reference-error">“Undefined reference” error</h3>
|
| <p>An “undefined reference” error may indicate incorrect link order and/or
|
| missing libraries. For example, if you leave out <code>-lppapi</code> when
|
| @@ -584,14 +563,12 @@ The nacl_io library essentially does option (3) for you: It lets your
|
| code use POSIX-like file system calls, and implements the calls using
|
| various technologies (e.g., HTML5 file system, read-only filesystems that
|
| use URL loaders, or an in-memory filesystem).</p>
|
| -</section><section id="can-t-find-libraries-containing-necessary-symbols">
|
| <h3 id="can-t-find-libraries-containing-necessary-symbols">Can’t find libraries containing necessary symbols</h3>
|
| <p>Here is one way to find the appropriate library for a given symbol:</p>
|
| <pre>
|
| <NACL_SDK_ROOT>/toolchain/<platform>_pnacl/bin/pnacl-nm -o \
|
| toolchain/<platform>_pnacl/usr/lib/*.a | grep <MySymbolName>
|
| </pre>
|
| -</section><section id="pnacl-abi-verification-errors">
|
| <h3 id="pnacl-abi-verification-errors">PNaCl ABI Verification errors</h3>
|
| <p>PNaCl has restrictions on what is supported in bitcode. There is a bitcode
|
| ABI verifier which checks that the application conforms to the ABI restrictions,
|
| @@ -618,6 +595,6 @@ LLVM ERROR: PNaCl ABI verification failed
|
| that are <a class="reference internal" href="/native-client/nacl-and-pnacl.html#when-to-use-nacl"><em>not supported by PNaCl</em></a>.
|
| If the problem you face is not listed as restricted,
|
| <a class="reference internal" href="/native-client/help.html#help"><em>let us know</em></a>!</p>
|
| -</section></section></section>
|
| +</section>
|
|
|
| {{/partials.standard_nacl_article}}
|
|
|