diff --git a/cc/llndk_library.go b/cc/llndk_library.go index 6cdf5c700..37f217eea 100644 --- a/cc/llndk_library.go +++ b/cc/llndk_library.go @@ -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 { diff --git a/cc/ndk_library.go b/cc/ndk_library.go index 44f773c52..969cb3fa7 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -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) diff --git a/cc/vendor_public_library.go b/cc/vendor_public_library.go index 5738d25ab..f0de267c1 100644 --- a/cc/vendor_public_library.go +++ b/cc/vendor_public_library.go @@ -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) }