aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-03-28 16:52:28 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-03-28 16:52:28 -0700
commitcde38c81c2330c139fa5d7d12a9e3688c5059f9c (patch)
tree1c31a885a9fe73364436b480f9db886d5c90a548 /emcc
parent20bfe6cf840a29d9dad7d7fda5a3001ebe71a3a5 (diff)
fix the case where emcc's input and output is a bitcode file
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc8
1 files changed, 2 insertions, 6 deletions
diff --git a/emcc b/emcc
index 20898043..fa51e57f 100755
--- a/emcc
+++ b/emcc
@@ -1394,8 +1394,6 @@ try:
temp_files.append(temp_file)
elif file_ending.endswith(ASSEMBLY_ENDINGS):
if not LEAVE_INPUTS_RAW:
- # Note that by assembling the .ll file, then disassembling it later, we will
- # remove annotations which is a good thing for compilation time
logging.debug('assembling assembly file: ' + input_file)
temp_file = in_temp(unsuffixed(uniquename(input_file)) + '.o')
shared.Building.llvm_as(input_file, temp_file)
@@ -1426,15 +1424,13 @@ try:
safe_move(get_bitcode_file(input_file), unsuffixed_basename(input_file) + final_ending)
else:
if len(input_files) == 1:
- temp_output_base = unsuffixed(get_bitcode_file(input_files[0]))
- if not specified_target:
- safe_move(get_bitcode_file(input_file), unsuffixed_basename(input_file) + final_ending)
+ safe_move(temp_files[0], specified_target if specified_target else unsuffixed_basename(input_file) + final_ending)
+ temp_output_base = unsuffixed(temp_files[0])
if os.path.exists(temp_output_base + '.d'):
# There was a .d file generated, from -MD or -MMD and friends, save a copy of it to where the output resides,
# adjusting the target name away from the temporary file name to the specified target.
# It will be deleted with the rest of the temporary directory.
deps = open(temp_output_base + '.d').read()
-
deps = deps.replace(temp_output_base + default_object_extension, specified_target)
with open(os.path.join(os.path.dirname(specified_target), os.path.basename(unsuffixed(input_files[0]) + '.d')), "w") as out_dep:
out_dep.write(deps)