Add CFI support for assembly heavy libraries
This commit adds an new option to the sanitizer build config to enable CFI with the "-fno-sanitize-cfi-canonical-jump-tables" flag in order to provide more support for assembly heavy libraries. Bug: 158010610 Test: Compile with option enabled in libaom and libvpx Change-Id: I7d0d3ed6ff876582043fd72b687757426e3dc5aa
This commit is contained in:
parent
caa0d93da0
commit
8cd45dea53
|
@ -172,6 +172,12 @@ type SanitizeUserProps struct {
|
|||
No_recover []string
|
||||
}
|
||||
|
||||
// Sanitizers to run with flag configuration specified
|
||||
Config struct {
|
||||
// Enables CFI support flags for assembly-heavy libraries
|
||||
Cfi_assembly_support *bool `android:"arch_variant"`
|
||||
}
|
||||
|
||||
// value to pass to -fsanitize-recover=
|
||||
Recover []string
|
||||
|
||||
|
@ -543,6 +549,9 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
|||
|
||||
flags.Local.CFlags = append(flags.Local.CFlags, cfiCflags...)
|
||||
flags.Local.AsFlags = append(flags.Local.AsFlags, cfiAsflags...)
|
||||
if Bool(sanitize.Properties.Sanitize.Config.Cfi_assembly_support) {
|
||||
flags.Local.CFlags = append(flags.Local.CFlags, "-fno-sanitize-cfi-canonical-jump-tables")
|
||||
}
|
||||
// Only append the default visibility flag if -fvisibility has not already been set
|
||||
// to hidden.
|
||||
if !inList("-fvisibility=hidden", flags.Local.CFlags) {
|
||||
|
|
Loading…
Reference in New Issue