msan_builder: fall back to GCC in rare cases.

e.g. when -aux-info is passed.
This commit is contained in:
Oliver Chang 2018-02-21 10:50:06 +11:00
parent cfc3788eb9
commit c39aa60723
1 changed files with 16 additions and 0 deletions

View File

@ -22,6 +22,10 @@ import sys
import msan_build
GCC_ONLY_ARGS = [
'-aux-info',
]
def InvokedAsGcc():
"""Return whether or not we're pretending to be GCC."""
@ -139,7 +143,19 @@ def FindRealClang():
return os.environ['REAL_CLANG_PATH']
def FallbackToGcc(args):
"""Check whether if we should fall back to GCC."""
if not InvokedAsGcc():
return False
return any(arg in GCC_ONLY_ARGS for arg in args[1:])
def main(args):
if FallbackToGcc(args):
sys.exit(subprocess.call(['/usr/bin/' + os.path.basename(args[0])] +
args[1:]))
is_cxx = args[0].endswith('++')
real_clang = FindRealClang()