diff options
author | 2023-07-13 11:01:41 -0400 | |
---|---|---|
committer | 2023-07-14 12:43:09 -0400 | |
commit | add122a828941a865daf3ec2531145676472a3cd (patch) | |
tree | e75664699cbeaf9a37ead411c8e9f10de312408e /rust/snapshot_utils.go | |
parent | e3c11d0aad4e1efa17e6dbade960f6041ecd602d (diff) |
rust: Add vendor and recovery dylib support.
Adds dylib support for vendor and recovery images.
This changes the default linkage for vendor and recovery images to
dylib, which matches the platform default linkage. This also means that
by default, dylib-std variants are used for rlib dependencies.
Bug: 204303985
Test: Soong tests.
Test: m dist vendor-snapshot
Test: RECOVERY_SNAPSHOT_VERSION=current m dist recovery-snapshot
Change-Id: If84074b8615a70c45e7e162abeb853dc8c34d49a
Diffstat (limited to 'rust/snapshot_utils.go')
-rw-r--r-- | rust/snapshot_utils.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rust/snapshot_utils.go b/rust/snapshot_utils.go index 8dabd9bf6..55c85e668 100644 --- a/rust/snapshot_utils.go +++ b/rust/snapshot_utils.go @@ -42,8 +42,7 @@ func (mod *Module) ExcludeFromRecoverySnapshot() bool { func (mod *Module) IsSnapshotLibrary() bool { if lib, ok := mod.compiler.(libraryInterface); ok { - // Rust-native dylibs are not snapshot supported yet. Only snapshot the rlib-std variants of rlibs. - return lib.shared() || lib.static() || (lib.rlib() && lib.rlibStd()) + return lib.shared() || lib.static() || lib.rlib() || lib.dylib() } return false } @@ -61,6 +60,14 @@ func (mod *Module) SnapshotStaticLibs() []string { return mod.Properties.SnapshotStaticLibs } +func (mod *Module) SnapshotRlibs() []string { + return mod.Properties.SnapshotRlibs +} + +func (mod *Module) SnapshotDylibs() []string { + return mod.Properties.SnapshotDylibs +} + func (mod *Module) Symlinks() []string { // TODO update this to return the list of symlinks when Rust supports defining symlinks return nil |