Bug 16264

Summary: reproducible issue with rust optimizations - lto or parallel-frontend-threads
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Sundeep Kokkonda <sundeep.kokkonda>
Component: devtools / tool chainAssignee: Sundeep Kokkonda <sundeep.kokkonda>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium+ CC: ccasciato, meta.mr.watcher, meta.watcher, randy.macleod
Version: unspecified   
Target Milestone: 6.1 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Sundeep Kokkonda 2026-04-23 10:00:41 UTC
When enabled lto or parallel-frontend-threads optimizations rust binaries are not reproducible.

Build errors:
https://lists.openembedded.org/g/openembedded-core/message/233071

When parallel-frontend-threads is enabled the binaries are differed in librustc_driver***.so between rust-dbg_1.94.0-r0_amd64.deb & rust_1.94.0-r0_amd64.deb

The difference in librustc_driver***.so is in .gnu_debuglink section. Further analysis on debug data shows the .strtab section is differed and there found the debug symbols are generated with changed *.llvm.{hash} between the builds. For e.g.,

BuildA has: _RINvNtCskNcDw7Prru3_4core3ptr13drop_in_placeINtNtNtNtCsc9RSozNcmFu_3std4sync6poison5mutex10MutexGuarduEECsi7rQHRWG1Yr_12rustc_middle.llvm.12271321240562639378
BuildB has: _RINvNtCskNcDw7Prru3_4core3ptr13drop_in_placeINtNtNtNtCsc9RSozNcmFu_3std4sync6poison5mutex10MutexGuarduEECsi7rQHRWG1Yr_12rustc_middle.llvm.16648798016096118002

In above 2 lines the *.llvm.{hash} is changed.

The issue is raised with rust upstream - https://github.com/rust-lang/rust/issues/154259