diff --git a/kiwixbuild/dependencies/armhf.py b/kiwixbuild/dependencies/armhf.py index 35adca3..ae41be2 100644 --- a/kiwixbuild/dependencies/armhf.py +++ b/kiwixbuild/dependencies/armhf.py @@ -7,7 +7,9 @@ class armhf_toolchain(Dependency): name = 'armhf' class Source(ReleaseDownload): - archive = Remotefile('raspberrypi-tools.tar.gz', - 'e72b35436f2f23f2f7df322d6c318b9be57b21596b5ff0b8936af4ad94e04f2e') + archive = Remotefile('cross-gcc-10.3.0-pi_64.tar.gz', + '82bf781d0cf6e4e4809a86c402e1a1dd4de70ed54cff66197ca5a244d4ae5144', + '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', + ) Builder = NoopBuilder diff --git a/kiwixbuild/dependencies/zlib.py b/kiwixbuild/dependencies/zlib.py index 0bbe5aa..87759e0 100644 --- a/kiwixbuild/dependencies/zlib.py +++ b/kiwixbuild/dependencies/zlib.py @@ -44,3 +44,10 @@ class zlib(Dependency): binary_path=pj(self.buildEnv.install_dir, 'bin'), ) return "" + + @property + def make_target(self): + if self.buildEnv.platformInfo.static: + return "static" + else: + return "shared" diff --git a/kiwixbuild/platforms/armhf.py b/kiwixbuild/platforms/armhf.py index 0da7528..3844571 100644 --- a/kiwixbuild/platforms/armhf.py +++ b/kiwixbuild/platforms/armhf.py @@ -6,7 +6,7 @@ from kiwixbuild._global import get_target_step class ArmhfPlatformInfo(PlatformInfo): build = 'armhf' - arch_full = 'arm-linux-gnueabihf' + arch_full = 'aarch64-linux-gnu' toolchain_names = ['armhf'] compatible_hosts = ['fedora', 'debian'] @@ -33,10 +33,7 @@ class ArmhfPlatformInfo(PlatformInfo): @property def root_path(self): - return pj(self.tlc_source.source_path, - 'raspberrypi-tools', - 'arm-bcm2708', - 'gcc-linaro-{}-raspbian-x64'.format(self.arch_full)) + return self.tlc_source.source_path @property def binaries(self): @@ -47,7 +44,9 @@ class ArmhfPlatformInfo(PlatformInfo): ('STRIP', 'strip'), ('WINDRES', 'windres'), ('RANLIB', 'ranlib'), - ('LD', 'ld')) + ('LD', 'ld'), + ('LDSHARED', 'g++ -shared') + ) ) binaries = {k:pj(self.root_path, 'bin', v) for k,v in binaries} @@ -72,8 +71,13 @@ class ArmhfPlatformInfo(PlatformInfo): 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, "arm-linux-gnueabihf", "libc") + env['QEMU_LD_PREFIX'] = pj(self.root_path, "aarch64-linux-gnu", "libc") env['QEMU_SET_ENV'] = "LD_LIBRARY_PATH={}".format( ':'.join([ pj(self.root_path, self.arch_full, "lib"), @@ -83,8 +87,8 @@ class ArmhfPlatformInfo(PlatformInfo): def set_comp_flags(self, env): super().set_comp_flags(env) - env['CFLAGS'] = " -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "+env['CFLAGS'] - env['CXXFLAGS'] = " -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "+env['CXXFLAGS'] + 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():