diff mbox series

[meta-oe,2/5] librice: Point bindgen at the target sysroot

Message ID 20261020003022.1913623-2-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-gnome,1/5] mutter: Fix build without remote desktop support | expand

Commit Message

Khem Raj Oct. 20, 2026, 12:30 a.m. UTC
rice-c/build.rs runs bindgen without any target flags, so libclang
parsed the build host headers in /usr/include, which fails when cross
compiling, e.g. for riscv64/musl:

  /usr/include/bits/floatn.h:97:9: error: __float128 is not supported on this target

Pass the target arch flags, sysroot and triple via
BINDGEN_EXTRA_CLANG_ARGS, as thin-provisioning-tools does.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 meta-oe/recipes-support/librice/librice_0.4.3.bb | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/librice/librice_0.4.3.bb b/meta-oe/recipes-support/librice/librice_0.4.3.bb
index 4017b58271..61934acd88 100644
--- a/meta-oe/recipes-support/librice/librice_0.4.3.bb
+++ b/meta-oe/recipes-support/librice/librice_0.4.3.bb
@@ -16,6 +16,11 @@  CARGO_BUILD_FLAGS += " --workspace"

 export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}/libclang.so"

+# rice-c/build.rs runs bindgen, point libclang at the target sysroot instead
+# of the build host headers in /usr/include
+BINDGEN_EXTRA_CLANG_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} --target=${TARGET_SYS}"
+export BINDGEN_EXTRA_CLANG_ARGS
+
 # rice-c/build.rs builds the internal rice-proto C library in-tree (via
 # "cargo cinstall") and then locates it through system-deps + pkg-config.
 # The generated rice-proto.pc carries an absolute prefix pointing at the