Force Thumb for CFI targets.
Bug: 22033465 Test: bionic device tests Change-Id: I672ccc970309631fa895b7134a32c0d403a2151e
This commit is contained in:
@@ -307,6 +307,11 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
||||
}
|
||||
|
||||
if Bool(sanitize.Properties.Sanitize.Cfi) {
|
||||
if ctx.Arch().ArchType == android.Arm {
|
||||
// __cfi_check needs to be built as Thumb (see the code in linker_cfi.cpp). LLVM is not set up
|
||||
// to do this on a function basis, so force Thumb on the entire module.
|
||||
flags.RequiredInstructionSet = "thumb"
|
||||
}
|
||||
sanitizers = append(sanitizers, "cfi")
|
||||
cfiFlags := []string{"-flto", "-fsanitize=cfi", "-fsanitize-cfi-cross-dso"}
|
||||
flags.CFlags = append(flags.CFlags, cfiFlags...)
|
||||
|
Reference in New Issue
Block a user