summaryrefslogtreecommitdiff
path: root/rust/rust.go
diff options
context:
space:
mode:
author Justin Yun <justinyun@google.com> 2021-06-29 20:50:37 +0900
committer Justin Yun <justinyun@google.com> 2021-07-01 11:42:28 +0000
commit5e035863652abbadda3fc7039654ce915792c6ac (patch)
tree28d73286f36924aebae7b19c5a77dd558cecf48f /rust/rust.go
parent7ce730b90c1a368caa94ca8f2045015da4608b9e (diff)
Include static lib information for the snapshot modules
snapshot modules require the list of static libs to find the NOTICE files for the snapshot modules. snapshot binaries must include static_executable property to check if non static binaries have libc as a static lib. Bug: 190690041 Test: Check NOTICE for libaudiopreprocessing.so built from snapshots. Change-Id: I53f7549a158ab27ada87833a3f4d58620aa7c3cf
Diffstat (limited to 'rust/rust.go')
-rw-r--r--rust/rust.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/rust/rust.go b/rust/rust.go
index 05f639939..a11a04c89 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -87,6 +87,7 @@ type BaseProperties struct {
// Used by vendor snapshot to record dependencies from snapshot modules.
SnapshotSharedLibs []string `blueprint:"mutated"`
+ SnapshotStaticLibs []string `blueprint:"mutated"`
// Make this module available when building for vendor ramdisk.
// On device without a dedicated recovery partition, the module is only
@@ -259,6 +260,13 @@ func (mod *Module) Binary() bool {
return false
}
+func (mod *Module) StaticExecutable() bool {
+ if !mod.Binary() {
+ return false
+ }
+ return Bool(mod.compiler.(*binaryDecorator).Properties.Static_executable)
+}
+
func (mod *Module) Object() bool {
// Rust has no modules which produce only object files.
return false
@@ -1097,6 +1105,7 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
// Record baseLibName for snapshots.
mod.Properties.SnapshotSharedLibs = append(mod.Properties.SnapshotSharedLibs, cc.BaseLibName(depName))
+ mod.Properties.SnapshotStaticLibs = append(mod.Properties.SnapshotStaticLibs, cc.BaseLibName(depName))
mod.Properties.AndroidMkSharedLibs = append(mod.Properties.AndroidMkSharedLibs, makeLibName)
exportDep = true