Fix logic for adding gnu debuglink to match Make

Only add gnu debuglink on userdebug builds to match Make, and don't
add it when using minidebuginfo, which doesn't support it.

Bug: 113936524
Test: m checkbuild
Change-Id: Ifd529f88d63afa5627172fb6ea612aea77159f40
This commit is contained in:
Colin Cross
2018-09-05 16:28:13 -07:00
parent 9a959cd519
commit ed064c0b1f
2 changed files with 7 additions and 2 deletions

View File

@@ -572,6 +572,10 @@ func (c *config) MinimizeJavaDebugInfo() bool {
return Bool(c.productVariables.MinimizeJavaDebugInfo) && !Bool(c.productVariables.Eng)
}
func (c *config) Debuggable() bool {
return Bool(c.productVariables.Debuggable)
}
func (c *config) DevicePrefer32BitExecutables() bool {
return Bool(c.productVariables.DevicePrefer32BitExecutables)
}

View File

@@ -39,13 +39,14 @@ func (stripper *stripper) strip(ctx ModuleContext, in android.Path, out android.
if ctx.Darwin() {
TransformDarwinStrip(ctx, in, out)
} else {
// TODO(ccross): don't add gnu debuglink for user builds
flags.stripAddGnuDebuglink = true
if Bool(stripper.StripProperties.Strip.Keep_symbols) {
flags.stripKeepSymbols = true
} else if !Bool(stripper.StripProperties.Strip.All) {
flags.stripKeepMiniDebugInfo = true
}
if ctx.Config().Debuggable() && !flags.stripKeepMiniDebugInfo {
flags.stripAddGnuDebuglink = true
}
TransformStrip(ctx, in, out, flags)
}
}