rust: Depend on CC a shared library's TOC, not .so

CC libraries generate TOC files which contain the list of exported
symbols. By depending on the TOC file instead of the .so, changes to
shared library dependencies will not result in rebuilding Rust
dependencies as long as the exported symbols remain unchanged. This
should improve incremental build times during development.

This also includes a minor fix where exported linkObjects should be
deduplicated to avoid the same object being included many times.

Bug: 173619911
Test: m libkeystore2; modify a bionic file; m libkeystore2
      doesn't rebuild the rust target.
Change-Id: I6383217c125bf8dd7125a5e013a78754cac4edf2
This commit is contained in:
Ivan Lozano
2021-01-21 15:23:29 -05:00
parent ad3421aacf
commit ec6e9910e6
2 changed files with 19 additions and 10 deletions

View File

@@ -188,7 +188,7 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl
implicits = append(implicits, rustLibsToPaths(deps.DyLibs)...)
implicits = append(implicits, rustLibsToPaths(deps.ProcMacros)...)
implicits = append(implicits, deps.StaticLibs...)
implicits = append(implicits, deps.SharedLibs...)
implicits = append(implicits, deps.SharedLibDeps...)
implicits = append(implicits, deps.srcProviderFiles...)
if deps.CrtBegin.Valid() {