Save deps when asflags contains -xassembler-with-cpp
Usually, ".S" files are processes with the c preprocessor, and ".s" files are not, so they don't have any dependency information, since it is generated by the preprocessor. But with the -xassembler-with-cpp flag, ".s" files are processed with the preprocessor, so we should ask for dependency information from them. Test: NINJA_ARGS="-t deps out/soong/.intermediates/external/sonivox/arm-wt-22k/libsonivox/android_arm_armv7-a-neon_core_static/obj/external/sonivox/arm-wt-22k/lib_src/ARM-E_filter_gnu.o" m Test: treehugger Change-Id: Iee7baeebc2b205b5a2f33e7c1705ea4a5b4fc95a
This commit is contained in:
@@ -271,6 +271,8 @@ type builderFlags struct {
|
|||||||
sAbiDump bool
|
sAbiDump bool
|
||||||
emitXrefs bool
|
emitXrefs bool
|
||||||
|
|
||||||
|
assemblerWithCpp bool
|
||||||
|
|
||||||
systemIncludeFlags string
|
systemIncludeFlags string
|
||||||
|
|
||||||
groupStaticLibs bool
|
groupStaticLibs bool
|
||||||
@@ -428,7 +430,9 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
|
|||||||
|
|
||||||
switch srcFile.Ext() {
|
switch srcFile.Ext() {
|
||||||
case ".s":
|
case ".s":
|
||||||
|
if !flags.assemblerWithCpp {
|
||||||
rule = ccNoDeps
|
rule = ccNoDeps
|
||||||
|
}
|
||||||
fallthrough
|
fallthrough
|
||||||
case ".S":
|
case ".S":
|
||||||
ccCmd = "clang"
|
ccCmd = "clang"
|
||||||
|
4
cc/cc.go
4
cc/cc.go
@@ -174,6 +174,7 @@ type Flags struct {
|
|||||||
CFlagsDeps android.Paths // Files depended on by compiler flags
|
CFlagsDeps android.Paths // Files depended on by compiler flags
|
||||||
LdFlagsDeps android.Paths // Files depended on by linker flags
|
LdFlagsDeps android.Paths // Files depended on by linker flags
|
||||||
|
|
||||||
|
AssemblerWithCpp bool
|
||||||
GroupStaticLibs bool
|
GroupStaticLibs bool
|
||||||
|
|
||||||
proto android.ProtoFlags
|
proto android.ProtoFlags
|
||||||
@@ -1053,6 +1054,9 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
|||||||
if c.sabi != nil {
|
if c.sabi != nil {
|
||||||
flags = c.sabi.flags(ctx, flags)
|
flags = c.sabi.flags(ctx, flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flags.AssemblerWithCpp = inList("-xassembler-with-cpp", flags.AsFlags)
|
||||||
|
|
||||||
// Optimization to reduce size of build.ninja
|
// Optimization to reduce size of build.ninja
|
||||||
// Replace the long list of flags for each file with a module-local variable
|
// Replace the long list of flags for each file with a module-local variable
|
||||||
ctx.Variable(pctx, "cflags", strings.Join(flags.CFlags, " "))
|
ctx.Variable(pctx, "cflags", strings.Join(flags.CFlags, " "))
|
||||||
|
@@ -79,6 +79,7 @@ func flagsToBuilderFlags(in Flags) builderFlags {
|
|||||||
|
|
||||||
systemIncludeFlags: strings.Join(in.SystemIncludeFlags, " "),
|
systemIncludeFlags: strings.Join(in.SystemIncludeFlags, " "),
|
||||||
|
|
||||||
|
assemblerWithCpp: in.AssemblerWithCpp,
|
||||||
groupStaticLibs: in.GroupStaticLibs,
|
groupStaticLibs: in.GroupStaticLibs,
|
||||||
|
|
||||||
proto: in.proto,
|
proto: in.proto,
|
||||||
|
Reference in New Issue
Block a user