android/build.py: add -fpic

Android native code should be position-independent.

The NDK build scripts use "-fpic" instead of "-fPIC" for ARM, but that
doesn't work with FFmpeg's assembly code, because it requires
R_ARM_MOVW_ABS_NC which is unavailable with "-fpic".
This commit is contained in:
Max Kellermann 2018-01-19 12:55:57 +01:00
parent cad5d11261
commit 9e058732ee

View File

@ -66,6 +66,7 @@ class AndroidNdkToolchain:
llvm_triple = 'armv7-none-linux-androideabi' llvm_triple = 'armv7-none-linux-androideabi'
common_flags = '-Os -g' common_flags = '-Os -g'
common_flags += ' -fPIC'
common_flags += ' -march=armv7-a -mfloat-abi=softfp' common_flags += ' -march=armv7-a -mfloat-abi=softfp'
toolchain_bin = os.path.join(toolchain_path, 'bin') toolchain_bin = os.path.join(toolchain_path, 'bin')