]> git.sesse.net Git - stockfish/commitdiff
Fix compile for Android 5
authorMarco Costalba <mcostalba@gmail.com>
Sat, 10 Jan 2015 15:14:37 +0000 (16:14 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 11 Jan 2015 09:52:42 +0000 (10:52 +0100)
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

index fa0e91a86ea81e2e6c290a386ee9cac0c4229125..8321cdcb36d81816124e7ac4e5ced4d216933567 100644 (file)
@@ -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
 ### ==========================================================================