This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/3, MIPS] Rewrite MIPS' atomic.h to use __atomic_* builtins.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]