diff --git a/cc/cc.go b/cc/cc.go index c4a1c004e..7aefdc18f 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -469,6 +469,7 @@ type ModuleContextIntf interface { nativeCoverage() bool directlyInAnyApex() bool isPreventInstall() bool + isCfiAssemblySupportEnabled() bool } type ModuleContext interface { @@ -1244,6 +1245,11 @@ func (c *Module) XrefCcFiles() android.Paths { return c.kytheFiles } +func (c *Module) isCfiAssemblySupportEnabled() bool { + return c.sanitize != nil && + Bool(c.sanitize.Properties.Sanitize.Config.Cfi_assembly_support) +} + type baseModuleContext struct { android.BaseModuleContext moduleContextImpl @@ -1409,6 +1415,10 @@ func (ctx *moduleContextImpl) isPreventInstall() bool { return ctx.mod.Properties.PreventInstall } +func (ctx *moduleContextImpl) isCfiAssemblySupportEnabled() bool { + return ctx.mod.isCfiAssemblySupportEnabled() +} + func newBaseModule(hod android.HostOrDeviceSupported, multilib android.Multilib) *Module { return &Module{ hod: hod, diff --git a/cc/coverage.go b/cc/coverage.go index acf98ddcf..5b5ccf2f0 100644 --- a/cc/coverage.go +++ b/cc/coverage.go @@ -58,6 +58,8 @@ func getGcovProfileLibraryName(ctx ModuleContextIntf) string { func getClangProfileLibraryName(ctx ModuleContextIntf) string { if ctx.useSdk() { return "libprofile-clang-extras_ndk" + } else if ctx.isCfiAssemblySupportEnabled() { + return "libprofile-clang-extras_cfi_support" } else { return "libprofile-clang-extras" }