From 9893280ab665216c714e210f429b47a02af6f1ca Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Wed, 27 Sep 2023 19:59:14 +0100 Subject: [PATCH] Add compiler specific attributes for FORCE_RAM_FUNC. --- inc/core/codal_target_hal.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inc/core/codal_target_hal.h b/inc/core/codal_target_hal.h index 3205333d..3f77c2af 100644 --- a/inc/core/codal_target_hal.h +++ b/inc/core/codal_target_hal.h @@ -104,7 +104,12 @@ extern "C" // This is for cycle-precise wait even in presence of flash caches (forces function to sit in RAM) #ifndef FORCE_RAM_FUNC -#define FORCE_RAM_FUNC __attribute__((noinline, long_call, section(".data.ramfuncs"))) +#if defined(__clang__) + // LLVM doesn't support long_call attribute for ARM: https://github.com/llvm/llvm-project/issues/39969 + #define FORCE_RAM_FUNC __attribute__((noinline, section(".data.ramfuncs"))) +#else + #define FORCE_RAM_FUNC __attribute__((noinline, long_call, section(".data.ramfuncs"))) +#endif #endif #endif