baremetal: disable -mindirect-branch-register (requires gcc >5.4)

This commit is contained in:
2026-03-08 12:56:59 +01:00
parent 2bc885e0f9
commit ef3b3eee85

View File

@ -135,7 +135,8 @@ endif()
if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang"))
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mindirect-branch-register")
# NOTE: The crosscompiler (gcc 5.4 i386) does not support this flag
# set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mindirect-branch-register")
endif ()
endif ()