44On a clean 16.04 server machine I will build apache. Desktop instructions should be no different.
55
66```
7- >pwd
8-
9- /home/me/
10-
117>more /etc/lsb-release
128
139DISTRIB_ID=Ubuntu
@@ -17,40 +13,29 @@ DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"
1713```
1814
1915
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-
2816## Step 1.
2917
30- Set up the environment
18+ Install wllvm
3119
3220```
33- >export WLLVM_HOME=/home/me/whole-program-llvm
34-
35- >export PATH=${WLLVM_HOME}:${PATH}
21+ >sudo apt-get update
3622
37- >which wllvm
23+ >sudo install python-pip
3824
39- /home/me/whole-program-llvm/ wllvm
25+ >sudo pip install wllvm
4026```
4127
4228## Step 2.
4329
4430I am only going to build apache, not apr, so I first install the prerequisites.
4531
4632```
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
5034
5135```
5236
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.
5439
5540## Step 3.
5641
@@ -67,13 +52,10 @@ At this point, you should check your clang version with `which clang` and `ls -l
6752 Fetch apache, untar, configure, then build:
6853
6954```
70- >cd && pwd
71-
72- /home/me
7355
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
7557
76- >tar xfz httpd-2.4.12 .tar.gz
58+ >tar xfz httpd-2.4.23 .tar.gz
7759
7860>cd httpd-2.4.23
7961
@@ -87,22 +69,17 @@ At this point, you should check your clang version with `which clang` and `ls -l
8769Extract the bitcode.
8870
8971```
90- >extract-bc -l llvm-link-3.8 httpd
72+ >extract-bc httpd
9173
9274>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
9476```
9577
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-
10078## Step 6.
10179
10280Turn the bitcode into a second executable binary. (optional -- just for fun and sanity checking)
10381
10482```
105- llgc httpd.bc -o httpd.s
106- as httpd.s -o httpd.o
83+ llc -filetype=obj httpd.bc
10784gcc httpd.o -lpthread -lapr-1 -laprutil-1 -lpcre -o httpd.new
10885```
0 commit comments