arch_atomic.c:Provide __sync_synchronize when the compiler does not support it

Summary:
  Configuration/Tool: zp214xpa/nsh,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2024-09-14 06:11:00
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Building NuttX...
arm-none-eabi-ld: /github/workspace/sources/nuttx/staging/libfs.a(fs_inoderemove.o): in function `inode_remove':
fs_inoderemove.c:(.text.inode_remove+0x94): undefined reference to `__sync_synchronize'
arm-none-eabi-ld: fs_inoderemove.c:(.text.inode_remove+0x9c): undefined reference to `__sync_synchronize'
make[1]: *** [Makefile:212: nuttx] Error 1
make: *** [tools/Unix.mk:548: nuttx] Error 2
make: Target 'all' not remade because of errors.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1 2024-09-14 16:46:07 +08:00 committed by Xiang Xiao
parent 03f215b374
commit 76e83a5424
1 changed files with 4 additions and 6 deletions

View File

@ -753,17 +753,15 @@ SYNC_VAL_CMP_SWAP(4, uint32_t)
SYNC_VAL_CMP_SWAP(8, uint64_t)
#endif /* __clang__ */
#ifdef __ghs__
/****************************************************************************
* Name: __sync_synchronize
****************************************************************************/
void weak_function __sync_synchronize(void)
{
asm volatile("" ::: "memory");
#ifdef SP_DMB
SP_DMB();
#endif
}
#endif
#endif /* __clang__ */