Revert "Delete SyspropMutator"
This reverts commit 2db49e32695470be11a3d12b10890aa39700dbb2.
Reason for revert: Break aosp build on git_tm-dev-plus-aosp and downstream branches
Change-Id: I0a86bf5e1e1f2ddf71308250f9110a9608ac2d8d
Bug: 246355583
diff --git a/cc/cc.go b/cc/cc.go
index 29a5fe1..c71fb34 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -51,6 +51,7 @@
ctx.BottomUp("test_per_src", TestPerSrcMutator).Parallel()
ctx.BottomUp("version", versionMutator).Parallel()
ctx.BottomUp("begin", BeginMutator).Parallel()
+ ctx.BottomUp("sysprop_cc", SyspropMutator).Parallel()
})
ctx.PostDepsMutators(func(ctx android.RegisterMutatorsContext) {
@@ -2362,8 +2363,18 @@
}
}
+ // sysprop_library has to support both C++ and Java. So sysprop_library internally creates one
+ // C++ implementation library and one Java implementation library. When a module links against
+ // sysprop_library, the C++ implementation library has to be linked. syspropImplLibraries is a
+ // map from sysprop_library to implementation library; it will be used in whole_static_libs,
+ // static_libs, and shared_libs.
+ syspropImplLibraries := syspropImplLibraries(actx.Config())
+
for _, lib := range deps.WholeStaticLibs {
depTag := libraryDependencyTag{Kind: staticLibraryDependency, wholeStatic: true, reexportFlags: true}
+ if impl, ok := syspropImplLibraries[lib]; ok {
+ lib = impl
+ }
lib = GetReplaceModuleName(lib, GetSnapshot(c, &snapshotInfo, actx).StaticLibs)
@@ -2381,6 +2392,10 @@
depTag.excludeInApex = true
}
+ if impl, ok := syspropImplLibraries[lib]; ok {
+ lib = impl
+ }
+
lib = GetReplaceModuleName(lib, GetSnapshot(c, &snapshotInfo, actx).StaticLibs)
actx.AddVariationDependencies([]blueprint.Variation{
@@ -2410,6 +2425,10 @@
depTag.excludeInApex = true
}
+ if impl, ok := syspropImplLibraries[lib]; ok {
+ lib = impl
+ }
+
name, version := StubsLibNameAndVersion(lib)
sharedLibNames = append(sharedLibNames, name)