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/vendor_snapshot.go b/cc/vendor_snapshot.go
index e17a6d0..93aece4 100644
--- a/cc/vendor_snapshot.go
+++ b/cc/vendor_snapshot.go
@@ -264,7 +264,7 @@
module.stl = nil
module.sanitize = nil
- library.StripProperties.Strip.None = BoolPtr(true)
+ library.disableStripping()
prebuilt := &vendorSnapshotLibraryDecorator{
libraryDecorator: library,
@@ -340,12 +340,12 @@
}
in := android.PathForModuleSrc(ctx, *p.properties.Src)
- builderFlags := flagsToBuilderFlags(flags)
+ stripFlags := flagsToStripFlags(flags)
p.unstrippedOutputFile = in
binName := in.Base()
- if p.needsStrip(ctx) {
+ if p.stripper.NeedsStrip(ctx) {
stripped := android.PathForModuleOut(ctx, "stripped", binName)
- p.stripExecutableOrSharedLib(ctx, in, stripped, builderFlags)
+ p.stripper.StripExecutableOrSharedLib(ctx, in, stripped, stripFlags)
in = stripped
}