diff options
| author | Alexandre Courbot <acourbot@nvidia.com> | 2026-06-22 22:30:08 +0900 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-06-29 11:28:38 +0200 |
| commit | 3b7b7ad78fd2adae8d9a016677b6dbbb9c9632a2 (patch) | |
| tree | e0927b78ad1213f7e4b7b16b2dc1380e700d3338 /drivers/gpu/nova-core | |
| parent | ca524e273c43c990756cac471a4cb48d219480dd (diff) | |
| download | linux-next-3b7b7ad78fd2adae8d9a016677b6dbbb9c9632a2.tar.gz linux-next-3b7b7ad78fd2adae8d9a016677b6dbbb9c9632a2.zip | |
gpu: nova-core: export Rust symbols for nova-drm
Export nova-core's Rust symbols so nova-drm can resolve references to it
when loaded as a module.
This is done by generating declarations and EXPORT_SYMBOL_RUST_GPL()
calls for Rust symbols referenced by nova-drm, and compiling them into
the module as `nova_core_exports.o`.
`nova_core_exports.o` declares every Rust symbol as `extern int`.
Running `gendwarfksyms` on it would compute CRCs from those placeholder
types instead of the real Rust ones, so make MODVERSIONS use this shim
only for the export list, and derive CRCs from `nova_core.o`.
This patch is intended to be a workaround until the build system
supports Rust cross-crate dependencies natively.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://patch.msgid.link/20260622-nova-exports-v5-2-6191773fc977@nvidia.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'drivers/gpu/nova-core')
| -rw-r--r-- | drivers/gpu/nova-core/.gitignore | 1 | ||||
| -rw-r--r-- | drivers/gpu/nova-core/nova_core_exports.c | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/nova-core/.gitignore b/drivers/gpu/nova-core/.gitignore new file mode 100644 index 000000000000..7cc8318c76b1 --- /dev/null +++ b/drivers/gpu/nova-core/.gitignore @@ -0,0 +1 @@ +exports_nova_core_generated.h diff --git a/drivers/gpu/nova-core/nova_core_exports.c b/drivers/gpu/nova-core/nova_core_exports.c new file mode 100644 index 000000000000..6e80ca9792ee --- /dev/null +++ b/drivers/gpu/nova-core/nova_core_exports.c @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0 +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +/* + * Exports Rust symbols from the `nova_core` crate for use by dependent modules. + * + * This is a workaround until the build system supports Rust cross-module + * dependencies natively. + */ + +#include <linux/export.h> + +#define EXPORT_SYMBOL_RUST_GPL(sym) extern int sym; EXPORT_SYMBOL_GPL(sym) + +#include "exports_nova_core_generated.h" |
