summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrances Wingerter <wingerter@google.com>2024-01-25 12:05:32 -0500
committerFrances Wingerter <wingerter@google.com>2024-02-14 09:50:01 -0500
commit8f541de9cc8b797986aa2722676d3bd22ccc8aae (patch)
tree0f8570e5286418b84f3cecf4b3893c8861f79d87
parent750734867c192e5d0ca09293ae68dae47a5aceb6 (diff)
downloadtrusty-main-16k.tar.gz
build: build modules from ALLHOSTMODULES for the hostmain-16k
we want to support requiring host modules (such as proc-macro crates) from the kernel. the kernel will export a list of these in ALLHOSTMODULES, and then here we can pick them up from the userspace build system, which already knows how to build host modules Bug: 304850822 Change-Id: I954adb979bd3b999836012978eec5d0b13bd29d1
-rw-r--r--app/trusty/user-tasks.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/trusty/user-tasks.mk b/app/trusty/user-tasks.mk
index 33238a7..4adb923 100644
--- a/app/trusty/user-tasks.mk
+++ b/app/trusty/user-tasks.mk
@@ -24,6 +24,7 @@
#
# Input variables
#
+# ALLHOSTMODULES - list of all host modules (e.g. Rust proc-macros) to be built
# TRUSTY_BUILTIN_USER_TASKS - list of compiled from source user tasks to be included into final image
# TRUSTY_PREBUILT_USER_TASKS - list of precompiled user tasks to be included into final image
# These prebuilt task modules must include a manifest binary and app elf binary, e.g.:
@@ -90,6 +91,15 @@ TRUSTY_SDK_LICENSE_DIR := $(TRUSTY_SDK_DIR)/licenses
TRUSTY_SDK_LICENSE := $(TRUSTY_SDK_DIR)/LICENSE
TRUSTY_LIBRARY_BUILDDIR := $(BUILDDIR)/lib
+# Host modules required by userspace are built in passing as needed, as the
+# userspace build system respects MODULE_RUST_HOST_LIB. But the kernel may also
+# need some host modules, e.g. for proc-macro crates. So we explicitly iterate
+# over the set of host modules required by the kernel, generating their build
+# rules with the userspace build system.
+$(foreach lib,$(ALLHOSTMODULES),\
+ $(eval $(call trusty-build-rule,$(lib))))
+
+
# The license file construction assumes that all projects will contain the same
# set of SDK modules and thus the same set of respective license files. If this
# ever changes, SDK zip construction in build.py will need to be adjusted to