diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-31 11:49:14 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-31 11:49:14 -0800 |
commit | ada59f0a9d23d8ec19ee6a1326977ddf6e93f5f9 (patch) | |
tree | 1e1f079b5569ae2d7269ff2abf4b520ad82d3cdd /tools/nativize_llvm.py | |
parent | 2f4401a79e96917f78876c3e09b8d31754a26f70 (diff) | |
parent | e97f48a2c9376354a6b8927191322322f13808ba (diff) |
Merge branch 'incoming'
Diffstat (limited to 'tools/nativize_llvm.py')
-rwxr-xr-x | tools/nativize_llvm.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/nativize_llvm.py b/tools/nativize_llvm.py index e76b9a4e..d9558c32 100755 --- a/tools/nativize_llvm.py +++ b/tools/nativize_llvm.py @@ -23,9 +23,12 @@ libs = sys.argv[2:] # e.g.: dl for dlopen/dlclose, util for openpty/forkpty print 'bc => clean bc' Popen([LLVM_OPT, filename, '-strip-debug', '-o=' + filename + '.clean.bc']).communicate()[0] print 'bc => s' -Popen([LLVM_COMPILER, filename + '.clean.bc', '-o=' + filename + '.s']).communicate()[0] -print 's => o' -Popen(['as', filename + '.s', '-o', filename + '.o']).communicate()[0] +for params in [[], ['-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] + 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] |