File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,17 @@ def buildObject(builder):
310310def isLinkOption (arg ):
311311 return arg == '-pthread' or arg .startswith ('-l' ) or arg .startswith ('-Wl,' )
312312
313+ def removeLinkOptions (args ):
314+ filtered = []
315+ prevarg = None
316+ for arg in args :
317+ if "-Xclang" == prevarg :
318+ filtered += [arg ]
319+ elif not isLinkOption (arg ):
320+ filtered += [arg ]
321+ prevarg = arg
322+ return filtered
323+
313324# This command does not have the executable with it
314325def buildAndAttachBitcode (builder ):
315326 af = builder .getBitcodeArglistFilter ()
@@ -324,7 +335,7 @@ def buildAndAttachBitcode(builder):
324335 # check to see if there was any output on stderr instead of the
325336 # return code of commands, so warnings about unused link flags can
326337 # cause spurious failures here.
327- bcc = [ arg for arg in bcc if not isLinkOption ( arg )]
338+ bcc = removeLinkOptions ( bcc )
328339 proc = Popen (bcc )
329340 rc = proc .wait ()
330341 if rc == 0 :
You can’t perform that action at this time.
0 commit comments