-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Ballooning compile time with LVI mitigations #74632
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.C-bugCategory: This is a bug.Category: This is a bug.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.
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.C-bugCategory: This is a bug.Category: This is a bug.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.
Type
Fields
Give feedbackNo fields configured for issues without a type.
There seems to be a significant compile time regression when using the LVI mitigation passes on some crates. The smallest case I could come up with is:
TOML:
This happens with the
x86_64-fortanix-unknown-sgxtarget, but also without it with the following codegen options (.cargo/config.toml):Expected:
Without the
config.tomlon a vanilla rustup-installed nightly, acargo clean && cargo buildtakes a second or two.Instead:
With LVI mitigations enabled, compile time explodes to about 35 minutes on my machine.
If I disable linking dead code, it drops to 2 minutes, although that's mostly because the sample above is simple. Using shorter uints (e.g. the ones commented out above) makes it drop further still, but compile time still noticeably depends on the uint length.
Using a newer version of the
uintcrate (e.g. 0.4.1) also seems to solve the issue. The main difference that I could find is that the older version uses inline assembly. Not sure if that's a red herring or not.Meta
rustc --version --verbose: