blob: b59cb28fb72fb5e5e1015f1a7a6a0a2c29f30183 [file] [log] [blame]
{{+bindTo:partials.standard_nacl_article}}
<b><font color="#cc0000">
NOTE:
Deprecation of the technologies described here has been announced
for platforms other than ChromeOS.<br/>
Please visit our
<a href="/native-client/migration">migration guide</a>
for details.
</font></b>
<hr/><section id="release-notes">
<h1 id="release-notes">Release Notes</h1>
<p>The dates in the following release notes denote when Chrome and the NaCl SDK
reached canary status. The stable release is typically 6 weeks later.</p>
<h2 id="chrome-pepper-49">Chrome/Pepper 49</h2>
<ul class="small-gap">
<li>GCC-based newlib toolchains removed from the SDK. These have been
superseded by the nacl-clang toolchain which also produces statically linked
architecture specific nexe files.</li>
<li>gtest/gmock no longer shipped as pre-built libraries. This is in-line with
normal gtest/gmock usage guidelines. Projects wishing to use gtest/gmock must
now add explicit include paths and compile gtest-all.cc locally.</li>
</ul>
<h2 id="chrome-pepper-45-10-july-2015">Chrome/Pepper 45 (10 July 2015)</h2>
<h3 id="pepper">Pepper</h3>
<ul class="small-gap">
<li>UDP Socket Multicast API in stable (PPB_UDP_SOCKET 1.2).</li>
</ul>
<h2 id="chrome-pepper-43-03-april-2015">Chrome/Pepper 43 (03 April 2015)</h2>
<h3 id="pnacl">PNaCl</h3>
<ul class="small-gap">
<li>The C11/C++11 <code>acquire</code>, <code>release</code>, and <code>acq_rel</code> memory orders are now
generated by default. The in-browser Chrome 42 translator supports them, the
SDK can therefore generate them.</li>
<li>Fix a <a class="reference external" href="https://code.google.com/p/chromium/issues/detail?id=460432">code generation bug on ARM</a> when dealing with 16-bit load/store and
<code>bswap</code> which led to a NaCl validation failure.</li>
<li>PNaCl is now based on LLVM 3.6. If you are using GDB to debug PNaCl
<a class="reference internal" href="/native-client/devguide/devcycle/debugging.html#debugging-pnacl-pexes"><em>BC files with debug metadata in the browser</em></a>,
remember that debug info from SDK version <code>X</code> is only compatible with the
PNaCl translator in chrome version <code>X</code>. The bitcode debug metadata format
changed from LLVM 3.5 to 3.6. If you need to debug an app built with SDK
version <code>X</code> running in Chrome version <code>Y</code> (with <code>X != Y</code>), it is still
possible to do so. Simply translate the pexe to a nexe using the
<a class="reference internal" href="/native-client/devguide/devcycle/debugging.html#debugging-pexes-via-nexes"><em>offline pnacl-translate tool from SDK version X</em></a> instead of using the translator in the
browser (version <code>Y</code>).</li>
<li>PNaCl&#8217;s support for use of libstdc++ 4.6 as the C++ standard library is
deprecated and will be removed in the next release. PNaCl has used libc++
(which is much more up to date, currently based on LLVM 3.6) as the default
since Pepper 33.</li>
<li>PNaCl&#8217;s experimental <a class="reference external" href="https://chromium.googlesource.com/native_client/pnacl-subzero/+/master/README.rst">Subzero translator</a> is available for x86-32 NaCl in
Chrome version 43, behind a flag. To give it a try, run Chrome with the
<code>--enable-pnacl-subzero</code> commandline flag, and use the <code>optlevel 0</code>
<a class="reference internal" href="/native-client/reference/nacl-manifest-format.html#pnacl-nmf-optlevels"><em>NaCl manifest option</em></a>. Application startup time
should be several times faster than the previous LLVM-based <code>optlevel 0</code>
mode, with similar code quality. Note that x86-32 NaCl requires a 32-bit
Chrome. On Windows, it also requires a 32-bit Windows OS, but 64-bit Linux
OSes can run x86-32 NaCl. If you try it out, please send us feedback
on <a class="reference external" href="https://groups.google.com/forum/#!forum/native-client-dev">native-client-dev</a>. We are working on improvements and adding
new targets.</li>
</ul>
<h3 id="id1">Pepper</h3>
<ul class="small-gap">
<li>UDP Socket Multicast API in development preview (PPB_UDP_SOCKET 1.2).</li>
<li>Hardware Video Encoder API in development preview (PPB_VIDEO_ENCODER 0.1).</li>
</ul>
<h2 id="chrome-pepper-42-20-february-2015">Chrome/Pepper 42 (20 February 2015)</h2>
<h3 id="sdk">SDK</h3>
<ul class="small-gap">
<li>The SDK now contains experimental versions of <code>i686-nacl-clang</code>,
<code>x86_64-nacl-clang</code>, and <code>arm-nacl-clang</code> as well as the <code>clang++</code>
equivalents. These toolchains are based on the same LLVM version as PNaCl, but
can be used to generate NaCl <code>.nexe</code> files instead of translating a
<code>.pexe</code> locally or using the GCC toolchain.</li>
</ul>
<h3 id="nacl">NaCl</h3>
<ul class="small-gap">
<li>The x86 NaCl validators accept instructions from the FMA3 extensions, as well
as AVX2 instructions (except <code>VGATHER</code>).</li>
</ul>
<h3 id="id2">PNaCl</h3>
<ul class="small-gap">
<li>PNaCl supports C11/C++11 memory orders <code>acquire</code>, <code>release</code>, and
<code>acq_rel</code>. It used to upgrade all accesses to <code>seq_cst</code>. It still upgrades
<code>consume</code> to <code>acquire</code> (no compiler currently implements <code>consume</code>), and
<code>relaxed</code> to <code>seq_cst</code> (to conservatively avoid platform differences due
to out-of-thin-air problems). This is currently disabled by default in the SDK
so that the in-browser translator installed on users&#8217; machines has time to
gain this support. Developers can turn it on by passing the
<code>-pnacl-memory-order-seq-cst-only=false</code> flag to <code>opt</code>.</li>
<li>PNaCl handles nested struct type expansion, which allows it to better support
non-C languages such as Rust.</li>
<li>PNaCl breaks up many integer operations over 64-bits into individual 64-bit
operations. This is often encountered when using large consecutive bitfields.</li>
</ul>
<h2 id="chrome-pepper-41-09-january-2015">Chrome/Pepper 41 (09 January 2015)</h2>
<h3 id="id3">NaCl</h3>
<ul class="small-gap">
<li>The x86 NaCl validators accept instructions from the AVX1 extensions.</li>
</ul>
<h3 id="id4">PNaCl</h3>
<ul class="small-gap">
<li>PNaCl is now based on LLVM 3.5.</li>
</ul>
<h2 id="chrome-pepper-40-november-07-2014">Chrome/Pepper 40 (November 07 2014)</h2>
<ul class="small-gap">
<li><a class="reference external" href="/native-client/pepper_stable/cpp/classpp_1_1_video_decoder.html">VideoDecoder</a> is now
stable, see the SDK example in <code>pepper_canary/examples/api/video_decode</code>.</li>
</ul>
<h2 id="chrome-pepper-39-26-september-2014">Chrome/Pepper 39 (26 September 2014)</h2>
<h3 id="id5">NaCl</h3>
<ul class="small-gap">
<li>This release contains a fix for CVE-2015-0565: <a class="reference external" href="https://code.google.com/p/nativeclient/issues/detail?id=3944">disable the x86 CLFLUSH
instruction due to rowhammer problem</a>.</li>
</ul>
<h3 id="id6">Pepper</h3>
<ul class="small-gap">
<li>Support for <code>DEBUG_ONLY:dev://postmessage</code> has been removed in favor of
<a class="reference internal" href="/native-client/devguide/devcycle/debugging.html#devcycle-debugging"><em>other more useful debugging approaches</em></a>.</li>
<li><code>postMessageAndAwaitResponse</code> is now stable and allows JavaScript to
<a class="reference external" href="/native-client/pepper_stable/cpp/classpp_1_1_message_handler">communicate synchronously</a> with PNaCl
embeds.</li>
</ul>
<h2 id="chrome-pepper-38-15-august-2014">Chrome/Pepper 38 (15 August 2014)</h2>
<h3 id="id7">PNaCl</h3>
<ul class="small-gap">
<li>Compilation speed improvements due to validation caching of the translator and
linker.</li>
<li>Performance improvement of SIMD vector shuffle.</li>
</ul>
<h2 id="chrome-pepper-37-20-june-2014">Chrome/Pepper 37 (20 June 2014)</h2>
<h3 id="id8">PNaCl</h3>
<ul class="small-gap">
<li>2–10% translation time improvement.</li>
<li>Improved vector load/store and shuffle performance.</li>
</ul>
<h3 id="id9">Pepper</h3>
<ul class="small-gap">
<li>Media Streams Input support.</li>
<li>Compositor API.</li>
<li>Hardware Decode API in development preview.</li>
<li>Sync API in development preview.</li>
</ul>
<h3 id="id10">SDK</h3>
<ul class="small-gap">
<li>Demo of a <a class="reference internal" href="/native-client/io2014.html#io2014"><em>full development environment in the browser</em></a>.</li>
</ul>
<h2 id="chrome-pepper-36-09-may-2014">Chrome/Pepper 36 (09 May 2014)</h2>
<h3 id="id11">PNaCl</h3>
<ul class="small-gap">
<li>Support <a class="reference external" href="http://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors">LLVM vectors</a>
and <a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html">GCC vectors</a> for SIMD
vectors through <a class="reference internal" href="/native-client/reference/pnacl-c-cpp-language-support.html#portable-simd-vectors"><em>Portable SIMD Vectors</em></a>. Note that this is still an early release,
and performance is expected to become acceptable for version 37 of
Chrome. More SIMD instructions will be added in later releases.</li>
</ul>
<h2 id="chrome-pepper-35-31-mar-2014">Chrome/Pepper 35 (31 Mar 2014)</h2>
<h3 id="id12">PNaCl</h3>
<ul class="small-gap">
<li>Upgraded LLVM to version 3.4.</li>
<li>Translation now uses dynamic load balancing, making translation time faster.</li>
<li>Unstable pexes (i.e. non-finalized) with debug information can be loaded by
Chrome, simplifying debugging with PNaCl. See <a class="reference internal" href="/native-client/devguide/devcycle/debugging.html#debugging-pnacl-pexes"><em>Debugging PNaCl pexes</em></a></li>
</ul>
<h2 id="chrome-pepper-34-20-feb-2014">Chrome/Pepper 34 (20 Feb 2014)</h2>
<h3 id="id13">Pepper</h3>
<ul class="small-gap">
<li>Filesystems can now be passed from JavaScript to NaCl. The resulting
<code>pp::Var</code> will contain a <code>pp::Resource</code> that can be given to the
<code>pp::FileSystem</code> constructor.</li>
<li>New Audio and Video input APIs have been added as dev interfaces. See
<a class="reference external" href="/native-client/pepper_dev/cpp/classpp_1_1_media_stream_audio_track">pp::MediaStreamAudioTrack</a> and
<a class="reference external" href="/native-client/pepper_dev/cpp/classpp_1_1_media_stream_video_track">pp::MediaStreamVideoTrack</a> for
more details.</li>
</ul>
<h3 id="id14">PNaCl</h3>
<ul class="small-gap">
<li>Parallel translation: at least 1.7x faster, even with older pexes.</li>
<li>Intelligent abbreviations in the bitcode: 20% reduction in binary size using
the <a class="reference internal" href="/native-client/devguide/devcycle/building.html#pnacl-compress"><em>pnacl-compress</em></a> tool.</li>
</ul>
<h2 id="chrome-pepper-33-16-dec-2013">Chrome/Pepper 33 (16 Dec 2013)</h2>
<h3 id="portable-native-client">Portable Native Client</h3>
<ul class="small-gap">
<li>PNaCl&#8217;s default C++ standard library is now LLVM&#8217;s own libc++, based on
LLVM 3.3. This library now supports optional <code>setjmp</code>/<code>longjmp</code> exception
handling (see <a class="reference external" href="https://groups.google.com/forum/#!topic/native-client-discuss/0spfg6O04FM">announcement</a>
for details).</li>
</ul>
<h3 id="id15">SDK</h3>
<ul class="small-gap">
<li>The <code>nacl_io</code> library now includes a FUSE mount.</li>
<li>In the SDK examples, <code>common.js</code> now loads the Release version of the
nexes/pexes that are built (by default).</li>
<li>&#8220;<code>make debug</code>&#8221; and &#8220;<code>make run</code>&#8221; have been fixed on Mac.</li>
</ul>
<h2 id="pnacl-enabled-by-default-in-chrome-31-12-nov-2013">PNaCl enabled by default in Chrome 31 (12 Nov 2013)</h2>
<ul class="small-gap">
<li>Portable Native Client (PNaCl) is enabled by default in Chrome 31. See
<a class="reference internal" href="/native-client/nacl-and-pnacl.html"><em>NaCl and PNaCl</em></a> for details on the differences between
NaCl and PNaCl.</li>
<li>The PNaCl ABI has changed from the preview release in Chrome 30.
Pexe modules built with the <code>pepper_30</code> bundle in the SDK must be recompiled
with the <code>pepper_31</code> bundle or later.
As a general rule, we always recommended building applications with the latest
stable bundle in the Native Client SDK.
The PNaCl ABI will remain stable starting with the release of Chrome 31.</li>
<li><p class="first">Additional changes in the Chrome/Pepper 31 release:</p>
<ul class="small-gap">
<li>Updates to the Pepper API, including socket and network support</li>
<li>Improved socket support in the <code>nacl_io</code> library</li>
</ul>
</li>
</ul>
<h2 id="pnacl-in-chrome-30-dev-channel-01-aug-2013">PNaCl in Chrome 30 Dev channel (01 Aug 2013)</h2>
<ul class="small-gap">
<li>Portable Native Client (PNaCl) is currently available for preview in Chrome
30 (currently in the Dev channel). Apps and sites built with PNaCl can run in
Chrome 30 without an explicit flag.</li>
<li>See <a class="reference external" href="http://www.chromium.org/nativeclient/pnacl/introduction-to-portable-native-client">Introduction to Portable Native Client</a>
for information on developing for PNaCl. More documentation will be available
soon.</li>
<li>Please note that the <a class="reference external" href="http://www.chromium.org/nativeclient/pnacl/bitcode-abi">PNaCl bitcode ABI</a> may still change
before the official public release; if you&#8217;re developing a PNaCl-based
application, be sure to build your code with the latest version of the Native
Client SDK.</li>
<li>Update: PNaCl is not enabled by default in beta or stable versions of M30.</li>
</ul>
<h2 id="pnacl-15-may-2013">PNaCl (15 May 2013)</h2>
<ul class="small-gap">
<li>Portable Native Client (PNaCl) is currently available for developer preview
in Chrome 29 or higher.</li>
<li>To produce a PNaCl executable (.pexe) file, you must use the pnacl toolchain
in the current <code>pepper_canary</code> bundle. Chrome 29 does not support .pexe
files produced by earlier versions of the pnacl toolchain (that is,
executables compiled with the <code>pepper_28</code> bundle or earlier).</li>
<li>To run an application with a PNaCl module, you must launch Chrome 29 with the
<code>--enable-pnacl</code> flag (for <a class="reference external" href="/apps">Chrome apps</a>), or the <code>--enable-nacl</code>
flag (for other apps).</li>
<li>When you launch Chrome with the <code>--enable-pnacl</code> flag, Chrome loads a PNaCl
translator in the background. Wait about a minute after you launch Chrome and
check <a class="reference external" href="chrome://nacl">chrome://nacl</a> to verify that the translator loaded.</li>
<li>PNaCl translators are currently available for 32-bit x86, 64-bit x86, and ARM
architectures.</li>
<li>PNaCl applications must use the newlib C library (glibc and dynamic linking
are not supported yet).</li>
<li>The intermediate representation (IR) format may change prior to the release
of PNaCl. If so, you will need to recompile your application with the pnacl
toolchain in a new SDK bundle.</li>
</ul>
<h2 id="pepper-27-12-april-2013">Pepper 27 (12 April 2013)</h2>
<p>The Pepper 27 bundle features a significant number of new libraries that have
been incorporated directly into the SDK.</p>
<h3 id="libraries">Libraries</h3>
<ul class="small-gap">
<li><p class="first">A number of libraries from the naclports project have been incorporated
directly into the Native Client SDK. These libraries include:</p>
<ul class="small-gap">
<li>image encoding/decoding: jpeg, tiff, png, webp</li>
<li>multimedia: openal, freealut, ogg, vorbis</li>
<li>XML parsing: tinyxml, xml2</li>
<li>miscellaneous: zlib (general purpose compression), freetype (font
rendering), lua (Lua interpreter)</li>
</ul>
<p>The libraries are located in <code>ports/lib</code>, and the header files are in
<code>ports/include</code>.</p>
</li>
<li>The <code>httpfs</code> filesystem in the nacl_io library now caches content in memory
by default; this improves performance considerably.</li>
<li>For applications compiled with a glibc toolchain, <code>dlopen()</code> can now be
used to open shared libraries that are not specified in an application&#8217;s
Native Client manifest (.nmf) file. This allows applications, for example, to
download a shared object and then use <code>dlopen()</code> to access the shared
object. The <code>dlopen</code> example has been modified to demonstrate this
functionality: reverse.cc is built into a shared object (.so) file, which is
downloaded and opened using an <code>httpfs</code> mount.</li>
</ul>
<h3 id="examples">Examples</h3>
<ul class="small-gap">
<li>Each example now has a single <code>index.html</code> file, instead of multiple HTML
files corresponding to NaCl modules built using different toolchains and
configurations. By default, most examples are built using one toolchain
(newlib) and one configuration (Debug). If you build an example using
multiple toolchains or configurations, you can specify which version to run
in Chrome using the query parameters <code>tc</code> and <code>config</code>. For example,
assuming you are serving an example from the local server localhost:5103, you
can run a version of the example built with the glibc toolchain in the
Release configuration by specifying the following URL in Chrome:
<code>http://localhost:5103/index.html?tc=glibc&amp;config=Release</code>. For additional
information about how different NaCl modules are loaded into <code>index.html</code>,
see the <code>common.js</code> file in each example.</li>
</ul>
<h3 id="build-tools-and-toolchains">Build tools and toolchains</h3>
<ul class="small-gap">
<li>Common makefiles, including <code>tools/common.mk</code>, can now handle source files
located outside of an application&#8217;s root directory. For example, a Makefile
for an application can specify a source file to compile such as
<code>../../some/other/place.cpp</code>.</li>
</ul>
<h2 id="pepper-26-29-march-2013">Pepper 26 (29 March 2013)</h2>
<p>The Pepper 26 bundle includes a new HTTP filesystem type in the nacl_mounts
library (which has been renamed nacl_io), changes to the example Makefiles, a
simple new 3D example, and a threaded file IO example.</p>
<h3 id="id16">Build tools and toolchains</h3>
<ul class="small-gap">
<li><p class="first">Makefiles have been changed significantly:</p>
<ul class="small-gap">
<li>Build commands are now specified in a number of common files
(<code>tools/*.mk</code>), which are included in the Makefiles in the examples.</li>
<li>By default, make displays a simplified list of build steps (e.g., <code>CC
newlib/Debug/hello_world_x86_32.o</code>) rather than the actual build commands.
To see the actual build commands, run <code>make V=1</code>.</li>
<li>By default, most examples are built using one toolchain (newlib) and one
configuration (Debug). To build an example using a different toolchain or
configuration, run <code>make</code> with the parameters <code>TOOLCHAIN=&lt;x&gt;</code> or
<code>CONFIG=&lt;y&gt;</code>. You can also run make <code>all_versions</code> to build an example
with all toolchains.</li>
</ul>
</li>
<li>Header files have been moved out of the toolchains. All toolchains now share
the same set of header files as host builds. Previously host and NaCl builds
used different headers, which could cause build problems.</li>
</ul>
<h3 id="id17">Libraries</h3>
<ul class="small-gap">
<li>The nacl_mounts library has been renamed <strong>nacl_io</strong>, and has been expanded
with a new type of mount, httpfs, which can be used to read URLs via HTTP.
For details see <code>include/nacl_io/nacl_io.h</code>, as well as the
<code>hello_nacl_io</code> example.</li>
</ul>
<h3 id="id18">Examples</h3>
<ul class="small-gap">
<li>A new example, <strong>hello_world_instance3d</strong>, has been added to demonstrate a
simplified 3D app.</li>
<li>The <strong>file_io</strong> example has been rewritten to do all file operations on a
thread. The example demonstrates how to use the MessageLoop API and blocking
callbacks on a thread.</li>
</ul>
<h3 id="general">General</h3>
<ul class="small-gap">
<li>Old bundles (<code>pepper_20</code> and earlier) have been removed from the Native
Client SDK Manifest, and will no longer be updated by the <code>naclsdk</code>
command.</li>
</ul>
<h2 id="pepper-25-21-december-2012">Pepper 25 (21 December 2012)</h2>
<p>The Pepper 25 bundle features an ARM toolchain to build Native Client modules
for ARM devices, two new Pepper APIs (including the MessageLoop API, which lets
you make Pepper calls on background threads), two new libraries (nacl_mounts,
which provides a virtual file system that you can use with standard C file
operations, and ppapi_main, which lets you implement a Native Client module
using a simple ppapi_main function), and two new examples that demonstrate how
to use the nacl_mounts and ppapi_main libraries.</p>
<h3 id="id19">Build tools and toolchains</h3>
<ul class="small-gap">
<li><p class="first">The SDK includes a new toolchain to build Native Client executables (.nexe
files) for <strong>ARM devices</strong>.</p>
<ul class="small-gap">
<li>Currently the ARM toolchain can only be used to compile modules that use
the <a class="reference internal" href="/native-client/devguide/devcycle/dynamic-loading.html#c-libraries"><em>newlib C library</em></a>. You cannot use the ARM toolchain
to compile modules that use the glibc library.</li>
<li>The ARM toolchain is in the directory
<code>pepper_25/toolchain/&lt;host&gt;_arm_newlib</code>. The bin subdirectory contains
the compiler (<code>arm-nacl-gcc</code>), the linker (<code>arm-nacl-g++</code>), and the
other tools in the toolchain.</li>
<li>Take a look at the <code>hello_world</code> example to see how to use the ARM
toolchain. Go to <code>examples/hello_world</code> and run <code>make</code>. When the build
finishes, the newlib/Debug and newlib/Release subdirectories will contain
.nexe files for the x86-32, x86-64, and ARM target architecutes, and a
Native Client manifest (.nmf file) that references those three .nexe files.</li>
</ul>
</li>
<li>The simple web server included in the SDK, <code>httpd.py</code>, has been moved from
the <code>examples/</code> directory to the <code>tools/</code> directory. On Windows, you can
run <code>httpd.cmd</code> (in the <code>examples/</code> directory) to start the server.</li>
</ul>
<h3 id="ppapi">PPAPI</h3>
<p>Pepper 25 includes two new APIs:</p>
<ul class="small-gap">
<li>The <a class="reference external" href="/native-client/pepper_stable/c/struct_p_p_b___console__1__0">Console API</a> lets your
module log messages to the JavaScript console in the Chrome browser.</li>
<li>The <a class="reference external" href="/native-client/pepper_stable/cpp/classpp_1_1_message_loop">MessageLoop</a> API lets your
module make PPAPI calls on a background thread. Once you&#8217;ve created a
message loop resource, attached it to a thread, and run it, you can post work
to the thread, including completion callbacks for asynchronous operations.
For a C++ example of how to use the MessageLoop API, see
<code>pepper_25/include/ppapi/utility/threading/simple_thread.h</code>. Note that you
cannot make asynchronous PPAPI calls on a background thread without creating
and using a message loop.</li>
</ul>
<h3 id="id20">Libraries</h3>
<p>The SDK includes two new libraries:</p>
<ul class="small-gap">
<li><p class="first">The <strong>nacl_mounts</strong> library provides a virtual file system that your module
can &#8220;mount&#8221; in a given directory tree. The file system can be one of several
types:</p>
<ul class="small-gap">
<li>&#8220;memfs&#8221; is an in-memory file system,</li>
<li>&#8220;dev&#8221; is a file system with various utility nodes (e.g., <code>/dev/null</code>,
<code>/dev/console[0-3]</code>, <code>/dev/tty</code>), and</li>
<li>&#8220;html5fs&#8221; is a persistent file system.</li>
</ul>
<p>Once you&#8217;ve mounted a file system in your module, you can use standard C
library file operations: fopen, fread, fwrite, fseek, and fclose. How those
operations are performed depends on the type of file system (e.g., for
html5fs, the operations are performed using the Pepper FileIO API). For a
list of the types of file systems you can mount, see
include/nacl_mounts/nacl_mounts.h. For an example of how to use nacl_mounts,
see examples/hello_nacl_mounts. Note that html5fs is subject to the same
constraints as persistent <a class="reference internal" href="/native-client/devguide/coding/file-io.html#devguide-coding-fileio"><em>local file IO</em></a> in
Chrome (for example, prior to using an html5fs file system, you must <a class="reference external" href="enabling_file_access">enable
local file IO</a>).</p>
</li>
<li>The <strong>ppapi_main</strong> library simplifies the creation of a NaCl module by
providing a familiar C programming environment. With this library, your
module can have a simple entry point called ppapi_main(), which is similar to
the standard C main() function, complete with argc and argv[] parameters.
Your module can also use standard C functions such as printf(), fopen(), and
fwrite(). For details see include/ppapi_main/ppapi_main.h. For an example of
how to use ppapi_main, see examples/hello_world_stdio.</li>
</ul>
<p>Header files for the new libraries are in the <code>include/</code> directory, source
files are in the <code>src/</code> directory, and compiled libraries are in the <code>lib/</code>
directory.</p>
<h3 id="id21">Examples</h3>
<ul class="small-gap">
<li><p class="first">The SDK includes two new examples:</p>
<ul class="small-gap">
<li><strong>hello_nacl_mounts</strong> illustrates how to use standard C library file
operations in a Native Client module through the use of the nacl_mounts
library.</li>
<li><strong>hello_world_stdio</strong> illustrates how to implement a Native Client module
with a ppapi_main() function, and how to write to STDOUT and STDERR in a
module, through the use of the nacl_mounts and ppapi_main libraries. This
example makes it easy for new users to get started with Native Client by
letting them start making changes in a familiar C environment.</li>
</ul>
</li>
<li><p class="first">With a few exceptions, the Makefile for each example now builds the following
versions of each example:</p>
<ul class="small-gap">
<li>glibc toolchain: 32-bit and 64-bit .nexes for the x86 target architecture</li>
<li>newlib toolchain: 32-bit and 64-bit .nexes for the x86 target architecture,
and ARM .nexe for the ARM architecture</li>
<li>pnacl toolchain: .pexe (which is subsequently tranlsated to .nexes for the
x86-32, x86-64, and ARM architectures)</li>
<li>hosted toolchain: .so or .dll (to be executed as a Pepper plug-in in
Chrome)</li>
</ul>
</li>
<li>Additionally, each version is built in both a Debug and a Release
configuration.</li>
<li>The Makefile for each example includes two new targets: <code>make RUN</code> and
<code>make LAUNCH</code>. These targets, which are interchangeable, launch a local
server and an instance of Chrome to run an example. When the instance of
Chrome is closed, the local server is shut down as well.</li>
<li>The hello_world_stdio example includes a simplified Makefile that only lists
source dependencies, and invokes the build rules in a separate file
(common.mk).</li>
</ul>
<h2 id="pepper-24-5-december-2012">Pepper 24 (5 December 2012)</h2>
<p>The Pepper 24 bundle features a new, experimental toolchain called PNaCl (short
for &#8220;Portable Native Client&#8221;), a new library (pthreads-win32) for the Windows
SDK, and an expanded list of attributes for Pepper 3D contexts that lets
applications specify a GPU preference for low power or performance.</p>
<h3 id="id22">Build tools and toolchains</h3>
<ul class="small-gap">
<li>The SDK includes a new, experimental toolchain called <a class="reference external" href="http://nativeclient.googlecode.com/svn/data/site/pnacl.pdf">PNaCl</a> (pronounced
&#8220;pinnacle&#8221;). The PNaCl toolchain produces architecture-independent executable
files (.pexe files). Chrome doesn&#8217;t yet support .pexe files directly, but if
you want to experiment with this early preview of PNaCl, the toolchain
includes a tool to translate .pexe files into architecture-specific .nexe
files. Take a look at the <code>hello_world</code> example to see how to build a .pexe
file and translate it into multiple .nexe files. Note that PNaCl is currently
restricted to the newlib C standard library – if your application uses glibc,
you can&#8217;t build it with PNaCl.</li>
<li>The <code>create_nmf.py</code> script uses ELF headers (rather than file names) to
determine the architecture of .nexe files. That means you can change the
names of your .nexe files and <code>create_nmf.py</code> will still be able to
generate the appropriate Native Client manifest file for your application.</li>
</ul>
<h3 id="id24">Examples</h3>
<ul class="small-gap">
<li>The SDK examples now build with four toolchains: the glibc and newlib
toolchains, the experimental PNaCl toolchain, and the hosted toolchain on
your development machine. Within each toolchain build, each example also
builds both a debug and a release version.</li>
<li>The example Makefiles use dependency (.d) files to enable incremental builds.</li>
<li>The pong example has been cleaned up and modified to run more smoothly. The
drawing function is now set up as the Flush() callback, which allows 2D
drawing to occur as quickly as possible.</li>
</ul>
<h3 id="id25">PPAPI</h3>
<ul class="small-gap">
<li>When creating a 3D rendering context, the <a class="reference external" href="/native-client/pepper_stable/c/group___enums#ga7df48e1c55f6401beea2a1b9c07967e8">attribute list</a>
for the context can specify whether to prefer low power or performance for
the GPU. Contexts with a low power preference may be created on an integrated
GPU; contexts with a performance preference may be created on a discrete GPU.</li>
</ul>
<h3 id="windows-sdk">Windows SDK</h3>
<ul class="small-gap">
<li>The Windows SDK includes the pthreads-win32 library to assist in porting from
win32 code. You can use this library when developing your module as a Pepper
plug-in (.dll). See pepper_24/include/win/pthread.h and
pepper_24/src/pthread/README for additional information.</li>
<li>The update utility naclsdk.bat works when it is run from a path with spaces.</li>
</ul>
<h2 id="pepper-23-15-october-2012">Pepper 23 (15 October 2012)</h2>
<p>The Pepper 23 bundle includes support for the nacl-gdb debugger on Mac and
32-bit Windows, resources to enable hosted development on Linux, and changes to
make the SDK examples compliant with version 2 of the Chrome Web Store manifest
file format.</p>
<h3 id="tools">Tools</h3>
<ul class="small-gap">
<li>The <a class="reference internal" href="/native-client/devguide/devcycle/debugging.html#using-gdb"><em>nacl-gdb debugger</em></a> now works on all systems (Mac,
Windows, and Linux).</li>
<li>The output of the SDK update utility has been simplified. When you run the
command <code>naclsdk list</code>, the utility displays one line for each available
bundle, annotated with an &#8220;<code>I</code>&#8221; if the bundle is already installed on your
system, and a &#8220;<code>*</code>&#8221; if the bundle has an update available. To see full
information about a bundle, use the command <code>naclsdk info &lt;bundle&gt;</code> (for
example, <code>naclsdk info pepper_28</code>).</li>
</ul>
<h3 id="linux-sdk">Linux SDK</h3>
<ul class="small-gap">
<li><p class="first">Developers using the Linux SDK now have resources, including pre-built
libraries and example Makefiles, that make it easier to <strong>build a module as a
Pepper plugin</strong> (sometimes called a &#8220;trusted&#8221; or &#8220;in-process&#8221; plugin) using
the native C/C++ compiler on their development system. In essence this makes
developing a Native Client module a two-step process:</p>
<ol class="arabic simple">
<li>Build the module into a shared library (.so file) using your system&#8217;s
C/C++ compiler. Test and debug the .so file using the tools in your normal
development environment.</li>
<li>Build the module into a .nexe file using the compiler from one of the
Native Client toolchains in the SDK (nacl-gcc or nacl-g++). Test and debug
the .nexe file using nacl-gdb.</li>
</ol>
<p>This two step development process has many benefits—in particular, you can
use the compilers, debuggers, profilers, and other tools that you&#8217;re already
familiar with. But there are a few potential issues to keep in mind:</p>
<ul class="small-gap">
<li>Chrome uses different threading models for trusted plugins and Native
Client modules.</li>
<li>Certain operations such as platform-specific library calls and system calls
may succeed during trusted development, but fail in Native Client.</li>
</ul>
<p>Here are the resources you can use to build your module into a Pepper plugin:</p>
<ul class="small-gap">
<li>header files are in <code>pepper_23/include</code></li>
<li>source files are in <code>pepper_23/src</code></li>
<li>pre-built libraries are in <code>pepper_23/lib</code></li>
</ul>
<p>You can now build and run most of the examples in the SDK as Pepper plugins.</p>
<ul class="small-gap">
<li>Look at the example Makefiles or run <code>make</code> in the example directories to
see the commands and flags used to build modules as Pepper plugins.</li>
<li>Run <code>make LAUNCH</code> in the example directories to see how to use the
<code>--register-pepper-plugins</code> argument to load a Pepper plugin in Chrome.
Note that you must set the <code>CHROME_PATH</code> environment variable and start a
<a class="reference internal" href="/native-client/devguide/devcycle/running.html#web-server"><em>local server</em></a> prior to running this command.</li>
</ul>
</li>
</ul>
<h3 id="id26">Examples</h3>
<ul class="small-gap">
<li>On Linux and Windows systems, most of the examples now build with three
toolchains: the Native Client glibc and newlib toolchains, and the native
toolchain on the host system. Modules built with the native toolchain on the
host system can only run as Pepper plugins.</li>
<li>All examples in the SDK now comply with version 2 of the Chrome Web Store
<a class="reference external" href="/extensions/manifest">manifest file format</a>. By default,
applications that use version 2 of the manifest file format apply a strict
<a class="reference external" href="/extensions/contentSecurityPolicy">content security policy</a>, which
includes a restriction against inline JavaScript. This restriction prohibits
both inline <code>&lt;script&gt;</code> blocks and inline event handlers (e.g., <code>&lt;button
onclick=&quot;...&quot;&gt;</code>). See <a class="reference external" href="/extensions/manifestVersion">Manifest Version</a> for
a list of changes between version 1 and version 2 of the manifest file
format, and a support schedule for applications that use version 1.</li>
</ul>
<h3 id="id27">PPAPI</h3>
<ul class="small-gap">
<li><a class="reference external" href="/native-client/pepper_stable/c/group___enums#ga21b811ac0484a214a8751aa3e1c959d9">PP_InputEvent_Modifier</a>
has two new enum values (_ISLEFT and _ISRIGHT).</li>
<li>The memory leak in the <a class="reference external" href="/native-client/pepper_stable/c/struct_p_p_b___web_socket__1__0">WebSocket</a> API has
been fixed.</li>
</ul>
<h2 id="pepper-22-22-august-2012">Pepper 22 (22 August 2012)</h2>
<p>The Pepper 22 bundle includes a <strong>command-line debugger</strong>, resources to enable
<strong>hosted development on Windows</strong>, and changes to the example Makefiles (each
example now builds both a debug and a release version).</p>
<h3 id="id28">Tools</h3>
<ul class="small-gap">
<li>The SDK now includes a <strong>command-line debugger</strong> that you can use to debug
Native Client modules. See <a class="reference internal" href="/native-client/devguide/devcycle/debugging.html#devcycle-debugging"><em>Debugging with nacl-gdb</em></a> for instructions on how to use this debugger. For now,
nacl-gdb only works on 64-bit Windows, 64-bit Linux, and 32-bit Linux
systems. Support for Mac and 32-bit Windows systems will be added soon.</li>
</ul>
<h3 id="id29">Windows SDK</h3>
<ul class="small-gap">
<li><p class="first">Developers using the Windows SDK can now <strong>build a module as a Pepper
plugin</strong> (sometimes called a &#8220;trusted&#8221; or &#8220;in-process&#8221; plugin) using the
native C/C++ compiler on their development system. In essence this makes
developing a Native Client module a two-step process:</p>
<ol class="arabic simple">
<li>Build the module into a DLL using your system&#8217;s C/C++ compiler. Test and
debug the DLL using the tools in your normal development environment.</li>
<li>Build the module into a .nexe using the compiler from one of the Native
Client toolchains in the SDK (nacl-gcc or nacl-g++). Test and debug the
.nexe using nacl-gdb.</li>
</ol>
<p>This two step development process has many benefits—in particular, you can
use the compilers, debuggers, profilers, and other tools that you&#8217;re already
familiar with. But there are a few potential issues to keep in mind:</p>
<ul class="small-gap">
<li>Some libraries that are commonly used with Native Client may not build
easily on Windows.</li>
<li>You may need to put in extra effort to get source code to compile with
multiple compilers, e.g., Microsoft Visual Studio and GCC.</li>
<li>Chrome uses different threading models for trusted plugins and Native
Client modules.</li>
<li>Certain operations such as platform-specific library calls and system calls
may succeed during trusted development, but fail in Native Client.</li>
</ul>
<p>Here are the resources you can use to build your module into a DLL:</p>
<ul class="small-gap">
<li>header files are in <code>pepper_22\include</code></li>
<li>source files are in <code>pepper_22\src</code></li>
<li>pre-built libraries are in <code>pepper_22\lib</code></li>
</ul>
</li>
<li>A Visual Studio add-in will be available in the near future with
configurations that include platforms for both Pepper plugins and NaCl
modules.</li>
</ul>
<aside class="note">
<strong>Note:</strong> It&#8217;s also possible to build a module as a trusted plugin on Mac and
Linux systems, but doing so requires more work because the SDK does not yet
include the above resources (library source files and pre-built libraries)
for Mac and Linux systems. To build and debug a trusted plugin on Mac and
Linux systems, you need to <a class="reference external" href="http://dev.chromium.org/developers/how-tos/get-the-code">get the Chromium code</a> and then follow
the <a class="reference external" href="http://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-a-trusted-plugin/trusted-debugging-on-mac">Mac instructions</a>
or <a class="reference external" href="http://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-a-trusted-plugin/debugging-a-trusted-plugin-on-linux">Linux instructions</a>.
In the future, the SDK will include resources for hosted development on Mac
and Linux as well as Windows.
</aside>
<h3 id="id30">Examples</h3>
<ul class="small-gap">
<li>Each example in the SDK now builds both a debug and a release version. As
before, most examples also build newlib and glibc versions, which means that
there are now four versions for each example. Take a look at the Makefiles in
the examples to see the compiler flags that are used for debug and release
versions. For a description of those flags, see <a class="reference internal" href="/native-client/devguide/devcycle/building.html#compile-flags"><em>Compile flags for
different development scenarios</em></a>.</li>
<li>Comments have been added to common.js, which is used in all the examples. The
JavaScript in common.js inserts an &lt;embed&gt; element that loads the NaCl module
in each example&#8217;s web page, attaches event listeners to monitor the loading
of the module, and implements handleMessage() to respond to messages sent
from the NaCl module to the JavaScript side of the application</li>
</ul>
<h3 id="id31">PPAPI</h3>
<ul class="small-gap">
<li>The <code>CompletionCallbackFactory</code> class template now takes a thread traits
class as its second parameter. For details see the <a class="reference external" href="/native-client/pepper_stable/cpp/classpp_1_1_completion_callback_factory#details">CompletionCallbackFactory
class template reference</a>.</li>
</ul>
</section>
{{/partials.standard_nacl_article}}