Merge pull request #611 from kiwix/arm64_musl
This commit is contained in:
commit
c58d50474b
|
@ -45,6 +45,9 @@ BUILD_DEF = """
|
||||||
| | aarch64_static | | | B | B | |
|
| | aarch64_static | | | B | B | |
|
||||||
| | aarch64_dyn | d | | B | B | |
|
| | aarch64_dyn | d | | B | B | |
|
||||||
| | aarch64_mixed | B | | | | |
|
| | aarch64_mixed | B | | | | |
|
||||||
|
| | aarch64_musl_static| | | B | B | |
|
||||||
|
| | aarch64_musl_dyn | d | | B | B | |
|
||||||
|
| | aarch64_musl_mixed | B | | | | |
|
||||||
| | win32_static | d | dB | dB | dB | |
|
| | win32_static | d | dB | dB | dB | |
|
||||||
| | win32_dyn | d | dB | dB | dB | |
|
| | win32_dyn | d | dB | dB | dB | |
|
||||||
| | i586_static | | | B | B | |
|
| | i586_static | | | B | B | |
|
||||||
|
|
|
@ -49,6 +49,8 @@ PLATFORM_TO_RELEASE = {
|
||||||
"armv8_mixed": "{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_static": "{os}-aarch64".format(os=RELEASE_OS_NAME),
|
||||||
"aarch64_mixed": "{os}-aarch64{extra}".format(os=RELEASE_OS_NAME, extra=EXTRA_NAME),
|
"aarch64_mixed": "{os}-aarch64{extra}".format(os=RELEASE_OS_NAME, extra=EXTRA_NAME),
|
||||||
|
"aarch64_musl_static": "{os}-aarch64-musl".format(os=RELEASE_OS_NAME),
|
||||||
|
"aarch64_musl_mixed": "{os}-aarch64-musl".format(os=RELEASE_OS_NAME),
|
||||||
"i586_static": "{os}-i586".format(os=RELEASE_OS_NAME),
|
"i586_static": "{os}-i586".format(os=RELEASE_OS_NAME),
|
||||||
"macOS_arm64_static": "{os}-arm64".format(os=RELEASE_OS_NAME),
|
"macOS_arm64_static": "{os}-arm64".format(os=RELEASE_OS_NAME),
|
||||||
"macOS_arm64_mixed": "{os}-arm64".format(os=RELEASE_OS_NAME),
|
"macOS_arm64_mixed": "{os}-arm64".format(os=RELEASE_OS_NAME),
|
||||||
|
@ -301,7 +303,7 @@ def make_deps_archive(target=None, name=None, full=False):
|
||||||
files_to_archive += HOME.glob("BUILD_*/android-ndk*")
|
files_to_archive += HOME.glob("BUILD_*/android-ndk*")
|
||||||
files_to_archive += HOME.glob("BUILD_*/emsdk*")
|
files_to_archive += HOME.glob("BUILD_*/emsdk*")
|
||||||
if PLATFORM_TARGET.startswith("aarch64"):
|
if PLATFORM_TARGET.startswith("aarch64"):
|
||||||
files_to_archive += (SOURCE_DIR / "aarch64").glob("*")
|
files_to_archive += SOURCE_DIR.glob("aarch64*/*")
|
||||||
if PLATFORM_TARGET.startswith("armv"):
|
if PLATFORM_TARGET.startswith("armv"):
|
||||||
files_to_archive += SOURCE_DIR.glob("armv*/*")
|
files_to_archive += SOURCE_DIR.glob("armv*/*")
|
||||||
if (BASE_DIR / "meson_cross_file.txt").exists():
|
if (BASE_DIR / "meson_cross_file.txt").exists():
|
||||||
|
|
|
@ -24,6 +24,9 @@ jobs:
|
||||||
- aarch64_static
|
- aarch64_static
|
||||||
- aarch64_dyn
|
- aarch64_dyn
|
||||||
- aarch64_mixed
|
- aarch64_mixed
|
||||||
|
- aarch64_musl_static
|
||||||
|
- aarch64_musl_dyn
|
||||||
|
- aarch64_musl_mixed
|
||||||
- i586_static
|
- i586_static
|
||||||
- i586_dyn
|
- i586_dyn
|
||||||
- android_arm
|
- android_arm
|
||||||
|
|
|
@ -22,6 +22,8 @@ jobs:
|
||||||
- armv8_mixed
|
- armv8_mixed
|
||||||
- aarch64_static
|
- aarch64_static
|
||||||
- aarch64_mixed
|
- aarch64_mixed
|
||||||
|
- aarch64_musl_static
|
||||||
|
- aarch64_musl_mixed
|
||||||
- win32_static
|
- win32_static
|
||||||
- i586_static
|
- i586_static
|
||||||
- android_arm
|
- android_arm
|
||||||
|
@ -53,6 +55,10 @@ jobs:
|
||||||
image_variant: focal
|
image_variant: focal
|
||||||
- target: aarch64_mixed
|
- target: aarch64_mixed
|
||||||
image_variant: bionic
|
image_variant: bionic
|
||||||
|
- target: aarch64_musl_static
|
||||||
|
image_variant: focal
|
||||||
|
- target: aarch64_musl_mixed
|
||||||
|
imagev_variant: focal
|
||||||
- target: win32_static
|
- target: win32_static
|
||||||
image_variant: f35
|
image_variant: f35
|
||||||
- target: i586_static
|
- target: i586_static
|
||||||
|
|
|
@ -5,6 +5,7 @@ from . import (
|
||||||
android_ndk,
|
android_ndk,
|
||||||
aria2,
|
aria2,
|
||||||
armhf,
|
armhf,
|
||||||
|
arm_musl,
|
||||||
docoptcpp,
|
docoptcpp,
|
||||||
emsdk,
|
emsdk,
|
||||||
flatpak,
|
flatpak,
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
from .base import Dependency, ReleaseDownload, NoopBuilder
|
||||||
|
from kiwixbuild.utils import Remotefile
|
||||||
|
|
||||||
|
class aarch64_musl_toolchain(Dependency):
|
||||||
|
dont_skip = True
|
||||||
|
neutral = True
|
||||||
|
name = "aarch64_musl"
|
||||||
|
|
||||||
|
class Source(ReleaseDownload):
|
||||||
|
archive = Remotefile('aarch64-linux-musl-cross.tgz',
|
||||||
|
'c909817856d6ceda86aa510894fa3527eac7989f0ef6e87b5721c58737a06c38',
|
||||||
|
'https://musl.cc/aarch64-linux-musl-cross.tgz')
|
||||||
|
|
||||||
|
Builder = NoopBuilder
|
|
@ -4,6 +4,7 @@ from .base import *
|
||||||
from . import (
|
from . import (
|
||||||
android,
|
android,
|
||||||
armhf,
|
armhf,
|
||||||
|
arm_musl,
|
||||||
flatpak,
|
flatpak,
|
||||||
i586,
|
i586,
|
||||||
ios,
|
ios,
|
||||||
|
|
|
@ -0,0 +1,114 @@
|
||||||
|
from .base import PlatformInfo, MixedMixin
|
||||||
|
|
||||||
|
from kiwixbuild.utils import pj
|
||||||
|
from kiwixbuild._global import get_target_step
|
||||||
|
|
||||||
|
|
||||||
|
class Aarch64MuslPlatformInfo(PlatformInfo):
|
||||||
|
build = 'aarch64_musl'
|
||||||
|
arch_full = 'aarch64-linux-musl'
|
||||||
|
toolchain_names = ['aarch64_musl']
|
||||||
|
compatible_hosts = ['fedora', 'debian']
|
||||||
|
libdir = "lib/aarch64-linux-musl"
|
||||||
|
|
||||||
|
def get_cross_config(self):
|
||||||
|
return {
|
||||||
|
'binaries': self.binaries,
|
||||||
|
'exe_wrapper_def': '',
|
||||||
|
'root_path': self.root_path,
|
||||||
|
'extra_libs': [],
|
||||||
|
'extra_cflags': ['-I{}'.format(include_dir) for include_dir in self.get_include_dirs()],
|
||||||
|
'host_machine': {
|
||||||
|
'system': 'linux',
|
||||||
|
'lsystem': 'linux',
|
||||||
|
'cpu_family': 'arm',
|
||||||
|
'cpu': 'armhf',
|
||||||
|
'endian': 'little',
|
||||||
|
'abi': ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def tlc_source(self):
|
||||||
|
return get_target_step(self.build, 'source')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def root_path(self):
|
||||||
|
return self.tlc_source.source_path
|
||||||
|
|
||||||
|
@property
|
||||||
|
def binaries(self):
|
||||||
|
binaries = ((k,'{}-{}'.format(self.arch_full, v))
|
||||||
|
for k, v in (('CC', 'gcc'),
|
||||||
|
('CXX', 'g++'),
|
||||||
|
('AR', 'ar'),
|
||||||
|
('STRIP', 'strip'),
|
||||||
|
('WINDRES', 'windres'),
|
||||||
|
('RANLIB', 'ranlib'),
|
||||||
|
('LD', 'ld'),
|
||||||
|
('LDSHARED', 'g++ -shared')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binaries = {k:pj(self.root_path, 'bin', v)
|
||||||
|
for k,v in binaries}
|
||||||
|
binaries['PKGCONFIG'] = 'pkg-config'
|
||||||
|
return binaries
|
||||||
|
|
||||||
|
@property
|
||||||
|
def exe_wrapper_def(self):
|
||||||
|
try:
|
||||||
|
which('qemu-arm')
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
return ""
|
||||||
|
else:
|
||||||
|
return "exe_wrapper = 'qemu-arm'"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def configure_option(self):
|
||||||
|
return '--host={}'.format(self.arch_full)
|
||||||
|
|
||||||
|
def get_bin_dir(self):
|
||||||
|
return [pj(self.root_path, 'bin')]
|
||||||
|
|
||||||
|
def get_env(self):
|
||||||
|
env = super().get_env()
|
||||||
|
env['LD_LIBRARY_PATH'] = ':'.join([
|
||||||
|
pj(self.root_path, self.arch_full, 'lib64'),
|
||||||
|
pj(self.root_path, 'lib'),
|
||||||
|
env['LD_LIBRARY_PATH']
|
||||||
|
])
|
||||||
|
env['PKG_CONFIG_LIBDIR'] = pj(self.root_path, 'lib', 'pkgconfig')
|
||||||
|
env['QEMU_LD_PREFIX'] = pj(self.root_path, self.arch_full, "libc")
|
||||||
|
env['QEMU_SET_ENV'] = "LD_LIBRARY_PATH={}".format(
|
||||||
|
':'.join([
|
||||||
|
pj(self.root_path, self.arch_full, "lib"),
|
||||||
|
env['LD_LIBRARY_PATH']
|
||||||
|
]))
|
||||||
|
return env
|
||||||
|
|
||||||
|
def set_comp_flags(self, env):
|
||||||
|
super().set_comp_flags(env)
|
||||||
|
env['CFLAGS'] = " -fPIC -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "+env['CFLAGS']
|
||||||
|
env['CXXFLAGS'] = " -fPIC -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "+env['CXXFLAGS']
|
||||||
|
|
||||||
|
def set_compiler(self, env):
|
||||||
|
for k, v in self.binaries.items():
|
||||||
|
env[k] = v
|
||||||
|
|
||||||
|
def finalize_setup(self):
|
||||||
|
super().finalize_setup()
|
||||||
|
self.buildEnv.cmake_crossfile = self._gen_crossfile('cmake_cross_file.txt')
|
||||||
|
self.buildEnv.meson_crossfile = self._gen_crossfile('meson_cross_file.txt')
|
||||||
|
|
||||||
|
|
||||||
|
class Aarch64MuslDyn(Aarch64MuslPlatformInfo):
|
||||||
|
name = 'aarch64_musl_dyn'
|
||||||
|
static = False
|
||||||
|
|
||||||
|
class Aarch64MuslStatic(Aarch64MuslPlatformInfo):
|
||||||
|
name = 'aarch64_musl_static'
|
||||||
|
static = True
|
||||||
|
|
||||||
|
class Aarch64MuslMixed(MixedMixin('aarch64_musl_static'), Aarch64MuslPlatformInfo):
|
||||||
|
name = 'aarch64_musl_mixed'
|
||||||
|
static = False
|
Loading…
Reference in New Issue