From fcabb1c5188abc94025b6e8b629a8ff969262f1d Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 3 Jan 2019 23:25:11 -0800 Subject: [PATCH] Don't expect depfile from .s files .s files (unlike .S files) aren't run through the preprocessor, so -M* doesn't actually write out a depfile. Since our ninja is now going to be verifying that the depfile is created (https://android-review.googlesource.com/861510), don't specify a depfile for .s files. Bug: 121058584 Test: apply https://android-review.googlesource.com/861510 Test: cd external/libavc; mma Change-Id: I1697aa020c63639317c8f4771147026601ae72fc --- cc/builder.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cc/builder.go b/cc/builder.go index bf35f84da..5dbd23e0d 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -55,6 +55,13 @@ var ( }, "ccCmd", "cFlags") + ccNoDeps = pctx.AndroidGomaStaticRule("ccNoDeps", + blueprint.RuleParams{ + Command: "$relPwd ${config.CcWrapper}$ccCmd -c $cFlags -o $out $in", + CommandDeps: []string{"$ccCmd"}, + }, + "ccCmd", "cFlags") + ld = pctx.AndroidStaticRule("ld", blueprint.RuleParams{ Command: "$ldCmd ${crtBegin} @${out}.rsp " + @@ -383,9 +390,13 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and tidy := flags.tidy coverage := flags.coverage dump := flags.sAbiDump + rule := cc switch srcFile.Ext() { - case ".S", ".s": + case ".s": + rule = ccNoDeps + fallthrough + case ".S": ccCmd = "clang" moduleCflags = asflags tidy = false @@ -416,7 +427,7 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and } ctx.Build(pctx, android.BuildParams{ - Rule: cc, + Rule: rule, Description: ccDesc + " " + srcFile.Rel(), Output: objFile, ImplicitOutputs: implicitOutputs,