From 1256b777476d40cd727db25d387929a0f426056e Mon Sep 17 00:00:00 2001 From: pancake Date: Fri, 7 Nov 2014 01:02:23 +0100 Subject: [PATCH] Use -pie -fPIC for Android builds (required for Android L) --- mk/android.mk | 2 +- sys/ndk-gcc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mk/android.mk b/mk/android.mk index dba6721a19..fabc449ea0 100644 --- a/mk/android.mk +++ b/mk/android.mk @@ -1,5 +1,5 @@ #CC=arm-linux-androideabi-gcc -CC=ndk-gcc +CC=ndk-gcc -fPIC -pie -fPIE #RANLIB=ndk-ranlib USERCC=ndk-gcc RANLIB=arm-linux-androideabi-ranlib diff --git a/sys/ndk-gcc b/sys/ndk-gcc index 3414852d76..27f93c62c9 100755 --- a/sys/ndk-gcc +++ b/sys/ndk-gcc @@ -57,6 +57,7 @@ if [ -z "${NDK_BINS}" ]; then fi CFLAGS="--sysroot=${PLATFORM_ROOT}" CFLAGS="${CFLAGS} -I${PLATFORM_PATH}/include" +CFLAGS="${CFLAGS} -pie -fPIC" LDFLAGS=-L${PLATFORM_PATH}/lib #LDFLAGS="${LDFLAGS} -nostdlib" #LDFLAGS="${LDFLAGS} -lc -ldl"