Files
buildroot/package/opencv4
Pengji Li bdfdeea8e1 package/opencv4: respect LoongArch SIMD selection
OpenCV probes the host compiler for LSX/LASX by trying to compile a
small test program with '-mlsx' / '-mlasx'. With Buildroot's toolchain
this probe succeeds even when the target CPU lacks the matching ISA
extension, and the resulting libraries then contain LSX/LASX
instructions. This causes SIGILL at runtime on, e.g., the LA264.

Map Buildroot's BR2_LOONGARCH_SIMD_* selection to OpenCV's
CPU_BASELINE / CPU_DISPATCH knobs:

  BR2_LOONGARCH_SIMD_NONE  -> no baseline, no dispatch
  BR2_LOONGARCH_SIMD_LSX   -> baseline = LSX,  no dispatch
  BR2_LOONGARCH_SIMD_LASX  -> baseline = LSX,  dispatch = LASX

The block is gated on BR2_loongarch64, so the existing auto detection
remains in effect for every other architecture.

Signed-off-by: Pengji Li <wjjsn@qq.com>
Reviewed-by: Woodrow Douglass <wdouglass@carnegierobotics.com>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
(cherry picked from commit b9d10eed1f)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
2026-06-11 10:09:08 +02:00
..