Skip to content

Commit 0e596d0

Browse files
committed
2 parents f4d0a5d + c0cf4c2 commit 0e596d0

File tree

6 files changed

+38
-30
lines changed

6 files changed

+38
-30
lines changed

README-freeBSD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ to your shell startup (in '~/.profile' for bash):
6767

6868
export LLVM_HOME=/usr/local/llvm-3.3
6969

70-
Get LLVM and Clang version 3.5:
70+
Get LLVM and Clang version 3.3:
7171

7272
svn co http://llvm.org/svn/llvm-project/llvm/branches/release_33 llvm
7373
cd llvm/tools

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ In addition to the above environment variables the following can be optionally u
5454
variable.
5555
Example `LLVM_COMPILER_PATH=/home/user/llvm_and_clang/Debug+Asserts/bin`.
5656

57+
* `WLLVM_CONFIGURE_ONLY` can be set to anything, when set `wllvm` and `wllvm++`
58+
will not carry out the second phase that involves the production of bitcode.
59+
This may prevent configuration errors being cause by the unexpected production
60+
of the hidden bitcode files.
61+
5762
Example building bitcode module
5863
===============================
5964

@@ -88,6 +93,15 @@ Example building an Operating System
8893
To see how to build freeBSD 10.0 from scratch check out the guide
8994
[here.](../master/README-freeBSD.md)
9095

96+
97+
Example configuring without building bitcode
98+
================================
99+
100+
101+
WLLVM_CONFIGURE_ONLY=1 CC=wllvm ./configure
102+
CC=wllvm make
103+
104+
91105
Debugging
92106
=========
93107

driver/as

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
# (which was created in the first compilation phase by the real
1111
# compiler). We'll link this together at a later stage.
1212

13-
import os
14-
import sys
15-
from utils import *
13+
from __future__ import absolute_import
14+
15+
from .utils import *
1616
from subprocess import *
17-
from popenwrapper import Popen
18-
import logconfig
17+
from .popenwrapper import Popen
1918

2019

2120
class BCFilter(ArgumentListFilter):

driver/utils.py

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from __future__ import absolute_import
2+
from __future__ import print_function
3+
14
from subprocess import *
25
import collections
36
import pprint
@@ -7,26 +10,13 @@
710
import re
811
import sys
912
import tempfile
13+
from .popenwrapper import Popen
1014

1115
fullSelfPath = os.path.realpath(__file__)
1216
prefix = os.path.dirname(fullSelfPath)
1317
driverDir = prefix
1418

15-
# This is a bit hacky.
16-
# We cannot do
17-
# from .popenwrapper import Popen
18-
# OR
19-
# from driver.popenwrapper import Popen
20-
# because then 'as' will not succesfully import us (wllvm/wllvm++ can
21-
# successfully import however).
22-
#
23-
# Using
24-
# from popenwrapper import Popen
25-
# will allow 'as' to import us but then wllvm/wllvm++ will not be able to.
26-
#
27-
# The work around is to put this directory in the search path for modules.
28-
sys.path.insert(0,driverDir)
29-
from popenwrapper import Popen
19+
3020

3121
# Environmental variable for path to compiler tools (clang/llvm-link etc..)
3222
llvmCompilerPathEnv = 'LLVM_COMPILER_PATH'
@@ -391,15 +381,15 @@ def getArtifactNames(self, srcFile, hidden=False):
391381

392382
#iam: for printing our partitioning of the args
393383
def dump(self):
394-
print "compileArgs: ", self.compileArgs
395-
print "inputFiles: ", self.inputFiles
396-
print "linkArgs: ", self.linkArgs
397-
print "objectFiles: ", self.objectFiles
398-
print "outputFilename: ", self.outputFilename
384+
print("compileArgs: ", self.compileArgs)
385+
print("inputFiles: ", self.inputFiles)
386+
print("linkArgs: ", self.linkArgs)
387+
print("objectFiles: ", self.objectFiles)
388+
print("outputFilename: ", self.outputFilename)
399389
for srcFile in self.inputFiles:
400-
print "srcFile: ", srcFile
390+
print("srcFile: ", srcFile)
401391
(objFile, bcFile) = self.getArtifactNames(srcFile)
402-
print "{0} ===> ({1}, {2})".format(srcFile, objFile, bcFile)
392+
print("{0} ===> ({1}, {2})".format(srcFile, objFile, bcFile))
403393

404394

405395

wllvm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# library or executable.
99

1010
import sys
11+
import os
1112
from driver.utils import *
1213
import driver.logconfig
1314

@@ -16,5 +17,7 @@ cmd = cmd[1:]
1617

1718
builder = getBuilder(cmd, False)
1819
buildObject(builder)
19-
buildAndAttachBitcode(builder)
20+
if not os.environ.get('WLLVM_CONFIGURE_ONLY', False):
21+
buildAndAttachBitcode(builder)
22+
2023

wllvm++

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# library or executable.
99

1010
import sys
11+
import os
1112
from driver.utils import *
1213
import driver.logconfig
1314

@@ -16,4 +17,5 @@ cmd = cmd[1:]
1617

1718
builder = getBuilder(cmd, True)
1819
buildObject(builder)
19-
buildAndAttachBitcode(builder)
20+
if not os.environ.get('WLLVM_CONFIGURE_ONLY', False):
21+
buildAndAttachBitcode(builder)

0 commit comments

Comments
 (0)