From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8364 invoked by alias); 14 Jun 2012 11:07:11 -0000 Received: (qmail 8350 invoked by uid 22791); 14 Jun 2012 11:07:10 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Jun 2012 11:06:56 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Sf7t9-00047W-Cv from joseph_myers@mentor.com ; Thu, 14 Jun 2012 04:06:55 -0700 Received: from digraph.polyomino.org.uk ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 14 Jun 2012 12:06:53 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.74) (envelope-from ) id 1Sf7t6-0005xg-HH; Thu, 14 Jun 2012 11:06:52 +0000 Date: Thu, 14 Jun 2012 11:07:00 -0000 From: "Joseph S. Myers" To: Maxim Kuvyrkov cc: libc-ports@sourceware.org, Richard Sandiford Subject: Re: [PATCH 1/3, MIPS] Rewrite MIPS' atomic.h to use __atomic_* builtins. In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00035.txt.bz2 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