diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-11 14:01:06 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-11 14:01:06 -0800 |
commit | c83b1d4e9ef4525c35adbbf5a697aa46418bb7f1 (patch) | |
tree | 2172c7cacd15592c2210d26a87da8d21565f06be | |
parent | d9e1837c619bc70f9424489787ca80766c998789 (diff) | |
parent | 42b03394eb80db5183d2eb8c2c22b587cd85794e (diff) |
Merge branch 'incoming' into asm_js
-rwxr-xr-x | emcc | 3 | ||||
-rwxr-xr-x | emscripten.py | 1 | ||||
-rw-r--r-- | tools/shared.py | 8 |
3 files changed, 10 insertions, 2 deletions
@@ -806,7 +806,8 @@ try: final_suffix = 'o' # do not link in libs when just generating object code (not an 'executable', i.e. JS, or a library) - if ('.' + final_suffix) in BITCODE_SUFFIXES: + if ('.' + final_suffix) in BITCODE_SUFFIXES and len(libs) > 0: + print >> sys.stderr, 'emcc: warning: not linking against libraries since only compiling to bitcode' libs = [] # Find library files diff --git a/emscripten.py b/emscripten.py index ea685718..e200ddd9 100755 --- a/emscripten.py +++ b/emscripten.py @@ -110,6 +110,7 @@ def emscript(infile, settings, outfile, libraries=[]): elif line.find(' = type { ') > 0: pre.append(line) # type elif line.startswith('!'): + if line.startswith('!llvm.module'): continue # we can ignore that meta.append(line) # metadata else: pre.append(line) # pre needs it so we know about globals in pre and funcs. So emit globals there diff --git a/tools/shared.py b/tools/shared.py index 18a32d27..6f5bd646 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -750,21 +750,26 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e contents = filter(os.path.exists, map(os.path.abspath, contents)) added_contents = set() added = True + #print >> sys.stderr, ' initial undef are now ', unresolved_symbols, '\n' while added: # recursively traverse until we have everything we need + #print >> sys.stderr, ' running loop of archive including for', f added = False for content in contents: if content in added_contents: continue new_symbols = Building.llvm_nm(content) # Link in the .o if it provides symbols, *or* this is a singleton archive (which is apparently an exception in gcc ld) #print >> sys.stderr, 'need', content, '?', unresolved_symbols, 'and we can supply', new_symbols.defs + #print >> sys.stderr, content, 'DEF', new_symbols.defs, '\n' if new_symbols.defs.intersection(unresolved_symbols) or len(files) == 1: if Building.is_bitcode(content): - #print >> sys.stderr, ' adding object', content + #print >> sys.stderr, ' adding object', content, '\n' resolved_symbols = resolved_symbols.union(new_symbols.defs) unresolved_symbols = unresolved_symbols.union(new_symbols.undefs.difference(resolved_symbols)).difference(new_symbols.defs) + #print >> sys.stderr, ' undef are now ', unresolved_symbols, '\n' actual_files.append(content) added_contents.add(content) added = True + #print >> sys.stderr, ' done running loop of archive including for', f finally: os.chdir(cwd) try_delete(target) @@ -786,6 +791,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e seen_symbols = seen_symbols.union(symbols.defs) # Finish link + if DEBUG: print >>sys.stderr, 'emcc: llvm-linking:', actual_files output = Popen([LLVM_LINK] + actual_files + ['-o', target], stdout=PIPE).communicate()[0] assert os.path.exists(target) and (output is None or 'Could not open input file' not in output), 'Linking error: ' + output + '\nemcc: If you get duplicate symbol errors, try --remove-duplicates' for temp_dir in temp_dirs: |