aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-03-07 14:28:13 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-03-07 14:28:13 -0800
commit84c9c225258ae9ab77eda0163b1368e95cb55f10 (patch)
tree862d10ede1597d4210dc05f97ad3eaaa7ef2815e
parent956eade969c8dc438a085e3837f5d59c41651b8d (diff)
improve emcc input finding so that it ignores -MT x
-rwxr-xr-xemcc5
1 files changed, 5 insertions, 0 deletions
diff --git a/emcc b/emcc
index d015d85e..f646108b 100755
--- a/emcc
+++ b/emcc
@@ -442,6 +442,11 @@ try:
for i in range(len(newargs)): # find input files XXX this a simple heuristic. we should really analyze based on a full understanding of gcc params,
# right now we just assume that what is left contains no more |-x OPT| things
arg = newargs[i]
+
+ if i > 0:
+ prev = newargs[i-1]
+ if prev == '-MT': continue # ignore this gcc-style argument
+
if arg.endswith(SOURCE_SUFFIXES + BITCODE_SUFFIXES + DYNAMICLIB_SUFFIXES + ASSEMBLY_SUFFIXES) or shared.Building.is_ar(arg): # we already removed -o <target>, so all these should be inputs
newargs[i] = ''
if os.path.exists(arg):