diff options
author | 2025-03-11 19:47:42 -0700 | |
---|---|---|
committer | 2025-03-11 19:47:42 -0700 | |
commit | 8d2c52035a6ccb8e6e85b2ca59e68a14166f6b5c (patch) | |
tree | 82421d46fd9038129feb3897823c07a7cd1c34b7 | |
parent | fb8f32470d4c98b110149320f5c5195b3e2b3ced (diff) | |
parent | 380aef16335ac30012369470061dff369e593842 (diff) |
Merge "Allow customizing stripping behavior with product variable" into main am: 84ec3e012b am: 380aef1633
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3538037
Change-Id: Ic402445814207be7e13d591105217a120f547dac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | android/config.go | 5 | ||||
-rw-r--r-- | android/variable.go | 2 | ||||
-rw-r--r-- | cc/strip.go | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/android/config.go b/android/config.go index 9f14e3767..ede2240ab 100644 --- a/android/config.go +++ b/android/config.go @@ -200,6 +200,11 @@ func (c Config) ReleaseAconfigValueSets() []string { return c.config.productVariables.ReleaseAconfigValueSets } +// If native modules should have symbols stripped by default. Default false, enabled for build tools +func (c Config) StripByDefault() bool { + return proptools.Bool(c.config.productVariables.StripByDefault) +} + func (c Config) ReleaseAconfigExtraReleaseConfigs() []string { result := []string{} if val, ok := c.config.productVariables.BuildFlags["RELEASE_ACONFIG_EXTRA_RELEASE_CONFIGS"]; ok { diff --git a/android/variable.go b/android/variable.go index bccf12f20..da7c96dcf 100644 --- a/android/variable.go +++ b/android/variable.go @@ -554,6 +554,8 @@ type ProductVariables struct { OdmManifestFiles []string `json:",omitempty"` UseSoongNoticeXML *bool `json:",omitempty"` + + StripByDefault *bool `json:",omitempty"` } type PartitionQualifiedVariablesType struct { diff --git a/cc/strip.go b/cc/strip.go index 32ea38df1..42c9137b7 100644 --- a/cc/strip.go +++ b/cc/strip.go @@ -52,7 +52,7 @@ type Stripper struct { func (stripper *Stripper) NeedsStrip(actx android.ModuleContext) bool { forceDisable := Bool(stripper.StripProperties.Strip.None) // Strip is enabled by default for device variants. - defaultEnable := actx.Device() + defaultEnable := actx.Device() || actx.Config().StripByDefault() forceEnable := Bool(stripper.StripProperties.Strip.All) || Bool(stripper.StripProperties.Strip.Keep_symbols) || Bool(stripper.StripProperties.Strip.Keep_symbols_and_debug_frame) |