summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2025-03-21 11:03:10 -0700
committer Jihoon Kang <jihoonkang@google.com> 2025-03-21 11:56:37 -0700
commitb6b93c28fa1dd941b1fb2a4bb3f8db32df0354a0 (patch)
tree57b8691b183d224e1f38709626498d5bda6cc99f
parentbe6f81d61e25753eeecdb65bdf7dd2bb6d4c1a5c (diff)
Set symbols related make variables in apexBundle's androidMkForType()
ALL_MODULES.$(my_register_name).SYMBOLIC_OUTPUT_PATH and ALL_MODULES.$(my_register_name).ELF_SYMBOL_MAPPING_PATH variables are used in generating symbols.zip and the elf mapping proto file. Setting these variables in the apex bundle allows the symbols of the modules included in the apex to be collected properly. Test: build mainline && inspect symbols.zip Change-Id: I08715a278e5fe508793ebee0f1e6feee1c234970
-rw-r--r--apex/androidmk.go21
1 files changed, 13 insertions, 8 deletions
diff --git a/apex/androidmk.go b/apex/androidmk.go
index 3a81ee4e6..0a5644ae3 100644
--- a/apex/androidmk.go
+++ b/apex/androidmk.go
@@ -75,7 +75,7 @@ func (a *apexBundle) fullModuleName(apexBundleName string, linkToSystemLib bool,
// populated by Soong for unconverted APEXes, or Bazel in mixed mode. Use
// apexFile#isBazelPrebuilt to differentiate.
func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, moduleDir string,
- apexAndroidMkData android.AndroidMkData) []string {
+ apexAndroidMkData android.AndroidMkData) (archSpecificModuleNames []string, moduleNames []string) {
// apexBundleName comes from the 'name' property or soong module.
// apexName comes from 'name' property of apex_manifest.
@@ -84,11 +84,12 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, moduleDir st
// However, symbol files for apex files are installed under /apex/<apexBundleName> to avoid
// conflicts between two apexes with the same apexName.
- moduleNames := []string{}
-
for _, fi := range a.filesInfo {
linkToSystemLib := a.linkToSystemLib && fi.transitiveDep && fi.availableToPlatform()
moduleName := a.fullModuleName(apexBundleName, linkToSystemLib, &fi)
+ if !android.InList(moduleName, moduleNames) {
+ moduleNames = append(moduleNames, moduleName)
+ }
// This name will be added to LOCAL_REQUIRED_MODULES of the APEX. We need to be
// arch-specific otherwise we will end up installing both ABIs even when only
@@ -100,8 +101,8 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, moduleDir st
case "lib64":
aName = aName + ":64"
}
- if !android.InList(aName, moduleNames) {
- moduleNames = append(moduleNames, aName)
+ if !android.InList(aName, archSpecificModuleNames) {
+ archSpecificModuleNames = append(archSpecificModuleNames, aName)
}
if linkToSystemLib {
@@ -216,7 +217,7 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, moduleDir st
fmt.Fprintf(w, "%s: %s\n", fi.androidMkModuleName, moduleName)
}
}
- return moduleNames
+ return
}
func (a *apexBundle) writeRequiredModules(w io.Writer, moduleNames []string) {
@@ -235,9 +236,10 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
return android.AndroidMkData{
// While we do not provide a value for `Extra`, AconfigUpdateAndroidMkData may add some, which we must honor.
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
+ archSpecificModuleNames := []string{}
moduleNames := []string{}
if a.installable() {
- moduleNames = a.androidMkForFiles(w, name, moduleDir, data)
+ archSpecificModuleNames, moduleNames = a.androidMkForFiles(w, name, moduleDir, data)
}
fmt.Fprintln(w, "\ninclude $(CLEAR_VARS) # apex.apexBundle")
@@ -274,7 +276,7 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
}
android.AndroidMkEmitAssignList(w, "LOCAL_OVERRIDES_MODULES", a.overridableProperties.Overrides)
- a.writeRequiredModules(w, moduleNames)
+ a.writeRequiredModules(w, archSpecificModuleNames)
// AconfigUpdateAndroidMkData may have added elements to Extra. Process them here.
for _, extra := range data.Extra {
extra(w, a.outputFile)
@@ -296,6 +298,9 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
fmt.Fprintln(w, dist)
}
+ fmt.Fprintf(w, "ALL_MODULES.$(my_register_name).SYMBOLIC_OUTPUT_PATH := $(foreach m,%s,$(ALL_MODULES.$(m).SYMBOLIC_OUTPUT_PATH))\n", strings.Join(moduleNames, " "))
+ fmt.Fprintf(w, "ALL_MODULES.$(my_register_name).ELF_SYMBOL_MAPPING_PATH := $(foreach m,%s,$(ALL_MODULES.$(m).ELF_SYMBOL_MAPPING_PATH))\n", strings.Join(moduleNames, " "))
+
distCoverageFiles(w, "ndk_apis_usedby_apex", a.nativeApisUsedByModuleFile.String())
distCoverageFiles(w, "ndk_apis_backedby_apex", a.nativeApisBackedByModuleFile.String())
distCoverageFiles(w, "java_apis_used_by_apex", a.javaApisUsedByModuleFile.String())