On Sat, 27 Dec 2025 at 09:46, mark.yang via lists.openembedded.org
<[email protected]> wrote:
>
> My error report is as follows.
> https://errors.yoctoproject.org/Errors/Details/892988/
>
> I am using only the openembedded-core layer, with nodistro.
> local.conf
>
> PREFERRED_TOOLCHAIN_TARGET = "clang"
> DISTRO_FEATURES:append = " ld-is-lld"
> require conf/distro/include/lto.inc
> DISTRO_FEATURES:append = " lto"
> # The settings below were taken from meta-clang.
> LTO:toolchain-clang:class-target = "${@bb.utils.contains('DISTRO_FEATURES', 
> 'thin-lto', '-flto=thin', '-flto -fuse-ld=lld', d)}"
> LTO:toolchain-clang:class-nativesdk = 
> "${@bb.utils.contains('DISTRO_FEATURES', 'thin-lto', '-flto=thin', '-flto 
> -fuse-ld=lld', d)}"
>
>
> dwarfsrcfiles checks .a files during the package process.
> Whether using LTO or not, DWARF information is extracted by iterating through 
> .o files inside .a files.
> However, they must be ELF objects.
>
> To summarize, it is as follows.
> The problem is that when using clang + LTO, the .o files are not ELF but LLVM 
> IR bitcode.

Thanks for the reproduction instructions and the error message.

The fix is somewhat problematic:
- it relies on the particular console output from dwarfsrcfiles which
may change over time (maybe subtly), and then the code around it will
quietly cease to work;
- it obscures other possible issues that would be exposed by the same
error from dwarfsrcfiles: there can be many reasons for something not
being a valid elf file, and they should remain fatal errors;
- conversely for this particular use case it still emits warnings,
even though there's nothing the user can do about it - should it
rather say nothing if .a has only llvm-ir files?

Is it possible to rather guard the call to dwarfsrcfiles with a set of
conditions: inspecting .a file, clang as toolchain and lto in
distro_features, and skip the call if all conditions are true?

Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#228577): 
https://lists.openembedded.org/g/openembedded-core/message/228577
Mute This Topic: https://lists.openembedded.org/mt/116947501/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to