aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-02-21 14:44:32 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-02-21 14:44:32 -0800
commit15f6d2d20bafaffe5eb559f42ff05fa296a10dcb (patch)
tree2bcb08af28d0aac2cea685345a4f31353a26eaec /tools
parent989d49f884cf7b72a14881e6040e43185cbfbd5b (diff)
fix llvm nativizer tool for fastcomp
Diffstat (limited to 'tools')
-rwxr-xr-xtools/nativize_llvm.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/nativize_llvm.py b/tools/nativize_llvm.py
index b327bdfc..52dfdea1 100755
--- a/tools/nativize_llvm.py
+++ b/tools/nativize_llvm.py
@@ -25,9 +25,11 @@ Popen([LLVM_OPT, filename, '-strip-debug', '-o', filename + '.clean.bc']).commun
print 'bc => s'
for params in [['-march=x86'], ['-march=x86-64']]: # try x86, then x86-64 FIXME
print 'params', params
- Popen([LLVM_COMPILER] + params + [filename + '.clean.bc', '-o', filename + '.s']).communicate()[0]
- print 's => o'
- Popen(['as', filename + '.s', '-o', filename + '.o']).communicate()[0]
+ for triple in [['-mtriple=i386-pc-linux-gnu'], []]:
+ Popen([LLVM_COMPILER] + params + triple + [filename + '.clean.bc', '-o', filename + '.s']).communicate()[0]
+ print 's => o'
+ Popen(['as', filename + '.s', '-o', filename + '.o']).communicate()[0]
+ if os.path.exists(filename + '.o'): break
if os.path.exists(filename + '.o'): break
print 'o => runnable'
Popen(['g++', path_from_root('system', 'lib', 'debugging.cpp'), filename + '.o', '-o', filename + '.run'] + ['-l' + lib for lib in libs]).communicate()[0]