android - ndk can't get executable file -
just build simple "helloworld" using android ndk
, got shard object supposed executable file. , after pushed file arm emulator, got segmentation fault, real device ok. what's problem? here os version:
darwin avator 13.4.0 darwin kernel version 13.4.0: sun aug 17 19:50:11 pdt 2014; root:xnu-2422.115.4~1/release_x86_64 x86_64 i386 macbookpro11,1 darwin
here android.mk
:
local_path := $(call my-dir) include $(clear_vars) local_module := test-libstl local_src_files := test-libstl.cpp include $(build_executable)
and after ndk-build
,i got file:
$file ../libs/arm64-v8a/test-libstl ../libs/arm64-v8a/test-libstl: elf 64-bit lsb shared object, version 1 (sysv), dynamically linked (uses shared libs), stripped
this not error in - it's file
utility interprets position independent executable (pie) shared object - executable has been built fine.
only android 4.1 , newer supports pie executables, , on 5.0, non-pie executables aren't allowed longer - may why can't run in emulator. see running native library on android l. error: position independent executables (pie) supported more details on issue. if target platform in ndk android 4.1 or newer (android-16), executables built pie enabled.
Comments
Post a Comment