Skip to content

Commit d0c69bd

Browse files
author
Marco Trivellato
committed
add fallback to llvm_opt
1 parent 88b5a68 commit d0c69bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/shared.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,11 @@ def llvm_opt(filename, opts, out=None):
16421642
logging.warning('Note: Input file "' + i + '" did not exist.')
16431643
elif not Building.is_bitcode(i):
16441644
logging.warning('Note: Input file "' + i + '" exists but was not an LLVM bitcode file suitable for Emscripten. Perhaps accidentally mixing native built object files with Emscripten?')
1645-
sys.exit(1)
1645+
if len(inputs) == 1 and os.path.exists(filename):
1646+
logging.warning('llvm_opt fallback: copy %s to %s', filename, target)
1647+
shutil.copyfile(filename, target)
1648+
else:
1649+
sys.exit(1)
16461650
if not out:
16471651
shutil.move(filename + '.opt.bc', filename)
16481652
return target

0 commit comments

Comments
 (0)