Forums - [Dragonboard APQ8094] calculator example fails PIE check

6 posts / 0 new
Last post
[Dragonboard APQ8094] calculator example fails PIE check
Silviu
Join Date: 11 Feb 15
Posts: 7
Posted: Wed, 2015-02-11 08:41

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

  • Up0
  • Down0
marior
Join Date: 11 Feb 15
Posts: 3
Posted: Wed, 2015-02-11 13:47

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

  • Up0
  • Down0
h.rubaiyat
Join Date: 1 Dec 14
Posts: 11
Posted: Thu, 2015-02-12 22:32

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?

  • Up0
  • Down0
Silviu
Join Date: 11 Feb 15
Posts: 7
Posted: Tue, 2015-02-17 20:07

Thank you marior. Your solution worked.

  • Up0
  • Down0
DAVID.ROACH
Join Date: 17 Jan 15
Posts: 3
Posted: Sat, 2015-02-21 21:07

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!

  • Up0
  • Down0
DAVID.ROACH
Join Date: 17 Jan 15
Posts: 3
Posted: Sat, 2015-02-21 21:08

Oops, that should have said "still can't get around the problem". I'm stuck...

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.