Skip to content

Commit

Permalink
Merge pull request #25 from gwsystems/arm-cleanup
Browse files Browse the repository at this point in the history
LLVM Dependency Cleanup and Debian Install Script Fixes
  • Loading branch information
bushidocodes authored Mar 26, 2021
2 parents a8c473b + 1aeae6f commit fc9d17d
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 84 deletions.
132 changes: 59 additions & 73 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"

[dependencies]
flexi_logger = "0.14.4"
llvm-alt = { git = "https://github.com/Others/llvm-rs.git"}
llvm-alt = { git = "https://github.com/gwsystems/llvm-rs", branch = "sfbase"}
log = "0.4.8"
structopt = "0.3.2"
wasmparser = "0.39.2"
Expand Down
26 changes: 16 additions & 10 deletions install_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
# Installs dependencies, builds Silverfish, and places it into your path
# Be sure to validate the Rust and LLVM install scripts we invoke below!

sudo="sudo"
if [[ $(whoami) == "root" ]]; then
sudo=""
fi

# Exit if not executing script from project root because we use relative paths
# We want to match without case because the URL of the git repo is case insensitive, but the resulting
# directory is case sensitive. Thus, we can end up with either "aWsm" or "awsm."
shopt -s nocasematch
if [[ $(git remote get-url origin) != *"/aWsm.git" || $(git rev-parse --show-toplevel) != $(pwd) ]]; then
if [[ $(git remote get-url origin) != *"/awsm"* || $(git rev-parse --show-toplevel) != $(pwd) ]]; then
echo "Install script must be run from project root."
exit 1
fi
shopt -u nocasematch

# Install Build Dependencies
sudo apt install build-essential --yes
sudo apt install cmake --yes
$sudo apt install build-essential --yes
$sudo apt install cmake --yes
$sudo apt install lsb-release wget software-properties-common --yes

# Initialize Wasmception submodule
# Check to see if ./wasmception directory exists and is not empty.
Expand All @@ -38,13 +44,13 @@ source "$HOME/.cargo/env"
export PATH="$HOME/.cargo/bin:$PATH"

# Install LLVM build dependencies
LLVM_VERSION=9
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" bash $LLVM_VERSION
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-$LLVM_VERSION 100
sudo apt install libc++-dev libc++abi-dev --yes
LLVM_VERSION=11
$sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" bash $LLVM_VERSION
$sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
$sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$LLVM_VERSION 100
$sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-$LLVM_VERSION 100
$sudo apt install libc++-dev libc++abi-dev --yes

# Build and install Silverfish
cargo build --release
sudo cp -t /usr/bin ./target/release/silverfish
$sudo cp -t /usr/bin ./target/release/silverfish

0 comments on commit fc9d17d

Please sign in to comment.