rust: strip libraries and binaries
Reuses the cc.Stripper logic. Abstracts Stripper to avoid the spreading
of references to the cc package.
rustc requires unstripped libraries (precisely, with the `.rustc`
section) when building dependent targets. Contrary to cc, the output of
a compiler module will remain unstripped and only an extra build rule
will be added. This rule will be referenced at install time (in
baseCompiler.install or androidmk).
This change drastically reduces the size of the installed libraries:
(unstripped, from out/target/product/crosshatch/system)
$ find . -name \*.dylib.so -print0 | du -c --files0-from=-
149996 total
(stripped, with this change)
$ find . -name \*.dylib.so -print0 | du -c --files0-from=-
42380 total
Bug: 153430439
Test: cd external/rust; mma
Change-Id: I94fd8bbcec97e0610aa325d3db4460be84d01734
diff --git a/rust/test.go b/rust/test.go
index 19802e3..d93fc31 100644
--- a/rust/test.go
+++ b/rust/test.go
@@ -88,7 +88,7 @@
return append(test.binaryDecorator.compilerProps(), &test.Properties)
}
-func (test *testDecorator) install(ctx ModuleContext, file android.Path) {
+func (test *testDecorator) install(ctx ModuleContext) {
test.testConfig = tradefed.AutoGenRustTestConfig(ctx,
test.Properties.Test_config,
test.Properties.Test_config_template,
@@ -103,7 +103,7 @@
ctx.PropertyErrorf("no_named_install_directory", "Module install directory may only be disabled if relative_install_path is set")
}
- test.binaryDecorator.install(ctx, file)
+ test.binaryDecorator.install(ctx)
}
func (test *testDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags {