From: "Zoltán Böszörményi" <zboszor@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: "Markus Volk" <f_l_k@t-online.de>,
"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
"Zoltán Böszörményi" <zboszor@gmail.com>
Subject: [PATCH] mesa: Fix bindgen includes
Date: Tue, 10 Jun 2025 16:24:13 +0200 [thread overview]
Message-ID: <20250610142413.681911-1-zboszor@gmail.com> (raw)
Add a patch to fix bindgen errors due to not finding headers
in the system, like:
|...
| ../mesa-25.1.2/src/gallium/frontends/rusticl/rusticl_llvm_bindings.hpp:1:10: fatal error: 'clang/Basic/Version.h' file not found
| Unable to generate bindings: clang diagnosed error: ../mesa-25.1.2/src/gallium/frontends/rusticl/rusticl_llvm_bindings.hpp:1:10: fatal error: 'clang/Basic/Version.h' file not found
|...
| .../work/corei7-64-oe-linux/mesa/25.1.2/mesa-25.1.2/include/./GL/glx.h:30:10: fatal error: 'X11/Xlib.h' file not found
| Unable to generate bindings: clang diagnosed error: /data2/dtd-yocto-5.2/tmp-sicom/work/corei7-64-oe-linux/mesa/25.1.2/mesa-25.1.2/include/./GL/glx.h:30:10: fatal error: 'X11/Xlib.h' file not found
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
| 57 +++++++++++++++++++
meta/recipes-graphics/mesa/mesa.inc | 3 +-
2 files changed, 59 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-graphics/mesa/files/0001-rusticl-Add-a-new-build-option-for-extra-bindgen-inc.patch
--git a/meta/recipes-graphics/mesa/files/0001-rusticl-Add-a-new-build-option-for-extra-bindgen-inc.patch b/meta/recipes-graphics/mesa/files/0001-rusticl-Add-a-new-build-option-for-extra-bindgen-inc.patch
new file mode 100644
index 0000000000..913357c5dc
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-rusticl-Add-a-new-build-option-for-extra-bindgen-inc.patch
@@ -0,0 +1,57 @@
+From 705309ce727575faac44f6399463616beeafbfa0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
+ <zboszor@gmail.com>
+Date: Tue, 10 Jun 2025 15:50:08 +0200
+Subject: [PATCH] rusticl: Add a new build option for extra bindgen include
+ dirs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Bindgen may need extra -I options when headers are not in
+the usual places, like when cross-compiling.
+
+Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35435]
+---
+ meson.options | 7 +++++++
+ src/gallium/frontends/rusticl/meson.build | 5 +++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/meson.options b/meson.options
+index 40fe433435a..65d1c236261 100644
+--- a/meson.options
++++ b/meson.options
+@@ -787,6 +787,13 @@ option(
+ ],
+ )
+
++option(
++ 'bindgen-includes',
++ type : 'array',
++ value : [],
++ description : 'Pass extra -I options to bindgen (if needed for cross builds).'
++)
++
+ option(
+ 'mesa-clc',
+ type : 'combo',
+diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build
+index 426b0a9b993..20e0d7682ea 100644
+--- a/src/gallium/frontends/rusticl/meson.build
++++ b/src/gallium/frontends/rusticl/meson.build
+@@ -106,6 +106,11 @@ rusticl_bindgen_c_args = [
+ '-fno-builtin-malloc',
+ ]
+
++_bindgen_includes = get_option('bindgen-includes')
++foreach _bindgen_include : _bindgen_includes
++ rusticl_bindgen_c_args += '-I' + _bindgen_include
++endforeach
++
+ cl_c_args = [
+ '-DCL_USE_DEPRECATED_OPENCL_1_0_APIS',
+ '-DCL_USE_DEPRECATED_OPENCL_1_1_APIS',
+--
+2.49.0
+
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index b222e72fdd..3179023efb 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -18,6 +18,7 @@ SRC_URI = "https://archive.mesa3d.org/mesa-${PV}.tar.xz \
file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
file://0001-freedreno-don-t-encode-build-path-into-binaries.patch \
file://0001-dont-build-clover-frontend.patch \
+ file://0001-rusticl-Add-a-new-build-option-for-extra-bindgen-inc.patch \
"
SRC_URI[sha256sum] = "ffcb6cadb5fd356d56008e6308641dfe4b2929f30139f6585436ca6e3cddba7f"
@@ -151,7 +152,7 @@ PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
# "opencl" also requires libclc and gallium-llvm to be present in PKGCONFIG!
# Be sure to enable them both for the target and for the native build.
-PACKAGECONFIG[opencl] = "-Dgallium-rusticl=true, -Dgallium-rusticl=false, bindgen-cli-native"
+PACKAGECONFIG[opencl] = "-Dgallium-rusticl=true -Dbindgen-includes=${STAGING_INCDIR}, -Dgallium-rusticl=false, bindgen-cli-native"
PACKAGECONFIG[broadcom] = ""
PACKAGECONFIG[etnaviv] = ",,python3-pycparser-native"
--
2.49.0
next reply other threads:[~2025-06-10 14:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 14:24 Zoltán Böszörményi [this message]
2025-06-10 19:49 ` [PATCH] mesa: Fix bindgen includes Dmitry Baryshkov
2025-06-11 10:46 ` [OE-core] " Böszörményi Zoltán
2025-06-11 17:34 ` Dmitry Baryshkov
2025-06-11 18:36 ` Böszörményi Zoltán
2025-06-11 19:32 ` Dmitry Baryshkov
2025-06-12 4:23 ` Böszörményi Zoltán
2025-06-12 8:08 ` Dmitry Baryshkov
2025-06-12 13:48 ` Böszörményi Zoltán
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250610142413.681911-1-zboszor@gmail.com \
--to=zboszor@gmail.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=f_l_k@t-online.de \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.