-
Notifications
You must be signed in to change notification settings - Fork 8
/
build-cheri.sh
executable file
·54 lines (46 loc) · 1.93 KB
/
build-cheri.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
# --------------------------------------------------------------------
# This script builds the Cheri-LLVM library
# --------------------------------------------------------------------
set -o errexit
set -o pipefail
set -o nounset
# --------------------------------------------------------------------
# The absolute path to the directory of this script.
# --------------------------------------------------------------------
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# --------------------------------------------------------------------
# Clean the cheri tools directory for a new build
# --------------------------------------------------------------------
rm -rf $SCRIPT_DIR/cheri
rm -rf $SCRIPT_DIR/cheribuild
rm -rf $SCRIPT_DIR/llvm-project
# --------------------------------------------------------------------
# Commit info
# --------------------------------------------------------------------
branch="simtight"
cheribuild_commithash="a1bdfa225b575606f7303435c4c75ea9942d697f"
llvm_commithash="19d402e23fcaa197e1d40547da403dc17e13c7ae"
# --------------------------------------------------------------------
# Clone the submodules with certain commit number
# --------------------------------------------------------------------
cd $SCRIPT_DIR/
# Cheribuild
git clone --recursive [email protected]:CTSRD-CHERI/cheribuild.git
cd cheribuild
git fetch --depth=1 origin $cheribuild_commithash
git checkout $cheribuild_commithash -b $branch
cd ..
# LLVM
git clone --recursive [email protected]:CTSRD-CHERI/llvm-project.git
cd llvm-project
git fetch --depth=1 origin $llvm_commithash
git checkout $llvm_commithash -b $branch
cd ..
# --------------------------------------------------------------------
# Build cheri tools
# --------------------------------------------------------------------
cd $SCRIPT_DIR/cheribuild && \
./cheribuild.py llvm \
--llvm/source-directory ../llvm-project \
--source-root ../cheri