Add integer_overflow sanitization build option.
Adds the SANITIZE_TARGET=integer_overflow build option to apply signed and unsigned integer overflow sanitization globally. This implements the Soong side of the build option. An additional build option is provided to control whether or not to run in diagnostics mode, controlled by SANITIZE_TARGET_DIAG. This works the same way that SANITIZE_TARGET does and currently only supports 'integer_overflow' as an option. A default sanitizer blacklist is added to avoid applying sanitization to functions that are likely to exhibit benign overflows. Bug: 30969751 Test: Building with and without the new flags, device boot-up, tested various permutations of controlling the new flags from build files. Change-Id: Ibc8a8615d3132f1a23faaf1cb4861f24c5ef734a
This commit is contained in:
@@ -66,6 +66,8 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
|
||||
ctx.Strict("CFI_EXTRA_CFLAGS", strings.Join(cfiCflags, " "))
|
||||
ctx.Strict("CFI_EXTRA_LDFLAGS", strings.Join(cfiLdflags, " "))
|
||||
|
||||
ctx.Strict("INTEGER_OVERFLOW_EXTRA_CFLAGS", strings.Join(intOverflowCflags, " "))
|
||||
|
||||
ctx.Strict("DEFAULT_C_STD_VERSION", config.CStdVersion)
|
||||
ctx.Strict("DEFAULT_CPP_STD_VERSION", config.CppStdVersion)
|
||||
ctx.Strict("DEFAULT_GCC_CPP_STD_VERSION", config.GccCppStdVersion)
|
||||
|
Reference in New Issue
Block a user