Skip to content

Commit 97d4589

Browse files
committed
Fix riscv64gc-unknown-linux-gnu target
Fix #1423
1 parent 33c4d26 commit 97d4589

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

.changes/1525.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"description": "Fix riscv64gc-unknown-linux-gnu target",
3+
"issues": [1423],
4+
"type": "fixed"
5+
}

docker/Dockerfile.riscv64gc-unknown-linux-gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04 as cross-base
1+
FROM ubuntu:22.04 as cross-base
22
ENV DEBIAN_FRONTEND=noninteractive
33

44
COPY common.sh lib.sh /

docker/lib.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ if_ubuntu() {
5454
fi
5555
}
5656

57+
if_ubuntu_ge() {
58+
if grep -q -i ubuntu /etc/os-release; then
59+
local ver
60+
ver="$(source /etc/os-release; echo $VERSION_ID)"
61+
if dpkg --compare-versions "$ver" "ge" "$1"; then
62+
shift
63+
eval "${@}"
64+
fi
65+
fi
66+
}
67+
68+
5769
GNU_MIRRORS=(
5870
"https://ftp.gnu.org/gnu/"
5971
"https://ftpmirror.gnu.org/"

docker/qemu.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ build_static_libffi () {
2929
build_static_libmount () {
3030
local version_spec=2.23.2
3131
local version=2.23
32+
33+
if_ubuntu_ge 22.04 version_spec=2.37.2
34+
if_ubuntu_ge 22.04 version=2.37
35+
3236
local td
3337
td="$(mktemp -d)"
3438

@@ -191,6 +195,9 @@ main() {
191195
libselinux1-dev \
192196
zlib1g-dev
193197

198+
# ubuntu no longer provides statically linked libmount
199+
if_ubuntu_ge 22.04 build_static_libmount
200+
194201
# if we have python3.6+, we can install qemu 7.0.0, which needs ninja-build
195202
# ubuntu 16.04 only provides python3.5, so remove when we have a newer qemu.
196203
is_ge_python36=$(python3 -c "import sys; print(int(sys.version_info >= (3, 6)))")

0 commit comments

Comments
 (0)