diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-23 19:41:36 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-25 08:59:27 +0300 |
commit | 794624d29502ab22d520f7a3d986bde403e198eb (patch) | |
tree | 3880e79c87beded9d6427c8c2281ee4c4cdf1ad5 | |
parent | a507cd8807f1d62f654af3beab15b221252de542 (diff) |
Do not get confused by Apple GCC dylib special '-compatibility_version' and '-current_version' directives when scanning for input files. Fixes test_the_bullet on OSX after the previous commit.
-rwxr-xr-x | emcc | 42 |
1 files changed, 20 insertions, 22 deletions
@@ -978,7 +978,7 @@ try: if i > 0: prev = newargs[i-1] - if prev in ['-MT', '-MF', '-MQ', '-D', '-U', '-o', '-x', '-Xpreprocessor', '-include', '-imacros', '-idirafter', '-iprefix', '-iwithprefix', '-iwithprefixbefore', '-isysroot', '-imultilib', '-A', '-isystem', '-iquote', '-install_name', '-I', '-L']: continue # ignore this gcc-style argument + if prev in ['-MT', '-MF', '-MQ', '-D', '-U', '-o', '-x', '-Xpreprocessor', '-include', '-imacros', '-idirafter', '-iprefix', '-iwithprefix', '-iwithprefixbefore', '-isysroot', '-imultilib', '-A', '-isystem', '-iquote', '-install_name', '-compatibility_version', '-current_version', '-I', '-L']: continue # ignore this gcc-style argument if (os.path.islink(arg) and os.path.realpath(arg).endswith(SOURCE_SUFFIXES + BITCODE_SUFFIXES + DYNAMICLIB_SUFFIXES + ASSEMBLY_SUFFIXES)): arg = os.path.realpath(arg) @@ -994,29 +994,27 @@ try: if arg_suffix.endswith(SOURCE_SUFFIXES): input_files.append(arg) has_source_inputs = True + elif arg_suffix.endswith(ASSEMBLY_SUFFIXES) or shared.Building.is_bitcode(arg): # this should be bitcode, make sure it is valid + input_files.append(arg) + elif arg_suffix.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: - # this should be bitcode, make sure it is valid - if arg_suffix.endswith(ASSEMBLY_SUFFIXES) or shared.Building.is_bitcode(arg): - input_files.append(arg) - elif arg_suffix.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: - logging.warning(arg + ' is not valid LLVM bitcode') + logging.warning(arg + ' is not valid LLVM bitcode') elif arg_suffix.endswith(STATICLIB_SUFFIXES): - if not shared.Building.is_ar(arg): - if shared.Building.is_bitcode(arg): - logging.error(arg + ': File has a suffix of a static library ' + str(STATICLIB_SUFFIXES) + ', but instead is an LLVM bitcode file! When linking LLVM bitcode files, use one of the suffixes ' + str(BITCODE_SUFFIXES)) - else: - logging.error(arg + ': Unknown format, not a static library!') - exit(1) + if not shared.Building.is_ar(arg): + if shared.Building.is_bitcode(arg): + logging.error(arg + ': File has a suffix of a static library ' + str(STATICLIB_SUFFIXES) + ', but instead is an LLVM bitcode file! When linking LLVM bitcode files, use one of the suffixes ' + str(BITCODE_SUFFIXES)) + else: + logging.error(arg + ': Unknown format, not a static library!') + exit(1) else: logging.error(arg + ": Input file has an unknown suffix, don't know what to do with it!") exit(1) |