From 7e3b4725c92a1c3cabdc6e2467acbce376d03085 Mon Sep 17 00:00:00 2001 From: Bo Sun Date: Thu, 24 Jul 2025 15:55:00 +0800 Subject: [PATCH] thin-provisioning-tools: fix bindgen build error with clang on octeontx2 Remove unsupported '-mcpu=octeontx2+crypto' from BINDGEN_EXTRA_CLANG_ARGS as clang does not recognize 'octeontx2' as a valid target CPU, causing bindgen to fail when generating Rust bindings. Since bindgen only parses headers using Clang, CPU-specific options like -mcpu are generally unnecessary. Fixes build failure: | error: unsupported argument 'octeontx2+crypto' to option '-mcpu=' | error: unknown target CPU 'octeontx2' Signed-off-by: Bo Sun Signed-off-by: Khem Raj --- .../thin-provisioning-tools/thin-provisioning-tools_1.1.0.bb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meta-oe/dynamic-layers/clang-layer/recipes-support/thin-provisioning-tools/thin-provisioning-tools_1.1.0.bb b/meta-oe/dynamic-layers/clang-layer/recipes-support/thin-provisioning-tools/thin-provisioning-tools_1.1.0.bb index 3ec7d486fa..317794defb 100644 --- a/meta-oe/dynamic-layers/clang-layer/recipes-support/thin-provisioning-tools/thin-provisioning-tools_1.1.0.bb +++ b/meta-oe/dynamic-layers/clang-layer/recipes-support/thin-provisioning-tools/thin-provisioning-tools_1.1.0.bb @@ -22,7 +22,10 @@ inherit pkgconfig DEPENDS += "udev libdevmapper libdevmapper-native clang-native" export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}" -export BINDGEN_EXTRA_CLANG_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} --target=${TARGET_SYS}" +# Remove octeontx2 specific CPU flags that may cause issues with bindgen +BINDGEN_EXTRA_CLANG_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} --target=${TARGET_SYS}" +BINDGEN_EXTRA_CLANG_ARGS:remove = "-mcpu=octeontx2+crypto" +export BINDGEN_EXTRA_CLANG_ARGS require ${BPN}-crates.inc require ${BPN}-git-crates.inc