Bug 15988

Summary: Non-deterministic package_qa in allarch+clang combination
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: coreAssignee: Ross Burton <ross.burton>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, randy.macleod
Version: 5.2   
Target Milestone: 6.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2025-10-02 12:53:13 UTC
In builds of linux-firmware when TOOLCHAIN=clang, the package_qa is non-deterministic.

The ldflags test in package_qa_hash_style() uses elf.run_objdump() which calls ${OBJDUMP}, but notably just returns the empty string if objdump fails with an error.

With TOOLCHAIN=clang, OBJDUMP is "${HOST_PREFIX}llvm-objdump".  The package_qa task depends on POPULATESYSROOTDEPS which for target builds is "virtual/cross-binutils:do_populate_sysroot", which is not where llvm-objdump is.

Several issues jump out at me:
1) run_objdump() should likely _at least_ warn if it fails, if not fail
2) clang.bbclass should extend POPULATESYSROOTDEPS to include llvm-native.
Comment 1 Ross Burton 2025-10-02 15:19:32 UTC
3) allarch clears POPULATESYSROOTDEPS
Comment 2 Ross Burton 2025-10-02 15:30:28 UTC
I wish bugzilla let you edit comments.

Re (3) we can't not unset POPULATESYSROOTDEPS because otherwise it depends on cross-binutils-allarch, which doesn't exist.

A horrible but interesting solution would be to use binutils-native as a provider of cross-binutils-allarch. Another approach might be to actually build both binutils-native (strip, etc) and binutils-cross (ld and anything else that needs to know about sysroots) which means we can be more specific about dependencies.