summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2025-04-18 03:57:13 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-04-23 09:47:42 +0100
commitb269fbd5b936d018e8e35c3b1d8ec40ff041caa5 (patch)
tree57fb79670639c21153df262241c27365242214b1
parent581861b94bde21e48b9cc992f34fe9ef2323756b (diff)
downloadpoky-b269fbd5b936d018e8e35c3b1d8ec40ff041caa5.tar.gz
mesa: drop the bindgen patch
Drop the bingen-target and bindgen-includedir options in favour of the bindgen_clang_args being passed through the meson target file. (From OE-Core rev: efd31bbd52b94ac7633e5c9d1664f2305c074059) Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-graphics/mesa/files/0001-rusticl-provide-cross-compilation-arguments-to-LLVM-.patch67
-rw-r--r--meta/recipes-graphics/mesa/mesa.inc6
2 files changed, 1 insertions, 72 deletions
diff --git a/meta/recipes-graphics/mesa/files/0001-rusticl-provide-cross-compilation-arguments-to-LLVM-.patch b/meta/recipes-graphics/mesa/files/0001-rusticl-provide-cross-compilation-arguments-to-LLVM-.patch
deleted file mode 100644
index d527b34087..0000000000
--- a/meta/recipes-graphics/mesa/files/0001-rusticl-provide-cross-compilation-arguments-to-LLVM-.patch
+++ /dev/null
@@ -1,67 +0,0 @@
1From b9cf34f39ca7e7546508ce2ab1f053edef5fc201 Mon Sep 17 00:00:00 2001
2From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
3Date: Wed, 26 Mar 2025 17:47:09 +0200
4Subject: [PATCH] rusticl: provide cross-compilation arguments to LLVM bindgen
5 invocation
6
7Correctly generating LLVM bindings requires several croos-compilation
8arguments. Provide them to rust.bindgen(). Karol Herbst on IRC suggested
9that a proper fix should be to fix meson's rust.bindgen() to support
10cross-compilation. Carry this patch until meson is fixed.
11
12Upstream-Status: Inappropriate [OE-Specific]
13Link: https://github.com/mesonbuild/meson/issues/13591
14Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
15---
16 meson_options.txt | 14 ++++++++++++++
17 src/gallium/frontends/rusticl/meson.build | 8 ++++++++
18 2 files changed, 22 insertions(+)
19
20diff --git a/meson_options.txt b/meson_options.txt
21index 0147cafcb146..f73e83fded18 100644
22--- a/meson_options.txt
23+++ b/meson_options.txt
24@@ -796,3 +796,17 @@ option(
25 value : false,
26 description : 'Install the drivers internal shader compilers (if needed for cross builds).'
27 )
28+
29+option(
30+ 'bindgen-includedir',
31+ type : 'string',
32+ value : '',
33+ description : 'system-wide include directory for cross-generating LLVM bindings'
34+ )
35+
36+option(
37+ 'bindgen-target',
38+ type : 'string',
39+ value : '',
40+ description : 'Clang target for cross-generating LLVM bindings'
41+ )
42diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build
43index a5d1dcf3abb9..480c220b7f5f 100644
44--- a/src/gallium/frontends/rusticl/meson.build
45+++ b/src/gallium/frontends/rusticl/meson.build
46@@ -115,6 +115,11 @@ rusticl_bindgen_c_args = [
47 '-fno-builtin-malloc',
48 ]
49
50+bindgen_target = get_option('bindgen-target')
51+if bindgen_target != ''
52+ rusticl_bindgen_c_args += [ '-target', bindgen_target ]
53+endif
54+
55 cl_c_args = [
56 '-DCL_USE_DEPRECATED_OPENCL_1_0_APIS',
57 '-DCL_USE_DEPRECATED_OPENCL_1_1_APIS',
58@@ -187,6 +192,9 @@ rusticl_llvm_bindings_rs = rust.bindgen(
59 rusticl_bindgen_c_args,
60 pre_args,
61 ],
62+ include_directories : [
63+ get_option('bindgen-includedir'),
64+ ],
65 dependencies : [
66 dep_clang,
67 dep_llvm,
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index c30253695f..2feaa70093 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -18,7 +18,6 @@ SRC_URI = "https://archive.mesa3d.org/mesa-${PV}.tar.xz \
18 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ 18 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
19 file://0001-meson-disable-SIMD-blake-optimisations-on-x32-host.patch \ 19 file://0001-meson-disable-SIMD-blake-optimisations-on-x32-host.patch \
20 file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\ 20 file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\
21 file://0001-rusticl-provide-cross-compilation-arguments-to-LLVM-.patch \
22" 21"
23 22
24SRC_URI[sha256sum] = "adf904d083b308df95898600ffed435f4b5c600d95fb6ec6d4c45638627fdc97" 23SRC_URI[sha256sum] = "adf904d083b308df95898600ffed435f4b5c600d95fb6ec6d4c45638627fdc97"
@@ -144,13 +143,10 @@ PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2
144# "egl" requires "opengl" 143# "egl" requires "opengl"
145PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled" 144PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
146 145
147BINDGEN_TARGET = "${TARGET_ARCH}-${TARGET_OS}${@['-gnu', ''][d.getVar('LIBCEXTENSION') != '']}"
148BINDGEN_TARGET:class-native = ""
149
150# "opencl" also requires libclc and gallium-llvm to be present in PKGCONFIG! 146# "opencl" also requires libclc and gallium-llvm to be present in PKGCONFIG!
151# Be sure to enable them both for the target and for the native build. 147# Be sure to enable them both for the target and for the native build.
152PACKAGECONFIG[opencl] = " \ 148PACKAGECONFIG[opencl] = " \
153 -Dgallium-opencl=icd -Dgallium-rusticl=true -Dbindgen-includedir=${STAGING_INCDIR} -Dbindgen-target=${BINDGEN_TARGET},\ 149 -Dgallium-opencl=icd -Dgallium-rusticl=true, \
154 -Dgallium-opencl=disabled -Dgallium-rusticl=false, \ 150 -Dgallium-opencl=disabled -Dgallium-rusticl=false, \
155 bindgen-cli-native \ 151 bindgen-cli-native \
156" 152"