$(objpfx)$(patsubst %,$(libtype$o),\
$(lib:lib%=%)))
-ifeq (,$(filter $(lib),extra-libs-others))
+ifeq (,$(filter $(lib),$(extra-libs-others)))
lib-noranlib: $(alltypes-$(lib))
ifeq (yes,$(build-shared))
lib-noranlib: $(objpfx)$(lib).so$($(lib).so-version)
# The linked shared library is never a dependent of lib-noranlib,
# because linking it will depend on libc.so already being built.
-ifneq (,$(filter .so,$(object-suffixes-$(lib))))
-others: $(objpfx)$(lib).so
+ifneq (,$(filter .os,$(object-suffixes-$(lib))))
+others: $(objpfx)$(lib).so$($(lib).so-version)
endif
object-suffixes-left = $(object-suffixes-$(lib))
include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-$(lib)))
+# Add the version script to the dependencies of the shared library.
+$(objpfx)$(lib).so: $(firstword $(wildcard $($(lib)-map) $(lib).map $(..)$(lib).map))
+
endif