Commit ac1e3a63 authored by George Burgess IV's avatar George Burgess IV Committed by Commit Bot

goma_link: parse `,` from `-mllvm` args appropriately

CrOS builders are complaining about broken flags like:
`-mllvm ,-enable-dse-memoryssa=false`

We should probably be dropping that `,`. This CL makes us do that.

Bug: 1135234
Change-Id: I3f99498003282d8e737d3d066bc7e2e257f65dec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2450743Reviewed-by: default avatarBob Haarman <inglorion@chromium.org>
Commit-Queue: George Burgess <gbiv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813878}
parent a858f424
......@@ -237,7 +237,7 @@ class GomaLinkBase(object):
'-Wl,--lto.*',
'-Wl,--thin.*',
)))
MLLVM_RE = re.compile('(?:-Wl,)?([-/]mllvm)[:=]?(.*)', re.IGNORECASE)
MLLVM_RE = re.compile('(?:-Wl,)?([-/]mllvm)[:=,]?(.*)', re.IGNORECASE)
OBJ_RE = re.compile('(.*)\\.(o(?:bj)?)', re.IGNORECASE)
def _no_codegen(self, args):
......
......@@ -228,6 +228,13 @@ class GomaLinkUnitTest(unittest.TestCase):
self.assertTrue(os.path.exists('test'))
self.assertRaises(OSError, goma_link.ensure_file, 'test/impossible')
def test_transform_codegen_param_on_mllvm(self):
# Regression test for crbug.com/1135234
link = goma_ld.GomaLinkUnix()
self.assertEqual(
link.transform_codegen_param_common('-mllvm,-import-instr-limit=20'),
['-mllvm', '-import-instr-limit=20'])
if __name__ == '__main__':
unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment