Merge "Add CFI support for assembly heavy libraries" am: 1cfd8af0a8

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1500330

Change-Id: Icc31acef62998b571a17e73ce28f2d11dfeed0d9
This commit is contained in:
Cindy Zhou 2020-11-20 13:21:13 +00:00 committed by Automerger Merge Worker
commit 07b9b74371

View file

@ -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) {