]> git.pld-linux.org Git - packages/Mesa.git/commitdiff
add patch to fix rusticl build on x32 auto/th/Mesa-23.2.1-1
authorJan Palus <atler@pld-linux.org>
Thu, 2 Nov 2023 20:37:22 +0000 (21:37 +0100)
committerJan Palus <atler@pld-linux.org>
Thu, 2 Nov 2023 20:37:22 +0000 (21:37 +0100)
prevent linking in proc_macros into final library which is only used by
rust compiler during compilation and is of no use to rusticl library.
since proc_macros are build for host target they fail linking due to
architecure mismatch with all other objects.

from: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25775

Mesa.spec
no-rust-proc-macro-link.patch [new file with mode: 0644]

index ecd497709d86ddfce79c01ea9c8e9c4a46f9c20a..9aba60ade5474d13ce301085ae52beee84a1fc91 100644 (file)
--- a/Mesa.spec
+++ b/Mesa.spec
@@ -80,6 +80,7 @@ Group:                X11/Libraries
 Source0:       https://archive.mesa3d.org/mesa-%{version}.tar.xz
 # Source0-md5: 0d89ec154ac9f06a1e876214114ed9af
 Patch0:                llvm17.patch
+Patch1:                no-rust-proc-macro-link.patch
 URL:           https://www.mesa3d.org/
 %if %{with opencl_spirv} || %{with gallium_rusticl}
 BuildRequires: SPIRV-LLVM-Translator-devel >= 8.0.1.3
@@ -1556,6 +1557,7 @@ radv - eksperymentalny sterownik Vulkan dla GPU firmy AMD.
 %prep
 %setup -q -n mesa-%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 %if %{with opencl}
diff --git a/no-rust-proc-macro-link.patch b/no-rust-proc-macro-link.patch
new file mode 100644 (file)
index 0000000..ff377dc
--- /dev/null
@@ -0,0 +1,45 @@
+From b9e6e1b10bf7eaa27c3b62e7b466b9b31cfa7cb2 Mon Sep 17 00:00:00 2001
+From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Date: Wed, 18 Oct 2023 07:37:55 +0300
+Subject: [PATCH] rusticl: use native build for proc-macro library
+
+The proc-macro libraries are used on the build machine rather than on
+the target system, so enforce perfoming native build of the
+rusticl_proc_macro crate.
+
+Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+---
+ src/gallium/frontends/rusticl/meson.build | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build
+index d7aee75240ce4..0522fc4c13da5 100644
+--- a/src/gallium/frontends/rusticl/meson.build
++++ b/src/gallium/frontends/rusticl/meson.build
+@@ -350,6 +350,7 @@ rusticl_proc_macros = shared_library(
+   'rusticl_proc_macros',
+   [rusticl_proc_macros_files],
+   rust_crate_type : 'proc-macro',
++  native: true,
+   rust_args : [
+     rusticl_args,
+   ],
+@@ -361,6 +362,7 @@ librusticl = static_library(
+   gnu_symbol_visibility : 'hidden',
+   rust_crate_type : 'staticlib',
+   rust_args : [
++    '--extern', 'rusticl_proc_macros=' + meson.current_build_dir() / 'librusticl_proc_macros.so',
+     rusticl_args,
+   ],
+   link_with : [
+@@ -368,7 +370,6 @@ librusticl = static_library(
+     libmesa_rust_gen,
+     libmesa_rust_util,
+     rusticl_opencl_gen,
+-    rusticl_proc_macros,
+   ],
+   dependencies : [
+     idep_rusticl_gen,
+-- 
+GitLab
+
This page took 0.417271 seconds and 4 git commands to generate.