From 02fe01f31903f3440a75a3641423e8962100745b Mon Sep 17 00:00:00 2001 From: Viet-Hoa Do Date: Wed, 16 Apr 2025 13:07:20 +0100 Subject: [PATCH] Disable link time optimization for microkernel library * Our SME kernels are compiled with auto-vectorization disabled, but the linker is unable to respect this flag, which can cause miscompilation and result in illegal instruction. Signed-off-by: Viet-Hoa Do --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a792d06a..5529fc5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -310,6 +310,13 @@ target_compile_options(kleidiai PRIVATE ${KLEIDIAI_WARNING_FLAGS} ) +# Micro-kernel library does not support link time optimization. +# +# The linker does not respect the use of -fno-tree-vectorize when building +# SME kernels. LTO can only be enabled once there is no need for disabling +# auto-vectorization. +set_target_properties(kleidiai PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) + if(KLEIDIAI_BUILD_TESTS) include(FetchGTest) enable_testing() -- GitLab