From df8086abe378d9afae97c8aa3775c638fde91b5e Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Fri, 7 Aug 2026 10:22:50 +0200 Subject: [PATCH] fix(bluedroid): disable Clang vectorization for GATT Avoid an Xtensa Clang vectorizer crash when compiling gatt_sr.c at -O2. --- components/bt/host/bluedroid/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/bt/host/bluedroid/CMakeLists.txt b/components/bt/host/bluedroid/CMakeLists.txt index e20f00aef8e..a95939b9fc7 100644 --- a/components/bt/host/bluedroid/CMakeLists.txt +++ b/components/bt/host/bluedroid/CMakeLists.txt @@ -26,6 +26,12 @@ function(set_bluedroid_host_compile_flags) set_source_files_properties("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/device/controller.c" PROPERTIES COMPILE_FLAGS "-Wno-unterminated-string-initialization") endif() + + if(CMAKE_C_COMPILER_ID MATCHES "Clang") + # Prevent an Xtensa Clang vectorizer crash when compiling this source at -O2. + set_source_files_properties("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/stack/gatt/gatt_sr.c" + PROPERTIES COMPILE_FLAGS "-fno-vectorize -fno-slp-vectorize") + endif() endfunction() set(bluedroid_host_srcs "" PARENT_SCOPE)