From 202a78e8e43148525d12dc4feeddda12e35a4dbd Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 10 Jan 2015 16:14:37 +0100 Subject: [PATCH] Fix compile for Android 5 Android 5 can only run position independent executables. Note that this breaks Android 4.0 and earlier. See here for more info: http://stackoverflow.com/questions/24818902/running-a-native-library-on-android-l-error-only-position-independent-executab Thanks to Peter Osterlund for the support. No functional change --- src/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Makefile b/src/Makefile index fa0e91a8..8321cdcb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -310,6 +310,14 @@ ifeq ($(comp),gcc) endif endif +### 3.12 Android 5 can only run position independent executables. Note that this +### breaks Android 4.0 and earlier. +ifeq ($(arch),armv7) + CXXFLAGS += -fPIE + LDFLAGS += -fPIE -pie +endif + + ### ========================================================================== ### Section 4. Public targets ### ========================================================================== -- 2.39.2