Merge logtags from cc modules too
Merged logtags files will be used for Soong built filesystem images.
Bug: 336189540
Test: m out/soong/.intermediates/all-event-log-tags.txt
Test: m out/target/common/obj/all-event-log-tags.txt
Change-Id: Ib590c2bc8073e9acee6b45ef08092768237cf9d3
diff --git a/cc/androidmk.go b/cc/androidmk.go
index ef26366..071d829 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -88,7 +88,7 @@
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
if len(c.Properties.Logtags) > 0 {
- entries.AddStrings("LOCAL_LOGTAGS_FILES", c.Properties.Logtags...)
+ entries.AddStrings("LOCAL_SOONG_LOGTAGS_FILES", c.logtagsPaths.Strings()...)
}
// Note: Pass the exact value of AndroidMkSystemSharedLibs to the Make
// world, even if it is an empty list. In the Make world,
diff --git a/cc/cc.go b/cc/cc.go
index e3954d7..e4f50f9 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -319,7 +319,7 @@
// *.logtags files, to combine together in order to generate the /system/etc/event-log-tags
// file
- Logtags []string
+ Logtags []string `android:"path"`
// Make this module available when building for ramdisk.
// On device without a dedicated recovery partition, the module is only
@@ -908,6 +908,8 @@
// Aconfig files for all transitive deps. Also exposed via TransitiveDeclarationsInfo
mergedAconfigFiles map[string]android.Paths
+
+ logtagsPaths android.Paths
}
func (c *Module) AddJSONData(d *map[string]interface{}) {
@@ -1997,6 +1999,11 @@
func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
ctx := moduleContextFromAndroidModuleContext(actx, c)
+ c.logtagsPaths = android.PathsForModuleSrc(actx, c.Properties.Logtags)
+ android.SetProvider(ctx, android.LogtagsProviderKey, &android.LogtagsInfo{
+ Logtags: c.logtagsPaths,
+ })
+
// If Test_only is set on a module in bp file, respect the setting, otherwise
// see if is a known test module type.
testOnly := c.testModule || c.testLibrary()