From 4a2dcb5c4bbf3d01533bc6643ad30954d3b8bd09 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 24 May 2018 16:44:14 +0900 Subject: [PATCH] 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 --- cc/compiler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cc/compiler.go b/cc/compiler.go index b410115f8..8f119cf3c 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -258,6 +258,8 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps 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 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps 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