From 011c7a1c2cf14efce2b7392ee3201edb2bb4b412 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Tue, 7 Apr 2026 07:00:19 +0200 Subject: [PATCH] compiler/rust: move ACORN PRNG to shared location Move the ACORN random number generator from src/nouveau/compiler/acorn/ to src/compiler/rust/acorn/ so it can be shared between different driver hardware test infrastructures. Signed-off-by: Christian Gmeiner Acked-by: Faith Ekstrand Reviewed-by: Lorenzo Rossi Part-of: --- .../compiler => compiler/rust}/acorn/lib.rs | 0 src/compiler/rust/meson.build | 12 ++++++++++++ src/nouveau/compiler/meson.build | 16 +--------------- 3 files changed, 13 insertions(+), 15 deletions(-) rename src/{nouveau/compiler => compiler/rust}/acorn/lib.rs (100%) diff --git a/src/nouveau/compiler/acorn/lib.rs b/src/compiler/rust/acorn/lib.rs similarity index 100% rename from src/nouveau/compiler/acorn/lib.rs rename to src/compiler/rust/acorn/lib.rs diff --git a/src/compiler/rust/meson.build b/src/compiler/rust/meson.build index afb63c2d184..d19ec161e1a 100644 --- a/src/compiler/rust/meson.build +++ b/src/compiler/rust/meson.build @@ -172,6 +172,18 @@ if with_tests and get_option('b_sanitize') == 'none' ) endif +_libacorn_rs = static_library( + 'acorn', + files('acorn/lib.rs'), + gnu_symbol_visibility : 'hidden', + rust_abi : 'rust', + rust_args : _compiler_rust_args, +) + +idep_acorn_rs = declare_dependency( + link_with : _libacorn_rs, +) + idep_compiler_rs = declare_dependency( link_with : _libcompiler_rs, ) diff --git a/src/nouveau/compiler/meson.build b/src/nouveau/compiler/meson.build index 4bf076240bd..df192993e9e 100644 --- a/src/nouveau/compiler/meson.build +++ b/src/nouveau/compiler/meson.build @@ -33,18 +33,6 @@ libnak_c_files = files( 'nak_nir_rematerialize_load_const.c', ) -_libacorn_rs = static_library( - 'acorn', - files('acorn/lib.rs'), - gnu_symbol_visibility : 'hidden', - rust_abi : 'rust', - rust_args : nouveau_rust_args, -) - -idep_acorn_rs = declare_dependency( - link_with : _libacorn_rs, -) - libnak_deps = [ idep_mesautil, idep_nir_headers, @@ -147,13 +135,11 @@ if with_tests and get_option('b_sanitize') == 'none' and not with_platform_andro idep_compiler.partial_dependency(link_args : true, links : true), idep_mesautil.partial_dependency(link_args : true, links : true), idep_nv_push_rs, + idep_acorn_rs, ], # This is needed to ensure we link against glibc # See also https://gitlab.freedesktop.org/mesa/mesa/-/issues/11632 rust_args: ['-C', 'default-linker-libraries'], - link_with: [ - _libacorn_rs, - ], ) endif