Add x86_64 musl toolchain and platform.
This commit is contained in:
parent
71e70d8a8e
commit
f2e2b09fe3
|
@ -12,3 +12,16 @@ class aarch64_musl_toolchain(Dependency):
|
|||
'https://musl.cc/aarch64-linux-musl-cross.tgz')
|
||||
|
||||
Builder = NoopBuilder
|
||||
|
||||
|
||||
class x86_64_musl_toolchain(Dependency):
|
||||
dont_skip = True
|
||||
neutral = True
|
||||
name = "x86-64_musl"
|
||||
|
||||
class Source(ReleaseDownload):
|
||||
archive = Remotefile('x86_64-linux-musl-cross.tgz',
|
||||
'',
|
||||
'https://musl.cc/x86_64-linux-musl-cross.tgz')
|
||||
|
||||
Builder = NoopBuilder
|
||||
|
|
|
@ -4,12 +4,8 @@ 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']
|
||||
class MuslPlatformInfo(PlatformInfo):
|
||||
compatible_hosts = ['fedora', 'debian']
|
||||
libdir = "lib/aarch64-linux-musl"
|
||||
|
||||
def get_cross_config(self):
|
||||
return {
|
||||
|
@ -21,8 +17,8 @@ class Aarch64MuslPlatformInfo(PlatformInfo):
|
|||
'host_machine': {
|
||||
'system': 'linux',
|
||||
'lsystem': 'linux',
|
||||
'cpu_family': 'arm',
|
||||
'cpu': 'armhf',
|
||||
'cpu_family': self.cpu_family,
|
||||
'cpu': self.cpu,
|
||||
'endian': 'little',
|
||||
'abi': ''
|
||||
}
|
||||
|
@ -57,11 +53,13 @@ class Aarch64MuslPlatformInfo(PlatformInfo):
|
|||
@property
|
||||
def exe_wrapper_def(self):
|
||||
try:
|
||||
which('qemu-arm')
|
||||
which(self.qemu)
|
||||
except subprocess.CalledProcessError:
|
||||
return ""
|
||||
except AttributeError:
|
||||
return ""
|
||||
else:
|
||||
return "exe_wrapper = 'qemu-arm'"
|
||||
return f"exe_wrapper = '{self.qemu}'"
|
||||
|
||||
@property
|
||||
def configure_option(self):
|
||||
|
@ -88,6 +86,10 @@ class Aarch64MuslPlatformInfo(PlatformInfo):
|
|||
|
||||
def set_comp_flags(self, env):
|
||||
super().set_comp_flags(env)
|
||||
env['LD_LIBRARY_PATH'] = ':'.join([
|
||||
pj(self.root_path, self.arch_full, 'lib'),
|
||||
env['LD_LIBRARY_PATH']
|
||||
])
|
||||
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']
|
||||
|
||||
|
@ -101,6 +103,16 @@ class Aarch64MuslPlatformInfo(PlatformInfo):
|
|||
self.buildEnv.meson_crossfile = self._gen_crossfile('meson_cross_file.txt')
|
||||
|
||||
|
||||
class Aarch64MuslPlatformInfo(MuslPlatformInfo):
|
||||
build = 'aarch64_musl'
|
||||
arch_full = 'aarch64-linux-musl'
|
||||
toolchain_names = ['aarch64_musl']
|
||||
libdir = "lib/aarch64-linux-musl"
|
||||
cpu_family = 'arm'
|
||||
cpu = 'armhf'
|
||||
qemu = 'qemu-arm'
|
||||
|
||||
|
||||
class Aarch64MuslDyn(Aarch64MuslPlatformInfo):
|
||||
name = 'aarch64_musl_dyn'
|
||||
static = False
|
||||
|
@ -112,3 +124,25 @@ class Aarch64MuslStatic(Aarch64MuslPlatformInfo):
|
|||
class Aarch64MuslMixed(MixedMixin('aarch64_musl_static'), Aarch64MuslPlatformInfo):
|
||||
name = 'aarch64_musl_mixed'
|
||||
static = False
|
||||
|
||||
|
||||
class X86_64MuslPlatformInfo(MuslPlatformInfo):
|
||||
build = 'x86-64_musl'
|
||||
arch_full = 'x86_64-linux-musl'
|
||||
toolchain_names = ['x86-64_musl']
|
||||
libdir = "lib/x86_64-linux-musl"
|
||||
cpu_family = 'x86_64'
|
||||
cpu = 'x86_64'
|
||||
|
||||
|
||||
class X86_64MuslDyn(X86_64MuslPlatformInfo):
|
||||
name = 'x86-64_musl_dyn'
|
||||
static = False
|
||||
|
||||
class X86_64MuslStatic(X86_64MuslPlatformInfo):
|
||||
name = 'x86-64_musl_static'
|
||||
static = True
|
||||
|
||||
class x86_64MuslMixed(MixedMixin('x86-64_musl_static'), X86_64MuslPlatformInfo):
|
||||
name = 'x86-64_musl_mixed'
|
||||
static = False
|
||||
|
|
Loading…
Reference in New Issue