diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-09-01 15:43:34 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-09-01 15:48:41 +0530 |
commit | c5f68aea1c53076639ff52916f424d5b94eada23 (patch) | |
tree | 71ff5859375b52dc8de6b298179e52bbdec02acc | |
parent | 3ff65b61caaaa7d74e5c5ca6d74c41040b093120 (diff) |
android.config: Unset _FILE_OFFSET_BITS for older Android
-rw-r--r-- | config/android.config | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/config/android.config b/config/android.config index c64d8e12..53701bfd 100644 --- a/config/android.config +++ b/config/android.config @@ -127,7 +127,12 @@ if target_arch != Architecture.UNIVERSAL and not os.path.exists(lib_dir): os.makedirs(lib_dir) ccache = use_ccache and 'ccache ' or '' -defines = '-DANDROID -DPIC -D__ANDROID_API__=%s' % (v) +defines = '-DANDROID -DPIC -D__ANDROID_API__=%s ' % (v) +# Android API older than 21 does not work well with -D_FILE_OFFSET_BITS=64, +# which is set by default in Meson. We must remove this when we move to +# building with Clang. +if v < 21: + defines += '-U_FILE_OFFSET_BITS ' cflags = '-isysroot %s -isystem %s -isystem %s/usr/include -isystem %s/usr/include/%s -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fPIC' % (isysroot, incl_dir, isysroot, isysroot, tools_prefix) ldflags = '--sysroot %s -fPIC -no-canonical-prefixes -Wl,-no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -Wl,-dynamic-linker,/system/bin/linker ' % (sysroot) if not target_arch in [Architecture.ARM64, Architecture.X86_64]: |