Skip to content

Commit

Permalink
Fix riscv64gc-unknown-linux-gnu target
Browse files Browse the repository at this point in the history
Fix #1423
  • Loading branch information
kxxt committed Jul 10, 2024
1 parent 33c4d26 commit 97d4589
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/1525.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"description": "Fix riscv64gc-unknown-linux-gnu target",
"issues": [1423],
"type": "fixed"
}
2 changes: 1 addition & 1 deletion docker/Dockerfile.riscv64gc-unknown-linux-gnu
Original file line number Diff line number Diff line change
@@ -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 /
Expand Down
12 changes: 12 additions & 0 deletions docker/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
7 changes: 7 additions & 0 deletions docker/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down Expand Up @@ -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)))")
Expand Down

0 comments on commit 97d4589

Please sign in to comment.