Soong: Change Sanitize.Recover order
Add Sanitize.Order cflags after the general sanitizer options, so
it can override the global -fno-sanitize-recover=all.
Bug: 38128476
Test: m SANITIZE_HOST=address
Test: manual test
Change-Id: Ied5600507b66bd25d9d2a8bba428162ed4eb01e4
diff --git a/cc/sanitize.go b/cc/sanitize.go
index ab7768a..8900ee8 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -348,11 +348,6 @@
}
}
- if sanitize.Properties.Sanitize.Recover != nil {
- flags.CFlags = append(flags.CFlags, "-fsanitize-recover="+
- strings.Join(sanitize.Properties.Sanitize.Recover, ","))
- }
-
if len(sanitizers) > 0 {
sanitizeArg := "-fsanitize=" + strings.Join(sanitizers, ",")
flags.CFlags = append(flags.CFlags, sanitizeArg)
@@ -370,6 +365,11 @@
}
// FIXME: enable RTTI if diag + (cfi or vptr)
+ if sanitize.Properties.Sanitize.Recover != nil {
+ flags.CFlags = append(flags.CFlags, "-fsanitize-recover="+
+ strings.Join(sanitize.Properties.Sanitize.Recover, ","))
+ }
+
// Link a runtime library if needed.
runtimeLibrary := ""
if Bool(sanitize.Properties.Sanitize.Address) {