From c59ffaa6d7271acc1e745814fa073a538f40e737 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 18 Oct 2019 02:59:21 +0300 Subject: [PATCH] waifulib: xcompile: fix AArch64 installation, fix including system headers --- scripts/waifulib/xcompile.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 4579ae6..a781891 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -144,6 +144,11 @@ class Android: else: return self.arch + '-linux-android' + def apk_arch(self): + if self.is_arm64(): + return 'arm64-v8a' + return self.arch + def gen_host_toolchain(self): # With host toolchain we don't care about OS # so just download NDK for Linux x86_64 @@ -235,7 +240,7 @@ class Android: if self.is_host(): cflags += [ '--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path()), - '-I%s/usr/include/' % (self.sysroot()) + '-isystem', '%s/usr/include/' % (self.sysroot()) ] cflags += ['-I%s' % (self.system_stl()), '-DANDROID', '-D__ANDROID__'] @@ -291,7 +296,7 @@ class Android: def ldflags(self): ldflags = ['-lgcc', '-no-canonical-prefixes'] - if self.is_clang(): + if self.is_clang() or self.is_host(): ldflags += ['-stdlib=libstdc++'] if self.is_arm(): if self.arch == 'armeabi-v7a': @@ -336,7 +341,7 @@ def configure(conf): conf.env.LIB_M = ['m_hard'] else: conf.env.LIB_M = ['m'] - conf.env.PREFIX = '/lib/%s' % (android.arch) + conf.env.PREFIX = '/lib/%s' % android.apk_arch() conf.msg('Selected Android NDK', '%s, version: %d' % (android.ndk_home, android.ndk_rev)) # no need to print C/C++ compiler, as it would be printed by compiler_c/cxx