Add minimal-runtime support for integer overflows.
Adds Soong support for -fsanitze-minimal-runtime when using
the integer overflow sanitizers. This makes the crashes due to these
sanitizers less mysterious.
Bug: 64091660
Test: Compiled and checked the generated compiler commands
Test: Checked program that overflows for the abort reason
Change-Id: Ieeceaf6c35c8371592952d3b8b977aefc11601c5
diff --git a/cc/config/toolchain.go b/cc/config/toolchain.go
index 471db1d..279ceef 100644
--- a/cc/config/toolchain.go
+++ b/cc/config/toolchain.go
@@ -215,6 +215,10 @@
return SanitizerRuntimeLibrary(t, "ubsan_standalone")
}
+func UndefinedBehaviorSanitizerMinimalRuntimeLibrary(t Toolchain) string {
+ return SanitizerRuntimeLibrary(t, "ubsan_minimal")
+}
+
func ThreadSanitizerRuntimeLibrary(t Toolchain) string {
return SanitizerRuntimeLibrary(t, "tsan")
}