kornia/kornia-rs

[Perf]: Investigate restoring opt-level=3 for aarch64 cross-compilation

Open

#682 aperta il 28 gen 2026

Vedi su GitHub
 (6 commenti) (0 reazioni) (1 assegnatario)Rust (188 fork)auto 404
bughelp wantedtriage

Metriche repository

Star
 (675 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

  1. Attempt to remove the -Copt-level=2 flag (reverting to the default or explicit 3).
  2. Cross-compile the project for aarch64-unknown-linux-gnu.
  3. If the build succeeds without crashing, benchmark the artifacts to verify performance gains and ensure runtime stability.
  4. If it still crashes, document the current rustc version and the specific LLVM error trace for upstream reporting.

Guida contributor