Skip to content

Commit 9ba9a72

Browse files
committed
multi_board: temporary fix for rustup 1.28.0
1 parent 566fb35 commit 9ba9a72

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

hwci/setup.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,43 @@ set -e -x
3737
# of its own build process:
3838
type rustup || (echo "rustup is not installed, aborting."; exit 1)
3939

40+
# Function to setup Tock-specific Rust toolchain with all required components
41+
setup_tock_toolchain() {
42+
# Define the specific toolchain needed
43+
local TOOLCHAIN="nightly-2024-11-16-aarch64-unknown-linux-gnu"
44+
45+
echo "Setting up Rust toolchain for Tock: $TOOLCHAIN"
46+
47+
# Install the specific toolchain if not already installed
48+
rustup toolchain install "$TOOLCHAIN"
49+
50+
# Add required components for Tock build
51+
rustup component add rust-src --toolchain "$TOOLCHAIN"
52+
rustup component add llvm-tools-preview --toolchain "$TOOLCHAIN"
53+
54+
# Add the target needed for Tock boards
55+
rustup target add thumbv7em-none-eabi --toolchain "$TOOLCHAIN"
56+
57+
# Verify installation
58+
echo "Verifying toolchain components..."
59+
rustup component list --toolchain "$TOOLCHAIN" | grep installed
60+
61+
# Set the PATH to include the LLVM tools from this toolchain
62+
RUSTC_SYSROOT=$(rustc +$TOOLCHAIN --print sysroot)
63+
LLVM_TOOLS_PATH=$(find "$RUSTC_SYSROOT" -path '*/llvm-tools*/bin' | head -n 1)
64+
65+
if [ -n "$LLVM_TOOLS_PATH" ]; then
66+
echo "Adding LLVM tools to PATH: $LLVM_TOOLS_PATH"
67+
export PATH="$LLVM_TOOLS_PATH:$PATH"
68+
echo "LLVM tools location: $(which llvm-size 2>/dev/null || echo 'Not found')"
69+
else
70+
echo "Warning: LLVM tools path not found in Rust installation"
71+
fi
72+
}
73+
74+
setup_tock_toolchain
75+
76+
4077
# Ensure that `elf2tab` is installed:
4178
if ! type elf2tab; then
4279
# We may not have a rustup default toolchain selected. In this case,

0 commit comments

Comments
 (0)