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 ++++
 drivers/gpu/nova-core/.gitignore | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile
index 2f9c6101e21c..164e704bc741 100644
--- a/drivers/gpu/Makefile
+++ b/drivers/gpu/Makefile
@@ -34,3 +34,7 @@ targets += nova-core/exports_nova_core_generated.h
 
 $(obj)/nova-core/nova_core_exports.o: 
$(obj)/nova-core/exports_nova_core_generated.h
 CFLAGS_nova-core/nova_core_exports.o := -I $(objtree)/$(obj)/nova-core
+
+# 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
diff --git a/drivers/gpu/nova-core/.gitignore b/drivers/gpu/nova-core/.gitignore
index 7cc8318c76b1..bac774beba3b 100644
--- a/drivers/gpu/nova-core/.gitignore
+++ b/drivers/gpu/nova-core/.gitignore
@@ -1 +1,2 @@
 exports_nova_core_generated.h
+libnova_core.rmeta

-- 
2.54.0

Reply via email to