Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't build PIE version correctly? #1

Open
bigwave opened this issue Jun 6, 2015 · 4 comments
Open

Doesn't build PIE version correctly? #1

bigwave opened this issue Jun 6, 2015 · 4 comments

Comments

@bigwave
Copy link

bigwave commented Jun 6, 2015

Hi,

First of all, a really useful docker container as all I needed was a PIE ssh client and I've never compiled NDK stuff before.

However the PIE output (at least for the ARM ssh client) wasn't actually a PIE executable.

It seemed that the final linking(?) command didn't have the PIE flags, so I brute forced a solution by adding -pie -fPIE to the end of the COMPILER=${TOOLCHAIN}/bin/arm-linux-androideabi-gcc line

Which worked, but I'm pretty sure this isn't the correct way to fix this.

Cheers,
Ian

@luveti
Copy link

luveti commented Mar 28, 2016

I'm having this same issue. Did you ever find a more proper solution?

@bigwave
Copy link
Author

bigwave commented Apr 3, 2016

Afraid not, once I had a PIE enabled executable I didn't need to look into this any more.

@luveti
Copy link

luveti commented Apr 9, 2016

That's fine! Thanks anyways!

@renaudcerrato
Copy link

The answer is that the -pie flag have to be set on LDFLAGS for executables.

@@ -75,6 +75,7 @@ for ARCH_NAME in mips arm x86; do

         if [ $BIN_TYPE == "pie" ]; then
             export CFLAGS="-g -O2 -pie -fPIE"
+            export LDFLAGS="-pie"
             # Use the default platform target for pie binaries 
             unset GOOGLE_PLATFORM
         else 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants