Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150724231846.GH16376@brightrain.aerifal.cx>
Date: Fri, 24 Jul 2015 19:18:46 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: implement stdatomic.h library interface

On Thu, Jul 23, 2015 at 02:14:15PM +0200, Joakim Sindholt wrote:
> What I don't understand is why it's seen as a necessity to re-implement
> compiler-specific functionality. Musl doesn't provide umoddi3 or other
> libgcc symbols, so why the stdatomic internals? Are you trying to
> compile without a compiler runtime library?
> I get that it could be useful to have instead of musl's current internal
> atomics but IMO only if it actually saves you the work of implementing
> the atomic primitives in the first place.

I don't have a set-in-stone position yet on whether this should be
done, but I can give a little bit of background on the libgcc side.
Originally I had considered implementing all of the libgcc-type
compiler runtime functions in musl (and providing external definitions
for them) to eliminate the need for an additional library and possibly
allow for more-optimized implementations. However, it turned out that
there's quite a bit of diversity in the set of symbols, signatures,
calling conventions, etc. that are needed from one arch to another,
and trying to go down this path would have meant maintaining a lot
more arch-specific code that's a duplication of work already done in
the compiler's target libs.

I'm not sure whether these issues apply to the atomic fallback
functions. If not, then given that there seem to be serious issues
with the gcc libatomic implementation (the whole ifunc mess, compat
problems between code built with 'hard' and 'soft' atomics, etc.) it
_might_ make sense to provide them in musl. But I'd like to make sure
we consider all other options, including possibly a separate
replacement for libatomic that's independent of musl.

One question about gcc's libatomic: does it work correctly with musl
if you've told gcc at build time that ifunc is not supported?

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.