Support "memtag_heap" sanitizer.
Memtag_heap adds an ELF note that enables MTE heap tagging in bionic/scudo. Ignored on non-executables. With diagnostic (diag:{memtag_heap:true}) enables the SYNC mode, otherwise - ASYNC mode. Memtag_heap defaults to set (with diag) on cc_test targets, unset otherwise. Ignored on non MTE-compatible hardware. Bug: b/135772972 Test: soong tests Change-Id: I88fd0f159e609e17bd13487749980a1ba02cb91c
This commit is contained in:
14
cc/cc.go
14
cc/cc.go
@@ -420,6 +420,7 @@ type VendorProperties struct {
|
||||
type ModuleContextIntf interface {
|
||||
static() bool
|
||||
staticBinary() bool
|
||||
testBinary() bool
|
||||
header() bool
|
||||
binary() bool
|
||||
object() bool
|
||||
@@ -1261,6 +1262,10 @@ func (ctx *moduleContextImpl) staticBinary() bool {
|
||||
return ctx.mod.staticBinary()
|
||||
}
|
||||
|
||||
func (ctx *moduleContextImpl) testBinary() bool {
|
||||
return ctx.mod.testBinary()
|
||||
}
|
||||
|
||||
func (ctx *moduleContextImpl) header() bool {
|
||||
return ctx.mod.Header()
|
||||
}
|
||||
@@ -2961,6 +2966,15 @@ func (c *Module) staticBinary() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (c *Module) testBinary() bool {
|
||||
if test, ok := c.linker.(interface {
|
||||
testBinary() bool
|
||||
}); ok {
|
||||
return test.testBinary()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Header returns true if the module is a header-only variant. (See cc/library.go header()).
|
||||
func (c *Module) Header() bool {
|
||||
if h, ok := c.linker.(interface {
|
||||
|
Reference in New Issue
Block a user