4
4
On a clean 16.04 server machine I will build apache. Desktop instructions should be no different.
5
5
6
6
```
7
- >pwd
8
-
9
- /home/me/
10
-
11
7
>more /etc/lsb-release
12
8
13
9
DISTRIB_ID=Ubuntu
@@ -17,40 +13,29 @@ DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"
17
13
```
18
14
19
15
20
- ## Step 0.
21
-
22
- Checkout the wllvm repository
23
-
24
- ```
25
- >git clone https://github.com/SRI-CSL/whole-program-llvm.git
26
- ```
27
-
28
16
## Step 1.
29
17
30
- Set up the environment
18
+ Install wllvm
31
19
32
20
```
33
- >export WLLVM_HOME=/home/me/whole-program-llvm
34
-
35
- >export PATH=${WLLVM_HOME}:${PATH}
21
+ >sudo apt-get update
36
22
37
- >which wllvm
23
+ >sudo install python-pip
38
24
39
- /home/me/whole-program-llvm/ wllvm
25
+ >sudo pip install wllvm
40
26
```
41
27
42
28
## Step 2.
43
29
44
30
I am only going to build apache, not apr, so I first install the prerequisites.
45
31
46
32
```
47
- >sudo apt-get update
48
-
49
- >sudo apt-get install llvm clang libapr1-dev libaprutil1-dev libpcre3-dev gcc make
33
+ >sudo apt-get install llvm clang libapr1-dev libaprutil1-dev libpcre3-dev make
50
34
51
35
```
52
36
53
- At this point, you should check your clang version with ` which clang ` and ` ls -l /usr/bin/clang ` . It should be clang-3.8.
37
+ At this point, you could check your clang version with ` which clang ` and ` ls -l /usr/bin/clang ` .
38
+ It should be at least clang-3.8.
54
39
55
40
## Step 3.
56
41
@@ -67,13 +52,10 @@ At this point, you should check your clang version with `which clang` and `ls -l
67
52
Fetch apache, untar, configure, then build:
68
53
69
54
```
70
- >cd && pwd
71
-
72
- /home/me
73
55
74
- >wget http ://apache.mirrors.pair.com /httpd/httpd-2.4.23.tar.gz
56
+ >wget https ://archive. apache.org/dist /httpd/httpd-2.4.23.tar.gz
75
57
76
- >tar xfz httpd-2.4.12 .tar.gz
58
+ >tar xfz httpd-2.4.23 .tar.gz
77
59
78
60
>cd httpd-2.4.23
79
61
@@ -87,22 +69,17 @@ At this point, you should check your clang version with `which clang` and `ls -l
87
69
Extract the bitcode.
88
70
89
71
```
90
- >extract-bc -l llvm-link-3.8 httpd
72
+ >extract-bc httpd
91
73
92
74
>ls -la httpd.bc
93
- -rw-r--r-- 1 vagrant vagrant 829960 Jun 1 2015 httpd.bc
75
+ -rw-r--r-- 1 vagrant vagrant 1119584 Aug 4 20:02 httpd.bc
94
76
```
95
77
96
- The extra command line argument to ` extract-bc ` is because ` apt `
97
- installs ` llvm-link ` as ` llvm-link-3.8 ` so we need to tell ` extract-bc `
98
- to use that one.
99
-
100
78
## Step 6.
101
79
102
80
Turn the bitcode into a second executable binary. (optional -- just for fun and sanity checking)
103
81
104
82
```
105
- llgc httpd.bc -o httpd.s
106
- as httpd.s -o httpd.o
83
+ llc -filetype=obj httpd.bc
107
84
gcc httpd.o -lpthread -lapr-1 -laprutil-1 -lpcre -o httpd.new
108
85
```
0 commit comments