This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH 1/3, MIPS] Rewrite MIPS' atomic.h to use __atomic_* builtins.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Maxim Kuvyrkov <maxim at codesourcery dot com>
- Cc: libc-ports at sourceware dot org, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Thu, 14 Jun 2012 11:06:52 +0000 (UTC)
- Subject: Re: [PATCH 1/3, MIPS] Rewrite MIPS' atomic.h to use __atomic_* builtins.
- References: <C14A8060-0B49-4D8C-B3A5-2F83A7CE6609@codesourcery.com>
On Thu, 14 Jun 2012, Maxim Kuvyrkov wrote:
> This patch rewrites MIPS' atomic.h to use __atomic_* builtins instead of
> inline assembly. These builtins are available in recent version of GCC
> and correspond to C++11 memory model support, they also map very well to
> GLIBC's atomic_* macros.
They are available in GCC 4.7 and later (with your patches being for 4.8
and later), but the documented minimum GCC version for building glibc is
4.3, and at least 4.4 and later should actually work.
Thus, these new definitions should be conditional on __GNUC_PREREQ (4, 8),
with the old definitions remaining when glibc is built with older GCC,
until in a few years' time 4.8 or later is the minimum version for
building glibc and the conditionals can be removed.
> * sysdeps/mips/bit/atomic.h: Rewrite using __atomic_* builtins.
"bits", and glibc follows the GNU Coding Standards for conditional
changes, so I think you want something like
[__GNUC_PREREQ (4, 8)] (__arch_foo): Define in terms of
__atomic_bar.
repeated for each macro changed.
--
Joseph S. Myers
joseph@codesourcery.com