kornia/kornia-rs
View on GitHub[Perf]: Investigate restoring opt-level=3 for aarch64 cross-compilation
Open
#682 opened on Jan 28, 2026
bughelp wantedtriage
Repository metrics
- Stars
- (675 stars)
- PR merge metrics
- (PR metrics pending)
Description
Title: Investigate restoring opt-level=3 for aarch64 cross-compilation
Description
We currently override the optimization level for the aarch64-unknown-linux-gnu target to 2 in our cargo configuration:
[target.aarch64-unknown-linux-gnu]
rustflags = ["-Copt-level=2", "-Ctarget-feature=+fp16,+fhm"]
This workaround was introduced to bypass a compiler segfault (SIGSEGV) in LLVM's BranchProbabilityInfo pass when compiling the faer dependency with opt-level=3.
Downgrading to opt-level=2 potentially leaves performance on the table for our ARM builds (e.g., Jetson devices), which is critical for this project.
Goal
Determine if this workaround is still necessary with the latest stable rustc version.
Task
- Attempt to remove the
-Copt-level=2flag (reverting to the default or explicit3). - Cross-compile the project for
aarch64-unknown-linux-gnu. - If the build succeeds without crashing, benchmark the artifacts to verify performance gains and ensure runtime stability.
- If it still crashes, document the current
rustcversion and the specific LLVM error trace for upstream reporting.