[libcxx-commits] [libcxx] [libc++][Android] Always redirect <stdatomic.h> to <atomic> (PR #143036)

Ryan Prichard via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 5 14:31:52 PDT 2025


rprichard wrote:

Some more context:
 - Prior to this diagnostic fix, https://github.com/llvm/llvm-project/pull/83351#issuecomment-2033055221, the Android LLVM team's build of LLVM allowed mixing <atomic> and <stdatomic.h> in a fragile way -- the previous libc++ diagnostic didn't fire because Bionic's stdatomic.h doesn't define `kill_dependency`. After the libc++ diagnostic was improved, it broke our C++23 stdatomic.h backport.
 - libc++ tried to enable the backport for all C++ dialects, https://github.com/llvm/llvm-project/pull/95498, but that broke other things, in particular `_Atomic` as a type-qualifier. It was reverted in https://github.com/llvm/llvm-project/pull/123130.

I'm trying to make the Android situation less clumsy, by making the upstream LLVM headers acceptable to use as-is, for the Android toolchain team's build of LLVM.

I think our team would actually prefer a way to enable the backport even when we target non-Android, but I don't know if this desire warrants adding a config flag (e.g. to `__config_site`).

I'm wondering if upstream libc++ has any thoughts on restoring the backport, but only when targeting Android.




https://github.com/llvm/llvm-project/pull/143036


More information about the libcxx-commits mailing list