diff --git a/cc/binary.go b/cc/binary.go index d4edc1a16..a8eb641fa 100644 --- a/cc/binary.go +++ b/cc/binary.go @@ -405,6 +405,10 @@ func (binary *binaryDecorator) link(ctx ModuleContext, return ret } +func (binary *binaryDecorator) unstrippedOutputFilePath() android.Path { + return binary.unstrippedOutputFile +} + func (binary *binaryDecorator) symlinkList() []string { return binary.symlinks } diff --git a/cc/cc.go b/cc/cc.go index 58ea5e14e..4c26e6006 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -306,6 +306,7 @@ type linker interface { link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path appendLdflags([]string) + unstrippedOutputFilePath() android.Path } type installer interface { @@ -406,10 +407,8 @@ func (c *Module) OutputFile() android.OptionalPath { } func (c *Module) UnstrippedOutputFile() android.Path { - if library, ok := c.linker.(*libraryDecorator); ok { - return library.unstrippedOutputFile - } else if binary, ok := c.linker.(*binaryDecorator); ok { - return binary.unstrippedOutputFile + if c.linker != nil { + return c.linker.unstrippedOutputFilePath() } return nil } diff --git a/cc/library.go b/cc/library.go index c01b3e742..13acfae62 100644 --- a/cc/library.go +++ b/cc/library.go @@ -740,6 +740,10 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext, return ret } +func (library *libraryDecorator) unstrippedOutputFilePath() android.Path { + return library.unstrippedOutputFile +} + func getRefAbiDumpFile(ctx ModuleContext, vndkVersion, fileName string) android.Path { isLlndk := inList(ctx.baseModuleName(), llndkLibraries) || inList(ctx.baseModuleName(), ndkMigratedLibs) diff --git a/cc/object.go b/cc/object.go index 552f63997..b9c57429d 100644 --- a/cc/object.go +++ b/cc/object.go @@ -107,3 +107,7 @@ func (object *objectLinker) link(ctx ModuleContext, ctx.CheckbuildFile(outputFile) return outputFile } + +func (object *objectLinker) unstrippedOutputFilePath() android.Path { + return nil +}