mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-01 21:23:51 -09:00
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>