Skip to content

Commit 715e46b

Browse files
lthmsvapourismo
authored and
Marge Bot
committed
Rust: Fix build on Arm64
Rust 1.78 and above are subjected to a [bug] leading Arm64 foreign archives to contain x86 builtins. It looks like we are now triggering this very bug, which prevents building on Arm64 hardware. The simplest way to move forward is to downgrade our recommended version of Rust to 1.77, and wait for a release containing the [fix] to be merged. [bug]: rust-lang/rust#125619 [fix]: rust-lang/rust#131221 Co-authored-by: Ole Krüger <[email protected]>
1 parent dfdf185 commit 715e46b

File tree

8 files changed

+14
-9
lines changed

8 files changed

+14
-9
lines changed

docs/introduction/compile-sources.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ sudo apt-get install -y rsync git m4 build-essential patch unzip wget opam jq bc
4040
# [install rust]
4141
wget https://sh.rustup.rs/rustup-init.sh
4242
chmod +x rustup-init.sh
43-
./rustup-init.sh --profile minimal --default-toolchain 1.78.0 -y
43+
./rustup-init.sh --profile minimal --default-toolchain 1.77.2 -y
4444
# [source cargo]
4545
. $HOME/.cargo/env
4646
# [get sources]

images/rust-toolchain/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ RUN curl https://sh.rustup.rs --silent --show-error --fail | \
3434
ENV PATH=/root/.cargo/bin:$PATH
3535

3636
# install rust toolchains and compilation targets
37-
RUN rustup update 1.66.0 1.73.0 1.76.0 1.78.0 && \
37+
RUN rustup update 1.66.0 1.73.0 1.76.0 1.77.2 1.78.0 && \
3838
for tc in $(rustup toolchain list | awk '{print $1}'); do \
3939
rustup target add --toolchain="$tc" \
4040
wasm32-unknown-unknown \

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.78.0
1+
1.77.2

scripts/lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ check_redirects() {
185185
}
186186

187187
check_rust_toolchain_files() {
188-
authorized_version=("1.66.0" "1.73.0" "1.76.0" "1.78.0")
188+
authorized_version=("1.66.0" "1.73.0" "1.76.0" "1.77.2" "1.78.0")
189189

190190
declare -a rust_toolchain_files
191191
mapfile -t rust_toolchain_files <<< "$(find src/ -name rust-toolchain)"

scripts/version.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export opam_version_major=2
1919
# The recommended rust version should equal the version set in the
2020
# root rust-toolchain file, such that:
2121
# rust-toolchain == recommended_rust_version
22-
export recommended_rust_version=1.78.0
22+
export recommended_rust_version=1.77.2
2323
export recommended_node_version=18.18.2
2424

2525
## opam_repository is a commit hash of the public opam repository, i.e.
@@ -47,10 +47,10 @@ export dal_srs_g2_sha=97d76e266e657cc3c859c3359c717136f55cfe4c0256ea418f907406cb
4747
export alpine_version='3.20'
4848

4949
# Installed via apk rust
50-
export rust_version='1.78.0'
50+
export rust_version='1.77.2'
5151

5252
# Installed via apk cargo
53-
export cargo_version='1.78.0'
53+
export cargo_version='1.77.2'
5454

5555
# Installed via apk opam
5656
export opam_version='2.2.1'

src/riscv/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ assets/jstz assets/jstz.checksum::
5252

5353
.PHONY: build-deps
5454
build-deps:
55-
@exec ./scripts/install-rust-std-hermit.sh
55+
@make -C jstz build-deps
56+
@make -C dummy_kernel build-deps
5657
@rustup component add rustfmt clippy
5758
ifneq ($(NATIVE_TARGET),)
5859
@rustup target add $(NATIVE_TARGET)

src/riscv/dummy_kernel/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ all: build test check
99
build:
1010
@cargo build --release
1111

12+
.PHONY: build-deps
13+
build-deps:
14+
@exec ../scripts/install-rust-std-hermit.sh
15+
1216
.PHONY: test
1317
test:
1418
@# This executable compiles to RISC-V. It should be run in the RISC-V sandbox.

src/riscv/rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.78.0"
2+
channel = "1.77.2"
33
components = ["rustfmt", "clippy"]

0 commit comments

Comments
 (0)