[Ozone-Drm] Add support for async content protection
[chromium-blink-merge.git] / native_client_sdk / doc_generated / sdk / release-notes.html
bloba96ec9f12ccfb18f6a01304dae8163c6f1f99d3b
1 {{+bindTo:partials.standard_nacl_article}}
3 <section id="release-notes">
4 <span id="sdk-release-notes"></span><h1 id="release-notes"><span id="sdk-release-notes"></span>Release Notes</h1>
5 <p>The dates in the following release notes denote when Chrome and the NaCl SDK
6 reached canary status. The stable release is typically 6 weeks later.</p>
7 <h2 id="chrome-pepper-43-03-april-2015">Chrome/Pepper 43 (03 April 2015)</h2>
8 <h3 id="pnacl">PNaCl</h3>
9 <ul class="small-gap">
10 <li>The C11/C++11 <code>acquire</code>, <code>release</code>, and <code>acq_rel</code> memory orders are now
11 generated by default. The in-browser Chrome 42 translator supports them, the
12 SDK can therefore generate them.</li>
13 <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
14 <code>bswap</code> which led to a NaCl validation failure.</li>
15 <li>PNaCl is now based on LLVM 3.6. If you are using GDB to debug PNaCl
16 <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>,
17 remember that debug info from SDK version <code>X</code> is only compatible with the
18 PNaCl translator in chrome version <code>X</code>. The bitcode debug metadata format
19 changed from LLVM 3.5 to 3.6. If you need to debug an app built with SDK
20 version <code>X</code> running in Chrome version <code>Y</code> (with <code>X != Y</code>), it is still
21 possible to do so. Simply translate the pexe to a nexe using the
22 <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
23 browser (version <code>Y</code>).</li>
24 <li>PNaCl&#8217;s support for use of libstdc++ 4.6 as the C++ standard library is
25 deprecated and will be removed in the next release. PNaCl has used libc++
26 (which is much more up-to-date, currently based on LLVM 3.6) as the default
27 since Pepper 33.</li>
28 <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
29 Chrome version 43, behind a flag. To give it a try, run Chrome with the
30 <code>--enable-pnacl-subzero</code> commandline flag, and use the <code>optlevel 0</code>
31 <a class="reference internal" href="/native-client/reference/nacl-manifest-format.html#pnacl-nmf-optlevels"><em>NaCl manifest option</em></a>. Application startup time
32 should be several times faster than the previous LLVM-based <code>optlevel 0</code>
33 mode, with similar code quality. Note that x86-32 NaCl requires a 32-bit
34 Chrome. On Windows, it also requires a 32-bit Windows OS, but 64-bit Linux
35 OSes can run x86-32 NaCl. If you try it out, please send us feedback
36 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
37 new targets.</li>
38 </ul>
39 <h3 id="pepper">Pepper</h3>
40 <ul class="small-gap">
41 <li>UDP Socket Multicast API in development preview (PPB_UDP_SOCKET 1.2).</li>
42 <li>Hardware Video Encoder API in development preview (PPB_VIDEO_ENCODER 0.1).</li>
43 </ul>
44 <h2 id="chrome-pepper-42-20-february-2015">Chrome/Pepper 42 (20 February 2015)</h2>
45 <h3 id="sdk">SDK</h3>
46 <ul class="small-gap">
47 <li>The SDK now contains experimental versions of <code>i686-nacl-clang</code>,
48 <code>x86_64-nacl-clang</code>, and <code>arm-nacl-clang</code> as well as the <code>clang++</code>
49 equivalents. These toolchains are based on the same LLVM version as PNaCl, but
50 can be used to generate NaCl <code>.nexe</code> files instead of translating a
51 <code>.pexe</code> locally or using the GCC toolchain.</li>
52 </ul>
53 <h3 id="nacl">NaCl</h3>
54 <ul class="small-gap">
55 <li>The x86 NaCl validators accept instructions from the FMA3 extensions, as well
56 as AVX2 instructions (except <code>VGATHER</code>).</li>
57 </ul>
58 <h3 id="id1">PNaCl</h3>
59 <ul class="small-gap">
60 <li>PNaCl supports C11/C++11 memory orders <code>acquire</code>, <code>release</code>, and
61 <code>acq_rel</code>. It used to upgrade all accesses to <code>seq_cst</code>. It still upgrades
62 <code>consume</code> to <code>acquire</code> (no compiler currently implements <code>consume</code>), and
63 <code>relaxed</code> to <code>seq_cst</code> (to conservatively avoid platform differences due
64 to out-of-thin-air problems). This is currently disabled by default in the SDK
65 so that the in-browser translator installed on users&#8217; machines has time to
66 gain this support. Developers can turn it on by passing the
67 <code>-pnacl-memory-order-seq-cst-only=false</code> flag to <code>opt</code>.</li>
68 <li>PNaCl handles nested struct type expansion, which allows it to better support
69 non-C languages such as Rust.</li>
70 <li>PNaCl breaks up many integer operations over 64-bits into individual 64-bit
71 operations. This is often encountered when using large consecutive bitfields.</li>
72 </ul>
73 <h2 id="chrome-pepper-41-09-january-2015">Chrome/Pepper 41 (09 January 2015)</h2>
74 <h3 id="id2">NaCl</h3>
75 <ul class="small-gap">
76 <li>The x86 NaCl validators accept instructions from the AVX1 extensions.</li>
77 </ul>
78 <h3 id="id3">PNaCl</h3>
79 <ul class="small-gap">
80 <li>PNaCl is now based on LLVM 3.5.</li>
81 </ul>
82 <h2 id="chrome-pepper-40-november-07-2014">Chrome/Pepper 40 (November 07 2014)</h2>
83 <ul class="small-gap">
84 <li><a class="reference external" href="/native-client/pepper_stable/cpp/classpp_1_1_video_decoder.html">VideoDecoder</a> is now
85 stable, see the SDK example in <code>pepper_canary/examples/api/video_decode</code>.</li>
86 </ul>
87 <h2 id="chrome-pepper-39-26-september-2014">Chrome/Pepper 39 (26 September 2014)</h2>
88 <h3 id="id4">NaCl</h3>
89 <ul class="small-gap">
90 <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
91 instruction due to rowhammer problem</a>.</li>
92 </ul>
93 <h3 id="id5">Pepper</h3>
94 <ul class="small-gap">
95 <li>Support for <code>DEBUG_ONLY:dev://postmessage</code> has been removed in favor of
96 <a class="reference internal" href="/native-client/devguide/devcycle/debugging.html#devcycle-debugging"><em>other more useful debugging approaches</em></a>.</li>
97 <li><code>postMessageAndAwaitResponse</code> is now stable and allows JavaScript to
98 <a class="reference external" href="/native-client/pepper_stable/cpp/classpp_1_1_message_handler">communicate synchronously</a> with PNaCl
99 embeds.</li>
100 </ul>
101 <h2 id="chrome-pepper-38-15-august-2014">Chrome/Pepper 38 (15 August 2014)</h2>
102 <h3 id="id6">PNaCl</h3>
103 <ul class="small-gap">
104 <li>Compilation speed improvements due to validation caching of the translator and
105 linker.</li>
106 <li>Performance improvement of SIMD vector shuffle.</li>
107 </ul>
108 <h2 id="chrome-pepper-37-20-june-2014">Chrome/Pepper 37 (20 June 2014)</h2>
109 <h3 id="id7">PNaCl</h3>
110 <ul class="small-gap">
111 <li>210% translation time improvement.</li>
112 <li>Improved vector load/store and shuffle performance.</li>
113 </ul>
114 <h3 id="id8">Pepper</h3>
115 <ul class="small-gap">
116 <li>Media Streams Input support.</li>
117 <li>Compositor API.</li>
118 <li>Hardware Decode API in development preview.</li>
119 <li>Sync API in development preview.</li>
120 </ul>
121 <h3 id="id9">SDK</h3>
122 <ul class="small-gap">
123 <li>Demo of a <a class="reference internal" href="/native-client/io2014.html#io2014"><em>full development environment in the browser</em></a>.</li>
124 </ul>
125 <h2 id="chrome-pepper-36-09-may-2014">Chrome/Pepper 36 (09 May 2014)</h2>
126 <h3 id="id10">PNaCl</h3>
127 <ul class="small-gap">
128 <li>Support <a class="reference external" href="http://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors">LLVM vectors</a>
129 and <a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html">GCC vectors</a> for SIMD
130 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,
131 and performance is expected to become acceptable for version 37 of
132 Chrome. More SIMD instructions will be added in later releases.</li>
133 </ul>
134 <h2 id="chrome-pepper-35-31-mar-2014">Chrome/Pepper 35 (31 Mar 2014)</h2>
135 <h3 id="id11">PNaCl</h3>
136 <ul class="small-gap">
137 <li>Upgraded LLVM to version 3.4.</li>
138 <li>Translation now uses dynamic load balancing, making translation time faster.</li>
139 <li>Unstable pexes (i.e. non-finalized) with debug information can be loaded by
140 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>
141 </ul>
142 <h2 id="chrome-pepper-34-20-feb-2014">Chrome/Pepper 34 (20 Feb 2014)</h2>
143 <h3 id="id12">Pepper</h3>
144 <ul class="small-gap">
145 <li>Filesystems can now be passed from JavaScript to NaCl. The resulting
146 <code>pp::Var</code> will contain a <code>pp::Resource</code> that can be given to the
147 <code>pp::FileSystem</code> constructor.</li>
148 <li>New Audio and Video input APIs have been added as dev interfaces. See
149 <a class="reference external" href="/native-client/pepper_dev/cpp/classpp_1_1_media_stream_audio_track">pp::MediaStreamAudioTrack</a> and
150 <a class="reference external" href="/native-client/pepper_dev/cpp/classpp_1_1_media_stream_video_track">pp::MediaStreamVideoTrack</a> for
151 more details.</li>
152 </ul>
153 <h3 id="id13">PNaCl</h3>
154 <ul class="small-gap">
155 <li>Parallel translation: at least 1.7x faster, even with older pexes.</li>
156 <li>Intelligent abbreviations in the bitcode: 20% reduction in binary size using
157 the <a class="reference internal" href="/native-client/devguide/devcycle/building.html#pnacl-compress"><em>pnacl-compress</em></a> tool.</li>
158 </ul>
159 <h2 id="chrome-pepper-33-16-dec-2013">Chrome/Pepper 33 (16 Dec 2013)</h2>
160 <h3 id="portable-native-client">Portable Native Client</h3>
161 <ul class="small-gap">
162 <li>PNaCl&#8217;s default C++ standard library is now LLVM&#8217;s own libc++, based on
163 LLVM 3.3. This library now supports optional <code>setjmp</code>/<code>longjmp</code> exception
164 handling (see <a class="reference external" href="https://groups.google.com/forum/#!topic/native-client-discuss/0spfg6O04FM">announcement</a>
165 for details).</li>
166 </ul>
167 <h3 id="id14">SDK</h3>
168 <ul class="small-gap">
169 <li>The <code>nacl_io</code> library now includes a FUSE mount.</li>
170 <li>In the SDK examples, <code>common.js</code> now loads the Release version of the
171 nexes/pexes that are built (by default).</li>
172 <li>&#8220;<code>make debug</code>&#8221; and &#8220;<code>make run</code>&#8221; have been fixed on Mac.</li>
173 </ul>
174 <h2 id="pnacl-enabled-by-default-in-chrome-31-12-nov-2013">PNaCl enabled by default in Chrome 31 (12 Nov 2013)</h2>
175 <ul class="small-gap">
176 <li>Portable Native Client (PNaCl) is enabled by default in Chrome 31. See
177 <a class="reference internal" href="/native-client/nacl-and-pnacl.html"><em>NaCl and PNaCl</em></a> for details on the differences between
178 NaCl and PNaCl.</li>
179 <li>The PNaCl ABI has changed from the preview release in Chrome 30.
180 Pexe modules built with the <code>pepper_30</code> bundle in the SDK must be recompiled
181 with the <code>pepper_31</code> bundle or later.
182 As a general rule, we always recommended building applications with the latest
183 stable bundle in the Native Client SDK.
184 The PNaCl ABI will remain stable starting with the release of Chrome 31.</li>
185 <li><p class="first">Additional changes in the Chrome/Pepper 31 release:</p>
186 <ul class="small-gap">
187 <li>Updates to the Pepper API, including socket and network support</li>
188 <li>Improved socket support in the <code>nacl_io</code> library</li>
189 </ul>
190 </li>
191 </ul>
192 <h2 id="pnacl-in-chrome-30-dev-channel-01-aug-2013">PNaCl in Chrome 30 Dev channel (01 Aug 2013)</h2>
193 <ul class="small-gap">
194 <li>Portable Native Client (PNaCl) is currently available for preview in Chrome
195 30 (currently in the Dev channel). Apps and sites built with PNaCl can run in
196 Chrome 30 without an explicit flag.</li>
197 <li>See <a class="reference external" href="http://www.chromium.org/nativeclient/pnacl/introduction-to-portable-native-client">Introduction to Portable Native Client</a>
198 for information on developing for PNaCl. More documentation will be available
199 soon.</li>
200 <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
201 before the official public release; if you&#8217;re developing a PNaCl-based
202 application, be sure to build your code with the latest version of the Native
203 Client SDK.</li>
204 <li>Update: PNaCl is not enabled by default in beta or stable versions of M30.</li>
205 </ul>
206 <h2 id="pnacl-15-may-2013">PNaCl (15 May 2013)</h2>
207 <ul class="small-gap">
208 <li>Portable Native Client (PNaCl) is currently available for developer preview
209 in Chrome 29 or higher.</li>
210 <li>To produce a PNaCl executable (.pexe) file, you must use the pnacl toolchain
211 in the current <code>pepper_canary</code> bundle. Chrome 29 does not support .pexe
212 files produced by earlier versions of the pnacl toolchain (that is,
213 executables compiled with the <code>pepper_28</code> bundle or earlier).</li>
214 <li>To run an application with a PNaCl module, you must launch Chrome 29 with the
215 <code>--enable-pnacl</code> flag (for <a class="reference external" href="/apps">Chrome apps</a>), or the <code>--enable-nacl</code>
216 flag (for other apps).</li>
217 <li>When you launch Chrome with the <code>--enable-pnacl</code> flag, Chrome loads a PNaCl
218 translator in the background. Wait about a minute after you launch Chrome and
219 check <a class="reference external" href="chrome://nacl">chrome://nacl</a> to verify that the translator loaded.</li>
220 <li>PNaCl translators are currently available for 32-bit x86, 64-bit x86, and ARM
221 architectures.</li>
222 <li>PNaCl applications must use the newlib C library (glibc and dynamic linking
223 are not supported yet).</li>
224 <li>The intermediate representation (IR) format may change prior to the release
225 of PNaCl. If so, you will need to recompile your application with the pnacl
226 toolchain in a new SDK bundle.</li>
227 </ul>
228 <h2 id="pepper-27-12-april-2013">Pepper 27 (12 April 2013)</h2>
229 <p>The Pepper 27 bundle features a significant number of new libraries that have
230 been incorporated directly into the SDK.</p>
231 <h3 id="libraries">Libraries</h3>
232 <ul class="small-gap">
233 <li><p class="first">A number of libraries from the naclports project have been incorporated
234 directly into the Native Client SDK. These libraries include:</p>
235 <ul class="small-gap">
236 <li>image encoding/decoding: jpeg, tiff, png, webp</li>
237 <li>multimedia: openal, freealut, ogg, vorbis</li>
238 <li>XML parsing: tinyxml, xml2</li>
239 <li>miscellaneous: zlib (general purpose compression), freetype (font
240 rendering), lua (Lua interpreter)</li>
241 </ul>
242 <p>The libraries are located in <code>ports/lib</code>, and the header files are in
243 <code>ports/include</code>.</p>
244 </li>
245 <li>The <code>httpfs</code> filesystem in the nacl_io library now caches content in memory
246 by default; this improves performance considerably.</li>
247 <li>For applications compiled with a glibc toolchain, <code>dlopen()</code> can now be
248 used to open shared libraries that are not specified in an application&#8217;s
249 Native Client manifest (.nmf) file. This allows applications, for example, to
250 download a shared object and then use <code>dlopen()</code> to access the shared
251 object. The <code>dlopen</code> example has been modified to demonstrate this
252 functionality: reverse.cc is built into a shared object (.so) file, which is
253 downloaded and opened using an <code>httpfs</code> mount.</li>
254 </ul>
255 <h3 id="examples">Examples</h3>
256 <ul class="small-gap">
257 <li>Each example now has a single <code>index.html</code> file, instead of multiple HTML
258 files corresponding to NaCl modules built using different toolchains and
259 configurations. By default, most examples are built using one toolchain
260 (newlib) and one configuration (Debug). If you build an example using
261 multiple toolchains or configurations, you can specify which version to run
262 in Chrome using the query parameters <code>tc</code> and <code>config</code>. For example,
263 assuming you are serving an example from the local server localhost:5103, you
264 can run a version of the example built with the glibc toolchain in the
265 Release configuration by specifying the following URL in Chrome:
266 <code>http://localhost:5103/index.html?tc=glibc&amp;config=Release</code>. For additional
267 information about how different NaCl modules are loaded into <code>index.html</code>,
268 see the <code>common.js</code> file in each example.</li>
269 </ul>
270 <h3 id="build-tools-and-toolchains">Build tools and toolchains</h3>
271 <ul class="small-gap">
272 <li>Common makefiles, including <code>tools/common.mk</code>, can now handle source files
273 located outside of an application&#8217;s root directory. For example, a Makefile
274 for an application can specify a source file to compile such as
275 <code>../../some/other/place.cpp</code>.</li>
276 </ul>
277 <h2 id="pepper-26-29-march-2013">Pepper 26 (29 March 2013)</h2>
278 <p>The Pepper 26 bundle includes a new HTTP filesystem type in the nacl_mounts
279 library (which has been renamed nacl_io), changes to the example Makefiles, a
280 simple new 3D example, and a threaded file IO example.</p>
281 <h3 id="id15">Build tools and toolchains</h3>
282 <ul class="small-gap">
283 <li><p class="first">Makefiles have been changed significantly:</p>
284 <ul class="small-gap">
285 <li>Build commands are now specified in a number of common files
286 (<code>tools/*.mk</code>), which are included in the Makefiles in the examples.</li>
287 <li>By default, make displays a simplified list of build steps (e.g., <code>CC
288 newlib/Debug/hello_world_x86_32.o</code>) rather than the actual build commands.
289 To see the actual build commands, run <code>make V=1</code>.</li>
290 <li>By default, most examples are built using one toolchain (newlib) and one
291 configuration (Debug). To build an example using a different toolchain or
292 configuration, run <code>make</code> with the parameters <code>TOOLCHAIN=&lt;x&gt;</code> or
293 <code>CONFIG=&lt;y&gt;</code>. You can also run make <code>all_versions</code> to build an example
294 with all toolchains.</li>
295 </ul>
296 </li>
297 <li>Header files have been moved out of the toolchains. All toolchains now share
298 the same set of header files as host builds. Previously host and NaCl builds
299 used different headers, which could cause build problems.</li>
300 </ul>
301 <h3 id="id16">Libraries</h3>
302 <ul class="small-gap">
303 <li>The nacl_mounts library has been renamed <strong>nacl_io</strong>, and has been expanded
304 with a new type of mount, httpfs, which can be used to read URLs via HTTP.
305 For details see <code>include/nacl_io/nacl_io.h</code>, as well as the
306 <code>hello_nacl_io</code> example.</li>
307 </ul>
308 <h3 id="id17">Examples</h3>
309 <ul class="small-gap">
310 <li>A new example, <strong>hello_world_instance3d</strong>, has been added to demonstrate a
311 simplified 3D app.</li>
312 <li>The <strong>file_io</strong> example has been rewritten to do all file operations on a
313 thread. The example demonstrates how to use the MessageLoop API and blocking
314 callbacks on a thread.</li>
315 </ul>
316 <h3 id="general">General</h3>
317 <ul class="small-gap">
318 <li>Old bundles (<code>pepper_20</code> and earlier) have been removed from the Native
319 Client SDK Manifest, and will no longer be updated by the <code>naclsdk</code>
320 command.</li>
321 </ul>
322 <h2 id="pepper-25-21-december-2012">Pepper 25 (21 December 2012)</h2>
323 <p>The Pepper 25 bundle features an ARM toolchain to build Native Client modules
324 for ARM devices, two new Pepper APIs (including the MessageLoop API, which lets
325 you make Pepper calls on background threads), two new libraries (nacl_mounts,
326 which provides a virtual file system that you can use with standard C file
327 operations, and ppapi_main, which lets you implement a Native Client module
328 using a simple ppapi_main function), and two new examples that demonstrate how
329 to use the nacl_mounts and ppapi_main libraries.</p>
330 <h3 id="id18">Build tools and toolchains</h3>
331 <ul class="small-gap">
332 <li><p class="first">The SDK includes a new toolchain to build Native Client executables (.nexe
333 files) for <strong>ARM devices</strong>.</p>
334 <ul class="small-gap">
335 <li>Currently the ARM toolchain can only be used to compile modules that use
336 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
337 to compile modules that use the glibc library.</li>
338 <li>The ARM toolchain is in the directory
339 <code>pepper_25/toolchain/&lt;host&gt;_arm_newlib</code>. The bin subdirectory contains
340 the compiler (<code>arm-nacl-gcc</code>), the linker (<code>arm-nacl-g++</code>), and the
341 other tools in the toolchain.</li>
342 <li>Take a look at the <code>hello_world</code> example to see how to use the ARM
343 toolchain. Go to <code>examples/hello_world</code> and run <code>make</code>. When the build
344 finishes, the newlib/Debug and newlib/Release subdirectories will contain
345 .nexe files for the x86-32, x86-64, and ARM target architecutes, and a
346 Native Client manifest (.nmf file) that references those three .nexe files.</li>
347 </ul>
348 </li>
349 <li>The simple web server included in the SDK, <code>httpd.py</code>, has been moved from
350 the <code>examples/</code> directory to the <code>tools/</code> directory. On Windows, you can
351 run <code>httpd.cmd</code> (in the <code>examples/</code> directory) to start the server.</li>
352 </ul>
353 <h3 id="ppapi">PPAPI</h3>
354 <p>Pepper 25 includes two new APIs:</p>
355 <ul class="small-gap">
356 <li>The <a class="reference external" href="/native-client/pepper_stable/c/struct_p_p_b___console__1__0">Console API</a> lets your
357 module log messages to the JavaScript console in the Chrome browser.</li>
358 <li>The <a class="reference external" href="/native-client/pepper_stable/cpp/classpp_1_1_message_loop">MessageLoop</a> API lets your
359 module make PPAPI calls on a background thread. Once you&#8217;ve created a
360 message loop resource, attached it to a thread, and run it, you can post work
361 to the thread, including completion callbacks for asynchronous operations.
362 For a C++ example of how to use the MessageLoop API, see
363 <code>pepper_25/include/ppapi/utility/threading/simple_thread.h</code>. Note that you
364 cannot make asynchronous PPAPI calls on a background thread without creating
365 and using a message loop.</li>
366 </ul>
367 <h3 id="id19">Libraries</h3>
368 <p>The SDK includes two new libraries:</p>
369 <ul class="small-gap">
370 <li><p class="first">The <strong>nacl_mounts</strong> library provides a virtual file system that your module
371 can &#8220;mount&#8221; in a given directory tree. The file system can be one of several
372 types:</p>
373 <ul class="small-gap">
374 <li>&#8220;memfs&#8221; is an in-memory file system,</li>
375 <li>&#8220;dev&#8221; is a file system with various utility nodes (e.g., <code>/dev/null</code>,
376 <code>/dev/console[0-3]</code>, <code>/dev/tty</code>), and</li>
377 <li>&#8220;html5fs&#8221; is a persistent file system.</li>
378 </ul>
379 <p>Once you&#8217;ve mounted a file system in your module, you can use standard C
380 library file operations: fopen, fread, fwrite, fseek, and fclose. How those
381 operations are performed depends on the type of file system (e.g., for
382 html5fs, the operations are performed using the Pepper FileIO API). For a
383 list of the types of file systems you can mount, see
384 include/nacl_mounts/nacl_mounts.h. For an example of how to use nacl_mounts,
385 see examples/hello_nacl_mounts. Note that html5fs is subject to the same
386 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
387 Chrome (for example, prior to using an html5fs file system, you must <a class="reference external" href="enabling_file_access">enable
388 local file IO</a>).</p>
389 </li>
390 <li>The <strong>ppapi_main</strong> library simplifies the creation of a NaCl module by
391 providing a familiar C programming environment. With this library, your
392 module can have a simple entry point called ppapi_main(), which is similar to
393 the standard C main() function, complete with argc and argv[] parameters.
394 Your module can also use standard C functions such as printf(), fopen(), and
395 fwrite(). For details see include/ppapi_main/ppapi_main.h. For an example of
396 how to use ppapi_main, see examples/hello_world_stdio.</li>
397 </ul>
398 <p>Header files for the new libraries are in the <code>include/</code> directory, source
399 files are in the <code>src/</code> directory, and compiled libraries are in the <code>lib/</code>
400 directory.</p>
401 <h3 id="id20">Examples</h3>
402 <ul class="small-gap">
403 <li><p class="first">The SDK includes two new examples:</p>
404 <ul class="small-gap">
405 <li><strong>hello_nacl_mounts</strong> illustrates how to use standard C library file
406 operations in a Native Client module through the use of the nacl_mounts
407 library.</li>
408 <li><strong>hello_world_stdio</strong> illustrates how to implement a Native Client module
409 with a ppapi_main() function, and how to write to STDOUT and STDERR in a
410 module, through the use of the nacl_mounts and ppapi_main libraries. This
411 example makes it easy for new users to get started with Native Client by
412 letting them start making changes in a familiar C environment.</li>
413 </ul>
414 </li>
415 <li><p class="first">With a few exceptions, the Makefile for each example now builds the following
416 versions of each example:</p>
417 <ul class="small-gap">
418 <li>glibc toolchain: 32-bit and 64-bit .nexes for the x86 target architecture</li>
419 <li>newlib toolchain: 32-bit and 64-bit .nexes for the x86 target architecture,
420 and ARM .nexe for the ARM architecture</li>
421 <li>pnacl toolchain: .pexe (which is subsequently tranlsated to .nexes for the
422 x86-32, x86-64, and ARM architectures)</li>
423 <li>hosted toolchain: .so or .dll (to be executed as a Pepper plug-in in
424 Chrome)</li>
425 </ul>
426 </li>
427 <li>Additionally, each version is built in both a Debug and a Release
428 configuration.</li>
429 <li>The Makefile for each example includes two new targets: <code>make RUN</code> and
430 <code>make LAUNCH</code>. These targets, which are interchangeable, launch a local
431 server and an instance of Chrome to run an example. When the instance of
432 Chrome is closed, the local server is shut down as well.</li>
433 <li>The hello_world_stdio example includes a simplified Makefile that only lists
434 source dependencies, and invokes the build rules in a separate file
435 (common.mk).</li>
436 </ul>
437 <h2 id="pepper-24-5-december-2012">Pepper 24 (5 December 2012)</h2>
438 <p>The Pepper 24 bundle features a new, experimental toolchain called PNaCl (short
439 for &#8220;Portable Native Client&#8221;), a new library (pthreads-win32) for the Windows
440 SDK, and an expanded list of attributes for Pepper 3D contexts that lets
441 applications specify a GPU preference for low power or performance.</p>
442 <h3 id="id21">Build tools and toolchains</h3>
443 <ul class="small-gap">
444 <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
445 &#8220;pinnacle&#8221;). The PNaCl toolchain produces architecture-independent executable
446 files (.pexe files). Chrome doesn&#8217;t yet support .pexe files directly, but if
447 you want to experiment with this early preview of PNaCl, the toolchain
448 includes a tool to translate .pexe files into architecture-specific .nexe
449 files. Take a look at the <code>hello_world</code> example to see how to build a .pexe
450 file and translate it into multiple .nexe files. Note that PNaCl is currently
451 restricted to the newlib C standard library – if your application uses glibc,
452 you can&#8217;t build it with PNaCl.</li>
453 <li>The <code>create_nmf.py</code> script uses ELF headers (rather than file names) to
454 determine the architecture of .nexe files. That means you can change the
455 names of your .nexe files and <code>create_nmf.py</code> will still be able to
456 generate the appropriate Native Client manifest file for your application.</li>
457 </ul>
458 <h3 id="id23">Examples</h3>
459 <ul class="small-gap">
460 <li>The SDK examples now build with four toolchains: the glibc and newlib
461 toolchains, the experimental PNaCl toolchain, and the hosted toolchain on
462 your development machine. Within each toolchain build, each example also
463 builds both a debug and a release version.</li>
464 <li>The example Makefiles use dependency (.d) files to enable incremental builds.</li>
465 <li>The pong example has been cleaned up and modified to run more smoothly. The
466 drawing function is now set up as the Flush() callback, which allows 2D
467 drawing to occur as quickly as possible.</li>
468 </ul>
469 <h3 id="id24">PPAPI</h3>
470 <ul class="small-gap">
471 <li>When creating a 3D rendering context, the <a class="reference external" href="/native-client/pepper_stable/c/group___enums#ga7df48e1c55f6401beea2a1b9c07967e8">attribute list</a>
472 for the context can specify whether to prefer low power or performance for
473 the GPU. Contexts with a low power preference may be created on an integrated
474 GPU; contexts with a performance preference may be created on a discrete GPU.</li>
475 </ul>
476 <h3 id="windows-sdk">Windows SDK</h3>
477 <ul class="small-gap">
478 <li>The Windows SDK includes the pthreads-win32 library to assist in porting from
479 win32 code. You can use this library when developing your module as a Pepper
480 plug-in (.dll). See pepper_24/include/win/pthread.h and
481 pepper_24/src/pthread/README for additional information.</li>
482 <li>The update utility naclsdk.bat works when it is run from a path with spaces.</li>
483 </ul>
484 <h2 id="pepper-23-15-october-2012">Pepper 23 (15 October 2012)</h2>
485 <p>The Pepper 23 bundle includes support for the nacl-gdb debugger on Mac and
486 32-bit Windows, resources to enable hosted development on Linux, and changes to
487 make the SDK examples compliant with version 2 of the Chrome Web Store manifest
488 file format.</p>
489 <h3 id="tools">Tools</h3>
490 <ul class="small-gap">
491 <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,
492 Windows, and Linux).</li>
493 <li>The output of the SDK update utility has been simplified. When you run the
494 command <code>naclsdk list</code>, the utility displays one line for each available
495 bundle, annotated with an &#8220;<code>I</code>&#8221; if the bundle is already installed on your
496 system, and a &#8220;<code>*</code>&#8221; if the bundle has an update available. To see full
497 information about a bundle, use the command <code>naclsdk info &lt;bundle&gt;</code> (for
498 example, <code>naclsdk info pepper_28</code>).</li>
499 </ul>
500 <h3 id="linux-sdk">Linux SDK</h3>
501 <ul class="small-gap">
502 <li><p class="first">Developers using the Linux SDK now have resources, including pre-built
503 libraries and example Makefiles, that make it easier to <strong>build a module as a
504 Pepper plugin</strong> (sometimes called a &#8220;trusted&#8221; or &#8220;in-process&#8221; plugin) using
505 the native C/C++ compiler on their development system. In essence this makes
506 developing a Native Client module a two-step process:</p>
507 <ol class="arabic simple">
508 <li>Build the module into a shared library (.so file) using your system&#8217;s
509 C/C++ compiler. Test and debug the .so file using the tools in your normal
510 development environment.</li>
511 <li>Build the module into a .nexe file using the compiler from one of the
512 Native Client toolchains in the SDK (nacl-gcc or nacl-g++). Test and debug
513 the .nexe file using nacl-gdb.</li>
514 </ol>
515 <p>This two step development process has many benefits—in particular, you can
516 use the compilers, debuggers, profilers, and other tools that you&#8217;re already
517 familiar with. But there are a few potential issues to keep in mind:</p>
518 <ul class="small-gap">
519 <li>Chrome uses different threading models for trusted plugins and Native
520 Client modules.</li>
521 <li>Certain operations such as platform-specific library calls and system calls
522 may succeed during trusted development, but fail in Native Client.</li>
523 </ul>
524 <p>Here are the resources you can use to build your module into a Pepper plugin:</p>
525 <ul class="small-gap">
526 <li>header files are in <code>pepper_23/include</code></li>
527 <li>source files are in <code>pepper_23/src</code></li>
528 <li>pre-built libraries are in <code>pepper_23/lib</code></li>
529 </ul>
530 <p>You can now build and run most of the examples in the SDK as Pepper plugins.</p>
531 <ul class="small-gap">
532 <li>Look at the example Makefiles or run <code>make</code> in the example directories to
533 see the commands and flags used to build modules as Pepper plugins.</li>
534 <li>Run <code>make LAUNCH</code> in the example directories to see how to use the
535 <code>--register-pepper-plugins</code> argument to load a Pepper plugin in Chrome.
536 Note that you must set the <code>CHROME_PATH</code> environment variable and start a
537 <a class="reference internal" href="/native-client/devguide/devcycle/running.html#web-server"><em>local server</em></a> prior to running this command.</li>
538 </ul>
539 </li>
540 </ul>
541 <h3 id="id25">Examples</h3>
542 <ul class="small-gap">
543 <li>On Linux and Windows systems, most of the examples now build with three
544 toolchains: the Native Client glibc and newlib toolchains, and the native
545 toolchain on the host system. Modules built with the native toolchain on the
546 host system can only run as Pepper plugins.</li>
547 <li>All examples in the SDK now comply with version 2 of the Chrome Web Store
548 <a class="reference external" href="/extensions/manifest">manifest file format</a>. By default,
549 applications that use version 2 of the manifest file format apply a strict
550 <a class="reference external" href="/extensions/contentSecurityPolicy">content security policy</a>, which
551 includes a restriction against inline JavaScript. This restriction prohibits
552 both inline <code>&lt;script&gt;</code> blocks and inline event handlers (e.g., <code>&lt;button
553 onclick=&quot;...&quot;&gt;</code>). See <a class="reference external" href="/extensions/manifestVersion">Manifest Version</a> for
554 a list of changes between version 1 and version 2 of the manifest file
555 format, and a support schedule for applications that use version 1.</li>
556 </ul>
557 <h3 id="id26">PPAPI</h3>
558 <ul class="small-gap">
559 <li><a class="reference external" href="/native-client/pepper_stable/c/group___enums#ga21b811ac0484a214a8751aa3e1c959d9">PP_InputEvent_Modifier</a>
560 has two new enum values (_ISLEFT and _ISRIGHT).</li>
561 <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
562 been fixed.</li>
563 </ul>
564 <h2 id="pepper-22-22-august-2012">Pepper 22 (22 August 2012)</h2>
565 <p>The Pepper 22 bundle includes a <strong>command-line debugger</strong>, resources to enable
566 <strong>hosted development on Windows</strong>, and changes to the example Makefiles (each
567 example now builds both a debug and a release version).</p>
568 <h3 id="id27">Tools</h3>
569 <ul class="small-gap">
570 <li>The SDK now includes a <strong>command-line debugger</strong> that you can use to debug
571 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,
572 nacl-gdb only works on 64-bit Windows, 64-bit Linux, and 32-bit Linux
573 systems. Support for Mac and 32-bit Windows systems will be added soon.</li>
574 </ul>
575 <h3 id="id28">Windows SDK</h3>
576 <ul class="small-gap">
577 <li><p class="first">Developers using the Windows SDK can now <strong>build a module as a Pepper
578 plugin</strong> (sometimes called a &#8220;trusted&#8221; or &#8220;in-process&#8221; plugin) using the
579 native C/C++ compiler on their development system. In essence this makes
580 developing a Native Client module a two-step process:</p>
581 <ol class="arabic simple">
582 <li>Build the module into a DLL using your system&#8217;s C/C++ compiler. Test and
583 debug the DLL using the tools in your normal development environment.</li>
584 <li>Build the module into a .nexe using the compiler from one of the Native
585 Client toolchains in the SDK (nacl-gcc or nacl-g++). Test and debug the
586 .nexe using nacl-gdb.</li>
587 </ol>
588 <p>This two step development process has many benefits—in particular, you can
589 use the compilers, debuggers, profilers, and other tools that you&#8217;re already
590 familiar with. But there are a few potential issues to keep in mind:</p>
591 <ul class="small-gap">
592 <li>Some libraries that are commonly used with Native Client may not build
593 easily on Windows.</li>
594 <li>You may need to put in extra effort to get source code to compile with
595 multiple compilers, e.g., Microsoft Visual Studio and GCC.</li>
596 <li>Chrome uses different threading models for trusted plugins and Native
597 Client modules.</li>
598 <li>Certain operations such as platform-specific library calls and system calls
599 may succeed during trusted development, but fail in Native Client.</li>
600 </ul>
601 <p>Here are the resources you can use to build your module into a DLL:</p>
602 <ul class="small-gap">
603 <li>header files are in <code>pepper_22\include</code></li>
604 <li>source files are in <code>pepper_22\src</code></li>
605 <li>pre-built libraries are in <code>pepper_22\lib</code></li>
606 </ul>
607 </li>
608 <li>A Visual Studio add-in will be available in the near future with
609 configurations that include platforms for both Pepper plugins and NaCl
610 modules.</li>
611 </ul>
612 <aside class="note">
613 <strong>Note:</strong> It&#8217;s also possible to build a module as a trusted plugin on Mac and
614 Linux systems, but doing so requires more work because the SDK does not yet
615 include the above resources (library source files and pre-built libraries)
616 for Mac and Linux systems. To build and debug a trusted plugin on Mac and
617 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
618 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>
619 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>.
620 In the future, the SDK will include resources for hosted development on Mac
621 and Linux as well as Windows.
622 </aside>
623 <h3 id="id29">Examples</h3>
624 <ul class="small-gap">
625 <li>Each example in the SDK now builds both a debug and a release version. As
626 before, most examples also build newlib and glibc versions, which means that
627 there are now four versions for each example. Take a look at the Makefiles in
628 the examples to see the compiler flags that are used for debug and release
629 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
630 different development scenarios</em></a>.</li>
631 <li>Comments have been added to common.js, which is used in all the examples. The
632 JavaScript in common.js inserts an &lt;embed&gt; element that loads the NaCl module
633 in each example&#8217;s web page, attaches event listeners to monitor the loading
634 of the module, and implements handleMessage() to respond to messages sent
635 from the NaCl module to the JavaScript side of the application</li>
636 </ul>
637 <h3 id="id30">PPAPI</h3>
638 <ul class="small-gap">
639 <li>The <code>CompletionCallbackFactory</code> class template now takes a thread traits
640 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
641 class template reference</a>.</li>
642 </ul>
643 </section>
645 {{/partials.standard_nacl_article}}