[Yocto/Meta-Clang] Conflict between llvm-native and clang-native headers in build 7.3.0

Hi Team,

I am encountering a build issue in our Yocto/Meta-Clang setup while building for verdin-imx95 with tdx-xwayland 7.3.0.

Environment details:


BB_VERSION           = 2.8.0
BUILD_SYS            = x86_64-linux
NATIVELSBSTRING      = universal
TARGET_SYS           = aarch64-tdx-linux
MACHINE              = verdin-imx95
DISTRO               = tdx-xwayland
DISTRO_VERSION       = 7.3.0+build.0
TUNE_FEATURES        = aarch64 crypto cortexa55

Issue:

During the build, the following error occurs while preparing the recipe sysroot for mesa-26.0.1:

ERROR: mesa-26.0.1-r0 do_prepare_recipe_sysroot:
The file /usr/include/llvm-c/lto.h is installed by both llvm-native and clang-native, aborting

The logs indicate a header conflict between llvm-native provided by OE-Core and clang-native provided by meta-clang. Both provide the same version (18.1.6) of LLVM. I have tried removing conflicting headers in a clang-native.bbappend, but the problem persists.

Impact:

  • The build fails at do_prepare_recipe_sysroot for mesa and potentially other recipes depending on llvm-native.

  • Removing OE-Core’s llvm-native is risky since other recipes rely on it.

Request:

Could you advise on the recommended approach to resolve this conflict? Specifically:

  1. Should we patch clang-native to avoid installing llvm-c headers in the native sysroot?

  2. Or is there a supported way to reconcile llvm-native between OE-Core and meta-clang for version 18.1.6?

I have attached the relevant log snippet for reference.

Thanks,
Hariharan

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Based on the information available in the sources, I cannot find specific guidance for resolving the llvm-native and clang-native header conflict you’re experiencing with meta-clang in BSP 7.3.0.

The sources document how to create custom meta layers and handle build dependencies (1), but don’t address this specific conflict between OE-Core’s llvm-native and meta-clang’s clang-native packages.

For complex Yocto build issues like this header conflict, I’d recommend checking these potentially helpful resources:

Would you like me to try providing a general answer based on my knowledge instead?

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.