Merge pull request #615 from kiwix/better_arm
Switch (again) to new arm cross-compilation toolchain.
This commit is contained in:
commit
c5037e6fd4
|
@ -44,11 +44,11 @@ def select_build_target():
|
|||
return ("libzim", "libkiwix")
|
||||
else:
|
||||
return ("zim-tools", "kiwix-tools")
|
||||
elif PLATFORM_TARGET in ("win32_static", "armhf_static", "armhf_dyn", "aarch64_static", "aarch64_dyn", "i586_static"):
|
||||
elif PLATFORM_TARGET in ("win32_static", "armv6_static", "armv6_dyn", "armv8_static", "armv8_dyn", "aarch64_static", "aarch64_dyn", "i586_static"):
|
||||
return ("zim-tools", "kiwix-tools")
|
||||
elif PLATFORM_TARGET == "flatpak":
|
||||
return ("kiwix-desktop",)
|
||||
elif PLATFORM_TARGET in ("wasm", "armhf_mixed", "aarch64_mixed"):
|
||||
elif PLATFORM_TARGET in ("wasm", "armv6_mixed", "armv8_mixed", "aarch64_mixed"):
|
||||
return ("libzim", )
|
||||
else:
|
||||
return ("libzim", "zim-tools", "libkiwix", "kiwix-tools")
|
||||
|
|
|
@ -51,8 +51,10 @@ PLATFORM_TO_RELEASE = {
|
|||
"native_mixed": "{os}-x86_64{extra}".format(os=RELEASE_OS_NAME, extra=EXTRA_NAME),
|
||||
"native_static": "{os}-x86_64".format(os=RELEASE_OS_NAME),
|
||||
"win32_static": "win-i686",
|
||||
"armhf_static": "{os}-armhf".format(os=RELEASE_OS_NAME),
|
||||
"armhf_mixed": "{os}-armhf".format(os=RELEASE_OS_NAME),
|
||||
"armv6_static": "{os}-armv6".format(os=RELEASE_OS_NAME),
|
||||
"armv6_mixed": "{os}-armv6".format(os=RELEASE_OS_NAME),
|
||||
"armv8_static": "{os}-armv8".format(os=RELEASE_OS_NAME),
|
||||
"armv8_mixed": "{os}-armv8".format(os=RELEASE_OS_NAME),
|
||||
"aarch64_static": "{os}-aarch64".format(os=RELEASE_OS_NAME),
|
||||
"aarch64_mixed": "{os}-aarch64{extra}".format(os=RELEASE_OS_NAME, extra=EXTRA_NAME),
|
||||
"i586_static": "{os}-i586".format(os=RELEASE_OS_NAME),
|
||||
|
@ -300,7 +302,8 @@ def make_deps_archive(target=None, name=None, full=False):
|
|||
files_to_archive += HOME.glob("BUILD_*/emsdk*")
|
||||
if PLATFORM_TARGET.startswith("aarch64"):
|
||||
files_to_archive += (SOURCE_DIR / "aarch64").glob("*")
|
||||
|
||||
if PLATFORM_TARGET.startswith("armv"):
|
||||
files_to_archive += SOURCE_DIR.glob("armv*/*")
|
||||
if (BASE_DIR / "meson_cross_file.txt").exists():
|
||||
files_to_archive.append(BASE_DIR / "meson_cross_file.txt")
|
||||
|
||||
|
@ -322,8 +325,7 @@ def make_deps_archive(target=None, name=None, full=False):
|
|||
files_to_archive += HOME.glob("BUILD_android*/**/.*_ok")
|
||||
files_to_archive += SOURCE_DIR.glob("*/.*_ok")
|
||||
files_to_archive += SOURCE_DIR.glob("zim-testing-suite-*/*")
|
||||
if PLATFORM_TARGET.startswith("armhf"):
|
||||
files_to_archive += (SOURCE_DIR / "armhf").glob("*")
|
||||
|
||||
toolchains_subdirs = HOME.glob("BUILD_*/TOOLCHAINS/*/*")
|
||||
for subdir in toolchains_subdirs:
|
||||
if not subdir.match("tools"):
|
||||
|
|
|
@ -16,9 +16,12 @@ jobs:
|
|||
- native_mixed
|
||||
- native_desktop
|
||||
- wasm
|
||||
- armhf_static
|
||||
- armhf_dyn
|
||||
- armhf_mixed
|
||||
- armv6_static
|
||||
- armv6_dyn
|
||||
- armv6_mixed
|
||||
- armv8_static
|
||||
- armv8_dyn
|
||||
- armv8_mixed
|
||||
- aarch64_static
|
||||
- aarch64_dyn
|
||||
- aarch64_mixed
|
||||
|
@ -29,20 +32,15 @@ jobs:
|
|||
- android_x86
|
||||
- android_x86_64
|
||||
image_variant: ['focal']
|
||||
lib_postfix: ['/x86_64-linux-gnu']
|
||||
include:
|
||||
- target: native_mixed
|
||||
image_variant: bionic
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: aarch64_mixed
|
||||
image_variant: bionic
|
||||
lib_postfix: '/aarch64-linux-gnu'
|
||||
- target: win32_static
|
||||
image_variant: f35
|
||||
lib_postfix: '64'
|
||||
- target: win32_dyn
|
||||
image_variant: f35
|
||||
lib_postfix: '64'
|
||||
env:
|
||||
HOME: /home/runner
|
||||
SSH_KEY: /tmp/id_rsa
|
||||
|
|
|
@ -18,8 +18,10 @@ jobs:
|
|||
- native_mixed
|
||||
- native_desktop
|
||||
- wasm
|
||||
- armhf_static
|
||||
- armhf_mixed
|
||||
- armv6_static
|
||||
- armv6_mixed
|
||||
- armv8_static
|
||||
- armv8_mixed
|
||||
- aarch64_static
|
||||
- aarch64_mixed
|
||||
- win32_static
|
||||
|
@ -31,55 +33,42 @@ jobs:
|
|||
include:
|
||||
- target: native_static
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: native_dyn
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: native_mixed
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: native_mixed
|
||||
image_variant: bionic
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: native_desktop
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: wasm
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: armhf_static
|
||||
- target: armv6_static
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: armhf_mixed
|
||||
- target: armv6_mixed
|
||||
image_variant: focal
|
||||
- target: armv8_static
|
||||
image_variant: focal
|
||||
- target: armv8_mixed
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: aarch64_static
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: aarch64_mixed
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: aarch64_mixed
|
||||
image_variant: bionic
|
||||
lib_postfix: '/aarch64-linux-gnu'
|
||||
- target: win32_static
|
||||
image_variant: f35
|
||||
lib_postfix: '64'
|
||||
- target: i586_static
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: android_arm
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: android_arm64
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: android_x86
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: android_x86_64
|
||||
image_variant: focal
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
env:
|
||||
HOME: /home/runner
|
||||
SSH_KEY: /tmp/id_rsa
|
||||
|
|
|
@ -1,36 +1,44 @@
|
|||
from .base import Dependency, ReleaseDownload, NoopBuilder
|
||||
from kiwixbuild.utils import Remotefile
|
||||
|
||||
# The arm toolchains
|
||||
# This is based on toolchains published here : https://github.com/tttapa/docker-arm-cross-toolchain
|
||||
|
||||
base_url = 'https://master.dl.sourceforge.net/project/raspberry-pi-cross-compilers/'
|
||||
base_url = "https://github.com/tttapa/docker-arm-cross-toolchain/releases/download/0.1.0/"
|
||||
|
||||
# This is Gcc 10.3.0 and Raspberry Pi 2 and 3 only !
|
||||
armhf_base_url = base_url + 'Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Stretch/GCC%2010.3.0/Raspberry%20Pi%202%2C%203/'
|
||||
|
||||
# This is Gcc 10.3.0 and ALL rapsberry Pi arch64
|
||||
aarch_base_url = base_url + 'Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Stretch/GCC%206.3.0/'
|
||||
|
||||
class armhf_toolchain(Dependency):
|
||||
class armv6_toolchain(Dependency):
|
||||
dont_skip = True
|
||||
neutral = True
|
||||
name = 'armhf'
|
||||
name = 'armv6'
|
||||
|
||||
class Source(ReleaseDownload):
|
||||
archive = Remotefile('cross-gcc-10.3.0-pi_2-3.tar.gz',
|
||||
'6aef31703fb7bfd63065dda7fb525f1f86a0509c4358c57631a51025805278b3',
|
||||
armhf_base_url + 'cross-gcc-10.3.0-pi_2-3.tar.gz')
|
||||
archive = Remotefile('x-tools-armv6-rpi-linux-gnueabihf.tar.xz',
|
||||
'4c371c4c5b55ebd1f3d7dd26b14703632d9ba47423f901bcd9303d83ad444434',
|
||||
base_url + 'x-tools-armv6-rpi-linux-gnueabihf.tar.xz')
|
||||
|
||||
Builder = NoopBuilder
|
||||
|
||||
|
||||
class armv8_toolchain(Dependency):
|
||||
dont_skip = True
|
||||
neutral = True
|
||||
name = 'armv8'
|
||||
|
||||
class Source(ReleaseDownload):
|
||||
archive = Remotefile('x-tools-armv8-rpi-linux-gnueabihf.tar.xz',
|
||||
'cc28f5c3f6a3e7d9985f98779c4e72224b4eb5a7e4dc2bcdefd90cb241fb94a5',
|
||||
base_url + 'x-tools-armv8-rpi3-linux-gnueabihf.tar.xz')
|
||||
|
||||
Builder = NoopBuilder
|
||||
|
||||
class aarch64_toolchain(Dependency):
|
||||
dont_skip = True
|
||||
neutral = True
|
||||
name = "aarch64"
|
||||
|
||||
class Source(ReleaseDownload):
|
||||
archive = Remotefile('cross-gcc-6.3.0-pi_64.tar.gz',
|
||||
'1b048bb8886ad63d21797cd9129fc37b9ea0dfaac7e3c36f888aa16fbec1d320',
|
||||
aarch_base_url + 'cross-gcc-6.3.0-pi_64.tar.gz')
|
||||
archive = Remotefile('x-tools-aarch64-rpi3-linux-gnu.tar.xz',
|
||||
'8be81d3fc47b1b280bf003646d2b623477badec4ec931944131bf412317b6332',
|
||||
base_url + 'x-tools-aarch64-rpi3-linux-gnu.tar.xz')
|
||||
|
||||
Builder = NoopBuilder
|
||||
|
|
|
@ -4,10 +4,8 @@ from kiwixbuild.utils import pj
|
|||
from kiwixbuild._global import get_target_step
|
||||
|
||||
|
||||
class ArmhfPlatformInfo(PlatformInfo):
|
||||
build = 'armhf'
|
||||
arch_full = 'arm-linux-gnueabihf'
|
||||
toolchain_names = ['armhf']
|
||||
# Base platform
|
||||
class ArmPlatformInfo(PlatformInfo):
|
||||
compatible_hosts = ['fedora', 'debian']
|
||||
|
||||
def get_cross_config(self):
|
||||
|
@ -20,20 +18,24 @@ class ArmhfPlatformInfo(PlatformInfo):
|
|||
'host_machine': {
|
||||
'system': 'linux',
|
||||
'lsystem': 'linux',
|
||||
'cpu_family': 'arm',
|
||||
'cpu': 'armhf',
|
||||
'cpu_family': self.cpu_family,
|
||||
'cpu': self.cpu,
|
||||
'endian': 'little',
|
||||
'abi': ''
|
||||
}
|
||||
}
|
||||
|
||||
@property
|
||||
def libdir(self):
|
||||
return "lib/{}".format(self.arch_full)
|
||||
|
||||
@property
|
||||
def tlc_source(self):
|
||||
return get_target_step(self.build, 'source')
|
||||
|
||||
@property
|
||||
def root_path(self):
|
||||
return self.tlc_source.source_path
|
||||
return pj(self.tlc_source.source_path, self.arch_full)
|
||||
|
||||
@property
|
||||
def binaries(self):
|
||||
|
@ -99,25 +101,52 @@ class ArmhfPlatformInfo(PlatformInfo):
|
|||
self.buildEnv.cmake_crossfile = self._gen_crossfile('cmake_cross_file.txt')
|
||||
self.buildEnv.meson_crossfile = self._gen_crossfile('meson_cross_file.txt')
|
||||
|
||||
class Armv6(ArmPlatformInfo):
|
||||
build = "armv6"
|
||||
arch_full = "armv6-rpi-linux-gnueabihf"
|
||||
toolchain_names = ['armv6']
|
||||
cpu_family = 'arm'
|
||||
cpu = 'armv6'
|
||||
|
||||
class ArmhfDyn(ArmhfPlatformInfo):
|
||||
name = 'armhf_dyn'
|
||||
class Armv6Dyn(Armv6):
|
||||
name = 'armv6_dyn'
|
||||
static = False
|
||||
|
||||
class ArmhfStatic(ArmhfPlatformInfo):
|
||||
name = 'armhf_static'
|
||||
class Armv6Static(Armv6):
|
||||
name = 'armv6_static'
|
||||
static = True
|
||||
|
||||
class ArmhfMixed(MixedMixin('armhf_static'), ArmhfPlatformInfo):
|
||||
name = 'armhf_mixed'
|
||||
class Armv6Mixed(MixedMixin('armv6_static'), Armv6):
|
||||
name = 'armv6_mixed'
|
||||
static = False
|
||||
|
||||
|
||||
class Aarch64(ArmhfPlatformInfo):
|
||||
class Armv8(ArmPlatformInfo):
|
||||
build = "armv8"
|
||||
arch_full = "armv8-rpi3-linux-gnueabihf"
|
||||
toolchain_names = ['armv8']
|
||||
cpu_family = 'arm'
|
||||
cpu = 'armv8'
|
||||
|
||||
class Armv8Dyn(Armv8):
|
||||
name = 'armv8_dyn'
|
||||
static = False
|
||||
|
||||
class Armv8Static(Armv8):
|
||||
name = 'armv8_static'
|
||||
static = True
|
||||
|
||||
class Armv8Mixed(MixedMixin('armv8_static'), Armv8):
|
||||
name = 'armv8_mixed'
|
||||
static = False
|
||||
|
||||
|
||||
class Aarch64(ArmPlatformInfo):
|
||||
build = 'aarch64'
|
||||
arch_full = 'aarch64-linux-gnu'
|
||||
arch_full = 'aarch64-rpi3-linux-gnu'
|
||||
toolchain_names = ['aarch64']
|
||||
libdir = "lib/aarch64-linux-gnu"
|
||||
cpu_family = 'aarch64'
|
||||
cpu = 'aarch64'
|
||||
|
||||
class Aarch64Dyn(Aarch64):
|
||||
name = 'aarch64_dyn'
|
||||
|
|
|
@ -39,7 +39,7 @@ release_versions = {
|
|||
|
||||
# This is the "version" of the whole base_deps_versions dict.
|
||||
# Change this when you change base_deps_versions.
|
||||
base_deps_meta_version = '88'
|
||||
base_deps_meta_version = '89'
|
||||
|
||||
base_deps_versions = {
|
||||
'zlib' : '1.2.12',
|
||||
|
|
Loading…
Reference in New Issue