-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f4ca17
commit 57a3783
Showing
1 changed file
with
2 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Reference: https://github.com/foundry-rs/foundry/blob/master/foundryup/install | ||
|
||
set -e | ||
|
||
echo "🚀 Installing mips-linux-muslsf-cross..." && echo | ||
|
||
BASE_DIR=$HOME | ||
MIPS_DIR=${MIPS_DIR-"$BASE_DIR/.mipsrust"} | ||
MIPS_BIN_DIR="$MIPS_DIR/mips-linux-muslsf-cross/bin" | ||
|
||
MIPS_TOOL_URL="http://musl.cc/mips-linux-muslsf-cross.tgz" | ||
|
||
# Create the mips tool directory . | ||
mkdir -p $MIPS_DIR | ||
|
||
echo && echo "Downloading $MIPS_TOOL_URL..." | ||
wget "$MIPS_TOOL_URL" -O "mips-linux-muslsf-cross.tgz" | ||
|
||
if [ ! -f "mips-linux-muslsf-cross.tgz" ]; then | ||
echo && echo "Download failed." | ||
exit 1 | ||
fi | ||
|
||
echo && echo "Unpacking to $MIPS_DIR..." | ||
tar -xzf "mips-linux-muslsf-cross.tgz" -C "$MIPS_DIR" | ||
|
||
if [ ! -d "$MIPS_BIN_DIR" ]; then | ||
echo && echo "Unpack failed." | ||
exit 1 | ||
fi | ||
|
||
echo && echo "Cleaning up..." | ||
rm "mips-linux-muslsf-cross.tgz" | ||
|
||
CONFIG_FILE="$HOME/.cargo/config" | ||
|
||
touch $CONFIG_FILE | ||
|
||
TARGET_CONFIG="[target.mips-unknown-linux-musl] | ||
linker = \"$MIPS_BIN_DIR/mips-linux-muslsf-gcc\" | ||
rustflags = [\"--cfg\", 'target_os=\"zkvm\"',\"-C\", \"target-feature=+crt-static\", \"-C\", \"link-arg=-g\"]" | ||
|
||
echo "🚀 Installing mips-zkm-zkvm-elf..." && echo | ||
|
||
if [ -f "$CONFIG_FILE" ]; then | ||
|
||
if grep -q "target.mips-unknown-linux-musl" "$CONFIG_FILE"; then | ||
echo && echo "Target configuration already exists in $CONFIG_FILE." | ||
else | ||
|
||
echo && echo "$TARGET_CONFIG" >> "$CONFIG_FILE" | ||
echo && echo "Target configuration added to $CONFIG_FILE." | ||
fi | ||
else | ||
echo && echo "$CONFIG_FILE does not exists, please check your rust setting." | ||
exit 1 | ||
fi | ||
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/zkMIPS/toolchain/refs/heads/main/setup.sh | sh | ||
|
||
echo && echo "✅ Installation complete!" | ||
|