Use the version script for ndk_library.
We were generating this, but not actually using it yet. Test: `make ndk` with libc/libm migration patches, readelf generated libs. Change-Id: I9aadf58307bc645b33cab5207409552c5046937a
This commit is contained in:
@@ -93,6 +93,8 @@ type stubCompiler struct {
|
|||||||
baseCompiler
|
baseCompiler
|
||||||
|
|
||||||
properties libraryProperties
|
properties libraryProperties
|
||||||
|
|
||||||
|
linker *stubLinker
|
||||||
}
|
}
|
||||||
|
|
||||||
// OMG GO
|
// OMG GO
|
||||||
@@ -175,6 +177,7 @@ func (c *stubCompiler) compile(ctx ModuleContext, flags Flags, deps PathDeps) an
|
|||||||
stubSrcPath := android.PathForModuleGen(ctx, stubSrcName)
|
stubSrcPath := android.PathForModuleGen(ctx, stubSrcName)
|
||||||
versionScriptName := fileBase + ".map"
|
versionScriptName := fileBase + ".map"
|
||||||
versionScriptPath := android.PathForModuleGen(ctx, versionScriptName)
|
versionScriptPath := android.PathForModuleGen(ctx, versionScriptName)
|
||||||
|
c.linker.versionScriptPath = versionScriptPath
|
||||||
symbolFilePath := android.PathForModuleSrc(ctx, c.properties.Symbol_file)
|
symbolFilePath := android.PathForModuleSrc(ctx, c.properties.Symbol_file)
|
||||||
ctx.ModuleBuild(pctx, android.ModuleBuildParams{
|
ctx.ModuleBuild(pctx, android.ModuleBuildParams{
|
||||||
Rule: genStubSrc,
|
Rule: genStubSrc,
|
||||||
@@ -209,6 +212,8 @@ func (c *stubCompiler) compile(ctx ModuleContext, flags Flags, deps PathDeps) an
|
|||||||
|
|
||||||
type stubLinker struct {
|
type stubLinker struct {
|
||||||
libraryLinker
|
libraryLinker
|
||||||
|
|
||||||
|
versionScriptPath android.ModuleGenPath
|
||||||
}
|
}
|
||||||
|
|
||||||
func (linker *stubLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
func (linker *stubLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
@@ -221,6 +226,14 @@ func (linker *stubLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
return linker.libraryLinker.linkerFlags(ctx, flags)
|
return linker.libraryLinker.linkerFlags(ctx, flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (linker *stubLinker) link(ctx ModuleContext, flags Flags, deps PathDeps,
|
||||||
|
objFiles android.Paths) android.Path {
|
||||||
|
|
||||||
|
linkerScriptFlag := "-Wl,--version-script," + linker.versionScriptPath.String()
|
||||||
|
flags.LdFlags = append(flags.LdFlags, linkerScriptFlag)
|
||||||
|
return linker.libraryLinker.link(ctx, flags, deps, objFiles)
|
||||||
|
}
|
||||||
|
|
||||||
type stubInstaller struct {
|
type stubInstaller struct {
|
||||||
baseInstaller
|
baseInstaller
|
||||||
|
|
||||||
@@ -258,6 +271,7 @@ func newStubLibrary() *Module {
|
|||||||
module.linker = linker
|
module.linker = linker
|
||||||
|
|
||||||
compiler := &stubCompiler{}
|
compiler := &stubCompiler{}
|
||||||
|
compiler.linker = linker
|
||||||
module.compiler = compiler
|
module.compiler = compiler
|
||||||
module.installer = &stubInstaller{baseInstaller{
|
module.installer = &stubInstaller{baseInstaller{
|
||||||
dir: "lib",
|
dir: "lib",
|
||||||
|
Reference in New Issue
Block a user