22
33set -euo pipefail
44
5- LINUX_VERSION=v6.9
5+ LINUX_VERSION=master
66
7- # Build rustc
8- ../x.py --stage 1 build library/std
9- BUILT_RUSTC=$( realpath ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc)
7+ # Build rustc and rustdoc
8+ ../x.py --stage 1 build library rustdoc
109
11- # Install rustup so that we have cargo for installing bindgen
10+ # Install rustup so that we can use the built toolchain easily
1211curl --proto ' =https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
1312sh rustup.sh -y --default-toolchain stable --profile minimal
1413
1514source /cargo/env
1615
16+ rustup toolchain link local ./build/x86_64-unknown-linux-gnu/stage1
17+ rustup default local
18+
1719mkdir -p rfl
1820cd rfl
1921
2022# Download Linux
2123git clone --depth 1 --branch ${LINUX_VERSION} \
2224 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
2325
24- # Install bindgen
25- cargo install --locked \
26- --version $( linux/scripts/min-tool-version.sh bindgen) bindgen-cli
26+ # Install bindgen. It needs to be compiled with the same version
27+ # as will be used for the RfL build.
28+ cargo install --version $( linux/scripts/min-tool-version.sh bindgen) bindgen-cli
2729
28- # Configure Linux
30+ # Configure Rust for Linux
2931cat << EOF > linux/kernel/configs/rfl-for-rust-ci.config
3032# CONFIG_RETHUNK is not set
3133# CONFIG_X86_KERNEL_IBT is not set
@@ -47,12 +49,12 @@ CONFIG_KUNIT=y
4749CONFIG_RUST_KERNEL_DOCTESTS=y
4850EOF
4951
50- make -C linux LLVM=1 RUSTC= ${BUILT_RUSTC} -j$(( $(nproc) + 1 )) \
52+ make -C linux LLVM=1 -j$(( $(nproc) + 1 )) \
5153 rustavailable \
5254 defconfig \
5355 rfl-for-rust-ci.config
5456
55- make -C linux LLVM=1 RUSTC= ${BUILT_RUSTC} -j$(( $(nproc) + 1 )) \
57+ make -C linux LLVM=1 -j$(( $(nproc) + 1 )) \
5658 samples/rust/rust_minimal.o \
5759 samples/rust/rust_print.o \
5860 drivers/net/phy/ax88796b_rust.o
0 commit comments