diff --git a/src/system/libroot/os/arch/arm/atomic.S b/src/system/libroot/os/arch/arm/atomic.S index f27bfd7223..838395e51e 100644 --- a/src/system/libroot/os/arch/arm/atomic.S +++ b/src/system/libroot/os/arch/arm/atomic.S @@ -81,11 +81,7 @@ FUNCTION(atomic_get): bx lr FUNCTION_END(atomic_get) -FUNCTION(__sync_fetch_and_add_4): - bx lr -FUNCTION_END(__sync_fetch_and_add_4) - -#endif +#endif /* ATOMIC_FUNCS_ARE_SYSCALLS */ #ifndef ATOMIC64_FUNCS_ARE_SYSCALLS diff --git a/src/system/libroot/os/atomic.c b/src/system/libroot/os/atomic.c index 3a3b2ffba9..24ccb061b5 100644 --- a/src/system/libroot/os/atomic.c +++ b/src/system/libroot/os/atomic.c @@ -88,3 +88,10 @@ atomic_get64(vint64 *value) } #endif /* ATOMIC64_FUNCS_ARE_SYSCALLS */ + +/* GCC compatibility: libstdc++ needs this one */ + +extern int32_t __sync_fetch_and_add_4(int32_t *value, int32_t addValue) +{ + return atomic_add((vint32 *)value, addValue); +}