aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2024-04-02 13:40:05 -0700
committerArve Hjønnevåg <arve@android.com>2024-04-02 13:50:00 -0700
commitd2fd6102ff20a9351d3e7ec53f8831c140d7b91f (patch)
tree412af91200bcf3cff0eac4670f86d2f559ce351d
parentc7e510877f54b3deb40a66149f1647df699527a3 (diff)
downloadcommon-d2fd6102ff20a9351d3e7ec53f8831c140d7b91f.tar.gz
make: rust: Move lib/rust_support dependency
Move lib/rust_support from kernel/rules.mk to implicit dependency for rust kernel modules. It was added to kernel/rules.mk so the panic handler was included, but this also pulls lib/rust_support into kernels that don't have any rust modules and therefore does not need it. We also have CLs that add features to lib/rust_support that don't yet compile on arm/arm64 where CFI is enabled. Moving this depandency lets us extend lib/rust_support and use it on x86, where CFI is not yet enabled, while we wait for an updated toolchain. Bug: 328519718 Test: trusty/vendor/google/aosp/scripts/build.py generic-x86_64-test Change-Id: I6badf66f7b138fbbc77bdd1ace4161cf0d4cf9a6
-rw-r--r--kernel/rules.mk1
-rw-r--r--make/module.mk4
2 files changed, 3 insertions, 2 deletions
diff --git a/kernel/rules.mk b/kernel/rules.mk
index e1719a61..433cda8e 100644
--- a/kernel/rules.mk
+++ b/kernel/rules.mk
@@ -5,7 +5,6 @@ MODULE := $(LOCAL_DIR)
MODULE_DEPS := \
lib/debug \
lib/heap \
- lib/rust_support \
trusty/kernel/lib/rand
ifeq ($(LK_LIBC_IMPLEMENTATION),lk)
diff --git a/make/module.mk b/make/module.mk
index 20f9e085..7a20424f 100644
--- a/make/module.mk
+++ b/make/module.mk
@@ -244,10 +244,12 @@ MODULE_ALL_DEPS := $(MODULE_LIBRARY_DEPS) $(MODULE_LIBRARY_EXPORTED_DEPS) $(MODU
ifeq ($(call TOBOOL,$(MODULE_ADD_IMPLICIT_DEPS)),true)
# In userspace, MODULE_ADD_IMPLICIT_DEPS adds std.
-# In the kernel, it adds core and compiler_builtins.
+# In the kernel, it adds core, compiler_builtins and
+# lib/rust_support.
MODULE_ALL_DEPS += \
trusty/user/base/lib/libcore-rust/ \
trusty/user/base/lib/libcompiler_builtins-rust/ \
+ $(LKROOT)/lib/rust_support \
endif