From af6d8959411c0381a6cdf49ade70d1b65a08a2d1 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Thu, 31 Jan 2019 12:21:23 +0900 Subject: [PATCH] Add unstrippedOutputFilePath to the linker interface Test: m Change-Id: I85a0cbda6ebb9838451ed8c607c2087460b7b742 --- cc/binary.go | 4 ++++ cc/cc.go | 7 +++---- cc/library.go | 4 ++++ cc/object.go | 4 ++++ 4 files changed, 15 insertions(+), 4 deletions(-) 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 +}