-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_dependencies.sh
executable file
·51 lines (43 loc) · 1.21 KB
/
install_dependencies.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
#!/bin/bash
set -e
THIS_DIR=$(dirname "$(readlink -f "$0")")
# Fetch the submodules
cd $THIS_DIR
git submodule update --init --recursive
#Apply the patch to default.nix to use the default gcc to compile LLVM
cd $THIS_DIR
git checkout default.nix
git apply install_dependencies.patch
#Enter the nix-shell & compile LLVM
#Note that we escape the BINUTILES_DIR to take the value of the shellHook in default.nix
nix-shell --run "
cd $THIS_DIR/llvm-project && \
git submodule update --init && \
mkdir -p build && \
mkdir -p install && \
cd build && \
cmake -G \"Unix Makefiles\" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BINUTILS_INCDIR=\$BINUTILS_DIR \
-DLLVM_ENABLE_PROJECTS=\"clang;clang-tools-extra\" \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DCMAKE_INSTALL_PREFIX=/llvm ../llvm && \
make -j$(nproc)
"
# Revert back the default.nix structure to use the impure-clang and use clang in the shell
cd $THIS_DIR
git checkout default.nix
# Compile the SPP runtime with the clang compiler
nix-shell --run "
cd $THIS_DIR/runtime && \
make clean && \
make
"
# # Compile PMDK with the clang compiler
nix-shell --run "
cd $THIS_DIR/pmdk && \
git checkout spp-pm_ptr_bit && \
make clean -j$(nproc) && \
make clobber -j$(nproc) && \
make -j$(nproc) TAG_BITS=26
"