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
This commit is contained in:
Oliver Smith 2019-05-19 18:56:16 +02:00
parent f26eb0d9b8
commit 9cf3e741a1
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 13 additions and 0 deletions

View File

@ -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 --"