From 9aab61f5a721ac469685c473b43eaf3860b5e42a Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 2 Sep 2022 15:17:19 +0200 Subject: [PATCH] mk: allow declaration of build artifacts for libs The build system automatically announces the names of shared libraries as build artifacts. However, in rare cases, it is required to manually define them. In particular, the 'ld' stub library plays no role at runtime and should not be integrated into the boot image. This patch adds a customization hook following the same pattern as used for target.mk files, namely the BUILD_ARTIFACTS variable. If defined, its value is taken as the list of boot artifacts generated by the library-description file. Issue #4368 --- repos/base/mk/dep_lib.mk | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/repos/base/mk/dep_lib.mk b/repos/base/mk/dep_lib.mk index 0648a8c2db..fca6396daa 100644 --- a/repos/base/mk/dep_lib.mk +++ b/repos/base/mk/dep_lib.mk @@ -82,14 +82,19 @@ include $(BASE_DIR)/mk/base-libs.mk include $(LIB_MK) ifdef SHARED_LIB -LIBS += ldso_so_support +BUILD_ARTIFACTS ?= $(LIB).lib.so +endif # record creation of shared library build artifact append_artifact_to_progress_log: - @echo -e "\n# Build artifact $(LIB).lib.so\n" >> $(LIB_PROGRESS_LOG) + @( $(foreach A,$(BUILD_ARTIFACTS),\ + echo -e "\n# Build artifact $A\n";) true \ + ) >> $(LIB_PROGRESS_LOG) append_lib_to_progress_log: append_artifact_to_progress_log -endif +ifdef SHARED_LIB +LIBS += ldso_so_support +endif # # Hide archive dependencies of shared libraries from users of the shared