From 9cf3e741a1f209df1b0d6c4ed288c23283cf5657 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 19 May 2019 18:56:16 +0200 Subject: [PATCH] envkernel.sh: fallback to old armhf hostspec (!1786) The armhf hostspec triplet has changed during the Alpine 3.6 release cylcle. It was recently adjusted in abuild's arch_to_hostspec() function [1]. Cross compilers in postmarketOS that were built with a previous version of abuild still have the old hostspec in the name. Since we use the same function in envkernel.sh to get the cross compiler name, it is currently failing here for armhf. We can't simply bump the pkgrel to force a rebuild, because that would make them go out of sync with the upstrem (non-cross) compiler packages. That would break the workflow for fixing incompatibilities with Alpine (see [2]). Add a workaround to envkernel.sh, to detect if the installed armhf cross compiler binaries still have the old name. [1] https://github.com/alpinelinux/abuild/pull/56 [2] https://wiki.postmarketos.org/wiki/Repository_maintenance --- helpers/envkernel.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/helpers/envkernel.sh b/helpers/envkernel.sh index 8b7e5a73..1b845622 100644 --- a/helpers/envkernel.sh +++ b/helpers/envkernel.sh @@ -178,6 +178,19 @@ set_alias_make() { cross_compiler="/usr/bin/$prefix-" fi + # Workaround for issue #1784 (can be removed after the following packages + # have been rebuilt with current abuild: binutils-armhf, gcc-armhf, + # gcc4-armhf, gcc6-armhf, musl-armhf) + if [ "$deviceinfo_arch" = "armhf" ] \ + && ! [ -e "${chroot}${cross_compiler}gcc" ]; then + echo "NOTE: using old armhf cross compiler name (#1784)" + _old="armv6-alpine-linux-muslgnueabihf" + _new="armv6-alpine-linux-musleabihf" + cc="$(echo "$cc" | sed "s/$_new/$_old/")" + cross_compiler="$(echo "$cross_compiler" | sed "s/$_new/$_old/")" + unset _old _new + fi + # Build make command cmd="echo '*** pmbootstrap envkernel.sh active for $PWD! ***';" cmd="$cmd pmbootstrap -q chroot --user --"