-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Combining LTO + PGO + lib/cdylib crashes on LLVM assertion #117220
Copy link
Copy link
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-LTOArea: Link-time optimization (LTO)Area: Link-time optimization (LTO)C-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.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-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-LTOArea: Link-time optimization (LTO)Area: Link-time optimization (LTO)C-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.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.
When compiling a cargo project with:
LTO=thin/fat)-Cprofile-use)libanddylibtargets for its libraryReproducer
There also needs to be an empty
src/lib.rsfile. Here is a reproducer script for PGO:I expected to see this happen: the project compiles.
Instead, compilation fails with the following error:
This was originally found in #115344, which contains many examples of this problem in the wild. Here I sent a minimal example, I wasn't able to minimize it further (removing LTO, PGO, clap or lib/dylib) fixes the problem.
Meta
rustc --version --verbose:I managed to reproduce this all the way back to
1.60.0(although this specific example requires at least1.70.0due toclap).