-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathreinstall.sh
More file actions
executable file
·109 lines (93 loc) · 2.66 KB
/
reinstall.sh
File metadata and controls
executable file
·109 lines (93 loc) · 2.66 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
# Only can be used when musl-libc already being built!
Curr_Path=`pwd`
echo "Current Path: "$Curr_Path
Bash_Dir=$(cd "$(dirname "$0")";pwd)
echo "Bash file Path: "$Bash_Dir
if [ "$Curr_Path" != "$Bash_Dir" ]
then
echo "Wrong install path! Please make sure you are in a right elf-respect repo!"
exit 1
fi
cd ..
Install_Path=`pwd`
echo "Re-install Path: "$Install_Path
if [ ! -d "./linux-sgx" ]
then
echo "No SGXSDK!"
exit 1
fi
SGXSDK_Source_Path=`pwd`"/linux-sgx"
if [ ! -d "./elfutils4sgx" ]
then
echo "No Libelf!"
exit 1
fi
Libelf_Path=`pwd`"/elfutils4sgx/elfutils-0.176"
if [ ! -d "./capstone" ]
then
echo "No Capstone!"
exit 1
fi
Capstone_Path=`pwd`"/capstone"
if [ ! -d "./llvm-mc" ]
then
echo "No llvm-mc!"
exit 1
fi
LLVM_MC_Path=`pwd`"/llvm-mc"
if [ ! -d "./proofGen" ]
then
echo "No proofGen!"
exit 1
fi
ProofGen_Path=`pwd`"/proofGen"
cd elf-respect
echo "Configuring loader..."
cd loader
echo "Generating new Makefile header..."
rm -f Makefile
echo "SGX_SRC_PATH = "$SGXSDK_Source_Path > Makefile_header4checker
echo "ELFUTILS_PATH = "$Libelf_Path >> Makefile_header4checker
echo "CAPSTONE_PATH = "$Capstone_Path >> Makefile_header4checker
cat Makefile_header4checker Makefile_template4checker > Makefile
make clean
rm Makefile_header4checker
cd target-program
echo "Generating new Makefile header..."
rm -f Makefile
CC4AS=$LLVM_MC_Path"/build/bin/clang -fPIC -fno-asynchronous-unwind-tables -fno-addrsig"
echo "CC = "$CC4AS > Makefile_header4target
cat Makefile_header4target Makefile_template4target > Makefile
rm Makefile_header4target
make clean
cd ../..
echo "Configuring dynamic-loader-checker..."
cd dynamic-loader-checker
echo "Generating new Makefile header..."
rm -f Makefile
echo "SGX_SRC_PATH = "$SGXSDK_Source_Path > Makefile_header4checker
echo "ELFUTILS_PATH = "$Libelf_Path >> Makefile_header4checker
echo "CAPSTONE_PATH = "$Capstone_Path >> Makefile_header4checker
cat Makefile_header4checker Makefile_template4checker > Makefile
make clean
rm Makefile_header4checker
cd target-program
echo "Generating new Makefile header..."
rm -f Makefile
echo "LLVM_PATH = "$ProofGen_Path > Makefile_header4target
echo "Our_AS_Path = "$LLVM_MC_Path >> Makefile_header4target
cat Makefile_header4target Makefile_template4target > Makefile
rm Makefile_header4target
make clean
cd ..
cd sc-resil-tg
echo "Generating new Makefile header..."
rm -f Makefile
echo "LLVM_PATH = "$ProofGen_Path > Makefile_header4target
echo "Our_AS_Path = "$LLVM_MC_Path >> Makefile_header4target
cat Makefile_header4target Makefile_template4target > Makefile
rm Makefile_header4target
make clean
cd ../..
echo "Re-installed!"