-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
executable file
·36 lines (28 loc) · 977 Bytes
/
build.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
#!/bin/bash
# For Mac
if [ $(command uname) == "Darwin" ]; then
if ! [ -x "$(command -v greadlink)" ]; then
brew install coreutils
fi
BIN_PATH=$(greadlink -f "$0")
ROOT_DIR=$(dirname $(dirname $(dirname $BIN_PATH)))
# For Linux
else
BIN_PATH=$(readlink -f "$0")
ROOT_DIR=$(dirname $(dirname $(dirname $BIN_PATH)))
fi
export ROOT_DIR=${ROOT_DIR}
export PATH=${ROOT_DIR}/clang+llvm/bin:$PATH
export LD_LIBRARY_PATH=${ROOT_DIR}/clang+llvm/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
echo "Everything's fine!"
set -eux
# build tests
# compile the program and get bit code
cd $ROOT_DIR/evaluation/SafeStack
./cleanDIR.sh
clang -g -emit-llvm -c ./SafeStack.cpp -o SafeStack.bc
# perform static analysis
$ROOT_DIR/tool/staticAnalysis/staticAnalysis.sh SafeStack
# complie the instrumented program
export Con_PATH=$ROOT_DIR/evaluation/SafeStack/ConConfig.SafeStack
$ROOT_DIR/tool/staticAnalysis/DBDS-INSTRU/dbds-clang-fast++ -g ./SafeStack.bc -o SafeStack -lpthread -ldl