From 35661d065e36ecb476ab5242113027c93d70f166 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 6 Sep 2022 12:14:47 +0200 Subject: [PATCH] base-linux: omit unused lib/mk/ from API recipe The 'base-linux' API is used by hybrid Genode/Linux programs for the lx_hybrid library. This API archive happend to contain other libraries - like seccomp - that are solely needed for building core. With the change of the build system in issue #4599, the build system would attempt to build all libraries instead of merely the library dependencies of the available targets. Hence, it would trigger the build of, e.g., the seccomp library for each user of the base-linux API. This patch avoids these superfluous build steps by pruning the content of lib/mk/ to the libraries actually needed for lx_hybrid users. Issue #4599 --- .../recipes/api/base-linux/content.mk | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/repos/base-linux/recipes/api/base-linux/content.mk b/repos/base-linux/recipes/api/base-linux/content.mk index c77cf9d735..7839296c17 100644 --- a/repos/base-linux/recipes/api/base-linux/content.mk +++ b/repos/base-linux/recipes/api/base-linux/content.mk @@ -1,8 +1,7 @@ FROM_BASE_LINUX := etc src/lib/syscall src/lib/lx_hybrid lib/import include -FROM_BASE_LINUX_AND_BASE := lib/mk src/lib/base src/include -FROM_BASE := src/lib/timeout +FROM_BASE_LINUX_AND_BASE := src/lib/base src/include -content: $(FROM_BASE_LINUX) $(FROM_BASE_LINUX_AND_BASE) $(FROM_BASE) LICENSE +content: $(FROM_BASE_LINUX) $(FROM_BASE_LINUX_AND_BASE) LICENSE $(FROM_BASE_LINUX): mkdir -p $@ @@ -13,9 +12,30 @@ $(FROM_BASE_LINUX_AND_BASE): cp -r $(GENODE_DIR)/repos/base/$@/* $@ cp -r $(REP_DIR)/$@/* $@ -$(FROM_BASE): +BASE_LIB_MK_CONTENT := \ + $(addprefix lib/mk/,base-common.inc timeout.mk) + +content: $(BASE_LIB_MK_CONTENT) + +$(BASE_LIB_MK_CONTENT): + mkdir -p $(dir $@) + cp $(GENODE_DIR)/repos/base/$@ $@ + +content: src/lib/timeout + +src/lib/timeout: mkdir -p $@ cp -r $(GENODE_DIR)/repos/base/$@/* $@ +BASE_LINUX_LIB_MK_CONTENT := \ + $(addprefix lib/mk/,lx_hybrid.mk base-linux.inc base-linux-common.mk) \ + $(foreach S,arm arm_64 x86_32 x86_64,lib/mk/spec/$S/syscall-linux.mk) + +content: $(BASE_LINUX_LIB_MK_CONTENT) + +$(BASE_LINUX_LIB_MK_CONTENT): + mkdir -p $(dir $@) + cp $(REP_DIR)/$@ $@ + LICENSE: cp $(GENODE_DIR)/LICENSE $@