diff --git a/.changes/1525.json b/.changes/1525.json new file mode 100644 index 000000000..c912f3852 --- /dev/null +++ b/.changes/1525.json @@ -0,0 +1,5 @@ +{ + "description": "Fix riscv64gc-unknown-linux-gnu target", + "issues": [1423], + "type": "fixed" +} diff --git a/docker/Dockerfile.riscv64gc-unknown-linux-gnu b/docker/Dockerfile.riscv64gc-unknown-linux-gnu index 8695d9134..d5ea70a17 100644 --- a/docker/Dockerfile.riscv64gc-unknown-linux-gnu +++ b/docker/Dockerfile.riscv64gc-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 as cross-base +FROM ubuntu:22.04 as cross-base ENV DEBIAN_FRONTEND=noninteractive COPY common.sh lib.sh / diff --git a/docker/lib.sh b/docker/lib.sh index dbd225bf4..248374fb1 100644 --- a/docker/lib.sh +++ b/docker/lib.sh @@ -54,6 +54,18 @@ if_ubuntu() { fi } +if_ubuntu_ge() { + if grep -q -i ubuntu /etc/os-release; then + local ver + ver="$(source /etc/os-release; echo $VERSION_ID)" + if dpkg --compare-versions "$ver" "ge" "$1"; then + shift + eval "${@}" + fi + fi +} + + GNU_MIRRORS=( "https://ftp.gnu.org/gnu/" "https://ftpmirror.gnu.org/" diff --git a/docker/qemu.sh b/docker/qemu.sh index bef061369..f56dfc83d 100755 --- a/docker/qemu.sh +++ b/docker/qemu.sh @@ -29,6 +29,10 @@ build_static_libffi () { build_static_libmount () { local version_spec=2.23.2 local version=2.23 + + if_ubuntu_ge 22.04 version_spec=2.37.2 + if_ubuntu_ge 22.04 version=2.37 + local td td="$(mktemp -d)" @@ -191,6 +195,9 @@ main() { libselinux1-dev \ zlib1g-dev + # ubuntu no longer provides statically linked libmount + if_ubuntu_ge 22.04 build_static_libmount + # if we have python3.6+, we can install qemu 7.0.0, which needs ninja-build # ubuntu 16.04 only provides python3.5, so remove when we have a newer qemu. is_ge_python36=$(python3 -c "import sys; print(int(sys.version_info >= (3, 6)))")