@@ -47,8 +47,8 @@ def __init__(self, inputList, exactMatches={}, patternMatches={}):
4747 '-v' : (0 , ArgumentListFilter .compileOnlyCallback ),
4848
4949 #warnings (apart from the regex below)
50- '-w' : (0 , ArgumentListFilter .compileUnaryCallback ),
51- '-W' : (0 , ArgumentListFilter .compileUnaryCallback ),
50+ '-w' : (0 , ArgumentListFilter .compileOnlyCallback ),
51+ '-W' : (0 , ArgumentListFilter .compileOnlyCallback ),
5252
5353
5454 #iam: if this happens, then we need to stop and think.
@@ -330,6 +330,18 @@ def __init__(self, inputList, exactMatches={}, patternMatches={}):
330330 (arity , handler ) = argExactMatches [currentItem ]
331331 flagArgs = self ._shiftArgs (arity )
332332 handler (self , currentItem , * flagArgs )
333+ elif currentItem == '-Wl,--start-group' :
334+ linkingGroup = [currentItem ]
335+ terminated = False
336+ while self ._inputArgs :
337+ groupCurrent = self ._inputArgs .popleft ()
338+ linkingGroup .append (groupCurrent )
339+ if groupCurrent == "-Wl,--end-group" :
340+ terminated = True
341+ break
342+ if not terminated :
343+ _logger .warning ('Did not find a closing "-Wl,--end-group" to match "-Wl,--start-group"' )
344+ self .linkingGroupCallback (linkingGroup )
333345 else :
334346 matched = False
335347 for pattern , (arity , handler ) in argPatterns .items ():
@@ -456,6 +468,10 @@ def linkBinaryCallback(self, flag, arg):
456468 self .linkArgs .append (flag )
457469 self .linkArgs .append (arg )
458470
471+ def linkingGroupCallback (self , args ):
472+ _logger .debug ('linkingGroupCallback: %s' , args )
473+ self .linkArgs .extend (args )
474+
459475 #flags common to both linking and compiling (coverage for example)
460476 def compileLinkUnaryCallback (self , flag ):
461477 _logger .debug ('compileLinkUnaryCallback: %s' , flag )
0 commit comments