Re: ARC rebootstrap prereq (was Re: switching ARC to 64-bit time_t )

Helmut Grohne
2020-03-26T14:29:02Z

Hi Alexey,

On Thu, Mar 26, 2020 at 12:53:45PM +0000, Alexey Brodkin wrote:
> Sorry for this stupid question but I'm not very familiar with use-cases for
> libatomic-ops so would like to get some more clarification on what's needed here.
>
> I know that GCC has quite a few built-ins for atomic ops and we do implement them.
> I'm adding our GCC maintainer (Claudiu) in the Cc so he may jump in if needed.

One part of the question here is "why do we need libatomic-ops?". The
answer to that is, because libgc uses it and libgc is used by e.g. gcc,
gnutls, guile, and make. Possibly, some of these could be built without
libgc, but this is how they are packaged for Debian at present. Package
dependencies currently say that we need libatomic-ops.

The other part is "what is missing in libatomic-ops"? If you look at a
more recent implementation, such as riscv, you see that it basically
says "trust gcc". So I guess all you need here is an arc-specific
implementation that says "gcc knows what it is doing, use its
primitives".

Given sufficient work, I guess libatomic-ops could be removed in favour
of using the gcc built-ins directly. Not sure whether that'd fly with
libgc upstream though.

So no, this is not a stupid question. Thank you for asking.

Helmut