From: "Böszörményi Zoltán" <zboszor@gmail.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: openembedded-core@lists.openembedded.org,
Markus Volk <f_l_k@t-online.de>
Subject: Re: [OE-core] [PATCH] mesa: Fix bindgen includes
Date: Thu, 12 Jun 2025 06:23:36 +0200 [thread overview]
Message-ID: <96fc5917-bd69-41e3-892e-b683fd635b9e@gmail.com> (raw)
In-Reply-To: <CAO9ioeVE94tAha_o0Q1tcP-2LhD6YAVtLUMkqACr4q55=ahgVQ@mail.gmail.com>
2025. 06. 11. 21:32 keltezéssel, Dmitry Baryshkov írta:
> On Wed, 11 Jun 2025 at 21:36, Böszörményi Zoltán <zboszor@gmail.com> wrote:
>> 2025. 06. 11. 19:34 keltezéssel, Dmitry Baryshkov írta:
>>> On 11/06/2025 13:46, Böszörményi Zoltán wrote:
>>>> 2025. 06. 10. 21:49 keltezéssel, Dmitry Baryshkov via lists.openembedded.org írta:
>>>>> On Tue, 10 Jun 2025 at 17:24, Zoltán Böszörményi <zboszor@gmail.com> wrote:
>>>>>> 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
>>>>> Can we fix this on the meson side by passing additional include path
>>>>> through the cross file?
>>>> This seems to work in mesa.inc without patching Mesa:
>>>>
>>>> CFLAGS:append:class-target = " -I${STAGING_INCDIR}"
>>>> CXXFLAGS:append:class-target = " -I${STAGING_INCDIR}"
>>> My question was more about meson.bbclass, where we set bindgen_clang_args. See the
>>> bindgen_args() function.
>> I wouldn't change meson.bbclass because it works for the
>> most recipes already.
> The bindgen_args was implemented for mesa as the first user. It is not
> frequent for the packaged software to use rust.bindgen.
>
>> Besides, it seems to be a meson bug, not a meson.bbclass bug
>> as -isystem and other include path related flags (besides -I) are
>> ignored in CFLAGS/CXXFLAGS.
>>
>> The "clang diag" messages are likely coming from mixed up host
>> vs target header paths.
>>
>> See
>> https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35435#note_2952621
>> https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/rust.py#L392-L397
>>
>> If we changed meson.bbclass to add -I${STAGING_INCDIR} to
>> the proper places in meson.cross, it would still print the
>> clang diag warning. Adding -isystem would still get ignored.
> Are we ta
???
>> FWIW, --sysroot is also ignored by meson and adding it forcibly
>> throws a different error. See
>> https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35435#note_2952805
> How were you passing it? Via CFLAGS / CPPFLAGS or via bindgen args?
Using this patch and -Dbindgen-sysroot=${STAGING_DIR_TARGET}
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35435/diffs?commit_id=a82381aeaba32775db51080b823893e4b6f647fb
--sysroot is not passing through to bindgen from CFLAGS/CXXFLAGS
due to the filtering of flags in meson by the already qouted code piece at
https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/rust.py#L392-L397
>> ¯\_(ツ)_/¯
>>
>>>> but it also[1] prints this for some of the bindgen runs:
>>>>
>>>> clang diag: /home/zozo/yocto-5.2/tmp-sicom/work/corei7-64-oe-linux/
>>>> mesa/25.1.3/recipe-sysroot/usr/include/stdint.h:95:11: warning: '__INT64_C' macro
>>>> redefined [-Wmacro-redefined]
>>>> clang diag: /home/zozo/yocto-5.2/tmp-sicom/work/corei7-64-oe-linux/
>>>> mesa/25.1.3/recipe-sysroot/usr/include/stdint.h:96:11: warning: '__UINT64_C' macro
>>>> redefined [-Wmacro-redefined]
>>>>
>>>> [1] Using the previously posted patch also prints the same.
>>>>
>>>> It seems to be caused by a meson bug because it doesn't
>>>> collect the -isystem or --sysroot flags for rust/bindgen.
>>>> See the discussion at the MR link in the patch.
>>>>
>>>> CFLAGS and CXXFLAGS changes are both needed because
>>>> bindgen is run on both .h and .hpp files for rusticl.
>>>>
>>>>>> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>>>>>> ---
>>>>>> ...w-build-option-for-extra-bindgen-inc.patch | 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
>>>>>>
>>>>>
>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>> Links: You receive all messages sent to this group.
>>>>> View/Reply Online (#218438): https://lists.openembedded.org/g/
>>>>> openembedded-core/message/218438
>>>>> Mute This Topic: https://lists.openembedded.org/mt/113570520/3617728
>>>>> Group Owner: openembedded-core+owner@lists.openembedded.org
>>>>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [zboszor@gmail.com]
>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>
>>>
>
next prev parent reply other threads:[~2025-06-12 4:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 14:24 [PATCH] mesa: Fix bindgen includes Zoltán Böszörményi
2025-06-10 19:49 ` 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 [this message]
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=96fc5917-bd69-41e3-892e-b683fd635b9e@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.