[packages/Mesa] add patch to fix rusticl build on x32

atler atler at pld-linux.org
Thu Nov 2 21:50:08 CET 2023


commit a4b6d46e380e4dded933ca6d8bb5ccc6fb7db924
Author: Jan Palus <atler at pld-linux.org>
Date:   Thu Nov 2 21:37:22 2023 +0100

    add patch to fix rusticl build on x32
    
    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                     |  2 ++
 no-rust-proc-macro-link.patch | 45 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
---
diff --git a/Mesa.spec b/Mesa.spec
index ecd4977..9aba60a 100644
--- 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
index 0000000..ff377dc
--- /dev/null
+++ b/no-rust-proc-macro-link.patch
@@ -0,0 +1,45 @@
+From b9e6e1b10bf7eaa27c3b62e7b466b9b31cfa7cb2 Mon Sep 17 00:00:00 2001
+From: Dmitry Baryshkov <dmitry.baryshkov at 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 at 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
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/Mesa.git/commitdiff/a4b6d46e380e4dded933ca6d8bb5ccc6fb7db924



More information about the pld-cvs-commit mailing list