| OLD | NEW |
| 1 {{+bindTo:partials.standard_nacl_article}} | 1 {{+bindTo:partials.standard_nacl_article}} |
| 2 | 2 |
| 3 <section id="building"> | 3 <section id="building"> |
| 4 <span id="devcycle-building"></span><h1 id="building"><span id="devcycle-buildin
g"></span>Building</h1> | 4 <span id="devcycle-building"></span><h1 id="building"><span id="devcycle-buildin
g"></span>Building</h1> |
| 5 <div class="contents local" id="table-of-contents" style="display: none"> | 5 <div class="contents local" id="table-of-contents" style="display: none"> |
| 6 <p class="topic-title first">Table Of Contents</p> | 6 <p class="topic-title first">Table Of Contents</p> |
| 7 <ul class="small-gap"> | 7 <ul class="small-gap"> |
| 8 <li><p class="first"><a class="reference internal" href="#introduction" id="id4"
>Introduction</a></p> | 8 <li><p class="first"><a class="reference internal" href="#introduction" id="id4"
>Introduction</a></p> |
| 9 <ul class="small-gap"> | 9 <ul class="small-gap"> |
| 10 <li><a class="reference internal" href="#target-architectures" id="id5">Target a
rchitectures</a></li> | 10 <li><a class="reference internal" href="#target-architectures" id="id5">Target a
rchitectures</a></li> |
| 11 <li><a class="reference internal" href="#c-libraries" id="id6">C libraries</a></
li> | 11 <li><a class="reference internal" href="#c-libraries" id="id6">C libraries</a></
li> |
| 12 <li><a class="reference internal" href="#c-standard-libraries" id="id7">C++ stan
dard libraries</a></li> | 12 <li><a class="reference internal" href="#c-standard-libraries" id="id7">C++ stan
dard libraries</a></li> |
| 13 <li><a class="reference internal" href="#sdk-toolchains" id="id8">SDK toolchains
</a></li> | 13 <li><a class="reference internal" href="#sdk-toolchains" id="id8">SDK toolchains
</a></li> |
| 14 <li><a class="reference internal" href="#sdk-toolchains-versus-your-hosted-toolc
hain" id="id9">SDK toolchains versus your hosted toolchain</a></li> | 14 <li><a class="reference internal" href="#sdk-toolchains-versus-your-hosted-toolc
hain" id="id9">SDK toolchains versus your hosted toolchain</a></li> |
| 15 </ul> | 15 </ul> |
| 16 </li> | 16 </li> |
| 17 <li><a class="reference internal" href="#the-pnacl-toolchain" id="id10">The PNaC
l toolchain</a></li> | 17 <li><a class="reference internal" href="#the-pnacl-toolchain" id="id10">The PNaC
l toolchain</a></li> |
| 18 <li><p class="first"><a class="reference internal" href="#using-the-pnacl-tools-
to-compile-link-debug-and-deploy" id="id11">Using the PNaCl tools to compile, li
nk, debug, and deploy</a></p> | 18 <li><p class="first"><a class="reference internal" href="#using-the-pnacl-tools-
to-compile-link-debug-and-deploy" id="id11">Using the PNaCl tools to compile, li
nk, debug, and deploy</a></p> |
| 19 <ul class="small-gap"> | 19 <ul class="small-gap"> |
| 20 <li><a class="reference internal" href="#compile" id="id12">Compile</a></li> | 20 <li><a class="reference internal" href="#compile" id="id12">Compile</a></li> |
| 21 <li><a class="reference internal" href="#create-a-static-library" id="id13">Crea
te a static library</a></li> | 21 <li><a class="reference internal" href="#create-a-static-library" id="id13">Crea
te a static library</a></li> |
| 22 <li><a class="reference internal" href="#link-the-application" id="id14">Link th
e application</a></li> | 22 <li><a class="reference internal" href="#link-the-application" id="id14">Link th
e application</a></li> |
| 23 <li><a class="reference internal" href="#finalizing-the-pexe-for-deployment" id=
"id15">Finalizing the <strong>pexe</strong> for deployment</a></li> | 23 <li><a class="reference internal" href="#finalizing-the-pexe-for-deployment" id=
"id15">Finalizing the <strong>pexe</strong> for deployment</a></li> |
| 24 <li><a class="reference internal" href="#compressing-the-pexe-for-deployment" id
="id16">Compressing the <strong>pexe</strong> for deployment</a></li> | 24 <li><a class="reference internal" href="#compressing-the-pexe-for-deployment" id
="id16">Compressing the <strong>pexe</strong> for deployment</a></li> |
| 25 </ul> | 25 </ul> |
| 26 </li> | 26 </li> |
| 27 <li><p class="first"><a class="reference internal" href="#the-gnu-based-toolchai
ns" id="id17">The GNU-based toolchains</a></p> | 27 <li><a class="reference internal" href="#objumping-pnacl-bitcode-files" id="id17
">Objumping PNaCl Bitcode files</a></li> |
| 28 <li><p class="first"><a class="reference internal" href="#the-gnu-based-toolchai
ns" id="id18">The GNU-based toolchains</a></p> |
| 28 <ul class="small-gap"> | 29 <ul class="small-gap"> |
| 29 <li><a class="reference internal" href="#compiling" id="id18">Compiling</a></li> | 30 <li><a class="reference internal" href="#compiling" id="id19">Compiling</a></li> |
| 30 <li><a class="reference internal" href="#creating-libraries-and-linking" id="id1
9">Creating libraries and Linking</a></li> | 31 <li><a class="reference internal" href="#creating-libraries-and-linking" id="id2
0">Creating libraries and Linking</a></li> |
| 31 <li><a class="reference internal" href="#finalizing-a-nexe-for-deployment" id="i
d20">Finalizing a <strong>nexe</strong> for deployment</a></li> | 32 <li><a class="reference internal" href="#finalizing-a-nexe-for-deployment" id="i
d21">Finalizing a <strong>nexe</strong> for deployment</a></li> |
| 32 </ul> | 33 </ul> |
| 33 </li> | 34 </li> |
| 34 <li><a class="reference internal" href="#using-make" id="id21">Using make</a></l
i> | 35 <li><a class="reference internal" href="#using-make" id="id22">Using make</a></l
i> |
| 35 <li><a class="reference internal" href="#libraries-and-header-files-provided-wit
h-the-sdk" id="id22">Libraries and header files provided with the SDK</a></li> | 36 <li><a class="reference internal" href="#libraries-and-header-files-provided-wit
h-the-sdk" id="id23">Libraries and header files provided with the SDK</a></li> |
| 36 <li><p class="first"><a class="reference internal" href="#troubleshooting" id="i
d23">Troubleshooting</a></p> | 37 <li><p class="first"><a class="reference internal" href="#troubleshooting" id="i
d24">Troubleshooting</a></p> |
| 37 <ul class="small-gap"> | 38 <ul class="small-gap"> |
| 38 <li><a class="reference internal" href="#undefined-reference-error" id="id24">&#
8220;Undefined reference” error</a></li> | 39 <li><a class="reference internal" href="#undefined-reference-error" id="id25">&#
8220;Undefined reference” error</a></li> |
| 39 <li><a class="reference internal" href="#can-t-find-libraries-containing-necessa
ry-symbols" id="id25">Can’t find libraries containing necessary symbols</a
></li> | 40 <li><a class="reference internal" href="#can-t-find-libraries-containing-necessa
ry-symbols" id="id26">Can’t find libraries containing necessary symbols</a
></li> |
| 40 <li><a class="reference internal" href="#pnacl-abi-verification-errors" id="id26
">PNaCl ABI Verification errors</a></li> | 41 <li><a class="reference internal" href="#pnacl-abi-verification-errors" id="id27
">PNaCl ABI Verification errors</a></li> |
| 41 </ul> | 42 </ul> |
| 42 </li> | 43 </li> |
| 43 </ul> | 44 </ul> |
| 44 | 45 |
| 45 </div><h2 id="introduction">Introduction</h2> | 46 </div><h2 id="introduction">Introduction</h2> |
| 46 <p>This document describes how to build Native Client modules. It is intended fo
r | 47 <p>This document describes how to build Native Client modules. It is intended fo
r |
| 47 developers who have experience writing, compiling, and linking C and C++ code. | 48 developers who have experience writing, compiling, and linking C and C++ code. |
| 48 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="refe
rence internal" href="/native-client/devguide/tutorial/index.html"><em>Tutorial<
/em></a>, we recommend starting | 49 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="refe
rence internal" href="/native-client/devguide/tutorial/index.html"><em>Tutorial<
/em></a>, we recommend starting |
| 49 with those.</p> | 50 with those.</p> |
| 50 <h3 id="target-architectures"><span id="id1"></span>Target architectures</h3> | 51 <h3 id="target-architectures"><span id="id1"></span>Target architectures</h3> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 run the tool with the <code>--version</code> command line flag. These tools | 129 run the tool with the <code>--version</code> command line flag. These tools |
| 129 are used to compile and link applications into <strong>.pexe</strong> files. The
toolchain | 130 are used to compile and link applications into <strong>.pexe</strong> files. The
toolchain |
| 130 also contains a tool to translate a <strong>pexe</strong> file into a | 131 also contains a tool to translate a <strong>pexe</strong> file into a |
| 131 architecture-specific <strong>.nexe</strong> (e.g., for debugging purposes).</p> | 132 architecture-specific <strong>.nexe</strong> (e.g., for debugging purposes).</p> |
| 132 <p>Some of the useful tools include:</p> | 133 <p>Some of the useful tools include:</p> |
| 133 <dl class="docutils"> | 134 <dl class="docutils"> |
| 134 <dt>pnacl-abicheck</dt> | 135 <dt>pnacl-abicheck</dt> |
| 135 <dd>Checks that the <strong>pexe</strong> follows the PNaCl ABI rules.</dd> | 136 <dd>Checks that the <strong>pexe</strong> follows the PNaCl ABI rules.</dd> |
| 136 <dt>pnacl-ar</dt> | 137 <dt>pnacl-ar</dt> |
| 137 <dd>Creates archives (i.e., static libraries)</dd> | 138 <dd>Creates archives (i.e., static libraries)</dd> |
| 139 <dt>pnacl-bcdis</dt> |
| 140 <dd>Objdumper for PNaCl bitcode files.</dd> |
| 138 <dt>pnacl-clang</dt> | 141 <dt>pnacl-clang</dt> |
| 139 <dd>C compiler and compiler driver</dd> | 142 <dd>C compiler and compiler driver</dd> |
| 140 <dt>pnacl-clang++</dt> | 143 <dt>pnacl-clang++</dt> |
| 141 <dd>C++ compiler and compiler driver</dd> | 144 <dd>C++ compiler and compiler driver</dd> |
| 142 <dt>pnacl-compress</dt> | 145 <dt>pnacl-compress</dt> |
| 143 <dd>Compresses a finalized <strong>pexe</strong> file for deployment.</dd> | 146 <dd>Compresses a finalized <strong>pexe</strong> file for deployment.</dd> |
| 144 <dt>pnacl-dis</dt> | 147 <dt>pnacl-dis</dt> |
| 145 <dd>Disassembler for both <strong>pexe</strong> files and <strong>nexe</strong>
files</dd> | 148 <dd>Disassembler for both <strong>pexe</strong> files and <strong>nexe</strong>
files</dd> |
| 146 <dt>pnacl-finalize</dt> | 149 <dt>pnacl-finalize</dt> |
| 147 <dd>Finalizes <strong>pexe</strong> files for deployment</dd> | 150 <dd>Finalizes <strong>pexe</strong> files for deployment</dd> |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 </pre> | 301 </pre> |
| 299 <p><code>pnacl-compress</code> must be called after a <strong>pexe</strong> file
has been finalized for | 302 <p><code>pnacl-compress</code> must be called after a <strong>pexe</strong> file
has been finalized for |
| 300 deployment (via <code>pnacl-finalize</code>). Alternatively, you can apply this
step as | 303 deployment (via <code>pnacl-finalize</code>). Alternatively, you can apply this
step as |
| 301 part of the finalizing step by adding the <code>--compress</code> flag to the | 304 part of the finalizing step by adding the <code>--compress</code> flag to the |
| 302 <code>pnacl-finalize</code> command line.</p> | 305 <code>pnacl-finalize</code> command line.</p> |
| 303 <p>This compression step doesn’t replace the gzip compression performed we
b servers | 306 <p>This compression step doesn’t replace the gzip compression performed we
b servers |
| 304 configured for HTTP compression: both compressions are complementary. You’
ll | 307 configured for HTTP compression: both compressions are complementary. You’
ll |
| 305 want to configure your web server to gzip <strong>pexe</strong> files: the gzipp
ed version of | 308 want to configure your web server to gzip <strong>pexe</strong> files: the gzipp
ed version of |
| 306 a compressed <strong>pexe</strong> file is smaller than the corresponding uncomp
ressed | 309 a compressed <strong>pexe</strong> file is smaller than the corresponding uncomp
ressed |
| 307 <strong>pexe</strong> file by 7.5% to 10%.</p> | 310 <strong>pexe</strong> file by 7.5% to 10%.</p> |
| 311 <h2 id="objumping-pnacl-bitcode-files"><span id="pnacl-bcdis"></span>Objumping P
NaCl Bitcode files</h2> |
| 312 <p>Sometimes you may be interesting in the contents of a PNaCl bitcode |
| 313 file. The tool <code>pnacl-bcdis</code> objdumps the contents of a PNaCl |
| 314 bitcode file. For a description of the output produced by this tool, |
| 315 see <a class="reference internal" href="/native-client/reference/pnacl-bitcode-m
anual.html"><em>Contents Of PNaCl Bitcode Files</em></a>.</p> |
| 316 <pre> |
| 317 nacl_sdk/pepper_<version>/toolchain/win_pnacl/bin/pnacl-bcdis \ |
| 318 hello_world.final.pexe |
| 319 </pre> |
| 320 <p>The output is the corresponding contents of the given <strong>pexe</strong>.<
/p> |
| 308 <h2 id="the-gnu-based-toolchains">The GNU-based toolchains</h2> | 321 <h2 id="the-gnu-based-toolchains">The GNU-based toolchains</h2> |
| 309 <p>Besides the PNaCl toolchain, the Native Client SDK also includes modified | 322 <p>Besides the PNaCl toolchain, the Native Client SDK also includes modified |
| 310 versions of the tools in the standard GNU toolchain, including the GCC | 323 versions of the tools in the standard GNU toolchain, including the GCC |
| 311 compilers and the linkers and other tools from binutils. These tools only | 324 compilers and the linkers and other tools from binutils. These tools only |
| 312 support building <strong>nexe</strong> files. Run the tool with the <code>--vers
ion</code> | 325 support building <strong>nexe</strong> files. Run the tool with the <code>--vers
ion</code> |
| 313 command line flag to determine the current version of the tools.</p> | 326 command line flag to determine the current version of the tools.</p> |
| 314 <p>Each tool in the toolchain is prefixed with the name of the target | 327 <p>Each tool in the toolchain is prefixed with the name of the target |
| 315 architecture. In the toolchain for the ARM target architecture, each | 328 architecture. In the toolchain for the ARM target architecture, each |
| 316 tool’s name is preceded by the prefix “arm-nacl-”. In the tool
chains for | 329 tool’s name is preceded by the prefix “arm-nacl-”. In the tool
chains for |
| 317 the x86 target architecture, there are actually two versions of each | 330 the x86 target architecture, there are actually two versions of each |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 Function foo has disallowed type: i128 (i128) | 586 Function foo has disallowed type: i128 (i128) |
| 574 LLVM ERROR: PNaCl ABI verification failed | 587 LLVM ERROR: PNaCl ABI verification failed |
| 575 </pre> | 588 </pre> |
| 576 <p>When faced with a PNaCl ABI verification error, check the list of features | 589 <p>When faced with a PNaCl ABI verification error, check the list of features |
| 577 that are <a class="reference internal" href="/native-client/nacl-and-pnacl.html#
when-to-use-nacl"><em>not supported by PNaCl</em></a>. | 590 that are <a class="reference internal" href="/native-client/nacl-and-pnacl.html#
when-to-use-nacl"><em>not supported by PNaCl</em></a>. |
| 578 If the problem you face is not listed as restricted, | 591 If the problem you face is not listed as restricted, |
| 579 <a class="reference internal" href="/native-client/help.html#help"><em>let us kn
ow</em></a>!</p> | 592 <a class="reference internal" href="/native-client/help.html#help"><em>let us kn
ow</em></a>!</p> |
| 580 </section> | 593 </section> |
| 581 | 594 |
| 582 {{/partials.standard_nacl_article}} | 595 {{/partials.standard_nacl_article}} |
| OLD | NEW |