Correctly set the armhf toolchain to a 32 bits arch.

cross-gcc-10.3.0-pi_64.tar.gz for 64 bits architecture and armhf
is about 32 bits.

However, we know use a pi 2 and 3 and Stretch only[*] toolchains

[*] To be tested. Maybe the only is for the target compilation but binary
run elsewhere too.
This commit is contained in:
Matthieu Gautier 2023-03-28 17:46:31 +02:00
parent 31771fa35c
commit 4e88c6eb10
2 changed files with 12 additions and 7 deletions

View File

@ -1,15 +1,20 @@
from .base import Dependency, ReleaseDownload, NoopBuilder from .base import Dependency, ReleaseDownload, NoopBuilder
from kiwixbuild.utils import Remotefile from kiwixbuild.utils import Remotefile
base_url = 'https://master.dl.sourceforge.net/project/raspberry-pi-cross-compilers/'
# 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/'
class armhf_toolchain(Dependency): class armhf_toolchain(Dependency):
dont_skip = True dont_skip = True
neutral = True neutral = True
name = 'armhf' name = 'armhf'
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile('cross-gcc-10.3.0-pi_64.tar.gz', archive = Remotefile('cross-gcc-10.3.0-pi_2-3.tar.gz',
'82bf781d0cf6e4e4809a86c402e1a1dd4de70ed54cff66197ca5a244d4ae5144', '6aef31703fb7bfd63065dda7fb525f1f86a0509c4358c57631a51025805278b3',
'https://deac-ams.dl.sourceforge.net/project/raspberry-pi-cross-compilers/Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Bullseye/GCC%2010.3.0/cross-gcc-10.3.0-pi_64.tar.gz', armhf_base_url + 'cross-gcc-10.3.0-pi_2-3.tar.gz')
)
Builder = NoopBuilder Builder = NoopBuilder

View File

@ -6,7 +6,7 @@ from kiwixbuild._global import get_target_step
class ArmhfPlatformInfo(PlatformInfo): class ArmhfPlatformInfo(PlatformInfo):
build = 'armhf' build = 'armhf'
arch_full = 'aarch64-linux-gnu' arch_full = 'arm-linux-gnueabihf'
toolchain_names = ['armhf'] toolchain_names = ['armhf']
compatible_hosts = ['fedora', 'debian'] compatible_hosts = ['fedora', 'debian']
@ -29,7 +29,7 @@ class ArmhfPlatformInfo(PlatformInfo):
@property @property
def tlc_source(self): def tlc_source(self):
return get_target_step('armhf', 'source') return get_target_step(self.build, 'source')
@property @property
def root_path(self): def root_path(self):
@ -77,7 +77,7 @@ class ArmhfPlatformInfo(PlatformInfo):
env['LD_LIBRARY_PATH'] env['LD_LIBRARY_PATH']
]) ])
env['PKG_CONFIG_LIBDIR'] = pj(self.root_path, 'lib', 'pkgconfig') env['PKG_CONFIG_LIBDIR'] = pj(self.root_path, 'lib', 'pkgconfig')
env['QEMU_LD_PREFIX'] = pj(self.root_path, "aarch64-linux-gnu", "libc") env['QEMU_LD_PREFIX'] = pj(self.root_path, self.arch_full, "libc")
env['QEMU_SET_ENV'] = "LD_LIBRARY_PATH={}".format( env['QEMU_SET_ENV'] = "LD_LIBRARY_PATH={}".format(
':'.join([ ':'.join([
pj(self.root_path, self.arch_full, "lib"), pj(self.root_path, self.arch_full, "lib"),