Merge "Fix the flaky build breakage for droiddoc target." into pi-dev
diff --git a/cc/compiler.go b/cc/compiler.go
index 8f18758..6154758 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -183,7 +183,7 @@
 }
 
 func (compiler *baseCompiler) Srcs() android.Paths {
-	return compiler.srcs
+	return append(android.Paths{}, compiler.srcs...)
 }
 
 func (compiler *baseCompiler) appendCflags(flags []string) {
diff --git a/genrule/filegroup.go b/genrule/filegroup.go
index 9f4aa10..2cff5fe 100644
--- a/genrule/filegroup.go
+++ b/genrule/filegroup.go
@@ -70,7 +70,7 @@
 }
 
 func (fg *fileGroup) Srcs() android.Paths {
-	return fg.srcs
+	return append(android.Paths{}, fg.srcs...)
 }
 
 var androidMkTemplate = template.Must(template.New("filegroup").Parse(`
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 0cd110c..42be88f 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -125,7 +125,7 @@
 }
 
 func (g *Module) Srcs() android.Paths {
-	return g.outputFiles
+	return append(android.Paths{}, g.outputFiles...)
 }
 
 func (g *Module) GeneratedHeaderDirs() android.Paths {