-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Rustc fails to compile a program with ThinLTO and split-debuginfo = "packed" #132677
Copy link
Copy link
Closed
Labels
A-LTOArea: Link-time optimization (LTO)Area: Link-time optimization (LTO)A-codegenArea: Code generationArea: Code generationA-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-LTOArea: Link-time optimization (LTO)Area: Link-time optimization (LTO)A-codegenArea: Code generationArea: Code generationA-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Hi!
A person on Reddit posted a strange build error when ThinLTO is enabled. I performed additional build tests in different configurations and I can confirm the error on current Rustc compilers (see the versions below). My environment is Fedora 41 + AMD Ryzen 5900x (x86-64). The test project is https://github.com/anza-xyz/agave on the
masterbranch with144925eda5eba98ef28a47a659be68b93211cdb2. The test command iscargo +stable test --profile release-with-debug/cargo +nightly test --profile release-with-debug.The original report is when ThinLTO is enabled, some binaries fail to be built with the
duplicate split compilation uniterror. I performed the build in multiple configurations and here are my results:Build ok:
Build ok:
Build ok:
Build ok:
Build fails:
Build fails:
According to the tests, the buggy is only the combination of ThinLTO and
split-debuginfo = "packed". Disabling one of these options or enabling Fat LTO instead of ThinLTO resolves the issue.I expected to see this happen: the build with
lto = "thin"+split-debuginfo = "packed"is successfulInstead, this happened: the build fails with the
duplicate split compilation uniterrorMeta
The issue is reproduced on both Rustc versions: stable and current nightly
rustc --version --verbose:rustc +nightly --version --verboseProviding
RUST_BACKTRACE=1doesn't give more information so no backtraces here.