From: Paul Barker <paul@pbarker.dev>
To: Royyan Zahir <royzah@gmail.com>,
openembedded-core@lists.openembedded.org
Subject: Re: [meson.bbclass] bindgen_clang_arguments lacks C++ include paths, breaks C++ bindgen (mesa rusticl)
Date: Mon, 21 Sep 2026 09:14:04 +0100 [thread overview]
Message-ID: <1234666ea330a4738b3c2bd0c69c163fc2c9f829.camel@pbarker.dev> (raw)
In-Reply-To: <20260919172851.1564760-1-royzah@gmail.com>
On Sat, 2026-09-19 at 21:28 +0400, Royyan Zahir wrote:
> meson.bbclass builds the bindgen arguments as:
>
> def bindgen_args(d):
> args = '${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} --target=${TARGET_SYS}'
>
> TOOLCHAIN_OPTIONS carries --sysroot, which is enough for C headers. It is not
> enough for C++: when clang cross-compiles against a GCC sysroot it does not
> infer the libstdc++ include directories from --sysroot alone, so any recipe
> running bindgen over a C++ header fails to find the standard library.
>
> mesa hits this with PACKAGECONFIG opencl, which turns on gallium-rusticl and
> runs bindgen over rusticl_llvm_bindings.hpp with -x c++ -std=c++17:
>
> FAILED: src/gallium/frontends/rusticl/rusticl_llvm_bindings.rs
> .../recipe-sysroot/usr/include/llvm/ADT/DenseMapInfo.h:17:10:
> fatal error: 'cassert' file not found
> Unable to generate bindings: clang diagnosed error
>
> Seen on mesa 26.0.5 with oe-core wrynose, aarch64 target, LLVM 22.1.3.
>
> The missing arguments are the staged C++ headers:
>
> -I${STAGING_INCDIR}/c++/<version>
> -I${STAGING_INCDIR}/c++/<version>/${TARGET_SYS}
>
> Our downstream workaround appends them to bindgen_clang_arguments in
> meson.cross from a mesa bbappend, which works but is recipe-specific and
> hardcodes a realpath glob over the staged header directory. It also has to run
> after do_prepare_recipe_sysroot, since the glob is empty on a clean build.
>
> Reporting rather than sending a patch because the right fix is a design call:
> bindgen_args() is generic, so this affects any meson recipe doing C++ bindgen,
> not just mesa. Options seem to be teaching bindgen_args() about the C++ include
> paths unconditionally, gating it on whether the recipe does C++ bindgen, or
> having clang-native resolve the GCC sysroot properly. A maintainer is better
> placed to pick.
>
> Happy to test a proposed fix on aarch64.
Hi,
Please could you share enough information to reproduce this build
failure. The bitbake command you ran and the initial output showing
layer versions, DISTRO, etc may be sufficient.
Best regards,
--
Paul Barker
next prev parent reply other threads:[~2026-09-21 8:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 17:28 [meson.bbclass] bindgen_clang_arguments lacks C++ include paths, breaks C++ bindgen (mesa rusticl) Royyan Zahir
2026-09-21 8:14 ` Paul Barker [this message]
2026-09-21 9:11 ` Royyan Zahir
2026-09-21 10:09 ` Paul Barker
2026-09-21 15:52 ` Royyan Zahir
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=1234666ea330a4738b3c2bd0c69c163fc2c9f829.camel@pbarker.dev \
--to=paul@pbarker.dev \
--cc=openembedded-core@lists.openembedded.org \
--cc=royzah@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox