From 0493ba2bfecabf47a58848e370d39da05ff0e93f Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Fri, 1 Dec 2017 10:47:18 -0600 Subject: [PATCH] Protect local static object construction in ARMCC Implement the functions __cxa_guard_acquire, __cxa_guard_release and __cxa_guard_abort for ARMCC so local static object construction is thread safe. --- platform/mbed_retarget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/mbed_retarget.cpp b/platform/mbed_retarget.cpp index a3bb015334..12fcb317a7 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/mbed_retarget.cpp @@ -977,6 +977,10 @@ extern "C" void __env_unlock( struct _reent *_r ) __rtos_env_unlock(_r); } +#endif + +#if defined (__GNUC__) || defined(__CC_ARM) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) + #define CXA_GUARD_INIT_DONE (1 << 0) #define CXA_GUARD_INIT_IN_PROGRESS (1 << 1) #define CXA_GUARD_MASK (CXA_GUARD_INIT_DONE | CXA_GUARD_INIT_IN_PROGRESS)