Skip to content

Commit

Permalink
arch_atomic.c:Provide __sync_synchronize when the compiler does not s…
Browse files Browse the repository at this point in the history
…upport 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 <[email protected]>
  • Loading branch information
crafcat7 committed Sep 14, 2024
1 parent 5205293 commit b291fb2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions libs/libc/machine/arch_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

0 comments on commit b291fb2

Please sign in to comment.