From 04101f37b820583387e3b93e3bdd50f791438e0e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 12 Jan 2020 12:41:37 +0100 Subject: [PATCH] android/build.py: add -fno-faddrsig and -lmstackrealign --- android/build.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android/build.py b/android/build.py index bea1dd051..d587982cd 100755 --- a/android/build.py +++ b/android/build.py @@ -100,6 +100,9 @@ class AndroidNdkToolchain: common_flags += ' -fvisibility=hidden -fdata-sections -ffunction-sections' + # required flags from https://android.googlesource.com/platform/ndk/+/ndk-release-r20/docs/BuildSystemMaintainers.md#additional-required-arguments + common_flags += ' -fno-addrsig' + self.ar = os.path.join(toolchain_bin, arch + '-ar') self.ranlib = os.path.join(toolchain_bin, arch + '-ranlib') self.nm = os.path.join(toolchain_bin, arch + '-nm') @@ -113,6 +116,10 @@ class AndroidNdkToolchain: self.ldflags = common_flags self.libs = '' + # required flags from https://android.googlesource.com/platform/ndk/+/ndk-release-r20/docs/BuildSystemMaintainers.md#additional-required-arguments + if ndk_arch == 'x86' and int(android_api_level) < 24: + self.ldflags += ' -lmstackrealign' + self.is_arm = ndk_arch == 'arm' self.is_armv7 = self.is_arm and 'armv7' in self.cflags self.is_aarch64 = ndk_arch == 'arm64'