On Tue, Mar 17, 2020 at 05:35:13PM -0400, Reinhard Tartler wrote:
> Control: forwarded -1 aspectc-develop...@aspectc.org
> 
> Hi Adrian,
> 
> Olaf, the upstream developer, has a question regarding your patch to 
> aspectc++.
> Would you mind having a look and ideally sharing your reply to everyone?
> 
> Thank you!
> -rt
> 
> On 3/17/20 11:05 AM, Olaf Spinczyk wrote:
> > Hi Reinhard!
> > 
> > Do you understand the reasons behind the patch?
> > 
> > The difference is the following addition for linking:
> > 
> >  -Wl,--as-needed -latomic -Wl,--no-as-needed
> > 
> > (1) I wonder why the atomics (e.g. __atomic_fetch_add_4) are not
> > available by default in armel. They seem to be on most other platforms.

Most other platforms have processor instructions for atomics.
Older arm processors do not,[1] they are implemented with a kernel helper.

It is a bug in gcc that linking with libatomic is not done automatically:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358

> > (2) Why is "--as-needed ... --no-as-needed" necessary?

It is not necessary.
It avoids linking with libatomic when it is not needed on other platforms.

> > (3) Could -latomic also be placed at the end of the list of libraries
> > (behind the additional libraries needed for Clang 9.0.x)?

The further behind the better, it has to come after static libraries
using it.

> > Cheers,
> > 
> > Olaf

cu
Adrian

[1] The Debian armel port currently has a port baseline of armv5,
    the Debian armhf port (including the raspbian rebuild) target
    more recent processors with atomic instructions.

Reply via email to