From: "Paul Barker" <paul@pbarker.dev>
To: "Khem Raj" <raj.khem@gmail.com>,
<openembedded-core@lists.openembedded.org>
Cc: "Khem Raj" <khem.raj@oss.qualcomm.com>
Subject: Re: [PATCH v2 1/2] compiler-rt: Add option to provide libatomic instead of gcc-runtime
Date: Fri, 04 Dec 2026 13:55:34 +0000 [thread overview]
Message-ID: <DNC009ROOQC8.EQB2STUKOBR0@pbarker.dev> (raw)
In-Reply-To: <CAMKF1sr6XZJyuqiUw9aoRjxGdH3cPtMrNkSC8nLpzF75BBjCqg@mail.gmail.com>
On Thu Dec 3, 2026 at 5:18 PM GMT, Khem Raj wrote:
> ping. Any concerns with this patch ?, it helps to select libatomic choice
> cleanly.
The question is, do we want to provide this option? Why would someone
choose a different libatomic provider? What benefit does it provide?
Apologies for the slow response as well, we're limited on review
bandwidth and Richard has been focused on the layer changes recently.
Best regards,
>
> On Thu, Nov 26, 2026 at 8:58 AM Khem Raj <raj.khem@gmail.com> wrote:
>
>> Add LIBATOMIC_PROVIDER to select the recipe providing libatomic for the
>> target. It defaults to "gcc-runtime", which keeps the current behaviour.
>>
>> With LIBATOMIC_PROVIDER = "compiler-rt"
>>
>> - compiler-rt builds its standalone shared libatomic from atomic.c and
>> installs it with the same layout as gcc-runtime: libatomic.so.1.2.0
>> with soname libatomic.so.1, the libatomic.so.1 and libatomic.so
>> symlinks, a libatomic.a archive, and the libatomic_asneeded.a and
>> libatomic_asneeded.so files gcc 16 links by default. They go in the
>> libatomic, libatomic-dev and libatomic-staticdev packages, so package
>> names and runtime dependencies stay the same.
>> - gcc-runtime no longer builds or packages libatomic for the target.
>> - Recipes built with gcc also depend on compiler-rt, since gcc links
>> -latomic_asneeded into every link.
>>
>> The upstream standalone libatomic does not link as is, LLVM links
>> shared libraries with -z defs and compiler-rt uses -nodefaultlibs, but
>> the generic __atomic_* functions call memcpy/memcmp, so link with libc.
>> atomic.c has no constructors, so link it with -nostartfiles.
>>
>> The shared library keeps one lock table per process for atomics that
>> are not lock free, e.g. 64-bit atomics on riscv32, as libatomic does.
>> The atomic builtins in the static libclang_rt.builtins archive would
>> instead give each executable and shared library its own hidden lock
>> table, which loses updates when they access the same object.
>>
>> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
--
Paul Barker
prev parent reply other threads:[~2026-12-04 13:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 16:58 [PATCH v2 1/2] compiler-rt: Add option to provide libatomic instead of gcc-runtime Khem Raj
2026-11-26 16:58 ` [PATCH v2 2/2] packagegroup-core-buildessential: Add clang with clang toolchain Khem Raj
2026-12-03 17:16 ` Khem Raj
2026-12-03 17:18 ` [PATCH v2 1/2] compiler-rt: Add option to provide libatomic instead of gcc-runtime Khem Raj
2026-12-04 13:55 ` Paul Barker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DNC009ROOQC8.EQB2STUKOBR0@pbarker.dev \
--to=paul@pbarker.dev \
--cc=khem.raj@oss.qualcomm.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=raj.khem@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.