Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 939408aa authored by Dan Willemsen's avatar Dan Willemsen
Browse files

Add dependency to version script when linking stub libraries

This isn't an effective issue with local builds currently, since the
version script is generated from the same rule as the sources used to
compile the objects that are also used in the link command. But if we
ever separated those paths or adopted restat, we could miss this
dependency.

This is also required for my RBE build to actually expose this file to
the link step.

Test: treehugger
Change-Id: I32bbb18cf7edddc88759d4f445d081868f3e9b44
parent b6fd6f75
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ func (stub *llndkStubDecorator) link(ctx ModuleContext, flags Flags, deps PathDe
	if !Bool(stub.Properties.Unversioned) {
		linkerScriptFlag := "-Wl,--version-script," + stub.versionScriptPath.String()
		flags.LdFlags = append(flags.LdFlags, linkerScriptFlag)
		flags.LdFlagsDeps = append(flags.LdFlagsDeps, stub.versionScriptPath)
	}

	if len(stub.Properties.Export_preprocessed_headers) > 0 {
+1 −0
Original line number Diff line number Diff line
@@ -337,6 +337,7 @@ func (stub *stubDecorator) link(ctx ModuleContext, flags Flags, deps PathDeps,
	if useVersionScript {
		linkerScriptFlag := "-Wl,--version-script," + stub.versionScriptPath.String()
		flags.LdFlags = append(flags.LdFlags, linkerScriptFlag)
		flags.LdFlagsDeps = append(flags.LdFlagsDeps, stub.versionScriptPath)
	}

	return stub.libraryDecorator.link(ctx, flags, deps, objs)
+1 −0
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ func (stub *vendorPublicLibraryStubDecorator) link(ctx ModuleContext, flags Flag
	if !Bool(stub.Properties.Unversioned) {
		linkerScriptFlag := "-Wl,--version-script," + stub.versionScriptPath.String()
		flags.LdFlags = append(flags.LdFlags, linkerScriptFlag)
		flags.LdFlagsDeps = append(flags.LdFlagsDeps, stub.versionScriptPath)
	}
	return stub.libraryDecorator.link(ctx, flags, deps, objs)
}