Skip to content

Commit 1ef5647

Browse files
committed
Updating the turorial.
1 parent 006dd32 commit 1ef5647

File tree

5 files changed

+46
-37
lines changed

5 files changed

+46
-37
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ Building bitcode archive
142142
# Produces src/LinearMath/libLinearMath.bca
143143
extract-bc src/LinearMath/libLinearMath.a
144144

145+
# Produces src/LinearMath/libLinearMath.a.bc
146+
extract-bc -b src/LinearMath/libLinearMath.a
147+
148+
149+
145150

146151
Building an Operating System
147152
============================

doc/tutorial.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,32 @@ DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"
1717
```
1818

1919

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-
2820
## Step 1.
2921

30-
Set up the environment
22+
23+
Install `wllvm`.
3124

3225
```
33-
>export WLLVM_HOME=/vagrant/whole-program-llvm
26+
>sudo apt-get update
3427
35-
>export PATH=${WLLVM_HOME}:${PATH}
28+
>sudo apt-get install python-pip
3629
37-
>which wllvm
30+
>sudo pip install wllvm
3831
39-
/vagrant/whole-program-llvm/wllvm
4032
```
4133

4234
## Step 2.
4335

4436
I am only going to build apache, not apr, so I first install the prerequisites.
4537

4638
```
47-
>sudo apt-get update
48-
4939
>sudo apt-get install llvm-3.4 clang-3.4 libapr1-dev libaprutil1-dev
5040
51-
```
41+
``` Note `wllvm` is agnostic with respect to llvm versions, when you
42+
use clang, so feel free to install a more recent version if you
43+
wish. However, if you are going to use dragonegg the llvm version is
44+
tightly coupled to the gcc and plugin versions you are using.
45+
5246
5347
## Step 3.
5448
@@ -60,16 +54,17 @@ I am only going to build apache, not apr, so I first install the prerequisites.
6054
>export WLLVM_OUTPUT=WARNING
6155
```
6256
57+
6358
## Step 4.
6459
6560
Fetch apache, untar, configure, then build:
6661
6762
```
68-
>wget http://apache.mirrors.pair.com//httpd/httpd-2.4.12.tar.gz
63+
>wget https://archive.apache.org/dist/httpd/httpd-2.4.18.tar.gz
6964
70-
>tar xfz httpd-2.4.12.tar.gz
65+
>tar xfz httpd-2.4.18.tar.gz
7166
72-
>cd httpd-2.4.12
67+
>cd httpd-2.4.18
7368
7469
>CC=wllvm ./configure
7570
@@ -84,7 +79,7 @@ Extract the bitcode.
8479
>extract-bc -l llvm-link-3.4 httpd
8580
8681
>ls -la httpd.bc
87-
-rw-r--r-- 1 vagrant vagrant 829960 Jun 1 2015 httpd.bc
82+
-rw-rw-r-- 1 vagrant vagrant 860608 Aug 4 16:55 httpd.bc
8883
```
8984
9085
The extra command line argument to `extract-bc` is because `apt`

wllvm/extractor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
from extraction import *
2727

2828
def main():
29-
return extraction(sys.argv)
30-
29+
try:
30+
extraction(sys.argv)
31+
except:
32+
return 1
33+
return 0
34+
3135
if __name__ == '__main__':
3236
sys.exit(main())

wllvm/wllvm.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818

1919

2020
def main():
21-
cmd = list(sys.argv)
22-
cmd = cmd[1:]
23-
24-
builder = getBuilder(cmd, False)
25-
buildObject(builder)
26-
if not os.environ.get('WLLVM_CONFIGURE_ONLY', False):
27-
buildAndAttachBitcode(builder)
28-
21+
try:
22+
cmd = list(sys.argv)
23+
cmd = cmd[1:]
24+
25+
builder = getBuilder(cmd, False)
26+
buildObject(builder)
27+
if not os.environ.get('WLLVM_CONFIGURE_ONLY', False):
28+
buildAndAttachBitcode(builder)
29+
except:
30+
return 1
2931
return 0
3032

3133

wllvm/wllvmpp.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@
1414
import logconfig
1515

1616
def main():
17-
cmd = list(sys.argv)
18-
cmd = cmd[1:]
19-
20-
builder = getBuilder(cmd, True)
21-
buildObject(builder)
22-
if not os.environ.get('WLLVM_CONFIGURE_ONLY', False):
23-
buildAndAttachBitcode(builder)
17+
try:
18+
cmd = list(sys.argv)
19+
cmd = cmd[1:]
2420

21+
builder = getBuilder(cmd, True)
22+
buildObject(builder)
23+
if not os.environ.get('WLLVM_CONFIGURE_ONLY', False):
24+
buildAndAttachBitcode(builder)
25+
except:
26+
return 1
27+
return 0
2528

2629

2730
if __name__ == '__main__':

0 commit comments

Comments
 (0)