From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: gpu: nova-core: export Rust symbols for dependent modules Date: Tue, 05 May 2026 10:17:59 +1000 Message-ID: In-Reply-To: <20260430-nova-exports-v1-4-7ca31664e983@nvidia.com> References: <20260430-nova-exports-v1-0-7ca31664e983@nvidia.com> <20260430-nova-exports-v1-4-7ca31664e983@nvidia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Verdict: Functional workaround, a few observations.** The approach =E2=80=94 using `nm` to find Rust text symbols (prefixed `_R`)= and wrapping them with `EXPORT_SYMBOL_GPL` =E2=80=94 is pragmatic: ```makefile rust_exports =3D \ $(NM) -p --defined-only $(1) | \ awk '$$2 =3D=3D "T" && $$3 ~ /^_R/ { \ printf "extern void %s(void); EXPORT_SYMBOL_GPL(%s);\n", $$3, $$3 \ }' ``` Observations: 1. **Over-export risk**: This exports *every* `_R`-prefixed global text sym= bol in `nova_core.o`. Rust's v0 mangling means that includes all `pub` func= tions that weren't inlined or elided, including potentially internal helper= s, trait impls, drop glue, etc. that consumers shouldn't rely on. The comme= nt should acknowledge this blanket export is intentional and that narrowing= it is a future improvement. For a temporary workaround this is acceptable,= but if this persists it could create an unstable ABI surface. 2. **Symbol type filter**: Only `T` (global text) symbols are exported. Thi= s misses `D`/`B` (global data/BSS) symbols which could also be needed if `n= ova-core` exposes `pub static` items. For the current POC this works, but w= orth noting. 3. The `nova_core_exports.c` file is clean and minimal =E2=80=94 just inclu= des `` and the generated header. The `extern void` declarat= ions for non-void functions are technically wrong C, but for the purpose of= `EXPORT_SYMBOL_GPL` it only needs the symbol name, not the actual prototyp= e. This is fine. --- Generated by Claude Code Patch Reviewer