[PATCH v5 3/5] gpu: nova-core: emit Rust metadata for nova-drm

Alexandre Courbot <[email protected]> Mon, 22 Jun 2026 22:30:09 +0900
Newsgroups gmane.linux.kbuild.devel,gmane.linux.kernel,gmane.linux.kernel.rust,gmane.comp.video.dri.devel
Message-ID <[email protected]>
Emit nova-core's crate metadata (libnova_core.rmeta) so that nova-drm
can import nova-core's types and functions at compile time.

This is intended to be a workaround until the build system supports Rust
cross-crate dependencies natively.

Signed-off-by: Alexandre Courbot <[email protected]>
---
 drivers/gpu/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile
index 67d51b7f3f55..13c96aa57033 100644
--- a/drivers/gpu/Makefile
+++ b/drivers/gpu/Makefile
@@ -56,3 +56,7 @@ $(obj)/nova-core/nova_core_exports.o: private cmd_gensymtypes_c = \
 		$(if $(KBUILD_SYMTYPES), --symtypes $(@:.o=.symtypes),) \
 		$(obj)/nova-core/nova_core.o
 endif
+
+# Output nova-core's crate metadata for use by nova-drm at compile time.
+RUSTFLAGS_nova-core/nova_core.o += \
+	--emit=metadata=$(objtree)/$(obj)/nova-core/libnova_core.rmeta

-- 
2.54.0