mk: don't link transitive shared-lib dependencies

This patch applies the existing "privatization" of transitive
shared-library dependencies from static lib dependencies to shared lib
dependencies. It thereby improves the consistency of binaries created in
a regular build directory with binaries created in depot archives.

Issue #4408
This commit is contained in:
Norman Feske 2022-02-08 16:14:27 +01:00
parent bdc766980e
commit f2f0711bf4

View File

@ -98,9 +98,11 @@ endif
# undefined.
#
ifdef SHARED_LIB
DEP_A_VAR_NAME := PRIVATE_DEP_A_$(LIB)
DEP_A_VAR_NAME := PRIVATE_DEP_A_$(LIB)
DEP_SO_VAR_NAME := PRIVATE_DEP_SO_$(LIB)
else
DEP_A_VAR_NAME := DEP_A_$(LIB)
DEP_A_VAR_NAME := DEP_A_$(LIB)
DEP_SO_VAR_NAME := DEP_SO_$(LIB)
endif
#
@ -130,8 +132,8 @@ endif
@for i in $(LIBS_TO_VISIT); do \
$(MAKE) $(VERBOSE_DIR) -f $(BASE_DIR)/mk/dep_lib.mk REP_DIR=$(REP_DIR) LIB=$$i; done
ifneq ($(LIBS),)
@(echo "$(DEP_A_VAR_NAME) = $(foreach l,$(LIBS),\$${ARCHIVE_NAME($l)} \$$(DEP_A_$l))"; \
echo "DEP_SO_$(LIB) = $(foreach l,$(LIBS),\$${SO_NAME($l)} \$$(DEP_SO_$l))"; \
@(echo "$(DEP_A_VAR_NAME) = $(foreach l,$(LIBS),\$${ARCHIVE_NAME($l)} \$$(DEP_A_$l))"; \
echo "$(DEP_SO_VAR_NAME) = $(foreach l,$(LIBS),\$${SO_NAME($l)} \$$(DEP_SO_$l))"; \
echo "") >> $(LIB_DEP_FILE)
endif
@(echo "$(LIB).lib: check_ports $(addsuffix .lib,$(LIBS))"; \
@ -142,7 +144,7 @@ endif
echo " SYMBOLS=$(SYMBOLS) \\"; \
echo " LIB=$(LIB) \\"; \
echo " ARCHIVES=\"\$$(sort \$$($(DEP_A_VAR_NAME)))\" \\"; \
echo " SHARED_LIBS=\"\$$(sort \$$(DEP_SO_$(LIB)))\" \\"; \
echo " SHARED_LIBS=\"\$$(sort \$$($(DEP_SO_VAR_NAME)))\" \\"; \
echo " BUILD_BASE_DIR=$(BUILD_BASE_DIR) \\"; \
echo " SHELL=$(SHELL) \\"; \
echo " INSTALL_DIR=\$$(INSTALL_DIR) \\"; \