diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-02-15 16:39:56 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-02-15 17:00:25 -0500 |
commit | d8e25261b69dd4cd5acaacf6c76d7c658c25e9bd (patch) | |
tree | 47277d9c408afebdb96a604816e82d08beb7163b | |
parent | b16a890dc7e1435497a1b97b1a0fb7b0987faaef (diff) |
support compiling .so files directly in emcc
-rwxr-xr-x | emcc | 8 | ||||
-rwxr-xr-x | tests/runner.py | 2 |
2 files changed, 6 insertions, 4 deletions
@@ -460,6 +460,8 @@ try: shared.Building.llvm_as(input_file, temp_file) temp_files.append(temp_file) + if not LEAVE_INPUTS_RAW: assert len(temp_files) == len(input_files) + # If we were just asked to generate bitcode, stop there if final_suffix not in ['js', 'html']: if llvm_opts > 0: @@ -534,8 +536,8 @@ try: ('dlmalloc', create_dlmalloc, fix_dlmalloc, dlmalloc_symbols)]: need = [] has = [] - for input_file in input_files: - symbols = shared.Building.llvm_nm(in_temp(unsuffixed_basename(input_file) + '.o')) + for temp_file in temp_files: + symbols = shared.Building.llvm_nm(temp_file) for library_symbol in library_symbols: if library_symbol in symbols.undefs: need.append(library_symbol) @@ -559,7 +561,7 @@ try: final = in_temp(target_basename + '.bc') else: if not LEAVE_INPUTS_RAW: - shutil.move(in_temp(unsuffixed_basename(input_files[0]) + '.o'), in_temp(target_basename + '.bc')) + shutil.move(temp_files[0], in_temp(target_basename + '.bc')) final = in_temp(target_basename + '.bc') else: final = input_files[0] diff --git a/tests/runner.py b/tests/runner.py index ac422e9e..a99a8320 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -5657,7 +5657,7 @@ Options that are modified or new in %s include: # emcc src.cpp -c and emcc src.cpp -o src.[o|bc] ==> should give a .bc file # regression check: -o js should create "js", with bitcode content - for args in [['-c'], ['-o', 'src.o'], ['-o', 'src.bc'], ['-o', 'js']]: + for args in [['-c'], ['-o', 'src.o'], ['-o', 'src.bc'], ['-o', 'src.so'], ['-o', 'js']]: target = args[1] if len(args) == 2 else 'hello_world.o' clear() Popen([compiler, path_from_root('tests', 'hello_world' + suffix)] + args, stdout=PIPE, stderr=PIPE).communicate() |