msan_builder: Inject MSan flags in wrapper if they don't exist.

Some packages build test binaries that don't use DEB_C(XX)FLAGS and fail
during linking.
This commit is contained in:
Oliver Chang 2017-12-04 14:48:38 -08:00
parent f402826092
commit 6a4d0f864c
1 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,8 @@ import os
import subprocess
import sys
import msan_build
def Is32Bit(args):
"""Return whether or not we're 32-bit."""
@ -72,6 +74,10 @@ def GetCompilerArgs(args):
'-w',
])
if '-fsanitize=memory' not in args:
# If MSan flags weren't added for some reason, add them here.
compiler_args.extend(msan_build.INJECTED_ARGS)
return compiler_args