Skip to content

Commit 209f0fc

Browse files
committed
2 parents 1b0974f + 4f4b1bf commit 209f0fc

File tree

8 files changed

+81
-36
lines changed

8 files changed

+81
-36
lines changed

.pylintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# iam: generated by
2+
#
3+
# pylint --generate-rcfile > .pylintrc
4+
#
5+
# then customized to ignore my warts
6+
17
[MASTER]
28

39
# Specify a configuration file.

.travis.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,35 @@ sudo: required
44
dist: trusty
55

66
python:
7+
- "3.5"
8+
- "3.4"
79
- "3.3"
810
- "2.7"
9-
- "2.6"
1011

1112

1213
# command to install dependencies
1314
install:
1415
- sudo apt-get update
15-
# to install wllvm
16-
- sudo apt-get install -y python-pip
1716
# apache prerequisites
1817
- sudo apt-get install -y libapr1-dev libaprutil1-dev
1918
# for the clang build
2019
- sudo apt-get install -y llvm-3.5 clang-3.5
2120
# dragonegg prereqs. dragonegg and llvm-gcc use llvm 3.3
2221
- sudo apt-get install -y llvm-3.3 llvm-gcc-4.7
23-
- sudo pip install -e .
24-
- export WLLVM_HOME=`pwd`
25-
- export APACHE_VER=2.4.18
22+
# Install wllvm
23+
# Report the version of pip being used for debugging purposes.
24+
# It should report the site-packages directory and the version
25+
# of python it is working with.
26+
- pip --version
27+
- pip install -e .
2628

2729

2830
# command to run tests
2931
script:
32+
# Run unittests
33+
- python -m unittest discover test/ || exit 1
34+
- export WLLVM_HOME=`pwd`
35+
- export APACHE_VER=2.4.18
3036
# build apache with clang
3137
- ${WLLVM_HOME}/.travis/apache_clang.sh
3238
# build apache with gcc and dragonegg

.travis/apache_clang.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export PATH=/usr/lib/llvm-3.5/bin:${PATH}
77
export LLVM_COMPILER=clang
88
export WLLVM_OUTPUT=WARNING
99

10+
wllvm-sanity-checker
11+
1012
wget https://archive.apache.org/dist/httpd/httpd-${APACHE_VER}.tar.gz
1113

1214
tar xfz httpd-${APACHE_VER}.tar.gz

.travis/apache_dragonegg.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export LLVM_DRAGONEGG_PLUGIN=/usr/lib/gcc/x86_64-linux-gnu/4.7/plugin/dragonegg.
1111

1212
export WLLVM_OUTPUT=WARNING
1313

14+
wllvm-sanity-checker
15+
1416
wget https://archive.apache.org/dist/httpd/httpd-${APACHE_VER}.tar.gz
1517

1618

README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![WLLVM](https://github.com/SRI-CSL/whole-program-llvm/blob/master/img/dragon128x128.png?raw_true)Whole Program LLVM
1+
![WLLVM](img/dragon128x128.png?raw_true)Whole Program LLVM
22
==================
33
[![PyPI version](https://badge.fury.io/py/wllvm.svg)](https://badge.fury.io/py/wllvm)
44
[![Build Status](https://travis-ci.org/SRI-CSL/whole-program-llvm.svg?branch=master)](https://travis-ci.org/SRI-CSL/whole-program-llvm)
@@ -51,9 +51,27 @@ Tutorial
5151
=======
5252
If you want to develop or use the development version:
5353

54-
git clone https://github.com/SRI-CSL/whole-program-llvm
55-
cd whole-program-llvm
56-
pip install -e .
54+
```
55+
git clone https://github.com/travitch/whole-program-llvm
56+
cd whole-program-llvm
57+
```
58+
59+
Now you need to install WLLVM. You can either install
60+
globally on your system in develop mode:
61+
62+
```
63+
sudo pip install -e .
64+
```
65+
66+
or install WLLVM into a virtual python environment
67+
in develop mode to avoid installing globally:
68+
69+
```
70+
virtualenv venv
71+
source venv/bin/activate
72+
pip install -e .
73+
```
74+
5775

5876

5977
Usage
@@ -126,7 +144,7 @@ Tutorials
126144
---------
127145

128146
A gentler set of instructions on building apache in a vagrant Ubuntu 14.04 can be found
129-
[here,](https://github.com/SRI-CSL/whole-program-llvm/blob/master/doc/tutorial.md) and for Ubuntu 16.04 [here.](https://github.com/SRI-CSL/whole-program-llvm/blob/master/doc/tutorial-ubuntu-16.04.md)
147+
[here,](doc/tutorial.md) and for Ubuntu 16.04 [here.](doc/tutorial-ubuntu-16.04.md)
130148

131149
Building a bitcode module with dragonegg
132150
----------------------------------------
@@ -173,7 +191,7 @@ Building an Operating System
173191
----------------------------
174192

175193
To see how to build freeBSD 10.0 from scratch check out this
176-
[guide.](https://github.com/SRI-CSL/whole-program-llvm/blob/master/doc/tutorial-freeBSD.md)
194+
[guide.](doc/tutorial-freeBSD.md)
177195

178196

179197
Configuring without building bitcode
@@ -239,4 +257,4 @@ it might point out what is wrong.
239257
License
240258
-------
241259

242-
WLLVM is released under the MIT license. See the file `LICENSE` for [details.](https://github.com/SRI-CSL/whole-program-llvm/blob/master/LICENSE)
260+
WLLVM is released under the MIT license. See the file `LICENSE` for [details.](LICENSE)

wllvm/checker.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
wllvm point of view. Useful first step in trying to
77
debug a failure.
88
"""
9+
from __future__ import print_function
910

1011
import sys
1112
import os
1213
import subprocess as sp
1314
import errno
1415

16+
1517
explain_LLVM_COMPILER = """
1618
1719
The environment variable 'LLVM_COMPILER' is a switch. It should either
@@ -91,7 +93,7 @@ def check(self):
9193
"""
9294

9395
if not self.checkOS():
94-
print 'I do not think we support your OS. Sorry.'
96+
print('I do not think we support your OS. Sorry.')
9597
return 1
9698

9799
success = self.checkCompiler()
@@ -152,18 +154,18 @@ def checkDragoneggPlugin(self):
152154
plugin = os.getenv('LLVM_DRAGONEGG_PLUGIN')
153155

154156
if not plugin:
155-
print explain_LLVM_DRAGONEGG_PLUGIN
157+
print(explain_LLVM_DRAGONEGG_PLUGIN)
156158
return False
157159

158160
if os.path.isfile(plugin):
159161
try:
160162
open(plugin)
161163
except IOError as e:
162-
print "Unable to open {0}: {1}".format(plugin, str(e))
164+
print("Unable to open {0}: {1}".format(plugin, str(e)))
163165
else:
164166
return True
165167
else:
166-
print "Could not find {0}".format(plugin)
168+
print("Could not find {0}".format(plugin))
167169
return False
168170

169171

@@ -172,16 +174,16 @@ def checkCompiler(self):
172174
(code, comment) = self.checkSwitch()
173175

174176
if code == 0:
175-
print comment
177+
print(comment)
176178
return False
177179
elif code == 1:
178-
print comment
180+
print(comment)
179181
return self.checkClang()
180182
elif code == 2:
181-
print comment
183+
print(comment)
182184
return self.checkDragonegg()
183185
else:
184-
print 'Insane'
186+
print('Insane')
185187
return False
186188

187189

@@ -192,21 +194,21 @@ def checkCompilers(self, cc, cxx):
192194
(cxxOk, cxxVersion) = self.checkExecutable(cxx)
193195

194196
if not ccOk:
195-
print 'The C compiler {0} was not found or not executable.\nBetter not try using wllvm!\n'.format(cc)
197+
print('The C compiler {0} was not found or not executable.\nBetter not try using wllvm!\n'.format(cc))
196198
else:
197-
print 'The C compiler {0} is:\n\n{1}\n'.format(cc, extractLine(ccVersion, 0))
199+
print('The C compiler {0} is:\n\n{1}\n'.format(cc, extractLine(ccVersion, 0)))
198200

199201
if not cxxOk:
200-
print 'The CXX compiler {0} was not found or not executable.\nBetter not try using wllvm++!\n'.format(cxx)
202+
print('The CXX compiler {0} was not found or not executable.\nBetter not try using wllvm++!\n'.format(cxx))
201203
else:
202-
print 'The C++ compiler {0} is:\n\n{1}\n'.format(cxx, extractLine(cxxVersion, 0))
204+
print('The C++ compiler {0} is:\n\n{1}\n'.format(cxx, extractLine(cxxVersion, 0)))
203205

204206
if not ccOk or not cxxOk:
205-
print explain_LLVM_COMPILER_PATH
207+
print(explain_LLVM_COMPILER_PATH)
206208
if not ccOk:
207-
print explain_LLVM_CC_NAME
209+
print(explain_LLVM_CC_NAME)
208210
if not cxxOk:
209-
print explain_LLVM_CXX_NAME
211+
print(explain_LLVM_CXX_NAME)
210212

211213

212214

@@ -251,16 +253,16 @@ def checkAuxiliaries(self):
251253
(arOk, arVersion) = self.checkExecutable(ar, '-version')
252254

253255
if not linkOk:
254-
print 'The bitcode linker {0} was not found or not executable.\nBetter not try using extract-bc!\n'.format(link)
255-
print explain_LLVM_LINK_NAME
256+
print('The bitcode linker {0} was not found or not executable.\nBetter not try using extract-bc!\n'.format(link))
257+
print(explain_LLVM_LINK_NAME)
256258
else:
257-
print 'The bitcode linker {0} is:\n\n{1}\n'.format(link, extractLine(linkVersion, 1))
259+
print('The bitcode linker {0} is:\n\n{1}\n'.format(link, extractLine(linkVersion, 1)))
258260

259261
if not arOk:
260-
print 'The bitcode archiver {0} was not found or not executable.\nBetter not try using extract-bc!\n'.format(ar)
261-
print explain_LLVM_AR_NAME
262+
print('The bitcode archiver {0} was not found or not executable.\nBetter not try using extract-bc!\n'.format(ar))
263+
print(explain_LLVM_AR_NAME)
262264
else:
263-
print 'The bitcode archiver {0} is:\n\n{1}\n'.format(ar, extractLine(arVersion, 1))
265+
print('The bitcode archiver {0} is:\n\n{1}\n'.format(ar, extractLine(arVersion, 1)))
264266

265267

266268

wllvm/extraction.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import print_function
2+
13
import os
24
import sys
35
import subprocess as sp
@@ -87,7 +89,7 @@ def getSectionContent(size, offset, filename):
8789
d = c.decode('utf-8')
8890
except UnicodeDecodeError:
8991
_logger.error('Failed to read section containing:')
90-
print c
92+
print(c)
9193
raise
9294
# The linker pads sections with null bytes; our real data
9395
# cannot have null bytes because it is just text. Discard

wllvm/version.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,12 @@
3838
3939
1.0.14 - 11/10/2016 --coverage flag.
4040
41+
1.0.15 - 11/15/2016 pylintification complete.
42+
43+
1.0.16 - 11/16/2016 ooops musl points out I screwed up the exit codes AGAIN.
44+
45+
1.0.17 - 11/23/2016 delcypher #16 over at travitch's place.
46+
4147
"""
42-
wllvm_version = '1.0.14'
48+
49+
wllvm_version = '1.0.17'

0 commit comments

Comments
 (0)