From c1e7f48b4c0eded0c9752146878158ddc4c53be7 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Sat, 12 Jan 2019 13:39:10 +0900 Subject: [PATCH] Stubs libs are built with version script Stubs libs are built with the generated version script file. Bug: 120266448 (comment #23) Test: lunch walleye_hwasan-userdebug make SANITIZE_TARGET=hwaddress oatdump Change-Id: I38652e61d0b336227b7f541590b0e70fe291f0a3 --- cc/library.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cc/library.go b/cc/library.go index da223dcca..4adb0815f 100644 --- a/cc/library.go +++ b/cc/library.go @@ -646,6 +646,11 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext, linkerDeps = append(linkerDeps, forceWeakSymbols.Path()) } } + if library.buildStubs() { + linkerScriptFlags := "-Wl,--version-script," + library.versionScriptPath.String() + flags.LdFlags = append(flags.LdFlags, linkerScriptFlags) + linkerDeps = append(linkerDeps, library.versionScriptPath) + } fileName := library.getLibName(ctx) + flags.Toolchain.ShlibSuffix() outputFile := android.PathForModuleOut(ctx, fileName)