RaspberryPI ADA-build causes: undefined reference to `__sync_synchronize'

Gedare Bloom gedare at rtems.org
Fri Jun 5 13:44:36 UTC 2015


On Thu, Jun 4, 2015 at 5:19 PM, Jan Sommer <soja-misc at aries.uberspace.de> wrote:
> Ok, in case someone else stumbles upon this, here is how I solved it with
> Sebastians help:
>
> Create a file cpukit/score/cpu/arm/armv4-sync-synchronize.c with:
>
> void
> __sync_synchronize (void)
> {
>   asm volatile("" : : : "memory");
> }
>
> Add "libscorecpu_a_SOURCES += arm-exception-default.c" to
>  cpukit/score/cpu/arm/Makefile.am
>
I guess you probably meant add armv4-sync-synchronize.c ?

> Bootstrap and recompile. The linking now works fine. Running the binary still
> shows some issues, but this can very well be due to my configuration.
>
It would be great if you could submit a patch when you are confident
about it. https://devel.rtems.org/wiki/Developer/Contributing

> One last question would be if there is a define I could use with an ifdef to
> check if the build is used for the raspberry pi, so that other bsps won't be
> affected?
>
I would guess this asm is valid across other ARM BSPs too, and the fix
probably would help them for building Ada also. We avoid any
BSP-specific ifdef in cpukit.

Gedare

> Best regards,
>
>    Jan
>
> Am Montag, 1. Juni 2015, 22:29:31 schrieb Sebastian Huber:
>> ----- Jan Sommer <soja-misc at aries.uberspace.de> schrieb:
>> > Am Freitag, 22. Mai 2015, 08:30:24 schrieb Sebastian Huber:
>> > > > I found this thread where it seems to have been discussed before, but
>> > > > don't see if and how it was solved:
>> > > > http://gcc.gnu.org/ml/gcc/2012-03/msg00083.html What would be a
>> > > > starting
>> > > > point to fix this issue?
>> > >
>> > > Which GCC options do you use to build or link to the Ada library? It
>> > > should work for the RPI 2, for the RPI 1 we lack a suitable multilib. So
>> > > something like this is necessarry:
>> > >
>> > > https://gcc.gnu.org/ml/gcc/2012-03/msg00090.html
>> >
>> > It may be a stupid question, but for the RPI1 I still don't get where I
>> > would add the function. Somewhere in the gcc sources before compiling the
>> > cross compiler toolchain, in the rtems sources or in the user program?
>> > I found the same mailinglist thread you point to, but unfortunately there
>> > it's not explained.
>>
>> Its not a stupid question.  Adding this to GCC would be a very difficult
>> task.  I would add it to RTEMS
>> (cpukit/score/cpu/arm/armv4-sync-synchronize.c).
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users



More information about the users mailing list