From b6e6f99521cee714c066fa33369d8d38f5cca17a Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Thu, 17 Aug 2023 17:42:26 -0700 Subject: Add transitive shared libs to LOCAL_SHARED_LIBRARIES for rust modules Rust modules are different from C++ modules in that they will install their transitive shared libs alongside a binary. C++ modules don't do this, you have to install the transitive shared lib manually. (but they do install direct shared libs) It does this by using InstallDepNeeded, a mechanism that adds dependencies from installed files to the installed copies of dependencies if InstallDepNeeded() returns true. This mechanism does not end up tracking the installed files all the way to FULL_SYSTEMIMAGE_DEPS. We're attempting to make FULL_SYSTEMIMAGE_DEPS more accurate so that we can track the files that should be installed properly, and remove the need for `m installclean`. Listing the libraries a binary uses in LOCAL_SHARED_LIBRARIES does properly track them and end up listing them in FULL_SYSTEMIMAGE_DEPS. Bug: 205632228 Test: Building the systemimage with a change to delete anything not in FULL_SYSTEMIMAGE_DEPS Change-Id: I4ba75b40b3ac77250297209a851bc9ba377782f5 --- rust/androidmk.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust/androidmk.go') diff --git a/rust/androidmk.go b/rust/androidmk.go index 5e680b03d..c684e810b 100644 --- a/rust/androidmk.go +++ b/rust/androidmk.go @@ -61,7 +61,7 @@ func (mod *Module) AndroidMkEntries() []android.AndroidMkEntries { entries.AddStrings("LOCAL_RLIB_LIBRARIES", mod.Properties.AndroidMkRlibs...) entries.AddStrings("LOCAL_DYLIB_LIBRARIES", mod.Properties.AndroidMkDylibs...) entries.AddStrings("LOCAL_PROC_MACRO_LIBRARIES", mod.Properties.AndroidMkProcMacroLibs...) - entries.AddStrings("LOCAL_SHARED_LIBRARIES", mod.Properties.AndroidMkSharedLibs...) + entries.AddStrings("LOCAL_SHARED_LIBRARIES", mod.transitiveAndroidMkSharedLibs.ToList()...) entries.AddStrings("LOCAL_STATIC_LIBRARIES", mod.Properties.AndroidMkStaticLibs...) entries.AddStrings("LOCAL_SOONG_LINK_TYPE", mod.makeLinkType) if mod.UseVndk() { -- cgit v1.2.3-59-g8ed1b