aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-04-04 00:05:26 -0400
committerBehdad Esfahbod <behdad@behdad.org>2012-04-04 01:03:43 -0400
commit03033b2fee5d0cc34fef6d4c1a542d0711ce95b9 (patch)
treec53f00bd79079f3dc2e8154b65800c0b31d1acf3 /emcc
parent67055e21159e58c0e0f52f6dc6d77730faf2edd0 (diff)
Look for bitcode for library input files in other places
If an input file is not bitcode and looks like a library file, treat it as library so we can look for it in other places. In conjuction with the previous change, now we can just drop, eg, libfreetype.dylib bitcode in emscripten/system/lib and "dynamic" linking would succeed. Perhaps this can be changed to only lookup in emscripten/system/lib instead of all lib_dirs, but this is a good start.
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc11
1 files changed, 11 insertions, 0 deletions
diff --git a/emcc b/emcc
index 740bfe96..d50c6fb9 100755
--- a/emcc
+++ b/emcc
@@ -554,6 +554,16 @@ try:
# this should be bitcode, make sure it is valid
if arg.endswith(ASSEMBLY_SUFFIXES) or shared.Building.is_bitcode(arg):
input_files.append(arg)
+ elif arg.endswith(STATICLIB_SUFFIXES + DYNAMICLIB_SUFFIXES):
+ # if it's not, and it's a library, just add it to libs to find later
+ l = unsuffixed_basename(arg)
+ for prefix in LIB_PREFIXES:
+ if not prefix: continue
+ if l.startswith(prefix):
+ l = l[len(prefix):]
+ break;
+ libs.append(l)
+ newargs[i] = ''
else:
print >> sys.stderr, 'emcc: %s: warning: Not valid LLVM bitcode' % arg
else:
@@ -564,6 +574,7 @@ try:
elif arg.startswith('-l'):
libs.append(arg[2:])
newargs[i] = ''
+
newargs = [ arg for arg in newargs if arg is not '' ]
# Find library files