bp2build conversion for Sanitize.Integer_overflow
and Sanitize.Misc_undefined.
This is a redo of aosp/2277186 with changes to account for issues
in mixed builds. Specifically, for now we're disabling mixed builds
for modules that use ubsan. This bug tracks enabling it:
b/261058727.
Bug: 253428057
Test: Unit tests
Change-Id: I9dbec1d99353f8cbe6751d5241283ab19592dc27
diff --git a/cc/cc.go b/cc/cc.go
index 2ff5bba..e07edeb 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1859,7 +1859,11 @@
}
func (c *Module) IsMixedBuildSupported(ctx android.BaseModuleContext) bool {
- return c.bazelHandler != nil
+ // TODO(b/261058727): Remove this (enable mised builds for modules with UBSan)
+ ubsanEnabled := c.sanitize != nil &&
+ ((c.sanitize.Properties.Sanitize.Integer_overflow != nil && *c.sanitize.Properties.Sanitize.Integer_overflow) ||
+ c.sanitize.Properties.Sanitize.Misc_undefined != nil)
+ return c.bazelHandler != nil && !ubsanEnabled
}
func (c *Module) ProcessBazelQueryResponse(ctx android.ModuleContext) {