Merge "Build against cfi supported coverage lib"

This commit is contained in:
Cindy Zhou 2021-01-20 18:08:30 +00:00 committed by Gerrit Code Review
commit 0ae13ec307
2 changed files with 12 additions and 0 deletions

View file

@ -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,

View file

@ -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"
}