I have a Dragonboard 8094 (Snapdragon 810) that came with Android L pre-loaded.
I'm trying to run the calculator sample application that came with the Hexagon SDK v1.2.2, however it seems to be slightly out-dated. Android L introduced some new security measures, including a PIE (Position-independent executables) check for all binaries.
When I try to run the calculator binary on the dragonboard I get the following error:
error: only position independent executables (PIE) are supported.
I can't rebuild Android to disable the PIE check because the source code from Intrystic will not able available until the end of February.
How can I modify the makefile of the calculator example to build a position-independent executable?
What else can I do?
Thank you
Follow these steps to compile with PIE enabled:
Open defines_android.min located at:
<SDK_ROOT>\tools\make.d.ext\android
Find these two lines on top of the file:
#arm-none-linux-gnueabi-gcc
ANDROID_GCC_PREFIX?=arm-linux-androideabi-# default
And add these two lines:
__CXX_FLAGS+=-fpie -fpic -fPIE -pie#
LD_FLAGS+=-fpie -fpic -fPIE -pie
Change should look like:
#arm-none-linux-gnueabi-gcc
ANDROID_GCC_PREFIX?=arm-linux-androideabi-# default
__CXX_FLAGS+=-fpie -fpic -fPIE -pie#
LD_FLAGS+=-fpie -fpic -fPIE -pie
Save the file!
Recompile Calculator
==================
Open a Windows command prompt at:
<SDK_ROOT>\examples\common\calculator
Clean existing binaries:
make tree V=<variant> clean
Recompile
make tree V=<variant>
<variant> can be any of:
android_Debug
android_ReleaseG
android_Release
I am facing same problem while running "getserial" binary for signing. There is no way to rebuild this binary as it is provided in this way. What am I supposed to do for this?
Thank you marior. Your solution worked.
I also hit both of these issues trying to use the current Hexagon SDK with Android Lollipop.
I still can get around "problem while running 'getserial' binary for signing". There is no obvious way to rebuild this binary with PIE. This pretty much makes the Quick Start portion of the SDK useless for Lollipop. Does anyone know when we can expect an updated SDK that does work with Lollipop? Maybe I need to reflash my target device to KitKat and start the process all over again.
Thanks!
Oops, that should have said "still can't get around the problem". I'm stuck...