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

Joel Sherrill joel at rtems.org
Mon Feb 27 13:19:08 UTC 2017


On Feb 27, 2017 1:15 PM, <Jan.Sommer at dlr.de> wrote:



> -----Ursprüngliche Nachricht-----
> Von: Sebastian Huber [mailto:sebastian.huber at embedded-brains.de]
> Gesendet: Montag, 27. Februar 2017 13:46
> An: Sommer, Jan; devel at rtems.org
> Betreff: Re: Undefined reference to `__sync_bool_compare_and_swap_4' for
> some Leon configurations with gfortran
>
[...]
> > If I check the different libgfortran.a libraries of
> > sparc-rtems4.12/6.3.0 with nm I get libgfortran.a
> >           U __sync_bool_compare_and_swap_4
> >           U __sync_bool_compare_and_swap_4
>
> Is this reference generated by the compiler or some GCC runtime source
code?
> The atomic operations are implemented via the libatomic, so you should
only
> have __atomic_() references.
>

I am not sure if I understand the question correctly.
I checked the mentioned elf.c-file (https://gcc.gnu.org/viewcvs/
gcc/branches/gcc-6-branch/libbacktrace/elf.c?view=markup#l960) and
the call to __sync_bool_compare_and_swap_4 does not seem to be dependent on
a configuration option of gcc.
The same is true for dwarf.c

There seems to have been a similar issue for hpux:
https://patchwork.ozlabs.org/patch/553017/
Would it make sense to set libbacktrace_cv_sys_sync=no in the same way for
the respective leon-targets?


I can't check that solution but this undefined symbol also shows up on the
nios2 for C++ tests in RTEMS.

--joel


> >
> > for the ones in the leon, soft and v8 directory.
> >
> > The libgfortran.a in the leon3  and leon3v7 directory do not have this
> undefined symbol.
>
> They implement this atomic operation in hardware.
>
> > Is that correct behavior? If yes, which library do I need to add to the
linker?
>
> It is a compiler or GCC runtime configuration issue.
>
> >
> >
> > Best regards,
> >
> >     Jan
> >
> >
> >
> > Deutsches Zentrum für Luft- und Raumfahrt e. V. (DLR)
> > German Aerospace Center
> > Simulation and Software Technology | Software for Space Systems and
> Interactive Visualization | Lilienthalplatz 7 | 38108 Braunschweig |
Germany
> >
> > Jan Sommer
> > Telephone +49 531 295-2494 | Telefax 0531 295-2767 | jan.sommer at dlr.de
> > DLR.de/SC
> >
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>
> --
> 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.

_______________________________________________
devel mailing list
devel at rtems.org
http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170227/0b3b6f9c/attachment-0002.html>


More information about the devel mailing list