summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Crane <cranes@google.com>2024-03-09 02:18:16 +0000
committerStephen Crane <cranes@google.com>2024-03-09 02:18:16 +0000
commit61a798d4062158018f616047f6974e0dad3355f1 (patch)
treef02144777524b7bab2e40d321440db7c3d5ee8d3
parent470210a88b33feb94430b1fd80d0c47210b6fc38 (diff)
downloadtrusty-61a798d4062158018f616047f6974e0dad3355f1.tar.gz
make: Ensure that GLOBAL_CRATE_COUNT is initialized
GLOBAL_CRATE_COUNT must be initialized before use. We use this variable when generating rules for proc-macros from ALLHOSTMODULES, so we need to initialize it earlier. Bug: None Test: build.py generic-x86_64-test (and inspect rust-project.json) Change-Id: I1de21897ae97cbde4b7e9c822ab0ff0da660fb75
-rw-r--r--app/trusty/user-tasks.mk6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/trusty/user-tasks.mk b/app/trusty/user-tasks.mk
index 4adb923..56e6fbc 100644
--- a/app/trusty/user-tasks.mk
+++ b/app/trusty/user-tasks.mk
@@ -91,6 +91,9 @@ TRUSTY_SDK_LICENSE_DIR := $(TRUSTY_SDK_DIR)/licenses
TRUSTY_SDK_LICENSE := $(TRUSTY_SDK_DIR)/LICENSE
TRUSTY_LIBRARY_BUILDDIR := $(BUILDDIR)/lib
+GLOBAL_CRATE_COUNT := 0
+RUST_ANALYZER_CRATES :=
+
# 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
@@ -161,9 +164,6 @@ GLOBAL_USER_RUSTFLAGS += -L dependency=$(TRUSTY_LIBRARY_BUILDDIR)
# macros and therefore built in the host build dir.
GLOBAL_USER_RUSTFLAGS += -L dependency=$(TRUSTY_HOST_LIBRARY_BUILDDIR)
-GLOBAL_CRATE_COUNT := 0
-RUST_ANALYZER_CRATES :=
-
# Save userspace-global variables so we can restore kernel state
TRUSTY_KERNEL_SAVED_ARCH := $(ARCH)
TRUSTY_KERNEL_SAVED_ALLOW_FP_USE := $(ALLOW_FP_USE)