cc: export Stripper struct
The cc stripping logic can be reused for Rust. Export the Stripper
structure for that purpose. Extract the strip-related flags from
builderFlags into StripFlags. Add the method flagsToStripFlags
(similarly to flagsToBuilderFlags).
Add the helper method disableStripping on libraryDecorator.
Test: m
Bug: 153430439
Change-Id: I11aef1abb8d498a4c1672500a7398279edf7f548
diff --git a/cc/toolchain_library.go b/cc/toolchain_library.go
index 042e012..19f5ea4 100644
--- a/cc/toolchain_library.go
+++ b/cc/toolchain_library.go
@@ -36,8 +36,7 @@
type toolchainLibraryDecorator struct {
*libraryDecorator
-
- stripper
+ stripper Stripper
Properties toolchainLibraryProperties
}
@@ -89,8 +88,8 @@
if library.stripper.StripProperties.Strip.Keep_symbols_list != nil {
fileName := ctx.ModuleName() + staticLibraryExtension
outputFile := android.PathForModuleOut(ctx, fileName)
- buildFlags := flagsToBuilderFlags(flags)
- library.stripper.stripStaticLib(ctx, srcPath, outputFile, buildFlags)
+ stripFlags := flagsToStripFlags(flags)
+ library.stripper.StripStaticLib(ctx, srcPath, outputFile, stripFlags)
return outputFile
}