* [PATCH] meson: remove -mcpu from bindgen_clang_arguments
@ 2026-06-10 12:33 Walter Werner Schneider
2026-06-12 9:19 ` Walter Werner SCHNEIDER
0 siblings, 1 reply; 2+ messages in thread
From: Walter Werner Schneider @ 2026-06-10 12:33 UTC (permalink / raw)
To: openembedded-core
Cc: Quentin Schulz, Deepesh Varatharajan, Walter Werner Schneider
bindgen uses libclang to parse target headers, so the arguments passed in
bindgen_clang_arguments must be valid clang arguments. Some GCC toolchains
emit -mcpu values for big.LITTLE Arm CPUs that clang/llvm does not support,
which breaks recipes using bindgen, for example Mesa with Rusticl enabled.
The -mcpu option only selects CPU-specific tuning/code generation and is not
required when generating Rust bindings. The target triple is sufficient for
clang to select the correct target ABI and parse the headers.
Drop -mcpu from the bindgen arguments and rely on the target triple instead.
Note that the target attribute depends on the system beeing built for,
it is either the host system, the target system or the SDK system.
Fixes: a647a0ff4c4e ("meson: correct bindgen_clang_argments")
Signed-off-by: Walter Werner Schneider <contact@schnwalter.eu>
---
meta/classes-recipe/meson.bbclass | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass
index 9bed293603..d99a93e7d4 100644
--- a/meta/classes-recipe/meson.bbclass
+++ b/meta/classes-recipe/meson.bbclass
@@ -59,11 +59,14 @@ def rust_tool(d, target_var):
return "rust = %s" % repr(cmd)
def bindgen_args(d):
- args = '${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} --target=${TARGET_SYS}'
+ args = '${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} --target=${HOST_SYS}'
# For SDK packages TOOLCHAIN_OPTIONS don't contain full sysroot path
if bb.data.inherits_class("nativesdk", d):
args += ' --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}${prefix_nativesdk}'
items = d.expand(args).split()
+ # Use the LLVM Linux target triple for all toolchains instead of -mcpu.
+ # Note: The big.LITTLE CPU architectures are not supported by llvm/clang.
+ items = [item for item in items if not item.startswith('-mcpu')]
return repr(items[0] if len(items) == 1 else items)
addtask write_config before do_configure
---
base-commit: 1e86aa039108621b2af734ef358a1e9d3c4d88d8
change-id: 20260604-fix-rust-bindgen-for-big-little-arch-78e45e8fefa1
Best regards,
--
Walter Werner Schneider <contact@schnwalter.eu>
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-12 9:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-10 12:33 [PATCH] meson: remove -mcpu from bindgen_clang_arguments Walter Werner Schneider
2026-06-12 9:19 ` Walter Werner SCHNEIDER
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.