This is the mail archive of the
mailing list for the GCC project.
Re: GCC 4.7.0 and C++ atomics
On 03/07/12 10:44, Andrew MacLeod wrote:
> rth, you are familiar with how this part is suppose to hook up properly...
> I traced the code in expand_mem_thread_fence, and the sync_synchronize is being emiited by:
> else if (synchronize_libfunc != NULL_RTX)
> emit_library_call (synchronize_libfunc, LCT_NORMAL, VOIDmode, 0);
> presumably something just isn't being linked to the executable? or maybe not being built into libgcc?
These functions are in libgcc, but only built for linux.
synchronize_libfunc = init_one_libfunc ("__sync_synchronize");
I assume this is because the default fallback, lacking an optab,
for synchronize is a no-op, and this is actively incorrect for
many ARM cpu revisions.
I also assume that rtems is now encountering this because of the
switch from arm-elf to arm-elf-eabi. In order to finish the port
to the eabi, rtems will need to provide this symbol somehow.
If rtems is always universally built explicitly targeting a
specific cpu revision, then this can be as simple as
#if defined(arm revisions supporting dmb)
asm volatile("dmb" : : : "memory");
asm volatile("" : : : "memory");
Otherwise you may need help from the rtems kernel, as linux does.