Stripped rust bin/libs are included in APEX
Previously, when a rust bin or library is selected for an APEX,
OutputFile() was used to get the file to be used. However, OutputFile()
always returns the unstripped output file even when the stripped output
file is available. As a result, APEX having a rust module was very big
due to the debugging information that exists in the unstripped file.
When a rust module is directly installed to the built-in partitions, we
use the stripped one whenever it's available. To make the same happen
when the rust module is placed in an APEX, OutputFile() is modified to
return the unstripped output if it's available.
Bug: 181751814
Test: TARGET_BUILD_APPS=com.android.virt m
The size is reduced from 180MB to 43MB
Change-Id: I6f8479e6a4794aac8bf94a84afdf65d417c75db0
diff --git a/rust/androidmk.go b/rust/androidmk.go
index 0f9a17d..b0e6967 100644
--- a/rust/androidmk.go
+++ b/rust/androidmk.go
@@ -50,7 +50,7 @@
}
ret := android.AndroidMkEntries{
- OutputFile: mod.outputFile,
+ OutputFile: mod.unstrippedOutputFile,
Include: "$(BUILD_SYSTEM)/soong_rust_prebuilt.mk",
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {