Undefined reference to `__sync_bool_compare_and_swap_4' for some Leon configurations with gfortran

Jan.Sommer at dlr.de Jan.Sommer at dlr.de
Tue Feb 28 14:27:07 UTC 2017



> -----Ursprüngliche Nachricht-----
> Von: Sebastian Huber [mailto:sebastian.huber at embedded-brains.de]
> Gesendet: Montag, 27. Februar 2017 15:25
> An: Sommer, Jan; devel at rtems.org
> Betreff: Re: AW: AW: AW: Undefined reference to
> `__sync_bool_compare_and_swap_4' for some Leon configurations with
> gfortran
> 
> 
> 
> On 27/02/17 15:15, Jan.Sommer at dlr.de wrote:
> >> -----Ursprüngliche Nachricht-----
> >> >Von: Sebastian Huber [mailto:sebastian.huber at embedded-brains.de]
> >> >Gesendet: Montag, 27. Februar 2017 15:11
> >> >An: Sommer, Jan;devel at rtems.org
> >> >Betreff: Re: AW: AW: Undefined reference to
> >> >`__sync_bool_compare_and_swap_4' for some Leon configurations with
> >> >gfortran
> >> >
> >> >On 27/02/17 15:08,Jan.Sommer at dlr.de  wrote:
> >>> > >Ok, thanks for the clarification.
> >>> > >I will try to create a patch for gcc and put rtems CC for the discussion.
> >> >
> >> >Another option would be to provide the __sync_() stuff also via libatomic.
> >> >
> > True. I will ask on the gcc mailinglist what they would prefer.
> >
> 
> This __sync_() stuff seems to be used in several places in GCC. So, changing
> libbacktrace is probably not enough. We need a general solution for the
> __sync_() builtins on RTEMS. I don't think GCC can be changed to emit
> __atomic_() calls for the __sync_() builtins (I would still try to ask). The libgcc or
> libatomic is probably a good place to add them for RTEMS as functions
> implemented via __atomic_() builtins.
> 

I updated the __sync-check of libbacktrace and now the undefined references are gone and my test program compiles.
If there are no objections I would try to push something like the attached patch upstream. Do you have any suggestions to which branches?
I thought about trunk and the gcc-6 branch or do we need further backports for older RTEMS versions?

Best regards,

   Jan

> --
> Sebastian Huber, embedded brains GmbH
> 
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-brains.de
> PGP     : Public key available on request.
> 
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-leon2-libbacktrace.patch
Type: application/octet-stream
Size: 1477 bytes
Desc: fix-leon2-libbacktrace.patch
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170228/dbb4a22c/attachment-0002.obj>


More information about the devel mailing list