fix: recovery.cflags now works
There was a bug that recovery.cflags is ignored. Respect the property
when building for recovery.
Bug: 79146551
Test: m -j
Change-Id: I24c1c1b593c83eb1992721571c6d5c42483a41a0
diff --git a/cc/compiler.go b/cc/compiler.go
index b410115..8f119cf 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -258,6 +258,8 @@
CheckBadCompilerFlags(ctx, "cppflags", compiler.Properties.Cppflags)
CheckBadCompilerFlags(ctx, "conlyflags", compiler.Properties.Conlyflags)
CheckBadCompilerFlags(ctx, "asflags", compiler.Properties.Asflags)
+ CheckBadCompilerFlags(ctx, "vendor.cflags", compiler.Properties.Target.Vendor.Cflags)
+ CheckBadCompilerFlags(ctx, "recovery.cflags", compiler.Properties.Target.Recovery.Cflags)
esc := proptools.NinjaAndShellEscape
@@ -454,6 +456,10 @@
flags.CFlags = append(flags.CFlags, esc(compiler.Properties.Target.Vendor.Cflags)...)
}
+ if ctx.inRecovery() {
+ flags.CFlags = append(flags.CFlags, esc(compiler.Properties.Target.Recovery.Cflags)...)
+ }
+
// We can enforce some rules more strictly in the code we own. strict
// indicates if this is code that we can be stricter with. If we have
// rules that we want to apply to *our* code (but maybe can't for