Skip to content

Commit 10c4316

Browse files
committed
feat(dev-container): add llvm-tools, cargo-binutils, and rustfilt support
1 parent 599154a commit 10c4316

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
libtool-bin help2man gawk \
1414
pkg-config libglib2.0-dev libpixman-1-dev libsdl2-dev libslirp-dev \
1515
libncurses5-dev libreadline-dev libssl-dev sudo tmux unzip xz-utils ca-certificates \
16+
openssl \
1617
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu \
1718
libgmp-dev libexpat1-dev fish libmpfr-dev libmpc-dev \
1819
lldb \
@@ -41,7 +42,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
4142
# 然后安装指定版本的 nightly
4243
RUN rustup toolchain install nightly-2025-01-13 && \
4344
rustup default nightly-2025-01-13 && \
44-
rustup component add rustfmt clippy rust-src rust-analyzer && \
45+
rustup component add rustfmt clippy rust-src rust-analyzer llvm-tools && \
4546
rustup target add \
4647
riscv64gc-unknown-none-elf \
4748
riscv64imac-unknown-none-elf \
@@ -58,6 +59,11 @@ RUN mkdir -p ${CARGO_HOME} && \
5859
echo '[source.ustc]' >> ${CARGO_HOME}/config.toml && \
5960
echo 'registry = "git://mirrors.ustc.edu.cn/crates.io-index"' >> ${CARGO_HOME}/config.toml
6061

62+
63+
# 配置 cargo binutils
64+
RUN cargo install cargo-binutils && \
65+
cargo binutils install rustfilt --force
66+
6167
# 切回 root 编译 QEMU 与 GDB
6268
USER root
6369
WORKDIR /root

0 commit comments

Comments
 (0)