arm64 #606
12 changed files with 1794 additions and 64 deletions
|
@ -25,6 +25,7 @@ build apk:
|
||||||
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
||||||
- cp -f $CI_PROJECT_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
|
- cp -f $CI_PROJECT_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
|
||||||
- cp -f $CI_PROJECT_DIR/scripts/mangled-glibc-syscalls.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
|
- cp -f $CI_PROJECT_DIR/scripts/mangled-glibc-syscalls.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
|
||||||
|
- cp -f $CI_PROJECT_DIR/scripts/mangled-glibc-syscalls__arm64.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm64/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
|
||||||
- rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
|
- rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
|
||||||
- git secret reveal
|
- git secret reveal
|
||||||
- mv buildozer.spec.ci buildozer.spec
|
- mv buildozer.spec.ci buildozer.spec
|
||||||
|
|
2
app
2
app
|
@ -1 +1 @@
|
||||||
Subproject commit e3f66e4fa67867b1e2b80ada480cd05808cad136
|
Subproject commit fccf371dde3bebf7d13739cdca990c8dd0839a43
|
|
@ -187,7 +187,7 @@ android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android
|
||||||
#android.copy_libs = 1
|
#android.copy_libs = 1
|
||||||
|
|
||||||
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
|
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
|
||||||
android.arch = armeabi-v7a
|
android.arch = arm64-v8a
|
||||||
|
|
||||||
#
|
#
|
||||||
# Python for android (p4a) specific
|
# Python for android (p4a) specific
|
||||||
|
|
|
@ -187,7 +187,7 @@ android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android
|
||||||
#android.copy_libs = 1
|
#android.copy_libs = 1
|
||||||
|
|
||||||
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
|
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
|
||||||
android.arch = armeabi-v7a
|
android.arch = arm64-v8a
|
||||||
|
|
||||||
#
|
#
|
||||||
# Python for android (p4a) specific
|
# Python for android (p4a) specific
|
||||||
|
|
|
@ -187,7 +187,7 @@ android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android
|
||||||
#android.copy_libs = 1
|
#android.copy_libs = 1
|
||||||
|
|
||||||
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
|
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
|
||||||
android.arch = armeabi-v7a
|
android.arch = arm64-v8a
|
||||||
|
|
||||||
#
|
#
|
||||||
# Python for android (p4a) specific
|
# Python for android (p4a) specific
|
||||||
|
|
|
@ -70,7 +70,7 @@ class BdistAPK(Command):
|
||||||
sys.argv.append('--version={}'.format(version))
|
sys.argv.append('--version={}'.format(version))
|
||||||
|
|
||||||
if not argv_contains('--arch'):
|
if not argv_contains('--arch'):
|
||||||
arch = 'armeabi'
|
arch = 'arm64-v8a'
|
||||||
self.arch = arch
|
self.arch = arch
|
||||||
sys.argv.append('--arch={}'.format(arch))
|
sys.argv.append('--arch={}'.format(arch))
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
|
||||||
jcenter()
|
jcenter()
|
||||||
|
google()
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -41,7 +41,7 @@ android {
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "x86"
|
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -288,7 +288,7 @@ class ToolchainCL(object):
|
||||||
|
|
||||||
generic_parser.add_argument(
|
generic_parser.add_argument(
|
||||||
'--arch', help='The archs to build for, separated by commas.',
|
'--arch', help='The archs to build for, separated by commas.',
|
||||||
default='armeabi-v7a')
|
default='arm64-v8a')
|
||||||
|
|
||||||
# Options for specifying the Distribution
|
# Options for specifying the Distribution
|
||||||
generic_parser.add_argument(
|
generic_parser.add_argument(
|
||||||
|
|
|
@ -1,31 +1,27 @@
|
||||||
from os.path import exists, join
|
from os.path import exists, join
|
||||||
|
from multiprocessing import cpu_count
|
||||||
from pythonforandroid.recipe import Recipe
|
from pythonforandroid.recipe import Recipe
|
||||||
from pythonforandroid.logger import info, shprint
|
from pythonforandroid.logger import shprint
|
||||||
from pythonforandroid.util import current_directory
|
from pythonforandroid.util import current_directory, ensure_dir
|
||||||
import sh
|
import sh
|
||||||
|
|
||||||
|
|
||||||
class LibffiRecipe(Recipe):
|
class LibffiRecipe(Recipe):
|
||||||
|
"""
|
||||||
|
Requires additional system dependencies on Ubuntu:
|
||||||
|
- `automake` for the `aclocal` binary
|
||||||
|
- `autoconf` for the `autoreconf` binary
|
||||||
|
- `libltdl-dev` which defines the `LT_SYS_SYMBOL_USCORE` macro
|
||||||
|
"""
|
||||||
name = 'libffi'
|
name = 'libffi'
|
||||||
version = 'v3.2.1'
|
version = '3.2.1'
|
||||||
url = 'https://github.com/atgreen/libffi/archive/{version}.zip'
|
url = 'https://github.com/libffi/libffi/archive/v{version}.tar.gz'
|
||||||
|
|
||||||
patches = ['remove-version-info.patch']
|
patches = ['remove-version-info.patch',
|
||||||
|
# This patch below is already included into libffi's master
|
||||||
def get_host(self, arch):
|
# branch and included in the pre-release 3.3rc0...so we should
|
||||||
with current_directory(self.get_build_dir(arch.arch)):
|
# remove this when we update the version number for libffi
|
||||||
host = None
|
'fix-includedir.patch']
|
||||||
with open('Makefile') as f:
|
|
||||||
for line in f:
|
|
||||||
if line.startswith('host = '):
|
|
||||||
host = line.strip()[7:]
|
|
||||||
break
|
|
||||||
|
|
||||||
if not host or not exists(host):
|
|
||||||
raise RuntimeError('failed to find build output! ({})'
|
|
||||||
.format(host))
|
|
||||||
|
|
||||||
return host
|
|
||||||
|
|
||||||
def should_build(self, arch):
|
def should_build(self, arch):
|
||||||
return not exists(join(self.ctx.get_libs_dir(arch.arch), 'libffi.so'))
|
return not exists(join(self.ctx.get_libs_dir(arch.arch), 'libffi.so'))
|
||||||
|
@ -37,47 +33,21 @@ class LibffiRecipe(Recipe):
|
||||||
shprint(sh.Command('./autogen.sh'), _env=env)
|
shprint(sh.Command('./autogen.sh'), _env=env)
|
||||||
shprint(sh.Command('autoreconf'), '-vif', _env=env)
|
shprint(sh.Command('autoreconf'), '-vif', _env=env)
|
||||||
shprint(sh.Command('./configure'),
|
shprint(sh.Command('./configure'),
|
||||||
'--host=' + arch.toolchain_prefix,
|
'--host=' + arch.command_prefix,
|
||||||
'--prefix=' + self.ctx.get_python_install_dir(),
|
'--prefix=' + self.get_build_dir(arch.arch),
|
||||||
|
'--disable-builddir',
|
||||||
'--enable-shared', _env=env)
|
'--enable-shared', _env=env)
|
||||||
#'--with-sysroot={}'.format(self.ctx.ndk_platform),
|
|
||||||
#'--target={}'.format(arch.toolchain_prefix),
|
|
||||||
|
|
||||||
# ndk 15 introduces unified headers required --sysroot and
|
shprint(sh.make, '-j', str(cpu_count()), 'libffi.la', _env=env)
|
||||||
# -isysroot for libraries and headers. libtool's head explodes
|
|
||||||
# trying to weave them into it's own magic. The result is a link
|
|
||||||
# failure tryng to link libc. We call make to compile the bits
|
|
||||||
# and manually link...
|
|
||||||
|
|
||||||
try:
|
host_build = self.get_build_dir(arch.arch)
|
||||||
shprint(sh.make, '-j5', 'libffi.la', _env=env)
|
ensure_dir(self.ctx.get_libs_dir(arch.arch))
|
||||||
except sh.ErrorReturnCode_2:
|
shprint(sh.cp,
|
||||||
info("make libffi.la failed as expected")
|
join(host_build, '.libs', 'libffi.so'),
|
||||||
cc = sh.Command(env['CC'].split()[0])
|
self.ctx.get_libs_dir(arch.arch))
|
||||||
cflags = env['CC'].split()[1:]
|
|
||||||
|
|
||||||
cflags.extend(['-march=armv7-a', '-mfloat-abi=softfp', '-mfpu=vfp',
|
|
||||||
'-mthumb', '-shared', '-fPIC', '-DPIC',
|
|
||||||
'src/.libs/prep_cif.o', 'src/.libs/types.o',
|
|
||||||
'src/.libs/raw_api.o', 'src/.libs/java_raw_api.o',
|
|
||||||
'src/.libs/closures.o', 'src/arm/.libs/sysv.o',
|
|
||||||
'src/arm/.libs/ffi.o', ]
|
|
||||||
)
|
|
||||||
|
|
||||||
ldflags = env['LDFLAGS'].split()
|
|
||||||
cflags.extend(ldflags)
|
|
||||||
cflags.extend(['-Wl,-soname', '-Wl,libffi.so', '-o',
|
|
||||||
'.libs/libffi.so'])
|
|
||||||
|
|
||||||
with current_directory(self.get_host(arch)):
|
|
||||||
shprint(cc, *cflags, _env=env)
|
|
||||||
|
|
||||||
shprint(sh.cp, '-t', self.ctx.get_libs_dir(arch.arch),
|
|
||||||
join(self.get_host(arch), '.libs', 'libffi.so'))
|
|
||||||
|
|
||||||
def get_include_dirs(self, arch):
|
def get_include_dirs(self, arch):
|
||||||
return [join(self.get_build_dir(arch.arch), self.get_host(arch),
|
return [join(self.get_build_dir(arch.arch), 'include')]
|
||||||
'include')]
|
|
||||||
|
|
||||||
|
|
||||||
recipe = LibffiRecipe()
|
recipe = LibffiRecipe()
|
||||||
|
|
34
recipes/libffi/fix-includedir.patch
Normal file
34
recipes/libffi/fix-includedir.patch
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
From 982b89c01aca99c7bc229914fc1521f96930919b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Yen Chi Hsuan <yan12125@gmail.com>
|
||||||
|
Date: Sun, 13 Nov 2016 19:17:19 +0800
|
||||||
|
Subject: [PATCH] Install public headers in the standard path
|
||||||
|
|
||||||
|
---
|
||||||
|
include/Makefile.am | 3 +--
|
||||||
|
libffi.pc.in | 2 +-
|
||||||
|
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/include/Makefile.am b/include/Makefile.am
|
||||||
|
index bb241e88..c59df9fb 100644
|
||||||
|
--- a/include/Makefile.am
|
||||||
|
+++ b/include/Makefile.am
|
||||||
|
@@ -6,5 +6,4 @@ DISTCLEANFILES=ffitarget.h
|
||||||
|
noinst_HEADERS=ffi_common.h ffi_cfi.h
|
||||||
|
EXTRA_DIST=ffi.h.in
|
||||||
|
|
||||||
|
-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
|
||||||
|
-nodist_includes_HEADERS = ffi.h ffitarget.h
|
||||||
|
+nodist_include_HEADERS = ffi.h ffitarget.h
|
||||||
|
diff --git a/libffi.pc.in b/libffi.pc.in
|
||||||
|
index edf6fde5..6fad83b4 100644
|
||||||
|
--- a/libffi.pc.in
|
||||||
|
+++ b/libffi.pc.in
|
||||||
|
@@ -2,7 +2,7 @@ prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
libdir=@libdir@
|
||||||
|
toolexeclibdir=@toolexeclibdir@
|
||||||
|
-includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
|
||||||
|
+includedir=@includedir@
|
||||||
|
|
||||||
|
Name: @PACKAGE_NAME@
|
||||||
|
Description: Library supporting Foreign Function Interfaces
|
|
@ -64,6 +64,7 @@ class OpenSSLRecipe(Recipe):
|
||||||
|
|
||||||
makefile = join(self.get_build_dir(arch.arch), 'Makefile')
|
makefile = join(self.get_build_dir(arch.arch), 'Makefile')
|
||||||
sh.sed('-i', 's/CROSS_COMPILE=arm-linux-androideabi-/CROSS_COMPILE=/g', makefile)
|
sh.sed('-i', 's/CROSS_COMPILE=arm-linux-androideabi-/CROSS_COMPILE=/g', makefile)
|
||||||
|
sh.sed('-i', 's/CROSS_COMPILE=aarch64-linux-android-/CROSS_COMPILE=/g', makefile)
|
||||||
shprint(sh.make, 'build_libs', _env=env)
|
shprint(sh.make, 'build_libs', _env=env)
|
||||||
|
|
||||||
self.install_libs(arch, 'libssl.a', 'libssl' + self.version + '.so',
|
self.install_libs(arch, 'libssl.a', 'libssl' + self.version + '.so',
|
||||||
|
|
1724
scripts/mangled-glibc-syscalls__arm64.h
Normal file
1724
scripts/mangled-glibc-syscalls__arm64.h
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue