revision_history.jd revision a73450cd270e3d2838d894b021e299d19f6290a9
1page.title=NDK Revision History 2@jd:body 3 4<p>This page provides information on previous releases of the NDK, enumerating the changes that 5took place in each new version.</p> 6 7<div class="toggle-content closed"> 8<a name="10d"></a> 9 <p> 10 <a href="#" onclick="return toggleContent(this)"> <img 11 src="/assets/images/triangle-closed.png" class="toggle-content-img" alt="" 12 >Android NDK, Revision 10d</a> <em>(December 2014)</em> 13 </p> 14 <div class="toggle-content-toggleme"> 15 <dl> 16 <dt>Important changes:</dt> 17 <dd> 18 <ul> 19 <li>Made GCC 4.8 the default for all 32-bit ABIs. Deprecated GCC 4.6, and 20 will remove it next release. To restore previous behavior, either add 21 <code>NDK_TOOLCHAIN_VERSION=4.6</code> to ndk-build, or 22 add <code>--toolchain=arm-linux-androideabi-4.6</code> when executing 23 <code>make-standalone-toolchain.sh</code> on the command line. GCC 4.9 remains the 24 default for 64-bit ABIs.</li> 25 26 <li>Stopped all x86[_64] toolchains from adding <code>-mstackrealign</code> by default. The 27 NDK toolchain assumes a 16-byte stack alignment. The tools and options used by default 28 enforce this rule. A user writing assembly code must make sure to preserve stack 29 alignment, and ensure that other compilers also comply with this rule. 30 (GCC bug <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38496">38496</a>)</li> 31 32 <li>Added Address Sanitizer functionality to Clang 3.5 support to the ARM and x86 ABIs. 33 For more information on this change, see the 34 <a href="https://code.google.com/p/address-sanitizer/wiki/Android">Address 35 Sanitizer</a> project.</li> 36 37 <li>Introduced the requirement, starting from API level 21, to use <code>-fPIE -pie 38 </code> when building. In API levels 16 and higher, ndk-build uses <code>PIE</code> 39 when building. This change has a number of implications, which are discussed in 40 <a href="https://code.google.com/p/android-developer-preview/issues/detail?id=888"> 41 Developer Preview Issue 888</a>. 42 These implications do not apply to shared libraries.</li> 43 </ul> 44 </dd> 45 <dl> 46 47 48 <dt>Important bug fixes:</dt> 49 <dd> 50 <ul> 51 <li>Made more fixes related to 52 <a href="https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00906.html"> 53 A53 Errata #835769</a> in the aarch64-linux-android-4.9 linker. As part of this, GCC 54 passes a new option, <code>--fix-cortex-a53-835769</code>, when 55 <code>-mfix-cortex-a53-835769</code> (enabled by default) is specified. 56 For more information, see this 57 <a href="https://sourceware.org/ml/binutils/2014-10/msg00198.html">binutils message</a> 58 and this 59 <a href="https://sourceware.org/ml/binutils/2014-11/msg00287.html">binutils message</a>. 60 </li> 61 62 <li>Documented a fix to a libc++ <code>sscanf/vsscanf</code> hang that occurred in API level 63 21. The fix itself had been implemented in r10c. 64 (Issue <a href="http://b.android.com/77988">77988</a>)</li> 65 66 <li>Fixed an AutoFDO (<code>-fauto-profile</code>) crash that occurred with GCC 4.9 when 67 <code>-Os</code> was specified. (Issue <a href="http://b.android.com/77571">77571</a>)</li> 68 </ul> 69 </dd> 70 71 72 <dt>Other bug fixes:</dt> 73 <dd> 74 <ul> 75 <li>Made the following header and library fixes:</li> 76 <ul> 77 <li>Added <code>posix_memalign</code> to API level 16. Also, added a prototype in 78 <code>stdlib.h</code> to API levels 16 to 19. 79 (Issue <a href="http://b.android.com/77861">77861</a>)</li> 80 <li>Fixed <code>stdatomic.h</code> so that it includes <code><atomic></code> only for 81 C++11.</li> 82 <li>Modified the following headers for standalone use: <code>sys/user.h</code>, and 83 <code>gl2ext.h</code>, <code>dlext.h</code>, <code>fts.h</code>, <code>sgidefs.h</code> 84 for API level 21.</li> 85 <li>Modified <code>sys/user.h</code> to rename <code>mxcsr_mask</code> as <code>mxcr_mask</code>, 86 and to change the data type for <code>u_ar0</code></li> from <code>unsigned long</code> 87 to </code>struct user_regs_struct*</code>. 88 <li>Changed <code>sysconf()</code> return value type from <code>int</code> to 89 <code>long</code>.</li> 90 </ul> 91 92 <li>Fixed ndk-build's handling of <code>thumb</code> for <code>LOCAL_ARM_MODE</code>: In 93 r10d, ndk-build adds <code>LOCAL_LDFLAGS+=-mthumb</code> by default, unless one of the 94 following conditions applies:</li> 95 <ul> 96 <li>You have set <code>LOCAL_ARM_MODE</code> equal to <code>arm</code>.</li> 97 <li>You are doing a debug build (with settings such as <code>APP_OPTIM=debug</code> and 98 <code>AndroidManifest.xml</code> containing <code>android:debuggable="true"</code>), 99 where ARM mode is the default in order to retain compatibility with earlier toolchains. 100 (Issue <a href="http://b.android.com/74040">74040</a>)</li> 101 </ul> 102 103 <li>Fixed <code>LOCAL_SRC_FILES</code> in ndk-build to use Windows absolute paths. 104 (Issue <a href="http://b.android.com/74333">74333</a>)</li> 105 106 <li>Removed bash-specific code from ndk-gdb. (Issue <a href="http://b.android.com/73338">73338</a>)</li> 107 108 <li>Removed bash-specific code from <code>make-standalone-toolchain.sh</code>. 109 (Issue <a href="http://b.android.com/74145">74145)</a></li> 110 111 <li>Revised documentation concerning a fix for <code>System.loadLibrary()</code> transitive 112 dependencies. (Issue <a href="http://b.android.com/41790">41790</a>)</li> 113 114 <li>Fixed a problem that was preventing 64-bit packages from extracting on Ubuntu 14.04 and 115 OS X 10.10 (Yosemite). (Issue <a href="http://b.android.com/78148">78148</a>)</li> 116 117 <li>Fixed an issue with <code>LOCAL_PCH</code> to improve Clang support. (Issue 118 <a href="http://b.android.com/77575">77575</a>)</li> 119 120 <li>Clarified "requires executable stack" warning from ld.gold. (Issue 121 <a href="http://b.android.com/79115">79115</a>)</li> 122 </ul> 123 </dd> 124 125 </dl> 126 </div> 127</div> 128 129 130 131 132 133 134 135<div class="toggle-content closed"> 136<a name="10c"></a> 137 <p> 138 <a href="#" onclick="return toggleContent(this)"> <img 139 src="/assets/images/triangle-closed.png" class="toggle-content-img" alt="" 140 >Android NDK, Revision 10c</a> <em>(October 2014)</em> 141 </p> 142 <div class="toggle-content-toggleme"> 143 <dl> 144 <dt>Important changes:</dt> 145 <dd> 146 <ul> 147 <li>Made the following changes to download structure:</li> 148 <ul> 149 <li>Each package now contains both the 32- and the 64-bit headers, libraries, and tools for 150 its respective platform.</li> 151 <li>STL libraries with debugging info no longer need be downloaded separately.</li> 152 </ul> 153 <li>Changed everything previously called <code>Android-L</code> to the official release 154 designation: <code>android-21</code>.</li> 155 <li>Updated GCC 4.9 by rebasing to the <code>google</code> branch 156 of the GCC repository. Major differences from the upstream version of GCC 4.9 include:</li> 157 158 <ul> 159 <li>The <code>-O2</code> option now turns on vectorization, without loop peeling but with more 160 aggressive unrolling.</li> 161 <li>Enhancements to FDO and <a href="https://gcc.gnu.org/wiki/LightweightIpo#LIPO_-_Profile_Feedback_Based_Lightweight_IPO"> 162 LIPO</a></li> 163 <p>For more detailed information, see <em>Important bug fixes</em> below.</p> 164 </ul> 165 166 <li>Added Clang 3.5 support to all hosts: <code>NDK_TOOLCHAIN_VERSION=clang</code> 167 now picks Clang 3.5. Note that:</li> 168 <ul> 169 170 <li>ARM and x86 default to using the integrated assembler. If this causes issues, use 171 <code>-fno-integrated-as</code> as a workaround.</code> 172 <li>Clang 3.5 issues more warnings for unused flags, such as the <code>-finline-functions</code> 173 option that GCC supports.</li> 174 <p>When migrating from projects using GCC, you can use 175 <code>-Wno-invalid-command-line-argument</code> and <code>-Wno-unused-command-line-argument</code> 176 to ignore the unused flags until you're able decide on what to do with them longer-term.</p> 177 178 </ul> 179 <li>Made it possible to enter ART debugging mode, when debugging on an Android 5.0 device using 180 ART as its virtual machine, by specifying the <code>art-on</code> option. For more information, 181 see <code>prebuilt/common/gdb/common.setup</code> in the directory containing the NDK.</li> 182 <li>Removed support for Clang 3.3.</li> 183 <li>Deprecated GCC 4.6, and may remove it from future releases.</li> 184 <li>Updated mclinker to 2.8 with Identical Code Folding ("ICF") support. Specify ICF using the 185 <code>--icf</code> option.</li> 186 <li>Broadened <code>arm_neon.h</code> support in x86 and x86_64, attaining coverage of ~93% of 187 NEON intrinsics. For more information about NEON support: 188 <ul> 189 <li>Navigate to the NDK Programmer's Guide (<code>docs/Programmers_Guide/html/</code>), and see 190 Architectures and CPUs > Neon.</li> 191 <li>Examine the updated <code>hello-neon</code> sample in <code>samples/</code>. 192 <li>See Intel's guide to <a href="https://software.intel.com/en-us/blogs/2012/12/12/from-arm-neon-to-intel-mmxsse-automatic-porting-solution-tips-and-tricks"> porting from ARM NEON to Intel SSE.</a></li> 193 </ul> 194 <li>Documented support for <code>_FORTIFY_SOURCE</code> in <code>headers/libs/android-21</code>, 195 which appeared in r10 (when <code>android-21</code> was still called <code>Android-L</code>), 196 but had no documentation.</li> 197 </ul> 198 </dd> 199 <dl> 200 201 202 <dt>Important bug fixes:</dt> 203 <dd> 204 <ul> 205 <li>Fixed an internal compiler error with GCC4.9/aarch64 that was causing the following 206 error message (Issue <a href="http://b.android.com/77564">77564</a>):</li> 207<pre> 208internal compiler error: in simplify_const_unary_operation, at simplify-rtx.c:1539 209</pre> 210 <li>Fixed incorrect code generation from GCC4.9/arm. (Issue 211 <a href="http://b.android.com/77567">77567<a>)</li> 212 <li>Fixed an internal compiler error with GCC4.9/mips involving inline-assembly. (Issue 213 <a href="http://b.android.com/77568">77568</a>)</li> 214 <li>Fixed incorrect code that GCC4.9/arm was generating for <code>x = (cond) ? y : x</code>. 215 (Issue <a href="http://b.android.com/77569">77569</a>)</li> 216 <li>Fixed GCC4.9/aarch64 and Clang3.5/aarch64 to work around the 217 <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141006/116322.html"> 218 Cortex-A53 erratum (835769)</a> by default. Disable the workaround by specifying 219 <code>-mno-fix-cortex-a53-835769</code>.</li> 220 </ul> 221 </dd> 222 223 224 <dt>Other bug fixes:</dt> 225 <dd> 226 <ul> 227 <li>Made the following header and library fixes to <code>android-21</code>: 228 <ul> 229 230 <li>Added more TV keycodes: <code>android/keycodes.h</code></li> 231 <li>Added more constants and six new sensor functions to <code>android/sensor.h</code>: 232 <code>ASensorManager_getDefaultSensorEx</code>, <code>ASensor_getFifoMaxEventCount</code>, 233 <code>ASensor_getFifoReservedEventCount</code>, <code>ASensor_getStringType</code>, 234 <code>ASensor_getReportingMode</code>, and <code>ASensor_isWakeUpSensor</code>.</li> 235 <li>Fixed <code>stdatomic.h</code> to improve compatibility with GCC 4.6, and provide support 236 for the <code><atomic></code> header.</li> 237 <li>Added <code>sys/ucontext.h</code> and <code>sys/user.h</code> to all API levels. The 238 <code>signal.h</code> header now includes <code><sys/ucontext.h></code>. You may 239 remove any existing definition of <code>struct ucontext</code>.</li> 240 <li>Added <code>posix_memalign</code> to API levels 17, 18, and 19.</li> 241 <li>Added the following functions to all architectures: 242 <code>android_set_abort_message</code>, <code>posix_fadvise</code>, 243 <code>posix_fadvise64</code>, <code>pthread_gettid_np</code>.</li> 244 <li>Added the required permissions to the <code>native-media/AndroidManifest.xml</code> 245 sample. 246 (Issue <a href="https://android-review.googlesource.com/#/c/106640/">106640</a>)</li> 247 <li>Added <code>clock_nanosleep</code> and <code>clock_settime</code> to API level 21. (Issue 248 <a href="http://b.android.com/77372">77372</a>) 249 <li>Removed the following symbols from all architectures: 250 <code>get_malloc_leak_info</code>, <code>free_malloc_leak_info</code>, 251 <code>__srget</code>, <code>__swbuf</code>, <code>__srefill</code>, <code>__swsetup</code>, 252 <code>__sdidinit</code>, <code>__sflags</code>, <code>__sfp</code>, 253 <code>__sinit</code>, <code>__smakebuf</code>, <code>__sflush</code>, <code>__sread</code>, 254 <code>__swrite</code>, <code>__sseek</code>, <code>__sclose</code>, 255 <code>_fwalk</code>, <code>__sglue</code>, <code>__get_thread</code>, <code>__wait4</code>, 256 <code>__futex_wake</code>, <code>__open</code>, <code>__get_tls</code>, 257 <code>__getdents64</code>, and <code>dlmalloc</code>.</li> 258 <li>Removed the following functions from the 64-bit architectures: <code>basename_r</code>, 259 <code>dirname_r</code>, <code>__isthreaded</code>, <code>_flush_cache</code> (mips64).</li> 260 <li>Removed the following function from the 32-bit architectures: 261 <code>__signalfd4</code>.</li> 262 <li>Changed the type of the third argument from <code>size_t</code> to <code>int</code> in 263 the following functions: <code>strtoll_l</code>, <code>strtoull_l</code>, 264 <code>wcstoll_l</code>, and <code>wcstoull_l</code>.</li> 265 <li>Restored the following functions to the 64-bit architecture: <code>arc4random</code>, 266 <code>arc4random_buf</code>, and <code>arc4random_uniform</code>.</li> 267 <li>Moved <code>cxa_*</code> and the <code>new</code> and <code>delete</code> operators back 268 to <code>libstdc++.so</code>. This change restores r9d behavior; previous versions of r10 269 contained dummy files.</li> 270 271 </ul> 272 <li>Restored MXU support in GCC 4.8 and 4.9 for mips. This support had been absent from 273 r10 and r10b because those versions of GCC had been compiled with binutils-2.24, which did 274 not support MXU. It now does.</li> 275 <li>Fixed <code>--toolchain=</code> in <code>make-standalone-toolchain.sh</code> so that it 276 now properly supports use of a suffix specifying a version of Clang.</li> 277 <li>Fixed the libc++/armeabi <code>strtod()</code> functions.</li> 278 <li>Made fixes to NDK documentation in <code>docs/</code>.</li> 279 </ul> 280 </dd> 281 282 <dt>Other changes:</dt> 283 <dd> 284 <ul> 285 <li>Enhanced <code>cpu-features</code> to detect ARMv8 support for the following 286 instruction sets: AES, CRC32, SHA2, SHA1, and 64-bit PMULL/PMULL2. (Issue 287 <a href="https://android-review.googlesource.com/#/c/106360/">106360</a>)</li> 288 289 <li>Modified ndk-build to use <code>*-gcc-ar</code>, which is available in GCC 4.8, GCC 4.9, and 290 Clang. Clang specifies it, instead of <code>*-ar</code>. This setting brings improved LTO 291 support.</li> 292 293 <li>Removed the <code>include-fixed/linux/a.out.h</code> and 294 <code>include-fixed/linux/compiler.h</code> headers from the GCC compiler. 295 (Issue <a href ="http://b.android.com/73728">73728</a>)</li> 296 297 <li>Fixed an issue related to <code>-flto</code> with GCC 4.8 on Mac OS X. The error message 298 read:</li> 299 300 <pre> 301.../ld: error: .../libexec/gcc/arm-linux-androideabi/4.9/liblto_plugin.so 302Symbol not found: _environ 303</pre> 304 305 <li>Fixed a typo in <code>build-binary.mk.</code> (Issue 306 <a href="http://b.android.com/76992">76992</a>)</li> 307 </ul> 308 </dd> 309 310 <dt>Important known issues:</dt> 311 <dd> 312 <ul> 313 <li>Specifying -Os (<code>-fauto-profile</code>) in GCC4.9 may cause crashing. 314 (Issue <a href="http://b.android.com/77571">77571</a>)</li> 315 </ul> 316 </dd> 317 318 </dl> 319 </div> 320</div> 321 322<div class="toggle-content closed"> 323<a name="10b"></a> 324 <p> 325 <a href="#" onclick="return toggleContent(this)"> <img 326 src="/assets/images/triangle-closed.png" class="toggle-content-img" alt="" 327 >Android NDK, Revision 10b</a> <em>(September 2014)</em> 328 </p> 329 <div class="toggle-content-toggleme"> 330 <dl> 331 332 <dt>Important notes:</dt> 333 <dd> 334 <ul> 335 <li>Because of the 512MB size restriction on downloadable packages, the following 32-bit items are not in the 32-bit NDK download packages. Instead, they reside in the 64-bit ones:</li> 336 <ul> 337 <li>Android-L headers</li> 338 <li>GCC 4.9</li> 339 </ul> 340 <li>Currently, the only Renderscript support provided by the NDK is for 32-bit Renderscript with Android 4.4 (API level 19). You cannot build HelloComputeNDK (the only Renderscript sample) with any other combination of Renderscript (32- or 64-bit) and Android version.</li> 341 <li>To compile native-codec, you must use a 64-bit NDK package, which is where all the Android-L headers are located. </li> 342 </ul> 343 </dd> 344 345 346 <dt>Important bug fixes:</dt> 347 <dd> 348 <ul> 349 <li>Fixed gdb 7.6 in GCC 4.8/4.9. (Issues <a href="http://b.android.com/74112">74112</a> and <a href="http://b.android.com/74371">74371</a>.)</li> 350 <li>Fixed GCC 4.8/4.9 for x86, so that they no longer enable <code>-msse4.2</code> and <code>-mpopcnt</code> by default. (Issue <a href="http://b.android.com/73843">73843</a>.)</li> 351 </ul> 352 </dd> 353 354 <dt>Other bug fixes:</dt> 355 <dd> 356 <ul> 357 <li>Removed <code>stdio.h</code> from the <code>include-fixed/</code> directories of all versions of GCC. (Issue <a href="http://b.android.com/73728">73728</a>.)</li> 358 <li>Removed duplicate header files from the Windows packages in the <code>platforms/android-L/arch-*/usr/include/linux/netfilter*/</code> directories. (Issue <a href="https://code.google.com/p/android/issues/detail?id=73704">73704</a>.)</li> 359 <li>Fixed a problem that prevented Clang from building HelloComputeNDK.</li> 360 <li>Fixed atexit. (Issue <a href="http://b.android.com/66595">66595</a>.)</li> 361 <li>Made various fixes to the docs in <code>docs/</code> and <code>sources/third_party/googletest/README.NDK</code>. (Issue <a href="http://b.android.com/74069">74069</a>.)</li> 362 <li>Made the following fixes to the Android-L headers:</li> 363 <ol> 364 <li>Added the following functions to <code>ctype.h</code> and <code>wchar.h</code>: <code>dn_expand()</code>, <code>grantpt()</code>, <code> inet_nsap_addr()</code>, <code>inet_nsap_ntoa()</code>, <code>insque()</code>, <code>nsdispatch()</code>, <code>posix_openpt()</code>, <code>__pthread_cleanup_pop()</code>, <code>__pthread_cleanup_push()</code>, <code>remque()</code>, <code>setfsgid()</code>, <code>setfsuid()</code>, <code>splice()</code>, <code>tee()</code>, <code>twalk()</code> (Issue <a href = "http://b.android.com/73719">73719</a>), and 42 <code>*_l()</code> functions.</li> 365 366 <li>Renamed <code>cmsg_nxthdr</code> to <code>__cmsg_nxthdr</code>.</li> 367 368 <li>Removed <code>__libc_malloc_dispatch</code>.</li> 369 370 <li>Changed the <code>ptrace()</code> prototype to <code>long ptrace(int, ...);</code>.</li> 371 372 <li>Removed <code>sha1.h</code>.</li> 373 374 <li>Extended <code>android_dlextinfo</code> in <code>android/dlext.h</code>.</li> 375 376 <li>Annotated <code>__NDK_FPABI__</code> for functions receiving or returning float- or double-type values in <code>stdlib.h</code>, <code>time.h</code>, <code>wchar.h</code>, and <code>complex.h</code>.</li> 377 </ol> 378 </ul> 379 </dd> 380 381 <dt>Other changes:</dt> 382 <dd> 383 <ul> 384 <li>Updated <code>mipsel-linux-android-4.9</code> and <code>mips64el-linux-android-4.9</code>, implementing a new multilib directory layout, and providing support for gdb-7.7</li> 385 <li>Enhanced <code>cpu-features</code> to detect more arm64 features. (Change list <a href="https://android-review.googlesource.com/#/c/100339">100339</a>.)</li> 386 </dd> 387 </ul> 388 389 </dl> 390 </div> 391</div> 392 393<div class="toggle-content closed"> 394<a name="10"></a> 395 <p> 396 <a href="#" onclick="return toggleContent(this)"> <img 397 src="/assets/images/triangle-closed.png" class="toggle-content-img" alt="" 398 >Android NDK, Revision 10</a> <em>(July 2014)</em> 399 </p> 400 <div class="toggle-content-toggleme"> 401 <dl> 402 <dt>Important changes:</dt> 403 <dd> 404 <ul> 405 <li>Added 3 new ABIs, all 64-bit: arm64-v8a, x86_64, mips64.</li> Note that: 406 <ul> 407 <li>GCC 4.9 is the default compiler for 64-bit ABIs. Clang is currently version 3.4. 408<code>NDK_TOOLCHAIN_VERSION=clang</code> 409 may not work for arm64-v8a and mips64.</li> 410 <li>Android-L is the first level with 64-bit support. Note that this API 411level is a temporary one, and only for L-preview. An actual API level number will replace it at 412L-release.</li> 413 <li>This release includes now includes <code>all32</code> and <code>all64</code> 414settings for <code>APP_ABI</code>. 415 <ul> 416 <li><code>APP_ABI=all32</code> is equivalent to 417<code>APP_ABI=armeabi,armeabi-v7a,x86,mips</code>.</li> 418 <li><code>APP_ABI=all64</code> is equivalent to 419<code>APP_ABI=arm64-v8a,x86_64,mips64</code>.</li> 420 <li><code>APP_ABI=all</code> selects all ABIs.</li> 421 </ul> 422 <li>The new GNU libstdc++ in Android-L contains all <code><tr1/cmath></code> 423Before defining your own math function, check <code>_GLIBCXX_USE_C99_MATH_TR1</code> to see a 424function with that name already exists, in order to avoid "multiple definition" errors from the 425linker.</li> 426 <li>The cpu-features library has been updated for the ARMv8 kernel. The existing 427cpu-features library may fail to detect the presence of NEON on the ARMv8 platform. Recompile your 428code with the new version.</li> 429 </ul> 430 <li>Added a new <code>platforms/android-L/</code> API directory. It includes:</li> 431 <ul> 432 <li>Updated Bionic headers, which had not changed from Android API levels 3 433(Cupcake) to 19 (KitKat). This new version, for level L, is to be synchronized with AOSP.</li> 434 <li>New media APIs and a native-codec sample.</li> 435 <li>An updated <code>Android.h</code> header for SLES/OpenSLES, enabling support for 436single-precision, floating-point audio format in AudioPlayer.</li> 437 <li>GLES 3.1 and AEP extensions to <code>libGLESv3.so.</code></li> 438 <li>GLES2 and GLES3 headers updated to the latest official Khronos versions.</li> 439 </ul> 440 <li>Added GCC 4.9 compilers to the 32-/64-bit ABIs. GCC 4.9 is the default (only) compiler 441for 64-bit ABIs, as previously mentioned. For 32-bit ABIs, you must explcitly enable GCC 4.9, as 442GCC 4.6 is still the default.</li> 443 <ul> 444 <li>For ndk-build, enable 32-bit, GCC 4.9 building either by adding 445<code>NDK_TOOLCHAIN_VERSION=4.9</code> to <code>Application.mk</code>, or exporting it as an 446environment variable from the command line.</li> 447 <li>For a standalone toolchain, use the <code>--toolchain=</code> option in the 448<code>make-standalone-toolchain.sh</code> script. For example: <code>--toolchain=arm-linux-androideabi-4.9.</code></li> 449 </ul> 450 <li>Upgraded GDB to version 7.6 in GCC 4.8/4.9 and x86*. Since GDB is still at version GDB-7.3.x in 451GCC 4.6 (the default for ARM and MIPS), you must set 452<code>NDK_TOOLCHAIN_VERSION=4.8</code> or <code>4.9</code> to enable ndk-gdb to select GDB 7.6.</li> 453 <li>Added the <code>-mssse3</code> build option to provide SSSE3 support, and made it the default for ABI x86 454(upgrading from SSE3). The image released by Google does not contain SSSE3 instructions.</li> 455 <li>Updated GCC 4.8 to 4.8.3.</li> 456 <li>Improved ARM libc++ EH support by switching from gabi++ to libc++abi. For details, see the "C++ Support" section of the documentation. 457 Note that:</li> 458 <ul> 459 <li>All tests except for locale now pass for Clang 3.4 and GCC 4.8. For more 460information, see the "C++ Support" section of the documentation.</li> 461 <li>The libc++ libraries for X86 and MIPS libc++ still use gabi++.</li> 462 <li>GCC 4.7 and later can now use <atomic>.</li> 463 <li>You must add <code>-fno-strict-aliasing</code> if you use <code> <list></code>, because <code>__list_imp::_end</code>_ breaks 464 TBAA rules. (Issue <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61571">61571</a>.)</li> 465 <li>As of GCC 4.6, LIBCXX_FORCE_REBUILD:=true no longer rebuilds libc++. Rebuilding it 466requires the use of a different compiler. Note that Clang 3.3 is untested.</li> 467 </ul> 468 <li>mclinker is now version 2.7, and has aarch64 Linux support.</li> 469 <li>Added precompiled header support for headers specified by <code>LOCAL_PCH</code>. (Issue <a href="http://b.android.com/25412">25412</a>).</li> 470 </dd> 471 <dl> 472 473 474 <dt>Important bug fixes:</dt> 475 <dd> 476 <ul> 477 <li>Fixed libc++ so that it now compiles <code>std::feof</code>, etc. (Issue <a 478href="http://b.android.com/66668">66668</a>).</li> 479 <li>Fixed a Clang 3.3/3.4 atomic library call that caused crashes in some of the libc++ 480tests for ABI armeabi.</li> 481 <li>Fixed Clang 3.4 crashes that were occurring on reading precompiled headers. (Issue <a 482href="http://b.android.com/66657">66657</a>).</li> 483 <li>Fixed the Clang 3.3/3.4 <code>-O3</code> assert on:</li> 484 <code>llvm-3.2/llvm/include/llvm/MDBuilder.h:64: llvm::MDNode* 485llvm::MDBuilder::createBranchWeights(llvm::ArrayRef<unsigned int>): Assertion Weights.size() >= 2 486&& "Need at least two branch weights!"</code> (Issue <a href="http://b.android.com/57381">57381</a>). 487 <li>Fixed the following Clang 3.3/3.4 crash:</li> 488 <code>Assertion failed: (!Fn && "cast failed but able to resolve overload expression!!"), function CheckCXXCStyleCast, file 489Volumes/data/ndk-toolchain/src/llvm-3.3/llvm/tools/clang/lib/Sema/SemaCast.cpp, line 2018</code>. 490(Issue <a href="http://b.android.com/66950">66950</a>). 491 </ul> 492 </dd> 493 494 <dt>Other bug fixes:</dt> 495 <dd> 496 <ul> 497 <li>Fixed headers:</li> 498 <ul> 499 <li>Fixed 32-bit <code>ssize_t</code> to be <code>int</code> instead of <code>long 500int</code>.</li> 501 <li>Fixed <code>WCHAR_MIN</code> and <code>WCHAR_MAX</code> so that they they take 502appropriate signs according to the architecture they're running on:</li> 503 <ul> 504 <li>X86/MIPS: signed. 505 <li>ARM: unsigned. 506 <li>To force X86/MIPS to default to unsigned, use 507<code>-D__WCHAR_UNSIGNED__</code>.</li> 508 <li>To force <code>wchar_t</code> to be 16 bits, use <code>-fshort-wchar</code>.</li> 509 </ul> 510 <li>Removed non-existent symbols from 32-bit <code>libc.so</code>, and added <code>pread64</code>, 511<code>pwrite64</code>, <code>ftruncate64</code> for 512Android API level 12 and higher. (Issue <a href="http://b.android.com/69319">69319</a>). For more 513information, see the commit message accompanying AOSP change list 514 <a href="https://android-review.googlesource.com/#/c/94137">94137</a>.</li> 515 </ul> 516 <li>Fixed GCC warning about redefinition of <code>putchar</code>. Warning message reads:</li> 517 <code>include/stdio.h:236:5: warning: conflicts with previous declaration here 518[-Wattributes] int putchar(int);</code> (Change list <a 519href="https://android-review.googlesource.com/#/c/91185">91185</a>). 520 <li>Fixed <code>make-standalone-toolchain.sh --stl=libc++</code> so that it:</li> 521 <ul> 522 <li>Copies <code>cxxabi.h</code>. (Issue <a 523href="http://b.android.com/68001">68001</a>).</li> 524 <li>Runs in directories other than the NDK install directory. (Issues <a 525href="http://b.android.com/67690">67690</a> and <a href="http://b.android.com/68647">68647</a>).</li> 526 </ul> 527 <li>Fixed GCC/Windows to quote arguments only when necessary for spawning processes in 528external programs. This change decreases the likelihood of exceeding the 32K length limit.</li> 529 <li>Fixed an issue that made it impossible to adjust the <code>APP_PLATFORM</code> 530environment variable.</li> 531 <li>Fixed the implementation of <code>IsSystemLibrary()</code> in crazy_linker so that it 532uses <code>strrchr()</code> 533 instead of <code>strchr()</code> to find the library path's true basename.</li> 534 <li>Fixed native-audio's inability to build in debug mode.</li> 535 <li>Fixed gdb's inability to print extreme floating-point numbers. (Issue <a 536href="http://b.android.com/69203">69203</a>).</li> 537 <li>Fixed Clang 3.4 inability to compile with <code>-Wl,-shared</code> (as opposed to 538<code>-shared</code>, which 539 had no compilation issues). The problem was that Clang added <code>-pie</code> for Android 540targets if neither <code>-shared</code> nor <code>-static</code> existed. This behavior, which was 541incorrect, caused the linker to complain that <code>-shared</code> and <code>-pie</code> could not 542co-exist.</li> 543 544 </ul> 545 </dd> 546 547 548 <dt>Other changes:</dt> 549 <dd> 550 <ul> 551 <li>Added <code>arm_neon.h</code> to the x86 toolchain so that it now emulates ~47% of 552Neon. There is currently no support for 64-bit types. For more information, see the section on ARM 553Neon intrinsics support in the x86 documentation.</li> 554 <li>Ported ARM/GOT_PREL optimization (present in GCC 4.6 built from the GCC google branch) to 555ARM GCC 4.8/4.9. This optimization sometimes reduces instruction count when accessing global 556variables. As an example, see the build.sh script in 557<code>$NDK/tests/build/b14811006-GOT_PREL-optimization/</code>.</li> 558 <li>Added ARM version for STL gabi++, stlport, and libc++. They now have both it and Thumb 559mode.</li> 560 <li>It is now possible to call the make-standalone-toolchain.sh script with 561<code>--toolchain=x86_64-linux-android-4.9</code>, which is equivalent to 562<code>--toolchain=x86_64-4.9</code>.</li> 563 </dd> 564 </ul> 565 </dl> 566 </div> 567</div> 568 569 570<div class="toggle-content closed"> 571<a name="9d"></a> 572 <p> 573 <a href="#" onclick="return toggleContent(this)"> <img 574 src="/assets/images/triangle-closed.png" class="toggle-content-img" alt="" 575 >Android NDK, Revision 9d</a> <em>(March 2014)</em> 576 </p> 577 <div class="toggle-content-toggleme"> 578 <dl> 579 <dt>Important changes:</dt> 580 <dd> 581 <ul> 582 <li>Added support for the Clang 3.4 compiler. The 583<code>NDK_TOOLCHAIN_VERSION=clang</code> option now picks Clang 3.4. GCC 4.6 is 584still the default compiler.</li> 585 <li>Added <code>APP_ABI=armeabi-v7a-hard</code>, with 586additional multilib option <code>-mfloat-abi=hard</code>. These options are for 587use with ARM GCC 4.6/4.8 and Clang 3.3/3.4 (which use 4.8's assembler, linker, 588and libs). When using these options, note the following changes:</li> 589 <ul> 590 <li> When executing the <code>ndk-build</code> script, add the 591following options for armeabi-v7a target: 592<pre>TARGET_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1 593TARGET_LDFLAGS += -Wl,--no-warn-mismatch -lm_hard</pre> 594The built library is copied to <code>libs/armeabi-v7a</code>. For make to 595behave as expected, you cannot specify both <code>armeabi-v7a</code> and 596<code>armeabi-v7a-hard</code> as make targets (i.e., on the APP_ABI= line). 597Doing so causes one of them to be ignored. Note that <code>APP_ABI=all</code> 598is still equivalent to 599<code>armeabi armeabi-v7a x86 mips</code>.</li> 600 <li>The <code>make-standalone-toolchain.sh</code> script copies 601additional libaries under <code>/hard</code> directories. 602 Add the above <code>CFLAGS</code> and <code>LFLAGS</code> to your 603makefile to enable GCC or Clang to link with 604 libraries in <code>/hard</code>.</li> 605 </ul> 606 <li>Added the yasm assembler, as well as <code>LOCAL_ASMFLAGS</code> 607and <code>EXPORT_ASMFLAGS</code> flags for x86 608targets. The <code>ndk-build</code> script uses 609<code>prebuilts/*/bin/yasm*</code> to build <code>LOCAL_SRC_FILES</code> that 610have the <code>.asm</code> extension.</li> 611 <li>Updated MClinker to 2.6.0, which adds <code>-gc-sections</code> 612support.</li> 613 <li>Added experimental libc++ support (upstream r201101). Use this new 614feature by following these steps: 615 <ul> 616 <li>Add <code>APP_STL := c++_static</code> or <code>APP_STL := 617c++_shared</code> in <code>Application.mk</code>. 618 You may rebuild from source via <code>LIBCXX_FORCE_REBUILD := 619true</code></li> 620 <li>Execute <code>make-standalone-toolchain.sh --stl=libc++</code> 621to create a standalone toolchain with libc++ headers/lib.</li> 622 </ul> 623 For more information, see 624<code>CPLUSPLUS-SUPPORT.html</code>. 625(Issue <a href="http://b.android.com/36496">36496</a>)</li> 626 </ul> 627 </dd> 628 <dl> 629 <dt>Important bug fixes:</dt> 630 <dd> 631 <ul> 632 <li>Fixed an uncaught throw from an unexpected 633exception handler for GCC 4.6/4.8 ARM EABI. (GCC Issue <a 634href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59392">59392</a>)</li> 635 <li>Fixed GCC 4.8 so that it now correctly resolves partial 636specialization of a template with 637 a dependent, non-type template argument. (GCC Issue <a 638href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59052">59052</a>)</li> 639 <li>Added more modules to prebuilt python (Issue <a 640href="http://b.android.com/59902">59902</a>): 641 <ul> 642 <li>Mac OS X: <code>zlib</code>, <code>bz2</code>, 643<code>_curses</code>, <code>_curses_panel</code>, <code>_hashlib</code>, 644<code>_ssl</code></li> 645 <li>Linux: <code>zlib</code>, <code>nis</code>, 646<code>crypt</code>, <code>_curses</code>, and <code>_curses_panel</code></li> 647 </ul> 648 <li>Fixed the x86 and MIPS gdbserver 649<code>event_getmsg_helper</code>.</li> 650 <li>Fixed numerous issues in the RenderScript NDK toolchain, including 651issues with compatibility across older devices and C++ reflection.</li> 652<br> 653 </ul> 654 </dd> 655 656 <dt>Other bug fixes:</dt> 657 <dd> 658 <ul> 659 <li>Header fixes: 660 <ul> 661 <li>Fixed a missing <code>#include <sys/types.h></code> in 662<code>android/asset_manager.h</code> for Android API level 13 and higher. 663 (Issue <a href="http://b.android.com/64988">64988</a>)</li> 664 <li>Fixed a missing <code>#include <stdint.h></code> in 665<code>android/rect_manager.h</code> for Android API level 14 and higher.</li> 666 <li>Added <code>JNICALL</code> to <code>JNI_OnLoad</code> and 667<code>JNI_OnUnload</code> in <code>jni.h</code>. Note that <code>JNICALL</code> 668 is defined as <code>__NDK_FPABI__</code> For more information, see 669<code>sys/cdefs.h</code>.</li> 670 <li>Updated the following headers so that they can be included 671without the need to 672manually include their dependencies (Issue <a 673href="http://b.android.com/64679">64679</a>):</li> 674<pre> 675android/tts.h 676EGL/eglext.h 677fts.h 678GLES/glext.h 679GLES2/gl2ext.h 680OMXAL/OpenMAXSL_Android.h 681SLES/OpenSLES_Android.h 682sys/prctl.h 683sys/utime.h 684</pre> 685 <li>Added <code>sys/cachectl.h</code> for all architectures. MIPS 686developers can now include this header instead of writing <code>#ifdef 687__mips__</code>.</li> 688 <li></code>Fixed <code>platforms/android-18/include/android/input.h 689</code> by adding <code>__NDK_FPABI__</code> to functions taking or returning 690float or double values.</li> 691 <li>Fixed MIPS <code>struct stat</code>, which was incorrectly set 692to its 64-bit counterpart for Android API level 12 and later. This wrong 693setting was a 694regression introduced in release r9c.</li> 695 <li>Defined <code>__PTHREAD_MUTEX_INIT_VALUE</code>, 696<code>__PTHREAD_RECURSIVE_MUTEX_INIT_VALUE</code>, 697 and <code>__PTHREAD_ERRORCHECK_MUTEX_INIT_VALUE</code> for Android API 698level 9 and lower.</li> 699 <li>Added <code>scalbln</code>, <code>scalblnf</code>, and 700<code>scalblnl</code> to x86 <code>libm.so</code> for APIs 18 and later.</li> 701 <li>Fixed a typo in 702<code>sources/android/support/include/iconv.h</code>. 703 (Issue <a href="http://b.android.com/63806">63806</a>)</li> 704 705 </ul> 706 </li> 707 <li>Fixed gabi++ <code>std::unexpected()</code> to call 708<code>std::terminate()</code> so that 709 a user-defined <code>std::terminate()</code> handler has a chance to run. 710</li> 711 <li>Fixed gabi++ to catch <code>std::nullptr</code>.</li> 712 <li>Fixed samples Teapot and MoreTeapots: 713 <ul> 714 <li>Solved a problem with Tegra 2 and 3 chips by changing specular 715variables to use medium precision. Values for specular power can now be less 716than 1.0. </li> 717 <li>Changed the samples so that pressing the volume button restores 718immersive mode and invalidates 719<code>SYSTEM_UI_FLAG_IMMERSIVE_STICKY</code>. Screen rotation does not 720trigger <code>onSystemUiVisibilityChange</code>, and so does not restore 721immersive mode.</li> 722 </ul> 723 </li> 724 <li>Fixed the <code>ndk-build</code> script to add 725<code>-rpath-link=$SYSROOT/usr/lib</code> and 726<code>-rpath-link=$TARGET_OUT</code> in order to use <code>ld.bfd</code> to 727link executables. (Issue <a href="http://b.android.com/64266">64266</a>)</li> 728 <li>Removed <code>-Bsymbolic</code> from all STL builds.</li> 729 <li>Fixed <code>ndk-gdb-py.cmd</code> by setting <code>SHELL</code> as 730an environment variable 731instead of passing it to 732 <code>python.exe</code>, which ignores the setting. 733 (Issue <a href="http://b.android.com/63054">63054</a>)</li> 734 <li>Fixed the <code>make-standalone-toolchain.sh</code> script so that 735the <code>--stl=stlport</code> option copies the gabi++ headers instead of 736symlinking them; the <code>cmd.exe</code> and MinGW shells do not understand 737symlinks created by cygwin.</li> 738 </ul> 739 </dd> 740 741 <dt>Other changes:</dt> 742 <dd> 743 <ul> 744 <li>Applied execution permissions to all <code>*cmd</code> scripts 745previously intended for use only in the <code>cmd.exe</code> shell, in case 746developers prefer to use <code>ndk-build.cmd</code> in cygwin instead of the 747recommended <code>ndk-build</code> script.</li> 748 <li>Improved the speed of the <code>make-standalone-toolchain.sh</code> 749script by moving instead of copying if the specified destination directory does 750not exist.</li> 751 </dd> 752 </ul> 753 </dl> 754 </div> 755</div> 756 757<div class="toggle-content closed"> 758<a name="9c"></a> 759 <p> 760 <a href="#" onclick="return toggleContent(this)"> <img 761 src="/assets/images/triangle-closed.png" class="toggle-content-img" alt="" 762 >Android NDK, Revision 9c</a> <em>(December 2013)</em> 763 </p> 764 <div class="toggle-content-toggleme"> 765<p>This is a bug-fix-only release.</p> 766 <dl> 767 <dt>Important bug fixes:</dt> 768 <dd> 769 <ul> 770 <li>Fixed a problem with GCC 4.8 ARM, in which the stack pointer is 771restored too early. This problem prevented the frame pointer from reliably 772accessing a variable in the stack frame. (GCC Issue <a 773href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854">58854</a>)</li> 774<li>Fixed a problem with GCC 4.8 libstdc++, in which a bug in 775std::nth_element was causing generation of code that produced a random 776segfault. (Issue <a 777href="https://code.google.com/p/android/issues/detail?id=62910">62910</a>)</li> 778 <li>Fixed GCC 4.8 ICE in cc1/cc1plus with 779<code>-fuse-ld=mcld</code>, so that the following error no longer occurs: 780<pre>cc1: internal compiler error: in common_handle_option, at 781opts.c:1774</pre></li> 782 <li>Fixed <code>-mhard-float</code> support for 783<code>__builtin</code> math functions. For ongoing information on fixes for 784<code>-mhard-float</code> with STL, please follow Issue <a 785href="http://b.android.com/61784">61784</a>.</li> 786 </ul> 787 </dd> 788 789 <dt>Other bug fixes:</dt> 790 <dd> 791 <ul> 792 <li>Header fixes: 793 <ul> 794 <li>Changed prototype of <code>poll</code> to <code>poll(struct 795pollfd *, nfds_t, int);</code> in <code>poll.h</code>.</li> 796 <li>Added <code>utimensat</code> to <code>libc.so</code> for Android 797API levels 12 and 19. These libraries are now included for all Android API 798levels 12 through 19.</li> 799<li>Introduced <code>futimens</code> into <code>libc.so</code>, for Android API 800level 19.</li> 801<li>Added missing <code>clock_settime()</code> and 802<code>clock_nanosleep()</code> to <code>time.h</code> for Android API level 8 803and higher.</li> 804<li>Added <code>CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, 805CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME, CLOCK_REALTIME_ALARM,</code> and 806<code>CLOCK_BOOTTIME_ALARM</code> in <code>time.h.</code></li> 807<li>Removed obsolete <code>CLOCK_REALTIME_HR</code> and 808<code>CLOCK_MONOTONIC_HR.</code></li> 809 </ul> 810 </li> 811 <li>In samples Teapot, MoreTeapots, and 812<code>source/android/ndk_helper</code>: 813 <ul> 814<li>Changed them so that they now use a hard-float abi for armeabi-v7a.</li> 815<li>Updated them to use immersive mode on Android API level 19 and 816higher.</li> 817<li>Fixed a problem with <code>Check_ReleaseStringUTFChars</code> in 818<code>/system/lib/libdvm.so</code> that was causing crashes on x86 devices.</li> 819 </ul> 820 </li> 821<li>Fixed <code>ndk-build</code> fails that happen in cygwin when the NDK 822package is 823referenced via symlink.</li> 824<li>Fixed <code>ndk-build.cmd</code> fails that happen in windows 825<code>cmd.exe</code> when 826<code>LOCAL_SRC_FILES</code> contains absolute paths. (Issue <a 827href="https://android-review.googlesource.com/#/c/69992">69992</a>)</li> 828<li>Fixed the <code>ndk-stack</code> script to proceed even when it can't parse 829a frame due to inability to find a routine, filename, or line number. In any of 830these cases, it prints <code>??</code>.</li> 831<li>Fixed the <code>ndk-stack</code> stack for windows-x64_64 targets so that 832it no longer erroneously matches a frame line with a line in the 833<code>stack:</code> section that doesn't contain <code>pc</code>, 834<code>eip</code>, or <code>ip</code>. For example: 835<pre>I/DEBUG ( 1151): #00 5f09db68 401f01c4 836/system/lib/libc.so</pre></li> 837<li>Fixed gabi++ so that it: 838 <ul> 839 <li>Does not use malloc() to allocate C++ thread-local 840 objects.</li> 841 <li>Avoids deadlocks in gabi++ in cases where libc.debug.malloc is 842non-zero in userdebug/eng Android platform builds.</li> 843 </ul> 844 </ul> 845 </dd> 846 847 <dt>Other changes:</dt> 848 <dd> 849 <ul> 850 <li>Added <code>LOCAL_EXPORT_LDFLAGS</code>.</li> 851<li>Introduced the <code>NDK_PROJECT_PATH=null</code> setting for use in an 852integrated build system where options are explicitly passed to 853<code>ndk-build</code>. With this setting, <code>ndk-build</code> makes no 854attempt to look for <code>NDK_PROJECT_PATH.</code> This setting also prevents 855variables from deriving default settings from NDK_PROJECT_PATH. As a result, 856the following variables must now be explicitly specified (with their default 857values if such exist): <code>NDK_OUT, NDK_LIBS_OUT, APP_BUILD_SCRIPT, 858NDK_DEBUG</code> (optional, default to 0), and other <code>APP_*</code>'s 859contained in <code>Application.mk</code>.</li> 860<li><code>APP_ABI</code> can now be enumerated in a comma-delimited list. For 861example: 862<pre>APP_ABI := "armeabi,armeabi-v7a"</pre></li> 863<li>Provided the ability to rebuild all of STL with debugging info in an 864optional, separate package called 865<code>android-ndk-r9c-cxx-stl-libs-with-debugging-info.zip</code>, using the 866<code>-g</code> option. This option 867helps the <code>ndk-stack</code> script provide better a stack dump across STL. 868This change should not affect the code/size of the final, stripped file.</li> 869<li>Enhanced <code>hello-jni</code> samples to report <code>APP_ABI</code> at 870compilation.</li> 871<li>Used the <code>ar</code> tool in Deterministic mode (option 872<code>-D</code>) to build static libraries. (Issue <a 873href="http://b.android.com/60705">60705</a>)</li> 874 </ul> 875 </dd> 876 877 </dl> 878 </div> 879</div> 880 881<div class="toggle-content closed"> 882<a name="9b"></a> 883 <p> 884 <a href="#" onclick="return toggleContent(this)"> <img 885 src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" 886 >Android NDK, Revision 9b</a> <em>(October 2013)</em> 887 </p> 888 <div class="toggle-content-toggleme"> 889 <dl> 890 <dt>Important changes:</dt> 891 <dd> 892 <ul> 893 <li>Updated {@code include/android/*h} and {@code math.h} for all Android API levels up to 894 18, including the addition of levels 13, 15, 16 and 17. 895 For information on added APIs, see commit messages for Changes 896 <a href="https://android-review.googlesource.com/68012">68012</a> and 897 <a href="https://android-review.googlesource.com/68014">68014</a>. 898 (Issues <a href="http://b.android.com/47150">47150</a>, 899 <a href="http://b.android.com/58528">58528</a>, and 900 <a href="http://b.android.com/38423">38423</a>)</li> 901 <li>Added support for Android API level 19, including Renderscript binding.</li> 902 <li>Added support for <code>-mhard-float</code> in the existing armeabi-v7a ABI. For more 903 information and current restrictions on Clang, see 904 {@code tests/device/hard-float/jni/Android.mk}.</li> 905 <li>Migrated from GNU Compiler Collection (GCC) 4.8 to 4.8.2, and added diagnostic color 906 support. To enable diagnostic colors, set <code>-fdiagnostics-color=auto</code>, 907 <code>-fdiagnostics-color=always,</code> or export {@code GCC_COLORS} as shown below: 908<pre> 909GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' 910</pre> 911 For more information, see 912 <a href="http://gcc.gnu.org/onlinedocs/gcc/Language-Independent-Options.html">GCC 913 Language Independent Options</a>. 914 </li> 915 <li>Added two new samples to demonstrate OpenGL ES 3.0 features: Teapot and MoreTeapots. 916 These samples run on devices with Android 4.1 (API level 16) and higher.</li> 917 <li>Deprecated GCC 4.7 and Clang 3.2 support, which will be removed in the next 918 release.</li> 919 </ul> 920 </dd> 921 922 <dt>Important bug fixes:</dt> 923 <dd> 924 <ul> 925 <li>Fixed problem with ARM GCC 4.6 {@code thumb2} failing to generate 16-bit relative jump 926 tables. (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48328">GCC Issue</a>)</li> 927 <li>Fixed GCC 4.8 internal compiler error (ICE) on 928 {@code g++.dg/cpp0x/lambda/lambda-defarg3.C}. 929 (<a href="https://android-review.googlesource.com/62770">Change 62770</a>, 930 <a href="http://gcc.gnu.org/ml/gcc/2013-07/msg00424.html">GCC Issue</a>)</li> 931 <li>Fixed a problem with Windows 32-bit {@code *-gdb.exe} executables failing to launch. 932 (<a href="http://b.android.com/58975">Issue 58975</a>)</li> 933 <li>Fixed GCC 4.8 ICE when building bullet library. The error message is as follows: 934 <pre>internal compiler error: verify_flow_info failed</pre> 935 (<a href="http://b.android.com/58916">Issue 58916</a>, 936 <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58165">GCC Issue</a>)</li> 937 <li>Modified GDB/ARM build to skip {@code ARM.exidx} data for unwinding in prologue code and 938 added a command ({@code set arm exidx-unwinding}) to control exidx-based stack unwinding. 939 (<a href="http://b.android.com/55826">Issue 55826</a>)</li> 940 <li>Fixed Clang 3.3 MIPS compiler problem where HI and LO registers are incorrectly 941 reused.</li> 942 <li>Fixed issue with MIPS 4.7 ICE in {@code dbx_reg_number}. The error message is as 943follows: 944<pre> 945external/icu4c/i18n/decimfmt.cpp:1322:1: 946internal compiler error: in dbx_reg_number, at dwarf2out.c:10185 947</pre> 948 (<a href="http://gcc.gnu.org/ml/gcc-patches/2012-12/msg00830.html">GCC Patch</a>) 949 950 </li> 951 952 </ul> 953 </dd> 954 955 <dt>Other bug fixes:</dt> 956 <dd> 957 <ul> 958 <li>Header fixes 959 <ul> 960 <li>Fixed the ARM {@code WCHAR_MIN} and {@code WCHAR_MAX} to be unsigned according to 961 spec (the X86/MIPS versions are signed). Define {@code _WCHAR_IS_ALWAYS_SIGNED} to 962 restore old behavior. (<a href="http://b.android.com/57749">Issue 57749</a>)</li> 963 <li>Fixed {@code include/netinet/tcp.h} to contain {@code TCP_INFO} state enum. 964 (<a href="http://b.android.com/38881">Issue 38881</a>)</li> 965 <li>Fixed the {@code cdefs_elh.h} macro {@code _C_LABEL_STRING} to stop generating 966 warnings in the GCC 4.8 toolchain when using c++11 mode. 967 (<a href="http://b.android.com/58135">Issue 58135</a>, 968 <a href="http://b.android.com/58652">Issue 58652</a>)</li> 969 <li>Removed non-existent functions {@code imaxabs} and {@code imaxdiv} from header 970 {@code inttypes.h}.</li> 971 <li>Fixed issue with {@code pthread_exit()} return values and {@code pthread_self()}. 972 (<a href="http://b.android.com/60686">Issue 60686</a>)</li> 973 <li>Added missing {@code mkdtemp()} function, which already exists in {@code bionic} 974 header {@code stdlib.h}.</li> 975 </ul> 976 </li> 977 <li>Fixed problem building {@code samples/gles3jni} with Clang on Android API level 11.</li> 978 <li>Fixed MCLinker to allow multiple occurrences of the following options: 979 {@code -gc-sections} and {@code --eh-frame-hdr}.</li> 980 <li>Fixed MCLinker to accept the {@code --no-warn-mismatch} option.</li> 981 <li>Modified {@code cpu-features} option to not assume all VFPv4 devices support IDIV. 982 Now this option only adds IDIV to white-listed devices, including Nexus 4. 983 (<a href="http://b.android.com/57637">Issue 57637</a>)</li> 984 <li>Fixed problem with {@code android_native_app_glue.c} erroneously logging errors on event 985 predispatch operations.</li> 986 <li>Fixed all operations on {@code gabi++} terminate and unexpected_handler to be 987 thread-safe.</li> 988 <li>Fixed several issues with Clang <code>-integrated-as</code> option so it can pass 989 tests for {@code ssax-instructions} and {@code fenv}.</li> 990 <li>Fixed GCC 4.6/4.7/4.8 compiler to pass the linker option {@code --eh-frame-hdr} even 991 for static executables. For more information, see the 992 <a href="http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00969.html">GCC patch</a>.</li> 993 <li>Fixed extra apostrophe in <code>CPU-ARCH-ABIS.html</code>. For more information, see 994 <code>NDK-DEPENDS.html</code>. (<a href="http://b.android.com/60142">Issue 60142</a>)</li> 995 <li>Fixed extra quotes in ndk-build output on Windows. 996 (<a href="http://b.android.com/60649">Issue 60649</a>)</li> 997 <li>Fixed Clang 3.3 to compile ARM's built-in, atomic operations such as 998 {@code __atomic_fetch_add}, {@code __atomic_fetch_sub}, and {@code __atomic_fetch_or}. 999 </li> 1000 <li>Fixed Clang 3.3 ICE with customized {@code vfprintf}. 1001 (<a href="http://llvm.org/bugs/show_bug.cgi?id=16344">Clang issue</a>) 1002 </li> 1003 </ul> 1004 </dd> 1005 1006 <dt>Other changes:</dt> 1007 <dd> 1008 <ul> 1009 <li>Enabled OpenMP for all GCC builds. To use this feature, add the following flags to your 1010 build settings: 1011<pre> 1012LOCAL_CFLAGS += -fopenmp 1013LOCAL_LDFLAGS += -fopenmp 1014</pre> 1015 For code examples, see {@code tests/device/test-openmp}</li> 1016 <li>Reduced the size of {@code ld.mcld} significantly (1.5MB vs. {@code ld.bfd} 3.5MB and 1017 {@code ld.gold} 7.5MB), resulting in a speed improvement of approximately 20%.</li> 1018 <li>Added <code>LOCAL_CONLYFLAGS</code> and <code>APP_CONLYFLAGS</code> to specify 1019 options applicable to C only but not C++. The existing <code>LOCAL_CFLAGS</code> 1020 and <code>APP_CFLAGS</code> are also used for C++ compilation (to save trouble of 1021 specifying most options twice), so options such as <code>-std=gnu99</code> may fail in 1022 g++ builds with a warning and clang++ builds with an error.</li> 1023 <li>Added {@code gabi++} array helper functions.</li> 1024 <li>Modified GCC builds so that all {@code libgcc.a} files are built with 1025 <code>-funwind-tables</code> to allow the stack to be unwound past previously blocked 1026 points, such as <code>__aeabi_idiv0</code>.</li> 1027 <li>Added Ingenic MXU support in MIPS GCC4.6/4.7/4.8 with new <code>-mmxu</code> 1028option.</li> 1029 <li>Extended MIPS GCC4.6/4.7/4.8 <code>-mldc1-sdc1</code> to control ldxc1/sdxc1 too</li> 1030 <li>Added crazy linker. For more information, see 1031 {@code sources/android/crazy_linker/README.TXT}.</li> 1032 <li>Fixed {@code bitmap-plasma} to draw to full screen rather than a 200x200 pixel 1033area.</li> 1034 <li>Reduced linux and darwin toolchain sizes by 25% by creating symlinks to identical files. 1035 </li> 1036 </ul> 1037 </dd> 1038 1039 </dl> 1040 </div> 1041</div> 1042 1043 1044<div class="toggle-content closed"> 1045<a name="9"></a> 1046 <p> 1047 <a href="#" onclick="return toggleContent(this)"> <img 1048 src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" 1049 >Android NDK, Revision 9</a> <em>(July 2013)</em> 1050 </p> 1051 <div class="toggle-content-toggleme"> 1052 <dl> 1053 <dt>Important changes:</dt> 1054 <dd> 1055 <ul> 1056 <li>Added support for Android 4.3 (API level 18). For more information, see 1057 {@code STABLE-APIS.html} and new code examples in {@code samples/gles3jni/README}. 1058 <li>Added headers and libraries for OpenGL ES 3.0, which is supported by Android 4.3 1059 (API level 18) and higher.</li> 1060 <li>Added GNU Compiler Collection (GCC) 4.8 compiler to the NDK. Since GCC 4.6 is still 1061 the default, you must explicitly enable this option: 1062 <ul> 1063 <li>For {@code ndk-build} builds, export {@code NDK_TOOLCHAIN_VERSION=4.8} or 1064 add it in {@code Application.mk}.</li> 1065 <li>For standalone builds, use the {@code --toolchain=} option in 1066 {@code make-standalone-toolchain.sh}, for example:<br> 1067 {@code --toolchain=arm-linux-androideabi-4.8}</li> 1068 </ul> 1069 <p class="note"><strong>Note:</strong> 1070 The {@code -Wunused-local-typedefs} option is enabled by {@code -Wall}. Be 1071 sure to add {@code __attribute__((unused))} if you use compile-time asserts like 1072 {@code sources/cxx-stl/stlport/stlport/stl/config/features.h}, line #311. For more 1073 information, see 1074 <a href="https://android-review.googlesource.com/#/c/55460">Change 55460</a></p> 1075 <p class="note"><strong>Note:</strong> 1076 In the GCC 4.7 release and later, ARM compilers generate unaligned access code by 1077 default for ARMv6 and higher build targets. You may need to add the 1078 {@code -mno-unaligned-access} build option when building for kernels that do not support 1079 this feature.</p> 1080 </li> 1081 <li>Added Clang 3.3 support. The {@code NDK_TOOLCHAIN_VERSION=clang} build option 1082 now picks Clang 3.3 by default. 1083 <p class="note"><strong>Note:</strong> 1084 Both GCC 4.4.3 and Clang 3.1 are deprecated, and will be removed from the next NDK 1085 release.</p></li> 1086 <li>Updated GNU Project Debugger (GDB) to support python 2.7.5.</li> 1087 <li>Added MCLinker to support Windows hosts. Since {@code ld.gold} 1088 is the default where available, you must add {@code -fuse-ld=mcld} in 1089 {@code LOCAL_LDFLAGS} or {@code APP_LDFLAGS} to enable MCLinker.</li> 1090 <li>Added {@code ndk-depends} tool which prints ELF library dependencies. 1091 For more information, see {@code NDK-DEPENDS.html}. 1092 (<a href="http://b.android.com/53486">Issue 53486</a>)</li> 1093 </ul> 1094 </dd> 1095 1096 <dt>Important bug fixes:</dt> 1097 <dd> 1098 <ul> 1099 <li>Fixed potential event handling issue in {@code android_native_app_glue}. 1100 (<a href="http://b.android.com/41755">Issue 41755</a>)</li> 1101 <li>Fixed ARM/GCC-4.7 build to generate sufficient alignment for NEON load and store 1102 instructions VST and VLD. 1103 (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57271">GCC Issue 57271</a>)</li> 1104 <li>Fixed a GCC 4.4.3/4.6/4.7 internal compiler error (ICE) for a constant negative index 1105 value on a string literal. 1106 (<a href="http://b.android.com/54623">Issue 54623</a>)</li> 1107 <li>Fixed GCC 4.7 segmentation fault for constant initialization with an object address. 1108 (<a href="http://b.android.com/56508">Issue 56508</a>)</li> 1109 <li>Fixed GCC 4.6 ARM segmentation fault for <code>-O</code> values when using Boost 1110 1.52.0. (<a href="http://b.android.com/42891">Issue 42891</a>) 1111 <li>Fixed {@code libc.so} and {@code libc.a} to support the {@code wait4()} function. 1112 (<a href="http://b.android.com/19854">Issue 19854</a>)</li> 1113 <li>Updated the x86 libc.so and libc.a files to include the {@code clone()} 1114 function.</li> 1115 <li>Fixed {@code LOCAL_SHORT_COMMANDS} bug where the {@code linker.list} file is 1116 empty or not used.</li> 1117 <li>Fixed GCC MIPS build on Mac OS to use CFI directives, without which 1118 {@code ld.mcld --eh-frame-hdr} fails frequently.</li> 1119 <li>Fixed Clang 3.2 X86/MIPS internal compiler error in {@code llvm/lib/VMCore/Value.cpp}. 1120 (<a href="https://android-review.googlesource.com/#/c/59021">Change 59021</a>)</li> 1121 <li>Fixed GCC 4.7 64-bit Windows assembler crash. (Error: {@code out of memory allocating 1122 4294967280 bytes}).</li> 1123 <li>Updated {@code ndk-gdb} script so that the {@code --start} or {@code --launch} actions 1124 now wait for the GNU Debug Server, so that it can more reliably hit breakpoints set 1125 early in the execution path (such as breakpoints in JNI code). 1126 (<a href="http://b.android.com/41278">Issue 41278</a>) 1127 <p class="note"><strong>Note:</strong> 1128 This feature requires jdb and produces warning about pending breakpoints. 1129 Specify the {@code --nowait} option to restore previous behavior. 1130 </p> 1131 </li> 1132 <li>Fixed GDB crash when library list is empty.</li> 1133 <li>Fixed GDB crash when using a {@code stepi} command past a {@code bx pc} or 1134 {@code blx pc} Thumb instruction. 1135 (<a href="http://b.android.com/56962">Issue 56962</a>, 1136 <a href="http://b.android.com/36149">Issue 36149</a>)</li> 1137 <li>Fixed MIPS {@code gdbserver} to look for {@code DT_MIPS_RLD_MAP} instead of 1138 {@code DT_DEBUG}. (<a href="http://b.android.com/56586">Issue 56586</a>)</li> 1139 <li>Fixed a circular dependency in the ndk-build script, for example: If A->B and 1140 B->B, then B was dropped from build. 1141 (<a href="http://b.android.com/56690">Issue 56690</a>)</li> 1142 </ul> 1143 </dd> 1144 1145 <dt>Other bug fixes:</dt> 1146 <dd> 1147 <ul> 1148 <li>Fixed the {@code ndk-build} script to enable you to specify a version of Clang as a 1149 command line option (e.g., {@code NDK_TOOLCHAIN_VERSION=clang3.2}). Previously, only 1150 specifying the version as an environment variable worked.</li> 1151 <li>Fixed gabi++ size of {@code _Unwind_Exception} to be 24 for MIPS build targets when 1152 using the Clang compiler. 1153 (<a href="https://android-review.googlesource.com/#/c/54141">Change 54141</a>)</li> 1154 <li>Fixed the {@code ndk-build} script to ensure that built libraries are actually 1155 removed from projects that include prebuilt static libraries when using the 1156 {@code ndk-build clean} command. 1157 (<a href="https://android-review.googlesource.com/#/c/54461">Change 54461</a>, 1158 <a href="https://android-review.googlesource.com/#/c/54480">Change 54480</a>)</li> 1159 <li>Modified the {@code NDK_ANALYZE=1} option to be less verbose.</li> 1160 <li>Fixed {@code gnu-libstdc++/Android.mk} to include a {@code backward/} path for builds 1161 that use backward compability. 1162 (<a href="http://b.android.com/53404">Issue 53404</a>)</li> 1163 <li>Fixed a problem where {@code stlport new} sometimes returned random values.</li> 1164 <li>Fixed {@code ndk-gdb} to match the order of {@code CPU_ABIS}, not {@code APP_ABIS}. 1165 (<a href="http://b.android.com/54033">Issue 54033</a>)</li> 1166 <li>Fixed a problem where the NDK 64-bit build on MacOSX choses the wrong path for 1167 compiler. 1168 (<a href="http://b.android.com/53769">Issue 53769</a>)</li> 1169 <li>Fixed build scripts to detect 64-bit Windows Vista. 1170 (<a href="http://b.android.com/54485">Issue 54485</a>)</li> 1171 <li>Fixed x86 {@code ntonl/swap32} error: {@code invalid 'asm': operand number 1172 out of range}. 1173 (<a href="http://b.android.com/54465">Issue 54465</a>, 1174 <a href="https://android-review.googlesource.com/#/c/57242">Change 57242</a>)</li> 1175 <li>Fixed {@code ld.gold} to merge string literals.</li> 1176 <li>Fixed {@code ld.gold} to handle large symbol alignment.</li> 1177 <li>Updated {@code ld.gold} to enable the {@code --sort-section=name} option.</li> 1178 <li>Fixed GCC 4.4.3/4.6/4.7 to suppress the {@code -export-dynamic} option for 1179 statically linked programs. GCC no longer adds an {@code .interp} section for statically 1180 linked programs.</li> 1181 <li>Fixed GCC 4.4.3 {@code stlport} compilation error about inconsistent {@code typedef} 1182 of {@code _Unwind_Control_Block}. 1183 (<a href="http://b.android.com/54426">Issue 54426</a>)</li> 1184 <li>Fixed {@code awk} scripts to handle {@code AndroidManifest.xml} files created on 1185 Windows which may contain trailing {@code \r} characters and cause build errors. 1186 (<a href="http://b.android.com/42548">Issue 42548</a>)</li> 1187 <li>Fixed {@code make-standalone-toolchain.sh} to probe the {@code prebuilts/} 1188 directory to detect if the host is 32 bit or 64 bit.</li> 1189 <li>Fixed the Clang 3.2 {@code -integrated-as} option.</li> 1190 <li>Fixed the Clang 3.2 ARM EHABI compact model {@code pr1} and {@code pr2} handler data. 1191 </li> 1192 <li>Added Clang {@code -mllvm -arm-enable-ehabi} option to fix the following Clang error: 1193 <pre>clang: for the -arm-enable-ehabi option: may only occur zero or one times!</pre> 1194 </li> 1195 <li>Fixed build failure when there is no {@code uses-sdk} element in application 1196 manifest. (<a href="http://b.android.com/57015">Issue 57015</a>)</li> 1197 </ul> 1198 1199 </dd> 1200 <dt>Other changes:</dt> 1201 <dd> 1202 <ul> 1203 <li>Header Fixes 1204 <ul> 1205 <li>Modified headers to make {@code __set_errno} an inlined function, since 1206 {@code __set_errno} in {@code errno.h} is deprecated, and {@code libc.so} no longer 1207 exports it.</li> 1208 <li>Modified {@code elf.h} to include {@code stdint.h}. 1209 (<a href="http://b.android.com/55443">Issue 55443</a>)</li> 1210 <li>Fixed {@code sys/un.h} to be included independently of other headers. 1211 (<a href="http://b.android.com/53646">Issue 53646</a>)</li> 1212 <li>Fixed all of the {@code MotionEvent_getHistorical} API family to take the 1213 {@code const AInputEvent* motion_event}. 1214 (<a href="http://b.android.com/55873">Issue 55873</a>)</li> 1215 <li>Fixed {@code malloc_usable_size} to take {@code const void*}. 1216 (<a href="http://b.android.com/55725">Issue 55725</a>)</li> 1217 <li>Fixed stdint.h to be more compatible with C99. 1218 (<a href="https://android-review.googlesource.com/#/c/46821">Change 46821</a>)</li> 1219 <li>Modified {@code wchar.h} to not redefine {@code WCHAR_MAX} and 1220 {@code WCHAR_MIN}</li> 1221 <li>Fixed {@code <inttypes.h>} declaration for pointer-related {@code PRI} and 1222 {@code SCN} macros. (<a href="http://b.android.com/57218">Issue 57218</a>)</li> 1223 <li>Changed the {@code sys/cdefs.h} header so that {@code __WCHAR_TYPE__} is 32-bit 1224 for API levels less than 9, which means that {@code wchat_t} is 32-bit for all 1225 API levels. To restore the previous behavior, define the {@code _WCHAR_IS_8BIT} 1226 boolean variable. (<a href="http://b.android.com/57267">Issue 57267</a>)</li> 1227 </ul> 1228 </li> 1229 <li>Added more formatting in NDK {@code docs/} and miscellaneous documentation fixes. 1230 </li> 1231 <li>Added support for a thin archive technique when building static libraries. 1232 (<a href="http://b.android.com/40303">Issue 40303</a>)</li> 1233 <li>Updated script {@code make-standalone-toolchain.sh} to support the {@code stlport} 1234 library in addition to {@code gnustl}, when you specify the option 1235 {@code --stl=stlport}. For more information, see {@code STANDALONE-TOOLCHAIN.html}.</li> 1236 <li>Updated the {@code make-standalone-toolchain.sh} script so that the 1237 {@code --llvm-version=} option creates the {@code $TOOLCHAIN_PREFIX-clang} and 1238 {@code $TOOLCHAIN_PREFIX-clang++} scripts in addition to {@code clang} and 1239 {@code clang++}, to avoid using the host's clang and clang++ definitions by accident. 1240 </li> 1241 <li>Added two flags to re-enable two optimizations in upstream Clang but disabled in 1242 NDK for better compatibility with code compiled by GCC: 1243 <ul> 1244 <li>Added a {@code -fcxx-missing-return-semantics} flag to re-enable <em>missing 1245return 1246 semantics</em> in Clang 3.2+. Normally, all paths should terminate with a return 1247 statement for a value-returning function. If this is not the case, clang inserts 1248 an undefined instruction (or trap in debug mode) at the path without a return 1249 statement. If you are sure your code is correct, use this flag to allow the 1250 optimizer to take advantage of the undefined behavior. If you are not sure, do not 1251 use this flag. The caller may still receive a random incorrect value, but the 1252 optimizer will not exploit it and make your code harder to debug.</li> 1253 <li>Added a {@code -fglobal-ctor-const-promotion} flag to re-enable 1254 promoting global variables with static constructor to be constants. With this flag, 1255 the global variable optimization pass of LLVM tries to evaluate the global 1256 variables with static constructors and promote them to global constants. Although 1257 this optimization is correct, it may cause some incompatability with code compiled 1258 by GCC. For example, code may do {@code const_cast} to cast the constant to mutable 1259 and modify it. In GCC, the variable is in read-write and the code is run by 1260 accident. In Clang, the const variable is in read-only memory and may cause your 1261 application to crash.</li> 1262 </ul> 1263 </li> 1264 <li>Added {@code -mldc1-sdc1} to the MIPS GCC and Clang compilers. By default, compilers 1265 align 8-byte objects properly and emit the {@code ldc1} and {@code sdc1} instructions 1266 to move them around. If your app uses a custom allocator that does not always align 1267 with a new object's 8-byte boundary in the same way as the default allocator, your app 1268 may crash due to {@code ldc1} and {@code sdc1} operations on unaligned memory. In this 1269 case, use the {@code -mno-ldc1-sdc1} flag to workaround the problem.</li> 1270 <li>Downgraded the event severity from warning to info if {@code APP_PLATFORM_LEVEL} is 1271 larger than {@code APP_MIN_PLATFORM_LEVEL}. The {@code APP_PLATFORM_LEVEL} may be lower 1272 than {@code APP_PLATFORM} in {@code jni/Application.mk} because the NDK does not have 1273 headers for all levels. In this case, the actual level is shifted downwards. The 1274 {@code APP_MIN_PLATFORM_LEVEL} is specified by the {@code android:minSdkVersion} in 1275 your application's manifest. 1276 (<a href="http://b.android.com/39752">Issue 39752</a>)</li> 1277 <li>Added the {@code android_getCpuIdArm()} and {@code android_setCpuArm()} methods to 1278 {@code cpu-features.c}. This addition enables easier retrieval of the ARM CPUID 1279 information. (<a href="http://b.android.com/53689">Issue 53689</a>)</li> 1280 <li>Modified {@code ndk-build} to use GCC 4.7's {@code as/ld} for Clang compiling. 1281 <p class="note"><strong>Note:</strong> 1282 In GCC 4.7, {@code monotonic_clock} and {@code is_monotonic} have been renamed to 1283 {@code steady_clock} and {@code is_steady}, respectively.</p></li> 1284 <li>Added the following new warnings to the {@code ndk-build} script: 1285 <ul> 1286 <li>Added warnings if {@code LOCAL_LDLIBS/LDFLAGS} are used in static library 1287 modules.</li> 1288 <li>Added a warning if a configuration has no module to build.</li> 1289 <li>Added a warning for non-system libraries being used in 1290 {@code LOCAL_LDLIBS/LDFLAGS} of a shared library or executable modules.</li> 1291 </ul> 1292 </li> 1293 <li>Updated build scripts, so that if {@code APP_MODULES} is not defined and only static 1294 libraries are listed in {@code Android.mk}, the script force-builds all of them. 1295 (<a href="http://b.android.com/53502">Issue 53502</a>)</li> 1296 <li>Updated {@code ndk-build} to support absolute paths in {@code LOCAL_SRC_FILES}.</li> 1297 <li>Removed the {@code *-gdbtui} executables, which are duplicates of the {@code *-gdb} 1298 executables with the {@code -tui} option enabled.</li> 1299 <li>Updated the build scripts to warn you when the Edison Design Group (EDG) compiler 1300 front-end turns {@code _STLP_HAS_INCLUDE_NEXT} back on. 1301 (<a href="http://b.android.com/53646">Issue 53646</a>)</li> 1302 <li>Added the environment variable {@code NDK_LIBS_OUT} to allow overriding of the 1303 path for {@code libraries/gdbserver} from the default {@code $PROJECT/libs}. 1304 For more information, see {@code OVERVIEW.html}.</li> 1305 <li>Changed ndk-build script defaults to compile code with format string protection 1306 {@code -Wformat -Werror=format-security}. You may set 1307 {@code LOCAL_DISABLE_FORMAT_STRING_CHECKS=true} to disable it. 1308 For more information, see {@code ANDROID-MK.html}</li> 1309 <li>Added STL pretty-print support in {@code ndk-gdb-py}. For more information, see 1310 {@code NDK-GDB.html}.</li> 1311 <li>Added tests based on the googletest frameworks.</li> 1312 <li>Added a notification to the toolchain build script that warns you if the current shell 1313 is not {@code bash}.</li> 1314 </ul> 1315 </dd> 1316 </dl> 1317 </div> 1318</div> 1319 1320 1321<div class="toggle-content closed"> 1322<a name="lower"></a> 1323 <p><a href="#" onclick="return toggleContent(this)"> 1324 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 1325 alt="">Android NDK, Revision 8e</a> <em>(March 2013)</em> 1326 </p> 1327 1328 <div class="toggle-content-toggleme"> 1329 <dl> 1330 <dt>Important changes:</dt> 1331 <dd> 1332 <ul> 1333 <li>Added 64-bit host toolchain set (package name suffix {@code *-x86_64.*}). For more 1334 information, see {@code CHANGES.HTML} and {@code NDK-BUILD.html}.</li> 1335 <li>Added Clang 3.2 compiler. GCC 4.6 is still the default. For information on using the 1336 Clang compiler, see {@code CHANGES.HTML}.</li> 1337 <li>Added static code analyzer for Linux/MacOSX hosts. For information on using the 1338 analyzer, see {@code CHANGES.HTML}.</li> 1339 <li>Added MCLinker for Linux/MacOSX hosts as an experimental feature. The {@code ld.gold} 1340 linker is the default where available, so you must explicitly enable it. For more 1341 information, see {@code CHANGES.HTML}.</li> 1342 <li>Updated ndk-build to use topological sort for module dependencies, which means the 1343 build automatically sorts out the order of libraries specified in 1344 {@code LOCAL_STATIC_LIBRARIES}, {@code LOCAL_WHOLE_STATIC_LIBRARIES} and 1345 {@code LOCAL_SHARED_LIBRARIES}. For more information, see {@code CHANGES.HTML}. 1346 (<a href="http://b.android.com/39378">Issue 39378</a>)</li> 1347 </ul> 1348 </dd> 1349 1350 <dt>Important bug fixes:</dt> 1351 <dd> 1352 <ul> 1353 <li>Fixed build script to build all toolchains in {@code -O2}. Toolchains in previous 1354 releases were incorrectly built without optimization.</li> 1355 <li>Fixed build script which unconditionally builds Clang/llvm for MacOSX in 64-bit.</li> 1356 <li>Fixed GCC 4.6/4.7 internal compiler error: 1357 {@code gen_thumb_movhi_clobber at config/arm/arm.md:5832}. 1358 (<a href="http://b.android.com/52732">Issue 52732</a>)</li> 1359 <li>Fixed build problem where GCC/ARM 4.6/4.7 fails to link code using 64-bit atomic 1360 built-in functions. 1361 (<a href="http://b.android.com/41297">Issue 41297</a>)</li> 1362 <li>Fixed GCC 4.7 linker DIV usage mismatch errors. 1363 (<a href="http://sourceware.org/ml/binutils/2012-12/msg00202.html">Sourceware Issue</a>) 1364 <li>Fixed GCC 4.7 internal compiler error {@code build_data_member_initialization, at 1365 cp/semantics.c:5790}.</li> 1366 <li>Fixed GCC 4.7 internal compiler error {@code redirect_eh_edge_1, at tree-eh.c:2214}. 1367 (<a href="http://b.android.com/52909">Issue 52909</a>)</li> 1368 <li>Fixed a GCC 4.7 segfault. 1369 (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55245">GCC Issue</a>)</li> 1370 <li>Fixed {@code <chrono>} clock resolution and enabled {@code steady_clock}. 1371 (<a href="http://b.android.com/39680">Issue 39680</a>)</li> 1372 <li>Fixed toolchain to enable {@code _GLIBCXX_HAS_GTHREADS} for GCC 4.7 libstdc++. 1373 (<a href="http://b.android.com/41770">Issue 41770</a>, 1374 <a href="http://b.android.com/41859">Issue 41859</a>)</li> 1375 <li>Fixed problem with the X86 MXX/SSE code failing to link due to missing 1376 {@code posix_memalign}. 1377 (<a href="https://android-review.googlesource.com/#/c/51872">Change 51872</a>)</li> 1378 <li>Fixed GCC4.7/X86 segmentation fault in {@code i386.c}, function 1379 {@code distance_non_agu_define_in_bb()}. 1380 (<a href="https://android-review.googlesource.com/#/c/50383">Change 50383</a>)</li> 1381 <li>Fixed GCC4.7/X86 to restore earlier {@code cmov} behavior. 1382 (<a href="http://gcc.gnu.org/viewcvs?view=revision&revision=193554">GCC Issue</a>)</li> 1383 <li>Fixed handling NULL return value of {@code setlocale()} in libstdc++/GCC4.7. 1384 (<a href="http://b.android.com/46718">Issue 46718</a>) 1385 <li>Fixed {@code ld.gold} runtime undefined reference to {@code __exidx_start} and 1386 {@code __exidx_start_end}. 1387 (<a href="https://android-review.googlesource.com/#/c/52134">Change 52134</a>)</li> 1388 <li>Fixed Clang 3.1 internal compiler error when using Eigen library. 1389 (<a href="http://b.android.com/41246">Issue 41246</a>)</li> 1390 <li>Fixed Clang 3.1 internal compiler error including {@code <chrono>} in C++11 1391mode. 1392 (<a href="http://b.android.com/39600">Issue 39600</a>)</li> 1393 <li>Fixed Clang 3.1 internal compiler error when generating object code for a method 1394 call to a uniform initialized {@code rvalue}. 1395 (<a href="http://b.android.com/41387">Issue 41387</a>)</li> 1396 <li>Fixed Clang 3.1/X86 stack realignment. 1397 (<a href="https://android-review.googlesource.com/#/c/52154">Change 52154</a>)</li> 1398 <li>Fixed problem with GNU Debugger (GDB) SIGILL when debugging on Android 4.1.2. 1399 (<a href="http://b.android.com/40941">Issue 40941</a>)</li> 1400 <li>Fixed problem where GDB cannot set {@code source:line} breakpoints when symbols 1401contain 1402 long, indirect file paths. 1403 (<a href="http://b.android.com/42448">Issue 42448</a>)</li> 1404 <li>Fixed GDB {@code read_program_header} for MIPS PIE executables. 1405 (<a href="https://android-review.googlesource.com/#/c/49592">Change 49592</a>)</li> 1406 <li>Fixed {@code STLport} segmentation fault in {@code uncaught_exception()}. 1407 (<a href="https://android-review.googlesource.com/#/c/50236">Change 50236</a>)</li> 1408 <li>Fixed {@code STLport} bus error in exception handling due to unaligned access of 1409 {@code DW_EH_PE_udata2}, {@code DW_EH_PE_udata4}, and {@code DW_EH_PE_udata8}.</li> 1410 <li>Fixed Gabi++ infinite recursion problem with {@code nothrow new[]} operator. 1411 (<a href="http://b.android.com/52833">Issue 52833</a>)</li> 1412 <li>Fixed Gabi++ wrong offset to exception handler pointer. 1413 (<a href="https://android-review.googlesource.com/#/c/53446">Change 53446</a>)</li> 1414 <li>Removed Gabi++ redundant free on exception object 1415 (<a href="https://android-review.googlesource.com/#/c/53447">Change 53447</a>)</li> 1416 </ul> 1417 </dd> 1418 1419 <dt>Other bug fixes:</dt> 1420 <dd> 1421 <ul> 1422 <li>Fixed NDK headers: 1423 <ul> 1424 <li>Removed redundant definitions of {@code size_t}, {@code ssize_t}, and 1425 {@code ptrdiff_t}.</li> 1426 <li>Fixed MIPS and ARM {@code fenv.h} header.</li> 1427 <li>Fixed {@code stddef.h} to not redefine {@code offsetof} since it already exists 1428 in the toolchain.</li> 1429 <li>Fixed {@code elf.h} to contain {@code Elf32_auxv_t} and {@code Elf64_auxv_t}. 1430 (<a href="http://b.android.com/38441">Issue 38441</a>) 1431 </li> 1432 <li>Fixed the {@code #ifdef} C++ definitions in the 1433 {@code OpenSLES_AndroidConfiguration.h} header file. 1434 (<a href="http://b.android.com/53163">Issue 53163</a>) 1435 </li> 1436 </ul> 1437 </li> 1438 <li>Fixed {@code STLport} to abort after out of memory error instead of silently exiting. 1439 </li> 1440 <li>Fixed system and Gabi++ headers to be able to compile with API level 8 and lower.</li> 1441 <li>Fixed {@code cpufeatures} to not parse {@code /proc/self/auxv}. 1442 (<a href="http://b.android.com/43055">Issue 43055</a>)</li> 1443 <li>Fixed {@code ld.gold} to not depend on host libstdc++ and on Windows platforms, 1444 to not depend on the {@code libgcc_sjlj_1.dll} library.</li> 1445 <li>Fixed Clang 3.1 which emits inconsistent register list in {@code .vsave} and fails 1446 assembler. 1447 (<a href="https://android-review.googlesource.com/#/c/49930">Change 49930</a>)</li> 1448 <li>Fixed Clang 3.1 to be able to compile libgabi++ and pass the {@code test-stlport} 1449 tests for MIPS build targets. 1450 (<a href="https://android-review.googlesource.com/#/c/51961">Change 51961</a>)</li> 1451 <li>Fixed Clang 3.1 to only enable exception by default for C++, not for C.</li> 1452 <li>Fixed several issues in Clang 3.1 to pass most GNU exception tests.</li> 1453 <li>Fixed scripts {@code clang} and {@code clang++} in standalone NDK compiler to detect 1454 {@code -cc1} and to not specify {@code -target} when found.</li> 1455 <li>Fixed {@code ndk-build} to observe {@code NDK_APP_OUT} set in {@code Application.mk}. 1456 </li> 1457 <li>Fixed X86 {@code libc.so} and {@code lib.a} which were missing the {@code sigsetjmp} 1458 and {@code siglongjmp} functions already declared in {@code setjmp.h}. 1459 (<a href="http://b.android.com/19851">Issue 19851</a>)</li> 1460 <li>Patched GCC 4.4.3/4.6/4.7 libstdc++ to work with Clang in C++ 11. 1461 (<a href="http://clang.llvm.org/cxx_status.html">Clang Issue</a>)</li> 1462 <li>Fixed cygwin path in argument passed to {@code HOST_AWK}.</li> 1463 <li>Fixed {@code ndk-build} script warning in windows when running from project's JNI 1464 directory. 1465 (<a href="http://b.android.com/40192">Issue 40192</a>)</li> 1466 <li>Fixed problem where the {@code ndk-build} script does not build if makefile has 1467 trailing whitespace in the {@code LOCAL_PATH} definition. 1468 (<a href="http://b.android.com/42841">Issue 42841</a>)</li> 1469 </ul> 1470 </dd> 1471 1472 <dt>Other changes:</dt> 1473 <dd> 1474 <ul> 1475 <li>Enabled threading support in GCC/MIPS toolchain.</li> 1476 <li>Updated GCC exception handling helpers {@code __cxa_begin_cleanup} and 1477 {@code __cxa_type_match} to have <em>default</em> visibility from the previous 1478 <em>hidden</em> visibility in GNU libstdc++. For more information, see 1479 {@code CHANGES.HTML}.</li> 1480 <li>Updated build scripts so that Gabi++ and STLport static libraries are now built with 1481 hidden visibility except for exception handling helpers.</li> 1482 <li>Updated build so that {@code STLport} is built for ARM in Thumb mode.</li> 1483 <li>Added support for {@code std::set_new_handler} in Gabi++. 1484 (<a href="http://b.android.com/52805">Issue 52805</a>)</li> 1485 <li>Enabled {@code FUTEX} system call in GNU libstdc++.</li> 1486 <li>Updated {@code ndk-build} so that it no longer copies prebuilt static library to 1487 a project's {@code obj/local/<abi>/} directory. 1488 (<a href="http://b.android.com/40302">Issue 40302</a>)</li> 1489 <li>Removed {@code __ARM_ARCH_5*__} from ARM {@code toolchains/*/setup.mk} script. 1490 (<a href="http://b.android.com/21132">Issue 21132</a>)</li> 1491 <li>Built additional GNU libstdc++ libraries in thumb for ARM.</li> 1492 <li>Enabled MIPS floating-point {@code madd/msub/nmadd/nmsub/recip/rsqrt} 1493 instructions with 32-bit FPU.</li> 1494 <li>Enabled graphite loop optimizer in GCC 4.6 and 4.7 to allow more optimizations: 1495 {@code -fgraphite}, {@code -fgraphite-identity}, {@code -floop-block}, {@code 1496-floop-flatten}, 1497 {@code -floop-interchange}, {@code -floop-strip-mine}, {@code -floop-parallelize-all}, 1498 and {@code -ftree-loop-linear}. 1499 (<a href="http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html">info</a>)</li> 1500 <li>Enabled {@code polly} for Clang 3.1 on Linux and Max OS X 32-bit hosts which analyzes 1501 and optimizes memory access. (<a href="http://polly.llvm.org">info</a>)</li> 1502 <li>Enabled {@code -flto} in GCC 4.7, 4.6, Clang 3.2 and Clang 3.1 on linux (Clang LTO 1503 via LLVMgold.so). MIPS compiler targets are not supported because {@code ld.gold} 1504 is not available.</li> 1505 <li>Enabled {@code --plugin} and {@code --plugin-opt} for {@code ld.gold} in GCC 4.6/4.7. 1506 </li> 1507 <li>Enabled {@code --text-reorder} for {@code ld.gold} in GCC 4.7.</li> 1508 <li>Configured GNU libstdc++ with {@code _GLIBCXX_USE_C99_MATH} which undefines the 1509 {@code isinf} script in the bionic header. For more information, see 1510 {@code CHANGES.html}.</li> 1511 <li>Added {@code APP_LDFLAGS} to the build scripts. For more information, see 1512 {@code ANDROID-MK.html}.</li> 1513 <li>Updated build scripts to allow {@code NDK_LOG=0} to disable the {@code NDK_LOG}.</li> 1514 <li>Updated build scripts to allow {@code NDK_HOST_32BIT=0} to disable the host developer 1515 environment 32-bit toolchain.</li> 1516 <li>Changed the default GCC/X86 flags {@code -march=} and {@code -mtune=} from 1517 {@code pentiumpro} and {@code generic} to {@code i686} and {@code atom}.</li> 1518 <li>Enhanced toolchain build scripts: 1519 <ul> 1520 <li>Fixed a race condition in {@code build-gcc.sh} for the {@code mingw} build type 1521 which was preventing a significant amount of parallel build processing.</li> 1522 <li>Updated {@code build-gabi++.sh} and {@code build-stlport.sh} so they can now run 1523 from the NDK package. 1524 (<a href="http://b.android.com/52835">Issue 52835</a>) 1525 </li> 1526 <li>Fixed {@code run-tests.sh} in the {@code MSys} utilities collection.</li> 1527 <li>Improved 64-bit host toolchain and Canadian Cross build support.</li> 1528 <li>Updated {@code build-mingw64-toolchain.sh} script to more recent version.</li> 1529 <li>Added option to build {@code libgnustl_static.a} and {@code stlport_static.a} 1530 without hidden visibility.</li> 1531 </ul> 1532 </li> 1533 </ul> 1534 1535 </dd> 1536 </dl> 1537 </div> 1538</div> 1539 1540 1541<div class="toggle-content closed"> 1542 <p><a href="#" onclick="return toggleContent(this)"> 1543 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 1544 alt="">Android NDK, Revision 8d</a> <em>(December 2012)</em> 1545 </p> 1546 1547 <div class="toggle-content-toggleme"> 1548 <dl> 1549 <dt>Important changes:</dt> 1550 <dd> 1551 <ul> 1552 <li>Added the GNU Compiler Collection (GCC) 4.7 compiler to the NDK. The GCC 4.6 compiler 1553 is still the default, so you must to explicitly enable the new version as follows: 1554 <ul> 1555 <li>For {@code ndk-build}, export the {@code NDK_TOOLCHAIN_VERSION=4.7} variable 1556 <em>or</em> add it to {@code Application.mk}.</li> 1557 <li>For standalone builds, add the {@code --toolchain=} option to 1558 {@code make-standalone-toolchain.sh}, for example: 1559 <pre>--toolchain=arm-linux-androideabi-4.7</pre></li> 1560 </ul> 1561 <p class="note"> 1562 <strong>Note:</strong> This feature is experimental. Please try it and 1563 <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p> 1564 </li> 1565 <li>Added {@code stlport} exception support via gabi++. Note that the new gabi++ 1566 depends on {@code dlopen} and related code, meaning that: 1567 <ul> 1568 <li>You can no longer build a <em>static</em> executable using the {@code -static} 1569 option or include {@code libstlport_static.a} using 1570 {@code APP_STL := stlport_static}. (You can still use the {@code -static} option 1571 with a standalone toolchain.) Compiling a <em>dynamic</em> executable using 1572 {@code include $(BUILD_EXECUTABLE)} continues to work because the compiler 1573 automatically adds the {@code -ldl} option.</li> 1574 <li>If your project links using {@code -nostdlib} and {-Wl,--no-undefined}, you 1575 must manually include the {@code -ldl} option.</li> 1576 </ul> 1577 For more information, see {@code CPLUSPLUS-SUPPORT.html}. 1578 1579 <p class="note"> 1580 <strong>Note:</strong> This feature is experimental and works better with the GCC 1581 4.6/4.7 compilers than with GCC 4.4.3 or Clang 3.1. Please try it and 1582 <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p> 1583 </li> 1584 <li>Added a {@code -mstack-protector-guard=} option for x86 to choose between a 1585 <em>global</em> default path which is compatible with older Android C library (bionic) 1586 and a new <em>tls</em> path (%gs:20) for {@code -fstack-protector}, 1587 {@code -fstack-protector-all} and {@code -fstack-protector-strong} using the GCC 4.6 1588 and higher compilers. 1589 1590 <p class="note"> 1591 <strong>Note:</strong> The {@code -mstack-protector-guard} setting itself does not 1592 enable any {@code -fstack-protector*} options.</p> 1593 </li> 1594 <li>Added {@code android_setCpu()} function to 1595 {@code sources/android/cpufeatures/cpu-features.c} for use when auto-detection via 1596 {@code /proc} is not possible in Android 4.1 and higher. 1597 (<a href="http://code.google.com/p/chromium/issues/detail?id=164154">Chromium Issue 1598 164154</a>)</li> 1599 </ul> 1600 </dd> 1601 1602 <dt>Important bug fixes:</dt> 1603 <dd> 1604 <ul> 1605 <li>Fixed unnecessary rebuild of object files when using the {@code ndk-build} script. 1606 (<a href="http://b.android.com/39810">Issue 39810</a>)</li> 1607 <li>Fixed a linker failure with the NDK 8c release for Mac OS X 10.6.x that produced the 1608 following error: 1609 <pre> 1610dyld: lazy symbol binding failed: Symbol not found: _memmem 1611Referenced from: ...../arm-linux-androideabi/bin/ld 1612Expected in: /usr/lib/libSystem.B.dylib</pre> 1613 This problem was caused by building on Mac OS X 10.7, which produced binaries that were 1614 not compatible with Mac OS 10.6.x and the NDK. 1615 </li> 1616 <li>Removed the {@code -x c++} options from the Clang++ standalone build script. 1617 (<a href="http://b.android.com/39089">Issue 39089</a>)</li> 1618 <li>Fixed issues using the {@code NDK_TOOLCHAIN_VERSION=clang3.1} option in Cygwin. 1619 (<a href="http://b.android.com/39585">Issue 39585</a>)</li> 1620 <li>Fixed the {@code make-standalone-toolchain.sh} script to allow generation of a 1621 standalone toolchain using the Cygwin or MinGW environments. The resulting toolchain 1622 can be used in Cygwin, MingGW or CMD.exe environments. 1623 (<a href="http://b.android.com/39915">Issue 39915</a>, 1624 <a href="http://b.android.com/39585">Issue 39585</a>)</li> 1625 <li>Added missing {@code SL_IID_ANDROIDBUFFERQUEUESOURCE} option in android-14 builds for 1626 ARM and X86. 1627 (<a href="http://b.android.com/40625">Issue 40625</a>)</li> 1628 <li>Fixed x86 CPU detection for the {@code ANDROID_CPU_X86_FEATURE_MOVBE} feature. 1629 (<a href="http://b.android.com/39317">Issue 39317</a>)</li> 1630 <li>Fixed an issue preventing the Standard Template Library (STL) from using C++ 1631 sources that do not have a {@code .cpp} file extension.</li> 1632 <li>Fixed GCC 4.6 ARM internal compiler error <em>at reload1.c:1061</em>. 1633 (<a href="http://b.android.com/20862">Issue 20862</a>)</li> 1634 <li>Fixed GCC 4.4.3 ARM internal compiler error <em>at emit-rtl.c:1954</em>. 1635 (<a href="http://b.android.com/22336">Issue 22336</a>)</li> 1636 <li>Fixed GCC 4.4.3 ARM internal compiler error <em>at postreload.c:396</em>. 1637 (<a href="http://b.android.com/22345">Issue 22345</a>)</li> 1638 <li>Fixed problem with GCC 4.6/4.7 skipping lambda functions. 1639 (<a href="http://b.android.com/35933">Issue 35933</a>)</li> 1640 </ul> 1641 </dd> 1642 1643 <dt>Other bug fixes:</dt> 1644 <dd> 1645 <ul> 1646 <li>NDK header file fixes: 1647 <ul> 1648 <li>Fixed {@code __WINT_TYPE__} and {@code wint_t} to be the same type.</li> 1649 <li>Corrected typo in {@code android/bitmap.h}. 1650 (<a href="http://b.android.com/15134">Issue 15134</a>) 1651 </li> 1652 <li>Corrected typo in {@code errno.h}.</li> 1653 <li>Added check for the presence of {@code __STDC_VERSION__} in {@code sys/cdefs.h}. 1654 (<a href="http://b.android.com/14627">Issue 14627</a>) 1655 </li> 1656 <li>Reorganized headers in {@code byteswap.h} and {@code dirent.h}.</li> 1657 <li>Fixed {@code limits.h} to include {@code page.h} which provides {@code PAGE_SIZE} 1658 settings. 1659 (<a href="http://b.android.com/39983">Issue 39983</a>) 1660 </li> 1661 <li>Fixed return type of {@code glGetAttribLocation()} and 1662 {@code glGetUniformLocation()} from {@code int} to {@code GLint}.</li> 1663 <li>Fixed {@code __BYTE_ORDER} constant for x86 builds. 1664 (<a href="http://b.android.com/39824">Issue 39824</a>) 1665 </li> 1666 </ul> 1667 </li> 1668 <li>Fixed {@code ndk-build} script to not overwrite {@code -Os} with {@code -O2} for ARM 1669 builds.</li> 1670 <li>Fixed build scripts to allow overwriting of {@code HOST_AWK}, {@code HOST_SED}, and 1671 {@code HOST_MAKE} settings.</li> 1672 <li>Fixed issue for {@code ld.gold} on {@code fsck_msdos} builds linking objects built by 1673 the Intel C/C++ compiler (ICC).</li> 1674 <li>Fixed ARM EHABI support in Clang to conform to specifications.</li> 1675 <li>Fixed GNU Debugger (GDB) to shorten the time spent on walking the target's link map 1676 during {@code solib} events. 1677 (<a href="http://b.android.com/38402">Issue 38402</a>)</li> 1678 <li>Fixed missing {@code libgcc.a} file when linking shared libraries.</li> 1679 </ul> 1680 </dd> 1681 1682 <dt>Other changes:</dt> 1683 <dd> 1684 <ul> 1685 <li>Backported 64-bit built-in atomic functions for ARM to GCC 4.6.</li> 1686 <li>Added documentation for audio output latency, along with other documentation and 1687 fixes.</li> 1688 <li>Fixed debug builds with Clang so that non-void functions now raise a {@code SIGILL} 1689 signal for paths without a return statement.</li> 1690 <li>Updated {@code make-standalone-toolchain.sh} to accept the suffix {@code -clang3.1} 1691 which is equivalent to adding {@code --llvm-version=3.1} to the GCC 4.6 toolchain.</li> 1692 <li>Updated GCC and Clang bug report URL to: 1693 <a 1694href="http://source.android.com/source/report-bugs.html">http://source.android.com/source/report-bug 1695s.html</a></li> 1696 <li>Added ARM ELF support to {@code llvm-objdump}.</li> 1697 <li>Suppressed <em>treating c input as c++</em> warning for Clang builds.</li> 1698 <li>Updated build so that only the 32-bit version of {@code libiberty.a} is built and 1699 placed in {@code lib32/}.</li> 1700 </ul> 1701 </dd> 1702 </dl> 1703 </div> 1704</div> 1705 1706 1707<div class="toggle-content closed"> 1708 <p><a href="#" onclick="return toggleContent(this)"> 1709 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 1710 alt="">Android NDK, Revision 8c</a> <em>(November 2012)</em> 1711 </p> 1712 1713 <div class="toggle-content-toggleme"> 1714 <dl> 1715 <dt>Important changes:</dt> 1716 1717 <dd> 1718 <ul> 1719 <li>Added the Clang 3.1 compiler to the NDK. The GNU Compiler Collection (GCC) 4.6 is 1720 still the default, so you must explicitly enable the Clang compiler option as follows: 1721 <ul> 1722 <li>For {@code ndk-build}, export {@code NDK_TOOLCHAIN_VERSION=clang3.1} <em>or</em> 1723 add this environment variable setting to {@code Application.mk}.</li> 1724 <li>For standalone builds, add {@code --llvm-version=3.1} to 1725 {@code make-standalone-toolchain.sh} and replace {@code CC} and {@code CXX} in your 1726 makefile with {@code <tool-path>/bin/clang} and 1727 {@code <tool-path>/bin/clang++}. See {@code STANDALONE-TOOLCHAIN.html} for 1728 details.</li> 1729 </ul> 1730 <p class="note"><strong>Note:</strong> This feature is experimental. Please try it and 1731 <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p></li> 1732 <li>Added Gold linker {@code ld.gold} for the Windows toolchain. Gold linker is also the 1733 default for ARM and X86 on all hosts. You may override it to use the {@code ld.bfd} 1734 linker by adding {@code LOCAL_LDFLAGS += -fuse-ld=bfd} to {@code Android.mk}, or by 1735passing 1736 {@code -fuse-ld=bfd} to the g++/clang++ command line that does the linking.</li> 1737 <li>Added checks for spaces in the NDK path to the {@code ndk-build[.cmd]} and 1738 {@code ndk-gdb} scripts, to prevent build errors that are difficult to diagnose.</li> 1739 <li>Made the following changes to API level handling: 1740 <ul> 1741 <li>Modified build logic so that projects that specify {@code android-10} through 1742 {@code android-13} in {@code APP_PLATFORM}, {@code project.properties} or 1743 {@code default.properties} link against {@code android-9} instead of 1744 {@code android-14}. 1745 <li>Updated build so that executables using android-16 (Jelly Bean) or higher are 1746 compiled with the {@code -fPIE} option for position-independent executables (PIE). 1747 A new {@code APP_PIE} option allows you to control this behavior. See {@code 1748 APPLICATION-MK.html} for details. 1749 <p class="note"> 1750 <strong>Note:</strong> All API levels above 14 still link against {@code 1751 platforms/android-14} and no new {@code platforms/android-N} have been added. 1752 </p></li> 1753 <li>Modified {@code ndk-build} to provide warnings if the adjusted API level is larger 1754 than {@code android:minSdkVersion} in the project's {@code AndroidManifest.xml}.</li> 1755 </ul> 1756 </li> 1757 <li>Updated the {@code cpu-features} helper library to include more ARM-specific features. 1758 See {@code sources/android/cpufeatures/cpu-features.h} for details.</li> 1759 <li>Modified the long double on the X86 platform to be 8 bytes. This data type is now the 1760 same size as a double, but is still treated as a distinct type.</li> 1761 <li>Updated build for {@code APP_ABI=armeabi-v7a}: 1762 <ul> 1763 <li>Modified this build type to pass the {@code -march=armv7-a} parameter 1764 to the linker. This change ensures that v7-specific libraries and {@code crt*.o} are 1765 linked correctly.</li> 1766 <li>Added {@code -mfpu=vfpv3-d16} to {@code ndk-build} instead of the 1767 {@code -mfpu=vfp} option used in previous releases.</li> 1768 </ul> 1769 </li> 1770 </ul> 1771 </dd> 1772 </dl> 1773 1774 <dl> 1775 <dt>Important bug fixes:</dt> 1776 1777 <dd> 1778 <ul> 1779 <li>Fixed an issue where running {@code make-standalone-toolchain.sh} with root privileges 1780 resulted in the stand alone tool chain being inaccessible to some users. 1781 (<a href="http://b.android.com/35279">Issue 35279</a>) 1782 <ul> 1783 <li>All files and executables in the NDK release package are set to have read and 1784 execute permissions for all.</li> 1785 <li>The ownership/group of {@code libstdc++.a} is now preserved when copied.</li> 1786 </ul> 1787 </li> 1788 <li>Removed redundant {@code \r} from Windows prebuilt {@code echo.exe}. The redundant 1789 {@code \r} caused {@code gdb.setup} to fail in the GNU Debugger (GDB) because it 1790 incorrectly became part of the path. 1791 (<a href="http://b.android.com/36054">Issue 36054</a>)</li> 1792 <li>Fixed Windows parallel builds that sometimes failed due to timing issues in the 1793 {@code host-mkdir} implementation. 1794 (<a href="http://b.android.com/25875">Issue 25875</a>)</li> 1795 <li>Fixed GCC 4.4.3 GNU {@code libstdc++} to <em>not</em> merge {@code typeinfo} names by 1796 default. For more details, see 1797 {@code toolchain repo gcc/gcc-4.4.3/libstdc++-v3/libsupc++/typeinfo}. 1798 (<a href="http://b.android.com/22165">Issue 22165</a>)</li> 1799 <li>Fixed problem on {@code null} context in GCC 4.6 1800 {@code cp/mangle.c::write_unscoped_name}, where GCC may crash when the context is 1801 {@code null} and dereferenced in {@code TREE_CODE}.</li> 1802 <li>Fixed GCC 4.4.3 crashes on ARM NEON-specific type definitions for floats. 1803 (<a href="http://b.android.com/34613">Issue 34613</a>)</li> 1804 <li>Fixed the {@code STLport} internal {@code _IteWrapper::operator*()} implementation 1805 where a stale stack location holding the dereferenced value was returned and caused 1806 runtime crashes. 1807 (<a href="http://b.android.com/38630">Issue 38630</a>)</li> 1808 1809 <li>ARM-specific fixes: 1810 <ul> 1811 <li>Fixed ARM GCC 4.4.3/4.6 {@code g++} to not warn that the <em>mangling of 1812 <va_list> was changed in GCC 4.4</em>. The workaround using the 1813 {@code -Wno-psabi} switch to avoid this warning is no longer required.</li> 1814 <li>Fixed an issue when a project with {@code .arm} or {@code .neon} suffixes in 1815 {@code LOCAL_SRC_FILES} also used {@code APP_STL}. With {@code APP_STL}, the 1816 {@code ndk-build} script searches for C++ files in {@code LOCAL_SRC_FILES} before 1817 adding STL {@code header/lib} paths to compilation. Modified {@code ndk-build} to 1818 filter out {@code .arm} and {@code .neon} suffixes before the search, otherwise items 1819 in {@code LOCAL_SRC_FILES} like {@code myfile.cpp.arm.neon} won't be compiled as C++ 1820 code.</li> 1821 <li>Fixed {@code binutils-2.21/ld.bfd} to be capable of linking object from older 1822 binutils without {@code tag_FP_arch}, which was producing <em>assertion fail</em> 1823 error messages in GNU Binutils. 1824 (<a href="http://b.android.com/35209">Issue 35209</a>) 1825 </li> 1826 <li>Removed <em>Unknown EABI object attribute 44</em> warning when 1827 {@code binutils-2.19/ld} links prebuilt object by newer {@code binutils-2.21}</li> 1828 <li>Fixed an issue in GNU {@code stdc++} compilation with both {@code -mthumb} and 1829 {@code -march=armv7-a}, by modifying {@code make-standalone-toolchain.sh} to populate 1830 {@code headers/libs} in sub-directory {@code armv7-a/thumb}. 1831 (<a href="http://b.android.com/35616">Issue 35616</a>) 1832 </li> 1833 <li>Fixed <em>unresolvable R_ARM_THM_CALL relocation</em> error. 1834 (<a href="http://b.android.com/35342">Issue 35342</a>) 1835 </li> 1836 <li>Fixed internal compiler error at {@code reload1.c:3633}, caused by the ARM 1837 back-end expecting the wrong operand type when sign-extend from {@code char}. 1838 (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50099">GCC Issue 50099</a>)</li> 1839 <li>Fixed internal compiler error with negative shift amount. 1840 (<a href="http://gcc.gnu.org/ml/gcc-patches/2011-10/msg00594.html">GCC Issue</a>)</li> 1841 </ul> 1842 </li> 1843 1844 <li>Fixed {@code -fstack-protector} for X86, which is also the default for the 1845 {@code ndk-build} x86 ABI target.</li> 1846 1847 <li>MIPS-specific fixes: 1848 <ul> 1849 <li>Fixed {@code STLport} endian-ness by setting {@code _STLP_LITTLE_ENDIAN} to 1 when 1850 compiling MIPS {@code libstlport_*}.</li> 1851 <li>Fixed GCC {@code __builtin_unreachable} issue when compiling LLVM. 1852 (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54369">GCC Issue 54369</a>)</li> 1853 <li>Backported fix for {@code cc1} compile process consuming 100% CPU. 1854 (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50380">GCC Issue 50380</a>)</li> 1855 </ul> 1856 </li> 1857 1858 <li>GNU Debugger-specific fixes: 1859 <ul> 1860 <li>Disabled Python support in gdb-7.x at build, otherwise the gdb-7.x configure 1861 function may pick up whatever Python version is available on the host and build 1862 {@code gdb} with a hard-wired dependency on a specific version of Python. 1863 (<a href="http://b.android.com/36120">Issue 36120</a>) 1864 </li> 1865 <li>Fixed {@code ndk-gdb} when {@code APP_ABI} contains {@code all} and matchs none 1866 of the known architectures. 1867 (<a href="http://b.android.com/35392">Issue 35392</a>) 1868 </li> 1869 <li>Fixed Windows pathname support, by keeping the {@code :} character if it looks 1870 like it could be part of a Windows path starting with a drive letter. 1871 (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12843">GDB Issue 12843</a>) 1872 </li> 1873 <li>Fixed adding of hardware breakpoint support for ARM in {@code gdbserver}. 1874 (<a href="http://sourceware.org/ml/gdb-patches/2011-09/msg00200.html">GDB Issue</a>) 1875 </li> 1876 <li>Added fix to only read the current {@code solibs} when the linker is consistent. 1877 This change speeds up {@code solib} event handling. 1878 (<a href="http://b.android.com/37677">Issue 37677</a>) 1879 </li> 1880 <li>Added fix to make repeated attempts to find {@code solib} breakpoints. GDB now 1881 retries {@code enable_break()} during every call to {@code svr4_current_sos()} until 1882 it succeeds. 1883 (<a href="https://android-review.googlesource.com/#/c/43563">Change 43563</a>)</li> 1884 <li>Fixed an issue where {@code gdb} would not stop on breakpoints placed in 1885 {@code dlopen-ed} libraries. 1886 (<a href="http://b.android.com/34856">Issue 34856</a>) 1887 </li> 1888 <li>Fixed {@code SIGILL} in dynamic linker when calling {@code dlopen()}, on system 1889 where {@code /system/bin/linker} is stripped of symbols and 1890 {@code rtld_db_dlactivity()} is implemented as {@code Thumb}, due to not preserving 1891 {@code LSB} of {@code sym_addr}. 1892 (<a href="http://b.android.com/37147">Issue 37147</a>) 1893 </li> 1894 </ul> 1895 </li> 1896 </ul> 1897 </dd> 1898 </dl> 1899 1900 <dl> 1901 <dt>Other bug fixes:</dt> 1902 1903 <dd> 1904 <ul> 1905 <li>Fixed NDK headers: 1906 <ul> 1907 <li>Fixed {@code arch-mips/include/asm/*} code that was incorrectly removed from 1908 original kernel. (<a href="https://android-review.googlesource.com/#/c/43335">Change 1909 43335</a>)</li> 1910 <li>Replaced struct member data {@code __unused} with {@code __linux_unused} in 1911 {@code linux/sysctl.h} and {@code linux/icmp.h} to avoid conflict with 1912 {@code #define __unused} in {@code sys/cdefs.h}.</li> 1913 <li>Fixed {@code fenv.h} for enclosed C functions with {@code __BEGIN_DECLS} and 1914 {@code __END_DECLS}.</li> 1915 <li>Removed unimplemented functions in {@code malloc.h}.</li> 1916 <li>Fixed {@code stdint.h} defintion of {@code uint64_t} for ANSI compilers. 1917 (<a href="http://b.android.com/1952">Issue 1952</a>)</li> 1918 <li>Fixed preprocessor macros in {@code <arch>/include/machine/*}.</li> 1919 <li>Replaced {@code link.h} for MIPS with new version supporting all platforms.</li> 1920 <li>Removed {@code linux-unistd.h}</li> 1921 <li>Move GLibc-specific macros {@code LONG_LONG_MIN}, {@code LONG_LONG_MAX} and 1922 {@code ULONG_LONG_MAX} from {@code <pthread.h>} to {@code 1923<limits.h>}.</li> 1924 </ul> 1925 </li> 1926 <li>Fixed a buffer overflow in {@code ndk-stack-parser}.</li> 1927 <li>Fixed {@code _STLP_USE_EXCEPTIONS}, when not defined, to omit all declarations 1928 and uses of {@code __Named_exception}. Compiling and use of {@code __Named_exception} 1929 settings only occurs when {@code STLport} is allowed to use exceptions.</li> 1930 <li>Fixed building of Linux-only NDK packages without also building Windows code. Use the 1931 following settings to perform this type of build: 1932 <pre>./build/tools/make-release.sh --force --systems=linux-x86</pre></li> 1933 <li>Fixed {@code libc.so} so it does not export {@code atexit()} and {@code __do_handler}. 1934 These symbols are exported for ARM builds by the system version of the C library to 1935 support legacy native libraries. NDK-generated should never reference them directly. 1936 Instead, each shared library or executable should embed its own version of these symbols, 1937 provided by {@code crtbegin_*.o}. 1938 <p>If your project is linked with the {@code -nostdlib -Wl,--no-undefined} options, you 1939 must provide your own {@code __dso_handle} because {@code crtbegin_so.o} is not linked in 1940 this case. The content of {@code __dso_handle} does not matter, as shown in the following 1941 example code:</p> 1942<pre> 1943extern "C" { 1944 extern void *__dso_handle __attribute__((__visibility__ ("hidden"))); 1945 void *__dso_handle; 1946} 1947</pre> 1948 </li> 1949 <li>Fixed symbol decoder for ARM used in {@code objdump} for {@code plt} entries to 1950 generate a more readable form {@code function@plt}.</li> 1951 <li>Removed the following symbols, introduced in GCC 4.6 {@code libgcc.a}, from 1952 the X86 platform {@code libc.so} library: {@code __aeabi_idiv0}, {@code __aeabi_ldiv0}, 1953 {@code __aeabi_unwind_cpp_pr1}, and {@code __aeabi_unwind_cpp_pr2}.</li> 1954 <li>Removed unused {@code .ctors}, {@code .dtors}, and {@code .eh_frame} in MIPS 1955 {@code crt*_so.S}.</li> 1956 <li>Updated {@code ndk-gdb} so that it only takes the last line of output for 1957 {@code ndk-build} {@code DUMP_XXXX}. This change ensures that if {@code Application.mk} or 1958 {@code Android.mk} print something with {@code $(info ...)} syntax, it does not get 1959 injected into the result of {@code DUMP_XXXX}. 1960 (<a href="https://groups.google.com/d/msg/android-ndk/-/ew0lTWGr1UEJ">More info</a>)</li> 1961 </ul> 1962 </dd> 1963 </dl> 1964 1965 <dl> 1966 <dt>Other changes:</dt> 1967 1968 <dd> 1969 <ul> 1970 <li>Removed {@code arch-x86} and {@code arch-mips} headers from 1971 {@code platforms/android-[3,4,5,8]}. Those headers were incomplete, since both X86 and 1972 MIPS ABIs are only supported at API 9 or higher.</li> 1973 <li>Simplified c++ include path in standalone packages, as shown below. 1974 (<a href="http://b.android.com/35279">Issue 35279</a>) 1975<pre> 1976<path>/arm-linux-androideabi/include/c++/4.6.x-google 1977 to: 1978<path>/include/c++/4.6/ 1979</pre></li> 1980 <li>Fixed {@code ndk-build} to recognize more C++ file extensions by default: 1981 {@code .cc .cp .cxx .cpp .CPP .c++ .C}. You may still use {@code LOCAL_CPP_EXTENSION} to 1982 overwrite these extension settings.</li> 1983 <li>Fixed an issue in {@code samples/san-angeles} that caused a black screen or freeze 1984 frame on re-launch.</li> 1985 <li>Replaced deprecated APIs in NDK samples. 1986 (<a href="http://b.android.com/20017">Issue 20017</a>) 1987 <ul> 1988 <li>{@code hello-gl2} from android-5 to android-7</li> 1989 <li>{@code native-activity} from android-9 to android-10</li> 1990 <li>{@code native-audio} from android-9 to android-10</li> 1991 <li>{@code native-plasma} from android-9 to android-10</li> 1992 </ul> 1993 </li> 1994 <li>Added new branding for Android executables with a simpler scheme in section 1995 {@code .note.android.ident} (defined in {@code crtbegin_static/dynamic.o}) so that 1996 debugging tools can act accordingly. The structure member and values are defined as 1997 follows: 1998<pre> 1999static const struct { 2000 int32_t namesz; /* = 8, sizeof ("Android") */ 2001 int32_t descsz; /* = 1 * sizeof(int32_t) */ 2002 int32_t type; /* = 1, ABI_NOTETYPE */ 2003 char name[sizeof "Android"]; /* = "Android" */ 2004 int32_t android_api; /* = 3, 4, 5, 8, 9, 14 */ 2005} 2006</pre> 2007 <p>The previous branding options in section {@code .note.ABI-tag} are deprecated.</p> 2008 </li> 2009 <li>Added a new script {@code run-tests-all.sh} which calls {@code run-tests.sh} and 2010 {@code standalone/run.sh} with various conditions. The script {@code run-tests.sh} runs 2011 without the {@code --abi} option, and is enhanced to compile most of the tests for all 2012 supported ABIs and run on all attached devices</li> 2013 </ul> 2014 </dd> 2015 </dl> 2016 2017 </div> 2018</div> 2019 2020<div class="toggle-content closed"> 2021 <p><a href="#" onclick="return toggleContent(this)"> 2022 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 2023 alt="">Android NDK, Revision 8b</a> <em>(July 2012)</em> 2024 </p> 2025 2026 <div class="toggle-content-toggleme"> 2027 <p>The main features of this release are a new GNU Compiler Collection (GCC) 4.6 toolchain and 2028GNU Debugger (GDB) 7.3.x which adds debugging support for the Android 4.1 (API Level 16) system 2029image.</p> 2030 2031 <dl> 2032 <dt>Important bug fixes:</dt> 2033 2034 <dd> 2035 <ul> 2036 <li>Fixed {@code LOCAL_SHORT_COMMANDS} issues on Mac OS, Windows Cygwin environments for 2037static libraries. List file generation is faster, and it is not regenerated to avoid repeated 2038project rebuilds.</li> 2039 <li>Fixed several issues in {@code ndk-gdb}: 2040 <ul> 2041 <li>Updated tool to pass flags {@code -e}, {@code -d} and {@code -s} to adb more 2042consistently.</li> 2043 <li>Updated tool to accept device serial names containing spaces.</li> 2044 <li>Updated tool to retrieve {@code /system/bin/link} information, so {@code gdb} on 2045the host can set a breakpoint in {@code __dl_rtld_db_dlactivity} and be aware of linker activity 2046(e.g., rescan {@code solib} symbols when {@code dlopen()} is called).</li> 2047 </ul> 2048 </li> 2049 <li>Fixed {@code ndk-build clean} on Windows, which was failing to remove 2050{@code ./libs/*/lib*.so}.</li> 2051 <li>Fixed {@code ndk-build.cmd} to return a non-zero {@code ERRORLEVEL} when {@code make} 2052fails.</li> 2053 <li>Fixed {@code libc.so} to stop incorrectly exporting the {@code __exidx_start} and 2054{@code __exidx_end} symbols.</li> 2055 <li>Fixed {@code SEGV} when unwinding the stack past {@code __libc_init} for ARM and 2056MIPS.</li> 2057 </ul> 2058 </dd> 2059 </dl> 2060 2061 <dl> 2062 <dt>Important changes:</dt> 2063 2064 <dd> 2065 <ul> 2066 <li>Added GCC 4.6 toolchain ({@code binutils} 2.21 with {@code gold} and GDB 7.3.x) to 2067co-exist with the original GCC 4.4.3 toolchain ({@code binutils} 2.19 and GDB 6.6). 2068 <ul> 2069 <li>GCC 4.6 is now the default toolchain. You may set {@code 2070NDK_TOOLCHAIN_VERSION=4.4.3} in {@code Application.mk} to select the original one.</li> 2071 <li>Support for the {@code gold} linker is only available for ARM and x86 2072architectures on Linux and Mac OS hosts. This support is disabled by default. Add {@code 2073LOCAL_LDLIBS += -fuse-ld=gold} in {@code Android.mk} to enable it.</li> 2074 <li>Programs compiled with {@code -fPIE} require the new {@code GDB} for debugging, 2075including binaries in Android 4.1 (API Level 16) system images.</li> 2076 <li>The {@code binutils} 2.21 {@code ld} tool contains back-ported fixes from 2077version 2.22: 2078 <ul> 2079 <li>Fixed {@code ld --gc-sections}, which incorrectly retains zombie references to 2080external libraries. (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=13177">more 2081info</a>).</li> 2082 <li>Fixed ARM {@code strip} command to preserve the original {@code p_align} and 2083{@code p_flags} in {@code GNU_RELRO} section if they are valid. Without this fix, programs 2084built with {@code -fPIE} could not be debugged. (<a 2085href="http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf.c.diff?cvsroot=src&r1=1.552&r2=1.553">mor 2086e info</a>)</li> 2087 </ul> 2088 </li> 2089 <li>Disabled {@code sincos()} optimization for compatibility with older 2090 platforms.</li> 2091 </ul> 2092 </li> 2093 2094 <li>Updated build options to enable the Never eXecute (NX) bit and {@code relro}/{@code 2095bind_now} protections by default: 2096 <ul> 2097 <li>Added {@code --noexecstack} to assembler and {@code -z noexecstack} to linker 2098that provides NX protection against buffer overflow attacks by enabling NX bit on stack and 2099heap.</li> 2100 <li>Added {@code -z relro} and {@code -z now} to linker for hardening of internal 2101data sections after linking to guard against security vulnerabilities caused by memory corruption. 2102(more info: <a href="http://www.akkadia.org/drepper/nonselsec.pdf">1</a>, 2103<a href="http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html">2</a>)</li> 2104 2105 <li>These features can be disabled using the following options: 2106 <ol> 2107 <li>Disable NX protection by setting the {@code --execstack} option for the 2108assembler and {@code -z execstack} for the linker.</li> 2109 <li>Disable hardening of internal data by setting the {@code -z norelro} and 2110{@code -z lazy} options for the linker.</li> 2111 <li>Disable these protections in the NDK {@code jni/Android.mk} by setting the 2112following options: 2113<pre> 2114LOCAL_DISABLE_NO_EXECUTE=true # disable "--noexecstack" and "-z noexecstack" 2115DISABLE_RELRO=true # disable "-z relro" and "-z now" 2116</pre> 2117 </li> 2118 </ol> 2119 <p>See {@code docs/ANDROID-MK.html} for more details.</p> 2120 </li> 2121 </ul> 2122 </li> 2123 2124 <li>Added branding for Android executables with the {@code .note.ABI-tag} section (in 2125{@code crtbegin_static/dynamic.o}) so that debugging tools can act accordingly. The structure 2126member and values are defined as follows: 2127<pre> 2128static const struct { 2129 int32_t namesz; /* = 4, sizeof ("GNU") */ 2130 int32_t descsz; /* = 6 * sizeof(int32_t) */ 2131 int32_t type; /* = 1 */ 2132 char name[sizeof "GNU"]; /* = "GNU" */ 2133 int32_t os; /* = 0 */ 2134 int32_t major; /* = 2 */ 2135 int32_t minor; /* = 6 */ 2136 int32_t teeny; /* = 15 */ 2137 int32_t os_variant; /* = 1 */ 2138 int32_t android_api; /* = 3, 4, 5, 8, 9, 14 */ 2139}</pre> 2140 </li> 2141 </ul> 2142 </dd> 2143 </dl> 2144 2145 <dl> 2146 <dt>Other bug fixes:</dt> 2147 2148 <dd> 2149 <ul> 2150 <li>Fixed {@code mips-linux-gnu} relocation truncated to fit {@code R_MIPS_TLS_LDM} issue. 2151 (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12637">more info</a>)</li> 2152 <li>Fixed {@code ld} tool segfaults when using {@code --gc-sections}. 2153 (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12845">more info</a>) 2154 </li> 2155 <li>Fixed MIPS {@code GOT_PAGE} counting issue. 2156 (<a href="http://sourceware.org/ml/binutils/2011-05/msg00198.html">more info</a>)</li> 2157 <li>Fixed follow warning symbol link for {@code mips_elf_count_got_symbols}.</li> 2158 <li>Fixed follow warning symbol link for {@code mips_elf_allocate_lazy_stub}.</li> 2159 <li>Moved MIPS {@code .dynamic} to the data segment, so that it is writable.</li> 2160 <li>Replaced hard-coded values for symbols with correct segment sizes for MIPS.</li> 2161 <li>Removed the {@code -mno-shared} option from the defaults in the MIPS toolchain. 2162The default for Android toolchain is {@code -fPIC} (or {@code -fpic} if supported). If you do not 2163explicitly specify {@code -mshared}, {@code -fpic}, {@code -fPIC}, {@code -fpie}, or {@code -fPIE}, 2164the MIPS compiler adds {@code -mno-shared} that turns off PIC. Fixed compiler not to add 2165{@code -mno-shared} in this case.</li> 2166 <li>Fixed wrong package names in samples {@code hello-jni} and {@code two-libs} so that 2167the {@code tests} project underneath it can compile.</li> 2168 </ul> 2169 </dd> 2170 </dl> 2171 2172 <dl> 2173 <dt>Other Changes:</dt> 2174 2175 <dd> 2176 <ul> 2177 <li>Changed locations of binaries: 2178 <ul> 2179 <li>Moved {@code gdbserver} from 2180{@code toolchain/<arch-os-ver>/prebuilt/gdbserver} to 2181{@code prebuilt/android-<arch>/gdbserver/gdbserver}.</li> 2182 <li>Renamed x86 toolchain prefix from {@code i686-android-linux-} to 2183{@code i686-linux-android-}.</li> 2184 <li>Moved {@code sources/cxx-stl/gnu-libstdc++/include} and {@code lib} to 2185{@code sources/cxx-stl/gnu-libstdc++/4.6} when compiled with GCC 4.6, or 2186{@code sources/cxx-stl/gnu-libstdc++/4.4.3} when compiled with GCC 4.4.3.</li> 2187 <li>Moved {@code libbfd.a} and {@code libintl.a} from {@code lib/} to {@code 2188lib32/}.</li> 2189 </ul> 2190 </li> 2191 2192 <li>Added and improved various scripts in the rebuild and test NDK toolchain: 2193 <ul> 2194 <li>Added {@code build-mingw64-toolchain.sh} to generate a new Linux-hosted toolchain 2195that generates Win32 and Win64 executables.</li> 2196 <li>Improved speed of {@code download-toolchain-sources.sh} by using the {@code 2197clone} command and only using {@code checkout} for the directories that are needed to build the NDK 2198toolchain binaries.</li> 2199 <li>Added {@code build-host-gcc.sh} and {@code build-host-gdb.sh} scripts.</li> 2200 <li>Added {@code tests/check-release.sh} to check the content of a given NDK 2201installation directory, or an existing NDK package.</li> 2202 <li>Rewrote the {@code tests/standalone/run.sh} standalone tests .</li> 2203 </ul> 2204 </li> 2205 <li>Removed {@code if_dl.h} header from all platforms and architectures. The {@code 2206AF_LINK} and {@code sockaddr_dl} elements it describes are specific to BSD (i.e., they don't exist 2207in Linux).</li> 2208 </ul> 2209 </dd> 2210 </dl> 2211 2212 </div> 2213</div> 2214 2215<div class="toggle-content closed"> 2216 <p><a href="#" onclick="return toggleContent(this)"> 2217 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 2218 alt="">Android NDK, Revision 8</a> <em>(May 2012)</em> 2219 </p> 2220 2221 <div class="toggle-content-toggleme"> 2222 <p>This release of the NDK includes support for MIPS ABI and a few additional fixes.</p> 2223 2224 <dl> 2225 <dt>New features:</dt> 2226 2227 <dd> 2228 <ul> 2229 <li>Added support for the MIPS ABI, which allows you to generate machine code that runs on 2230 compatible MIPS-based Android devices. Major features for MIPS include MIPS-specific 2231 toolchains, system headers, libraries and debugging support. For more details regarding 2232 MIPS support, see {@code docs/CPU-MIPS.html} in the NDK package. 2233 2234 <p>By default, code is generated for ARM-based devices. You can add {@code mips} to 2235 your {@code APP_ABI} definition in your {@code Application.mk} file to build 2236 for MIPS platforms. For example, the following line instructs {@code ndk-build} 2237 to build your code for three distinct ABIs:</p> 2238 2239 <pre>APP_ABI := armeabi armeabi-v7a <strong>mips</strong></pre> 2240 2241 <p>Unless you rely on architecture-specific assembly sources, such as ARM assembly 2242 code, you should not need to touch your {@code Android.mk} files to build MIPS 2243 machine code.</p> 2244 </li> 2245 2246 <li>You can build a standalone MIPS toolchain using the {@code --arch=mips} 2247 option when calling <code>make-standalone-toolchain.sh</code>. See 2248 {@code docs/STANDALONE-TOOLCHAIN.html} for more details. 2249 </li> 2250 </ul> 2251 2252 <p class="note"><strong>Note:</strong> To ensure that your applications are available 2253to users only if their devices are capable of running them, Google Play filters applications based 2254on the instruction set information included in your application ? no action is needed on your part 2255to enable the filtering. Additionally, the Android system itself also checks your application at 2256install time and allows the installation to continue only if the application provides a library that 2257is compiled for the device's CPU architecture.</p> 2258 </dd> 2259 2260 <dt>Important bug fixes:</dt> 2261 2262 <dd> 2263 <ul> 2264 <li>Fixed a typo in GAbi++ implementation where the result of {@code 2265 dynamic_cast<D>(b)} of base class object {@code b} to derived class {@code D} is 2266 incorrectly adjusted in the opposite direction from the base class. 2267 (<a href="http://b.android.com/28721">Issue 28721</a>) 2268 </li> 2269 <li>Fixed an issue in which {@code make-standalone-toolchain.sh} fails to copy 2270 {@code libsupc++.*}.</li> 2271 </ul> 2272 </dd> 2273 2274 <dt>Other bug fixes:</dt> 2275 2276 <dd> 2277 <ul> 2278 <li>Fixed {@code ndk-build.cmd} to ensure that {@code ndk-build.cmd} works correctly even 2279 if the user has redefined the {@code SHELL} environment variable, which may be changed 2280 when installing a variety of development tools in Windows environments. 2281 </li> 2282 </ul> 2283 </dd> 2284 </dl> 2285 </div> 2286</div> 2287 2288<div class="toggle-content closed"> 2289 <p><a href="#" onclick="return toggleContent(this)"> 2290 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 2291 alt="">Android NDK, Revision 7c</a> <em>(April 2012)</em> 2292 </p> 2293 2294 <div class="toggle-content-toggleme"> 2295 <p>This release of the NDK includes an important fix for Tegra2-based devices, and a few 2296additional fixes and improvements:</p> 2297 2298 <dl> 2299 <dt>Important bug fixes:</dt> 2300 2301 <dd> 2302 <ul> 2303 <li>Fixed GNU STL armeabi-v7a binaries to not crash on non-NEON 2304 devices. The files provided with NDK r7b were not configured properly, 2305 resulting in crashes on Tegra2-based devices and others when trying to use 2306 certain floating-point functions (e.g., {@code cosf}, {@code sinf}, {@code expf}).</li> 2307 </ul> 2308 </dd> 2309 2310 <dt>Important changes:</dt> 2311 2312 <dd> 2313 <ul> 2314 <li>Added support for custom output directories through the {@code NDK_OUT} 2315 environment variable. When defined, this variable is used to store all 2316 intermediate generated files, instead of {@code $PROJECT_PATH/obj}. The variable is 2317 also recognized by {@code ndk-gdb}. </li> 2318 <li>Added support for building modules with hundreds or even thousands of source 2319 files by defining {@code LOCAL_SHORT_COMMANDS} to {@code true} in your {@code Android.mk}. 2320 <p>This change forces the NDK build system to put most linker or archiver options 2321 into list files, as a work-around for command-line length limitations. 2322 See {@code docs/ANDROID-MK.html} for details.</p> 2323 </li> 2324 </ul> 2325 </dd> 2326 2327 <dt>Other bug fixes:</dt> 2328 2329 <dd> 2330 <ul> 2331 <li>Fixed {@code android_getCpuCount()} implementation in the {@code cpufeatures} 2332helper library. On certain devices, where cores are enabled dynamically by the system, the previous 2333implementation would report the total number of <em>active</em> cores the first time the function 2334was called, rather than the total number of <em>physically available</em> cores.</li> 2335 </ul> 2336 </dd> 2337 </dl> 2338 </div> 2339</div> 2340 2341 2342<div class="toggle-content closed"> 2343 <p><a href="#" onclick="return toggleContent(this)"> 2344 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 2345 alt="">Android NDK, Revision 7b</a> <em>(February 2012)</em> 2346 </p> 2347 2348 <div class="toggle-content-toggleme"> 2349 <p>This release of the NDK includes fixes for native Windows builds, Cygwin and many other 2350 improvements:</p> 2351 2352 <dl> 2353 <dt>Important bug fixes:</dt> 2354 2355 <dd> 2356 <ul> 2357 <li>Updated {@code sys/atomics.h} to avoid correctness issues 2358 on some multi-core ARM-based devices. Rebuild your unmodified sources with this 2359 version of the NDK and this problem should be completely eliminated. 2360 For more details, read {@code docs/ANDROID-ATOMICS.html}.</li> 2361 <li>Reverted to {@code binutils} 2.19 to fix debugging issues that 2362 appeared in NDK r7 (which switched to {@code binutils} 2.20.1).</li> 2363 <li>Fixed {@code ndk-build} on 32-bit Linux. A packaging error put a 64-bit version 2364 of the {@code awk} executable under {@code prebuilt/linux-x86/bin} in NDK r7.</li> 2365 <li>Fixed native Windows build ({@code ndk-build.cmd}). Other build modes were not 2366 affected. The fixes include: 2367 <ul> 2368 <li>Removed an infinite loop / stack overflow bug that happened when trying 2369 to call {@code ndk-build.cmd} from a directory that was <em>not</em> the top of 2370 your project path (e.g., in any sub-directory of it).</li> 2371 <li>Fixed a problem where the auto-generated dependency files were ignored. This 2372 meant that updating a header didn't trigger recompilation of sources that included 2373 it.</li> 2374 <li>Fixed a problem where special characters in files or paths, other than spaces and 2375 quotes, were not correctly handled.</li> 2376 </ul> 2377 </li> 2378 <li>Fixed the standalone toolchain to generate proper binaries when using 2379 {@code -lstdc++} (i.e., linking against the GNU {@code libstdc++} C++ runtime). You 2380 should use {@code -lgnustl_shared} if you want to link against the shared library 2381 version or {@code -lstdc++} for the static version. 2382 2383 <p>See {@code docs/STANDALONE-TOOLCHAIN.html} for more details about this fix.</p> 2384 </li> 2385 <li>Fixed {@code gnustl_shared} on Cygwin. The linker complained that it couldn't find 2386 {@code libsupc++.a} even though the file was at the right location.</li> 2387 <li>Fixed Cygwin C++ link when not using any specific C++ runtime through 2388 {@code APP_STL}.</li> 2389 </ul> 2390 </dd> 2391 </dl> 2392 2393 <dl> 2394 <dt>Other changes:</dt> 2395 2396 <dd> 2397 <ul> 2398 <li>When your application uses the GNU {@code libstdc++} runtime, the compiler will 2399 no longer forcibly enable exceptions and RTTI. This change results in smaller code. 2400 <p>If you need these features, you must do one of the following:</p> 2401 <ul> 2402 <li>Enable exceptions and/or RTTI explicitly in your modules or 2403 {@code Application.mk}. (recommended)</li> 2404 <li>Define {@code APP_GNUSTL_FORCE_CPP_FEATURES} to {@code 'exceptions'}, 2405 {@code 'rtti'} or both in your {@code Application.mk}. See 2406 {@code docs/APPLICATION-MK.html} for more details.</li> 2407 </ul> 2408 </li> 2409 <li>{@code ndk-gdb} now works properly when your application has private services 2410 running in independent processes. It debugs the main application process, instead of the 2411 first process listed by {@code ps}, which is usually a service process.</li> 2412 <li>Fixed a rare bug where NDK r7 would fail to honor the {@code LOCAL_ARM_MODE} value 2413 and always compile certain source files (but not all) to 32-bit instructions.</li> 2414 <li>{@code STLport}: Refresh the sources to match the Android platform version. This 2415 update fixes a few minor bugs: 2416 <ul> 2417 <li>Fixed instantiation of an incomplete type</li> 2418 <li>Fixed minor "==" versus "=" typo</li> 2419 <li>Used {@code memmove} instead of {@code memcpy} in {@code string::assign}</li> 2420 <li>Added better handling of {@code IsNANorINF}, {@code IsINF}, {@code IsNegNAN}, 2421 etc.</li> 2422 </ul> 2423 <p>For complete details, see the commit log.</p> 2424 </li> 2425 <li>{@code STLport}: Removed 5 unnecessary static initializers from the library.</li> 2426 <li>The GNU libstdc++ libraries for armeabi-v7a were mistakenly compiled for 2427 armeabi instead. This change had no impact on correctness, but using the right 2428 ABI should provide slightly better performance.</li> 2429 <li>The {@code cpu-features} helper library was updated to report three optional 2430 x86 CPU features ({@code SSSE3}, {@code MOVBE} and {@code POPCNT}). See 2431 {@code docs/CPU-FEATURES.html} for more details.</li> 2432 <li>{@code docs/NDK-BUILD.html} was updated to mention {@code NDK_APPLICATION_MK} instead 2433 of {@code NDK_APP_APPLICATION_MK} to select a custom {@code Application.mk} file.</li> 2434 <li>Cygwin: {@code ndk-build} no longer creates an empty "NUL" file in the current 2435 directory when invoked.</li> 2436 <li>Cygwin: Added better automatic dependency detection. In the previous version, it 2437 didn't work properly in the following cases: 2438 <ul> 2439 <li>When the Cygwin drive prefix was not {@code /cygdrive}.</li> 2440 <li>When using drive-less mounts, for example, when Cygwin would translate 2441 {@code /home} to {@code \\server\subdir} instead of {@code C:\Some\Dir}.</li> 2442 </ul> 2443 </li> 2444 <li>Cygwin: {@code ndk-build} does not try to use the native Windows tools under 2445 {@code $NDK/prebuilt/windows/bin} with certain versions of Cygwin and/or GNU Make.</li> 2446 </ul> 2447 </dd> 2448 </dl> 2449 </div> 2450</div> 2451 2452 2453<div class="toggle-content closed"> 2454 <p><a href="#" onclick="return toggleContent(this)"> 2455 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 2456 alt="">Android NDK, Revision 7</a> <em>(November 2011)</em> 2457 </p> 2458 2459 <div class="toggle-content-toggleme"> 2460 <p>This release of the NDK includes new features to support the Android 4.0 platform as well 2461 as many other additions and improvements:</p> 2462 2463 <dl> 2464 <dt>New features</dt> 2465 2466 <dd> 2467 <ul> 2468 <li>Added official NDK APIs for Android 4.0 (API level 14), which adds the following 2469 native features to the platform: 2470 2471 <ul> 2472 <li>Added native multimedia API based on the Khronos Group OpenMAX AL? 1.0.1 2473 standard. The new <code><OMXAL/OpenMAXAL.h></code> and 2474 <code><OMXAL/OpenMAXAL_Android.h></code> headers allow applications targeting 2475 API level 14 to perform multimedia output directly from native code by using a new 2476 Android-specific buffer queue interface. For more details, see 2477 <code>docs/openmaxal/index.html</code> and <a href= 2478 "http://www.khronos.org/openmax/">http://www.khronos.org/openmax/</a>.</li> 2479 2480 <li>Updated the native audio API based on the Khronos Group OpenSL ES 1.0.1? 2481 standard. With API Level 14, you can now decode compressed audio (e.g. MP3, AAC, 2482 Vorbis) to PCM. For more details, see <code>docs/opensles/index.html</code> and 2483 <a href= 2484 "http://www.khronos.org/opensles">http://www.khronos.org/opensles/</a>.</li> 2485 </ul> 2486 </li> 2487 2488 <li>Added CCache support. To speed up large rebuilds, define the 2489 <code>NDK_CCACHE</code> environment variable to <code>ccache</code> (or the path to 2490 your <code>ccache</code> binary). When declared, the NDK build system automatically 2491 uses CCache when compiling any source file. For example: 2492 <pre> 2493export NDK_CCACHE=ccache 2494</pre> 2495 <p class="note"><strong>Note:</strong> CCache is not included in the NDK release 2496 so you must have it installed prior to using it. For more information about CCache, see 2497 <a href="http://ccache.samba.org">http://ccache.samba.org</a>.</p> 2498 </li> 2499 2500 <li>Added support for setting <code>APP_ABI</code> to <code>all</code> to indicate that 2501 you want to build your NDK modules for all the ABIs supported by your given NDK 2502 release. This means that either one of the following two lines in your 2503 <code>Application.mk</code> are equivalent with this release: 2504 <pre> 2505APP_ABI := all 2506APP_ABI := armeabi armeabi-v7a x86 2507</pre> 2508 2509 <p>This also works if you define <code>APP_ABI</code> when calling 2510 <code>ndk-build</code> from the command-line, which is a quick way to check that your 2511 project builds for all supported ABIs without changing the project's 2512 <code>Application.mk file</code>. For example:</p> 2513 <pre> 2514ndk-build APP_ABI=all 2515</pre> 2516 </li> 2517 2518 <li>Added a <code>LOCAL_CPP_FEATURES</code> variable in <code>Android.mk</code> that 2519 allows you to declare which C++ features (RTTI or Exceptions) your module uses. This 2520 ensures that the final linking works correctly if you have prebuilt modules that depend 2521 on these features. See <code>docs/ANDROID-MK.html</code> and 2522 <code>docs/CPLUSPLUS-SUPPORT.html</code> for more details.</li> 2523 2524 <li>Shortened paths to source and object files that are used in build commands. When 2525 invoking <code>$NDK/ndk-build</code> from your project path, the paths to the source, 2526 object, and binary files that are passed to the build commands are significantly 2527 shorter now, because they are passed relative to the current directory. This is useful 2528 when building projects with a lot of source files, to avoid limits on the maximum 2529 command line length supported by your host operating system. The behavior is unchanged 2530 if you invoke <code>ndk-build</code> from a sub-directory of your project tree, or if 2531 you define <code>NDK_PROJECT_PATH</code> to point to a specific directory.</li> 2532 </ul> 2533 </dd> 2534 2535 <dt>Experimental features</dt> 2536 2537 <dd> 2538 You can now build your NDK source files on Windows <em>without</em> Cygwin by calling the 2539 <code>ndk-build.cmd</code> script from the command line from your project path. The 2540 script takes exactly the same arguments as the original <code>ndk-build</code> script. 2541 The Windows NDK package comes with its own prebuilt binaries for GNU Make, Awk and other 2542 tools required by the build. You should not need to install anything else to get a 2543 working build system. 2544 2545 <p class="caution"><strong>Important:</strong> <code>ndk-gdb</code> does not work on 2546 Windows, so you still need Cygwin to debug.</p> 2547 2548 <p>This feature is still experimental, so feel free to try it and report issues on the 2549 <a href="http://b.android.com">public bug database</a> or <a href= 2550 "http://groups.google.com/group/android-ndk">public forum</a>. All samples and unit tests 2551 shipped with the NDK succesfully compile with this feature.</p> 2552 </dd> 2553 2554 <dt>Important bug fixes</dt> 2555 2556 <dd> 2557 <ul> 2558 <li>Imported shared libraries are now installed by default to the target installation 2559 location (<code>libs/<abi></code>) if <code>APP_MODULES</code> is not defined in 2560 your <code>Application.mk</code>. For example, if a top-level module <code>foo</code> 2561 imports a module <code>bar</code>, then both <code>libfoo.so</code> and 2562 <code>libbar.so</code> are copied to the install location. Previously, only 2563 <code>libfoo.so</code> was copied, unless you listed <code>bar</code> in your 2564 <code>APP_MODULES</code> too. If you define <code>APP_MODULES</code> explicitly, the 2565 behavior is unchanged.</li> 2566 2567 <li><code>ndk-gdb</code> now works correctly for activities with multiple categories in 2568 their MAIN intent filters.</li> 2569 2570 <li>Static library imports are now properly transitive. For example, if a top-level 2571 module <code>foo</code> imports static library <code>bar</code> that imports static 2572 library <code>zoo</code>, the <code>libfoo.so</code> will now be linked against both 2573 <code>libbar.a</code> and <code>libzoo.a</code>.</li> 2574 </ul> 2575 </dd> 2576 2577 <dt>Other changes</dt> 2578 2579 <dd> 2580 <ul> 2581 <li><code>docs/NATIVE-ACTIVITY.HTML</code>: Fixed typo. The minimum API level should be 2582 9, not 8 for native activities.</li> 2583 2584 <li><code>docs/STABLE-APIS.html</code>: Added missing documentation listing EGL as a 2585 supported stable API, starting from API level 9.</li> 2586 2587 <li><code>download-toolchain-sources.sh</code>: Updated to download the toolchain 2588 sources from <a href="http://android.googlesource.com">android.googlesource.com</a>, 2589 which is the new location for the AOSP servers.</li> 2590 2591 <li>Added a new C++ support runtime named <code>gabi++</code>. More details about it 2592 are available in the updated <code>docs/CPLUSPLUS-SUPPORT.html</code>.</li> 2593 2594 <li>Added a new C++ support runtime named <code>gnustl_shared</code> that corresponds 2595 to the shared library version of GNU libstdc++ v3 (GPLv3 license). See more info at 2596 <code>docs/CPLUSPLUS-SUPPORT.html</code></li> 2597 2598 <li>Added support for RTTI in the STLport C++ runtimes (no support for 2599 exceptions).</li> 2600 2601 <li>Added support for multiple file extensions in <code>LOCAL_CPP_EXTENSION</code>. For 2602 example, to compile both <code>foo.cpp</code> and <code>bar.cxx</code> as C++ sources, 2603 declare the following: 2604 <pre> 2605LOCAL_CPP_EXTENSION := .cpp .cxx 2606</pre> 2607 </li> 2608 2609 <li>Removed many unwanted exported symbols from the link-time shared system libraries 2610 provided by the NDK. This ensures that code generated with the standalone toolchain 2611 doesn't risk to accidentally depend on a non-stable ABI symbol (e.g. any libgcc.a 2612 symbol that changes each time the toolchain used to build the platform is changed)</li> 2613 2614 <li>Refreshed the EGL and OpenGLES Khronos headers to support more extensions. Note 2615 that this does <em>not</em> change the NDK ABIs for the corresponding libraries, 2616 because each extension must be probed at runtime by the client application. 2617 2618 <p>The extensions that are available depend on your actual device and GPU drivers, 2619 not the platform version the device runs on. The header changes simply add new 2620 constants and types to make it easier to use the extensions when they have been 2621 probed with <code>eglGetProcAddress()</code> or <code>glGetProcAddress()</code>. The 2622 following list describes the newly supported extensions:</p> 2623 2624 <dl> 2625 <dt>GLES 1.x</dt> 2626 2627 <dd> 2628 <ul> 2629 <li><code>GL_OES_vertex_array_object</code></li> 2630 2631 <li><code>GL_OES_EGL_image_external</code></li> 2632 2633 <li><code>GL_APPLE_texture_2D_limited_npot</code></li> 2634 2635 <li><code>GL_EXT_blend_minmax</code></li> 2636 2637 <li><code>GL_EXT_discard_framebuffer</code></li> 2638 2639 <li><code>GL_EXT_multi_draw_arrays</code></li> 2640 2641 <li><code>GL_EXT_read_format_bgra</code></li> 2642 2643 <li><code>GL_EXT_texture_filter_anisotropic</code></li> 2644 2645 <li><code>GL_EXT_texture_format_BGRA8888</code></li> 2646 2647 <li><code>GL_EXT_texture_lod_bias</code></li> 2648 2649 <li><code>GL_IMG_read_format</code></li> 2650 2651 <li><code>GL_IMG_texture_compression_pvrtc</code></li> 2652 2653 <li><code>GL_IMG_texture_env_enhanced_fixed_function</code></li> 2654 2655 <li><code>GL_IMG_user_clip_plane</code></li> 2656 2657 <li><code>GL_IMG_multisampled_render_to_texture</code></li> 2658 2659 <li><code>GL_NV_fence</code></li> 2660 2661 <li><code>GL_QCOM_driver_control</code></li> 2662 2663 <li><code>GL_QCOM_extended_get</code></li> 2664 2665 <li><code>GL_QCOM_extended_get2</code></li> 2666 2667 <li><code>GL_QCOM_perfmon_global_mode</code></li> 2668 2669 <li><code>GL_QCOM_writeonly_rendering</code></li> 2670 2671 <li><code>GL_QCOM_tiled_rendering</code></li> 2672 </ul> 2673 </dd> 2674 2675 <dt>GLES 2.0</dt> 2676 2677 <dd> 2678 <ul> 2679 <li><code>GL_OES_element_index_uint</code></li> 2680 2681 <li><code>GL_OES_get_program_binary</code></li> 2682 2683 <li><code>GL_OES_mapbuffer</code></li> 2684 2685 <li><code>GL_OES_packed_depth_stencil</code></li> 2686 2687 <li><code>GL_OES_texture_3D</code></li> 2688 2689 <li><code>GL_OES_texture_float</code></li> 2690 2691 <li><code>GL_OES_texture_float_linear</code></li> 2692 2693 <li><code>GL_OES_texture_half_float_linear</code></li> 2694 2695 <li><code>GL_OES_texture_npot</code></li> 2696 2697 <li><code>GL_OES_vertex_array_object</code></li> 2698 2699 <li><code>GL_OES_EGL_image_external</code></li> 2700 2701 <li><code>GL_AMD_program_binary_Z400</code></li> 2702 2703 <li><code>GL_EXT_blend_minmax</code></li> 2704 2705 <li><code>GL_EXT_discard_framebuffer</code></li> 2706 2707 <li><code>GL_EXT_multi_draw_arrays</code></li> 2708 2709 <li><code>GL_EXT_read_format_bgra</code></li> 2710 2711 <li><code>GL_EXT_texture_format_BGRA8888</code></li> 2712 2713 <li><code>GL_EXT_texture_compression_dxt1</code></li> 2714 2715 <li><code>GL_IMG_program_binary</code></li> 2716 2717 <li><code>GL_IMG_read_format</code></li> 2718 2719 <li><code>GL_IMG_shader_binary</code></li> 2720 2721 <li><code>GL_IMG_texture_compression_pvrtc</code></li> 2722 2723 <li><code>GL_IMG_multisampled_render_to_texture</code></li> 2724 2725 <li><code>GL_NV_coverage_sample</code></li> 2726 2727 <li><code>GL_NV_depth_nonlinear</code></li> 2728 2729 <li><code>GL_QCOM_extended_get</code></li> 2730 2731 <li><code>GL_QCOM_extended_get2</code></li> 2732 2733 <li><code>GL_QCOM_writeonly_rendering</code></li> 2734 2735 <li><code>GL_QCOM_tiled_rendering</code></li> 2736 </ul> 2737 </dd> 2738 2739 <dt>EGL</dt> 2740 2741 <dd> 2742 <ul> 2743 <li><code>EGL_ANDROID_recordable</code></li> 2744 2745 <li><code>EGL_NV_system_time</code></li> 2746 </ul> 2747 </dd> 2748 </dl> 2749 </li> 2750 </ul> 2751 </dd> 2752 </dl> 2753 </div> 2754</div> 2755 2756 2757<div class="toggle-content closed"> 2758 <p><a href="#" onclick="return toggleContent(this)"> 2759 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 2760 alt="">Android NDK, Revision 6b</a> <em>(August 2011)</em> 2761 </p> 2762 2763 <div class="toggle-content-toggleme"> 2764 <p>This release of the NDK does not include any new features compared to r6. The r6b release 2765 addresses the following issues in the r6 release:</p> 2766 <dl> 2767 <dt>Important bug fixes</dt> 2768 <dd> 2769 <ul> 2770 <li>Fixed the build when <code>APP_ABI="armeabi x86"</code> is used for 2771 multi-architecture builds.</li> 2772 <li>Fixed the location of prebuilt STLport binaries in the NDK release package. 2773 A bug in the packaging script placed them in the wrong location.</li> 2774 <li>Fixed <code>atexit()</code> usage in shared libraries with the x86standalone 2775 toolchain.</li> 2776 <li>Fixed <code>make-standalone-toolchain.sh --arch=x86</code>. It used to fail 2777 to copy the proper GNU libstdc++ binaries to the right location.</li> 2778 <li>Fixed the standalone toolchain linker warnings about missing the definition and 2779 size for the <code>__dso_handle</code> symbol (ARM only).</li> 2780 <li>Fixed the inclusion order of <code>$(SYSROOT)/usr/include</code> for x86 builds. 2781 See the <a href="http://b.android.com/18540">bug</a> for 2782 more information.</li> 2783 <li>Fixed the definitions of <code>ptrdiff_t</code> and <code>size_t</code> in 2784 x86-specific systems when they are used with the x86 standalone toolchain.</li> 2785 </ul> 2786 </dd> 2787 </dl> 2788 </div> 2789</div> 2790 2791<div class="toggle-content closed"> 2792 <p><a href="#" onclick="return toggleContent(this)"> 2793 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 2794 alt="">Android NDK, Revision 6</a> <em>(July 2011)</em> 2795 </p> 2796 2797 <div class="toggle-content-toggleme"> 2798 <p>This release of the NDK includes support for the x86 ABI and other minor changes. 2799 For detailed information describing the changes in this release, read the 2800 <code>CHANGES.HTML</code> document included in the NDK package. 2801 </p> 2802 <dl> 2803 <dt>General notes:</dt> 2804 <dd> 2805 <ul> 2806 <li>Adds support for the x86 ABI, which allows you to generate machine code 2807 that runs on compatible x86-based Android devices. Major features for x86 2808 include x86-specific toolchains, system headers, libraries and 2809 debugging support. For all of the details regarding x86 support, 2810 see <code>docs/CPU-X86.html</code> in the NDK package. 2811 2812 <p>By default, code is generated for ARM-based devices, but you can add x86 to your 2813 <code>APP_ABI</code> definition in your <code>Application.mk</code> file to build 2814 for x86 platforms. For example, the following line instructs <code>ndk-build</code> 2815 to build your code for three distinct ABIs:</p> 2816 2817 <pre>APP_ABI := armeabi armeabi-v7a x86</pre> 2818 2819 <p>Unless you rely on ARM-based assembly sources, you shouldn't need to touch 2820 your <code>Android.mk</code> files to build x86 machine code.</p> 2821 2822 </li> 2823 2824 <li>You can build a standalone x86 toolchain using the 2825<code>--toolchain=x86-4.4.3</code> 2826 option when calling <code>make-standalone-toolchain.sh</code>. See 2827 <code>docs/STANDALONE-TOOLCHAIN.html</code> for more details. 2828 </li> 2829 <li>The new <code>ndk-stack</code> tool lets you translate stack traces in 2830 <code>logcat</code> that are generated by native code. The tool translates 2831 instruction addresses into a readable format that contains things such 2832 as the function, source file, and line number corresponding to each stack frame. 2833 For more information and a usage example, see <code>docs/NDK-STACK.html</code>. 2834 </li> 2835 </ul> 2836 </dd> 2837 <dt>Other changes:</dt> 2838 <dd><code>arm-eabi-4.4.0</code>, which had been deprecated since NDK r5, has been 2839 removed from the NDK distribution.</dd> 2840 2841 </dl> 2842 </div> 2843 </div> 2844 2845<div class="toggle-content closed"> 2846 <p><a href="#" onclick="return toggleContent(this)"> 2847 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 2848 alt="">Android NDK, Revision 5c</a> <em>(June 2011)</em> 2849 </p> 2850 2851 <div class="toggle-content-toggleme"> 2852 <p>This release of the NDK does not include any new features compared to r5b. The r5c release 2853 addresses the following problems in the r5b release:</p> 2854 <dl> 2855 <dt>Important bug fixes:</dt> 2856 <dd> 2857 <ul> 2858 <li><code>ndk-build</code>: Fixed a rare bug that appeared when trying to perform parallel 2859 builds of debuggable projects.</li> 2860 2861 <li>Fixed a typo that prevented <code>LOCAL_WHOLE_STATIC_LIBRARIES</code> to work 2862 correctly with the new toolchain and added documentation for this in 2863 <code>docs/ANDROID-MK.html</code>.</li> 2864 2865 <li>Fixed a bug where code linked against <code>gnustl_static</code> crashed when run on 2866 platform releases older than API level 8 (Android 2.2).</li> 2867 2868 <li><code>ndk-gdb</code>: Fixed a bug that caused a segmentation fault when debugging 2869Android 3.0 2870 or newer devices.</li> 2871 2872 <li><code><android/input.h></code>: Two functions that were introduced in API level 2873 9 (Android 2.3) were incorrect and are fixed. While this breaks the source API, the 2874 binary interface to the system is unchanged. The incorrect functions were missing a 2875 <code>history_index</code> parameter, and the correct definitions are shown below: 2876<pre> 2877float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event, 2878 size_t pointer_index, 2879 size_t history_index); 2880 2881float AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event, 2882 size_t pointer_index, 2883 size_t history_index); 2884</pre> 2885 </li> 2886 2887 <li>Updated the C library ARM binary for API level 9 (Android 2.3) to correctly expose at 2888 link time new functions that were added in that API level (for example, 2889 <code>pthread_rwlock_init</code>).</li> 2890 2891 </ul> 2892 </dd> 2893 2894 <dt>Minor improvements and fixes:</dt> 2895 <dd> 2896 <ul> 2897 <li>Object files are now always linked in the order they appear in 2898 <code>LOCAL_SRC_FILES</code>. This was not the case previously because the files were 2899 grouped by source extensions instead.</li> 2900 2901 <li>When <code>import-module</code> fails, it now prints the list of directories that 2902 were searched. This is useful to check that the <code>NDK_MODULE_PATH</code> definition 2903 used by the build system is correct.</li> 2904 2905 <li>When <code>import-module</code> succeeds, it now prints the directory where the 2906 module was found to the log (visible with <code>NDK_LOG=1</code>).</li> 2907 2908 <li>Increased the build speed of debuggable applications when there is a very large number 2909 of include directories in the project.</li> 2910 2911 <li><code>ndk-gdb</code>: Better detection of <code>adb shell</code> failures and improved 2912 error messages.</li> 2913 2914 <li><code><pthread.h></code>: Fixed the definition of 2915 <code>PTHREAD_RWLOCK_INITIALIZER</code> for API level 9 (Android 2.3) and higher.</li> 2916 2917 <li>Fixed an issue where a module could import itself, resulting in an infinite loop in 2918 GNU Make.</li> 2919 2920 <li>Fixed a bug that caused the build to fail if <code>LOCAL_ARM_NEON</code> was set to 2921 true (typo in <code>build/core/build-binary.mk</code>).</li> 2922 2923 <li>Fixed a bug that prevented the compilation of <code>.s</code> assembly files 2924 (<code>.S</code> files were okay).</li> 2925 </ul> 2926 </dd> 2927 </dl> 2928 </div> 2929</div> 2930 2931<div class="toggle-content closed"> 2932 <p><a href="#" onclick="return toggleContent(this)"> 2933 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 2934 alt="">Android NDK, Revision 5b</a> <em>(January 2011)</em> 2935 </p> 2936 2937 <div class="toggle-content-toggleme"> 2938 <p>This release of the NDK does not include any new features compared to r5. The r5b release 2939addresses the 2940 following problems in the r5 release: 2941 </p> 2942 <ul> 2943 <li>The r5 binaries required glibc 2.11, but the r5b binaries are generated with a special 2944 toolchain that targets glibc 2.7 or higher instead. The Linux toolchain binaries now run on 2945Ubuntu 8.04 or higher. </li> 2946 <li>Fixes a compiler bug in the arm-linux-androideabi-4.4.3 toolchain. 2947 The previous binary generated invalid thumb instruction sequences when 2948 dealing with signed chars.</li> 2949 <li>Adds missing documentation for the 2950 "gnustl_static" value for APP_STL, that allows you to link against 2951 a static library version of GNU libstdc++. </li> the 2952 <li>Fixed the following <code>ndk-build</code> issues: 2953 <ul> 2954 <li>A bug that created inconsistent dependency files when a 2955 compilation error occured on Windows. This prevented a proper build after 2956 the error was fixed in the source code.</li> 2957 <li>A Cygwin-specific bug where using very short paths for 2958 the Android NDK installation or the project path led to the 2959 generation of invalid dependency files. This made incremental builds 2960 impossible.</li> 2961 <li>A typo that prevented the cpufeatures library from working correctly 2962 with the new NDK toolchain.</li> 2963 <li>Builds in Cygwin are faster by avoiding calls to <code>cygpath -m</code> 2964 from GNU Make for every source or object file, which caused problems 2965 with very large source trees. In case this doesn't work properly, define 2966<code>NDK_USE_CYGPATH=1</code> in your 2967 environment to use <code>cygpath -m</code> again.</li> 2968 <li>The Cygwin installation now notifies the user of invalid installation paths that 2969contain spaces. Previously, an invalid path 2970 would output an error that complained about an incorrect version of GNU Make, even if the 2971right one was installed. 2972 </ul> 2973 </li> 2974 <li>Fixed a typo that prevented the <code>NDK_MODULE_PATH</code> environment variable from 2975working properly when 2976 it contained multiple directories separated with a colon. </li> 2977 <li>The <code>prebuilt-common.sh</code> script contains fixes to check the compiler for 64-bit 2978 generated machine code, instead of relying on the host tag, which 2979 allows the 32-bit toolchain to rebuild properly on Snow Leopard. The toolchain rebuild scripts 2980now also support 2981 using a 32-bit host toolchain.</li> 2982 <li>A missing declaration for <code>INET_ADDRSTRLEN</code> was added to 2983<code><netinet/in.h></code>.</li> 2984 <li>Missing declarations for <code>IN6_IS_ADDR_MC_NODELOCAL</code> and 2985<code>IN6_IS_ADDR_MC_GLOBAL</code> were added to <code><netinet/in6.h></code>.</li> 2986 <li>'asm' was replaced with '__asm__' in <code><asm/byteorder.h></code> to allow 2987compilation with <code>-std=c99</code>.</li> 2988 </ul> 2989 </div> 2990 </div> 2991 2992<div class="toggle-content closed"> 2993 <p><a href="#" onclick="return toggleContent(this)"> 2994 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 2995 alt="">Android NDK, Revision 5</a> <em>(December 2010)</em> 2996 </p> 2997 2998 <div class="toggle-content-toggleme"> 2999 <p>This release of the NDK includes many new APIs, most of which are introduced to 3000 support the development of games and similar applications that make extensive use 3001 of native code. Using the APIs, developers have direct native access to events, audio, 3002 graphics and window management, assets, and storage. Developers can also implement the 3003 Android application lifecycle in native code with help from the new 3004 {@link android.app.NativeActivity} class. For detailed information describing the changes 3005in this 3006 release, read the <code>CHANGES.HTML</code> document included in the downloaded NDK 3007package. 3008 </p> 3009 <dl> 3010 <dt>General notes:</dt> 3011 <dd> 3012 <ul> 3013 <li>Adds support for native activities, which allows you to implement the 3014 Android application lifecycle in native code.</li> 3015 3016 <li>Adds native support for the following: 3017 3018 <ul> 3019 3020 <li>Input subsystem (such as the keyboard and touch screen)</li> 3021 3022 <li>Access to sensor data (accelerometer, compass, gyroscope, etc).</li> 3023 3024 <li>Event loop APIs to wait for things such as input and sensor events.</li> 3025 3026 <li>Window and surface subsystem</li> 3027 3028 <li>Audio APIs based on the OpenSL ES standard that support playback and recording 3029 as well as control over platform audio effects</li> 3030 3031 <li>Access to assets packaged in an <code>.apk</code> file.</li> 3032 3033 </ul> 3034 </li> 3035 3036 <li>Includes a new toolchain (based on GCC 4.4.3), which generates better code, and can 3037also now 3038 be used as a standalone cross-compiler, for people who want to build their stuff with 3039 <code>./configure && make</code>. See 3040 docs/STANDALONE-TOOLCHAIN.html for the details. The binaries for GCC 4.4.0 are still 3041provided, 3042 but the 4.2.1 binaries were removed.</li> 3043 3044 <li>Adds support for prebuilt static and shared libraries (docs/PREBUILTS.html) and 3045module 3046 exports and imports to make sharing and reuse of third-party modules much easier 3047 (docs/IMPORT-MODULE.html explains why).</li> 3048 3049 <li>Provides a default C++ STL implementation (based on STLport) as a helper module. It 3050can be used either 3051 as a static or shared library (details and usage examples are in 3052sources/android/stlport/README). Prebuilt 3053 binaries for STLport (static or shared) and GNU libstdc++ (static only) are also 3054provided if you choose to 3055 compile against those libraries instead of the default C++ STL implementation. 3056 C++ Exceptions and RTTI are not supported in the default STL implementation. For more 3057information, see 3058 docs/CPLUSPLUS-SUPPORT.HTML.</li> 3059 3060 <li>Includes improvements to the <code>cpufeatures</code> helper library that improves 3061reporting 3062 of the CPU type (some devices previously reported ARMv7 CPU when the device really was 3063an ARMv6). We 3064 recommend developers that use this library to rebuild their applications then 3065 upload to Google Play to benefit from the improvements.</li> 3066 3067 <li>Adds an EGL library that lets you create and manage OpenGL ES textures and 3068 services.</li> 3069 3070 <li>Adds new sample applications, <code>native-plasma</code> and 3071<code>native-activity</code>, 3072 to demonstrate how to write a native activity.</li> 3073 3074 <li>Includes many bugfixes and other small improvements; see docs/CHANGES.html for a 3075more 3076 detailed list of changes.</li> 3077 </ul> 3078 </dd> 3079 </dl> 3080 </div> 3081 </div> 3082 3083<div class="toggle-content closed"> 3084 <p><a href="#" onclick="return toggleContent(this)"> 3085 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 3086 alt="">Android NDK, Revision 4b</a> <em>(June 2010)</em> 3087 </p> 3088 3089 <div class="toggle-content-toggleme"> 3090 <dl> 3091 <dt>NDK r4b notes:</dt> 3092 3093 <dd> 3094 <p>Includes fixes for several issues in the NDK build and debugging scripts — if 3095 you are using NDK r4, we recommend downloading the NDK r4b build. For detailed 3096 information describing the changes in this release, read the CHANGES.TXT document 3097 included in the downloaded NDK package.</p> 3098 </dd> 3099 </dl> 3100 3101 <dl> 3102 <dt>General notes:</dt> 3103 3104 <dd> 3105 <ul> 3106 <li>Provides a simplified build system through the new <code>ndk-build</code> build 3107 command.</li> 3108 3109 <li>Adds support for easy native debugging of generated machine code on production 3110 devices through the new <code>ndk-gdb</code> command.</li> 3111 3112 <li>Adds a new Android-specific ABI for ARM-based CPU architectures, 3113 <code>armeabi-v7a</code>. The new ABI extends the existing <code>armeabi</code> ABI to 3114 include these CPU instruction set extensions: 3115 3116 <ul> 3117 <li>Thumb-2 instructions</li> 3118 3119 <li>VFP hardware FPU instructions (VFPv3-D16)</li> 3120 3121 <li>Optional support for ARM Advanced SIMD (NEON) GCC intrinsics and VFPv3-D32. 3122 Supported by devices such as Verizon Droid by Motorola, Google Nexus One, and 3123 others.</li> 3124 </ul> 3125 </li> 3126 3127 <li>Adds a new <code>cpufeatures</code> static library (with sources) that lets your 3128 app detect the host device's CPU features at runtime. Specifically, applications can 3129 check for ARMv7-A support, as well as VFPv3-D32 and NEON support, then provide separate 3130 code paths as needed.</li> 3131 3132 <li>Adds a sample application, <code>hello-neon</code>, that illustrates how to use the 3133 <code>cpufeatures</code> library to check CPU features and then provide an optimized 3134 code path using NEON instrinsics, if supported by the CPU.</li> 3135 3136 <li>Lets you generate machine code for either or both of the instruction sets supported 3137 by the NDK. For example, you can build for both ARMv5 and ARMv7-A architectures at the 3138 same time and have everything stored to your application's final 3139 <code>.apk</code>.</li> 3140 3141 <li>To ensure that your applications are available to users only if their devices are 3142 capable of running them, Google Play now filters applications based on the 3143 instruction set information included in your application — no action is needed on 3144 your part to enable the filtering. Additionally, the Android system itself also checks 3145 your application at install time and allows the installation to continue only if the 3146 application provides a library that is compiled for the device's CPU architecture.</li> 3147 3148 <li>Adds support for Android 2.2, including a new stable API for accessing the pixel 3149 buffers of {@link android.graphics.Bitmap} objects from native code.</li> 3150 </ul> 3151 </dd> 3152 </dl> 3153 </div> 3154 </div> 3155 3156<div class="toggle-content closed"> 3157 <p><a href="#" onclick="return toggleContent(this)"> 3158 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 3159 alt="">Android NDK, Revision 3</a> <em>(March 2010)</em> 3160 </p> 3161 3162 <div class="toggle-content-toggleme"> 3163 <dl> 3164 <dt>General notes:</dt> 3165 3166 <dd> 3167 <ul> 3168 <li>Adds OpenGL ES 2.0 native library support.</li> 3169 3170 <li>Adds a sample application,<code>hello-gl2</code>, that illustrates the use of 3171 OpenGL ES 2.0 vertex and fragment shaders.</li> 3172 3173 <li>The toolchain binaries have been refreshed for this release with GCC 4.4.0, which 3174 should generate slightly more compact and efficient machine code than the previous one 3175 (4.2.1). The NDK also still provides the 4.2.1 binaries, which you can optionally use 3176 to build your machine code.</li> 3177 </ul> 3178 </dd> 3179 </dl> 3180 </div> 3181 </div> 3182 3183<div class="toggle-content closed"> 3184 <p><a href="#" onclick="return toggleContent(this)"> 3185 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 3186 alt="">Android NDK, Revision 2</a> <em>(September 2009)</em> 3187 </p> 3188 3189 <div class="toggle-content-toggleme"> 3190 <p>Originally released as "Android 1.6 NDK, Release 1".</p> 3191 3192 <dl> 3193 <dt>General notes:</dt> 3194 3195 <dd> 3196 <ul> 3197 <li>Adds OpenGL ES 1.1 native library support.</li> 3198 3199 <li>Adds a sample application, <code>san-angeles</code>, that renders 3D graphics 3200 through the native OpenGL ES APIs, while managing activity lifecycle with a {@link 3201 android.opengl.GLSurfaceView} object.</li> 3202 </ul> 3203 </dd> 3204 </dl> 3205 </div> 3206 </div> 3207 3208<div class="toggle-content closed"> 3209 <p><a href="#" onclick="return toggleContent(this)"> 3210 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" 3211 alt="">Android NDK, Revision 1</a> <em>(June 2009)</em> 3212 </p> 3213 3214 <div class="toggle-content-toggleme"> 3215 <p>Originally released as "Android 1.5 NDK, Release 1".</p> 3216 3217 <dl> 3218 <dt>General notes:</dt> 3219 3220 <dd> 3221 <ul> 3222 <li>Includes compiler support (GCC) for ARMv5TE instructions, including Thumb-1 3223 instructions.</li> 3224 3225 <li>Includes system headers for stable native APIs, documentation, and sample 3226 applications.</li> 3227 </ul> 3228 </dd> 3229 </dl> 3230 </div> 3231 </div> 3232 3233 3234 3235 3236 3237<!-- ####################### END OF RELEASE NOTES ####################### --> 3238