Home | History | Annotate | Download | only in guides
      1 page.title=Support for 64-bit x86
      2 @jd:body
      3 
      4 <div id="qv-wrapper">
      5     <div id="qv">
      6       <h2>On this page</h2>
      7 
      8       <ol>
      9         <li><a href="#over">Overview</a></li>
     10          <li><a href="#st">Standalone Toolchain</a></li>
     11          <li><a href="#comp">Compatibilty</a></li>
     12           </ol>
     13         </li>
     14       </ol>
     15     </div>
     16   </div>
     17 
     18 <p>The Android NDK supports the {@code x86_64} ABI. This ABI allows native code to run on
     19 Android-based devices using CPUs that support the 64-bit x86 instruction set.</p>
     20 
     21 <h2 id="over">Overview</h2>
     22 <p>To generate 64-bit machine code for x86, add {@code x86_64} to the {@code APP_ABI} definition in
     23 your {@code Application.mk} file. For example:
     24 
     25 <pre>
     26 APP_ABI := x86_64
     27 </pre>
     28 
     29 For more information on how to specify values for {@code APP_ABI}, see
     30 <a href="{@docRoot}ndk/guides/application_mk.html">Application.mk</a>.</p>
     31 
     32 <p>The build system places libraries generated for the {@code x86_64} ABI into
     33 {@code $PROJECT/libs/x86_64/} on your host machine, where {@code $PROJECT} is the root directory
     34 of your project. It also embeds them in your APK, under {@code /lib/x86_64/}.</p>
     35 
     36 <p>The Android package manager extracts these libraries when installing your APK on a compatible
     37 64-bit, x86-powered device, placing them under your app's private data directory.</p>
     38 
     39 <p>In the Google Play store, the server filters applications so that a consumer sees only the native
     40 libraries that run on the CPU powering his or her device.</p>
     41 
     42 <h2 id="st">Standalone Toolchain</h2>
     43 
     44 <p>You can use the 64-bit x86 toolchain in standalone mode with the NDK. For more
     45 information about doing so, see <a href="{@docRoot}ndk/guides/standalone_toolchain.html">
     46 Standalone Toolchain</a>, under the "Advanced method" section.
     47 
     48 <h2 id="comp">Compatibility</h2>
     49 <p>The NDK provides native versions of Android APIs for 64-bit x86 machine code starting from
     50 Android 5.0 (Android API level 21). If your project files target an older API level, but include
     51 {@code x86_64} as a targeted platform, the NDK build script automatically selects the right set of
     52 native platform headers and libraries for you.</p>
     53