diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-08 14:17:44 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-08 14:17:44 -0700 |
commit | 52fc56f0c99a3e87ae38da19b903630dc4262be9 (patch) | |
tree | 7b541a43c9845c9c3a52cae909eb3e86d4d98c65 /tools/shared.py | |
parent | 768dbda0b3305a33002b2185f83605c225f36e62 (diff) |
nicer solution for removing linker stub
Diffstat (limited to 'tools/shared.py')
-rw-r--r-- | tools/shared.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/shared.py b/tools/shared.py index 73e2a9a7..04c2eec3 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -473,10 +473,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e @staticmethod def link(files, target): try_delete(target) - stub = 'a.out' if not WINDOWS else 'a.exe' - need_cleanup = not os.path.exists(stub) - output = Popen([LLVM_LD, '-disable-opt'] + files + ['-b', target], stdout=PIPE).communicate()[0] - if need_cleanup: try_delete(stub) # clean up stub left by the linker + stub = os.path.join(EMSCRIPTEN_TEMP_DIR, 'stub_deleteme') + output = Popen([LLVM_LD, '-disable-opt'] + files + ['-b', target, '-o', stub], stdout=PIPE).communicate()[0] + try_delete(stub) # clean up stub left by the linker assert os.path.exists(target) and (output is None or 'Could not open input file' not in output), 'Linking error: ' + output # Emscripten optimizations that we run on the .ll file |