title: Running a native library on Android L. error: only position independent executables (PIE) are supported
body: <p>When I run native code on Android L (Nexus 5), I get the error.</p>
  
  <blockquote>
    <p>error: only position independent executables (PIE) are supported.</p>
  </blockquote>
  
  <p>The same code is executed correctly on my Samsung Galaxy S3 (Android 4.3).</p>
  
  <p>Here is my Application.mk</p>
  
  <pre><code>APP_PROJECT_PATH := $(call my-dir)/..
  APP_ABI := armeabi
  NDK_TOOLCHAIN_VERSION := 4.7
  APP_PLATFORM := android-9
  APP_GNUSTL_FORCE_CPP_FEATURES := exceptions rtti
  </code></pre>
  
  <p>However when I replace <code>APP_PLATFORM := android-9</code> with <code>APP_PLATFORM := android-16</code> (As I read <a href="https://www.duosecurity.com/blog/exploit-mitigations-in-android-jelly-bean-4-1" rel="noreferrer">here</a>, PIE support appeared in Jelly Been (API level 16)), the same executable file works fine on Android L.</p>
  
  <p>Is there a way to compile native code using <code>APP_PLATFORM := android-9</code> and run it on Android L?</p>